MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / cnd

Function cnd

examples/financial/black_scholes_options.cpp:22–25  ·  view source on GitHub ↗

Use the relationship between the cumulative normal distribution and the (complementary) error function: https://en.wikipedia.org/wiki/Error_function#Cumulative_distribution_function

Source from the content-addressed store, hash-verified

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

Callers 1

black_scholesFunction · 0.70

Calls 2

sqrtFunction · 0.85
erfcFunction · 0.85

Tested by

no test coverage detected