Code:
const double t_D = t;
const double left_BSM = BSM_C - BSM_P;
// const double right_BSM = S - D - K * exp(-r * t); // WRONG, but wikipedia says so
// const double right_BSM = S - D * exp(-r * t_D) - K * exp(-r * t); // WRONG, but some research papers say so, fe. "Extracting Implied Dividends from Options Prices", p2
// const double right_BSM = S - D * exp(-q * t_D) - K * exp(-r * t); // WRONG
const double right_BSM = S * exp(-q * t_D) - K * exp(-r * t); // this is used in the BSM formula, it fits, but is it also correct? it's not intuitive
