Use the relationship between the cumulative normal distribution and the (complementary) error function: https://en.wikipedia.org/wiki/Error_function#Cumulative_distribution_function
| 20 | // (complementary) error function: |
| 21 | // https://en.wikipedia.org/wiki/Error_function#Cumulative_distribution_function |
| 22 | array cnd(array x) { |
| 23 | const float sqrt05 = sqrt(0.5f); |
| 24 | return 0.5f * erfc(-x * sqrt05); |
| 25 | } |
| 26 | |
| 27 | static void black_scholes(array& C, array& P, const array& S, const array& X, |
| 28 | const array& R, const array& V, const array& T) { |
no test coverage detected