Ncdf

Different Ways To Evaluate N(x) in Mathematica

other_ncdf_1.gif

other_ncdf_2.gif

other_ncdf_3.gif

other_ncdf_4.gif

other_ncdf_5.gif

Notes on Error & Efficiency

Using built-in function, one can obtain almost exact values.
In constrast, the widely used approximation could introduce an errof of other_ncdf_6.gif, as shown in the figure.
But, as experiments show us, using built-in functions to evaluate N(x) is very inefficient.
If an algorithm involves N(x) frequently, and if one can withstand an error of other_ncdf_7.gif, the widely used approximation is a better choice.

other_ncdf_8.gif

other_ncdf_9.gif

More Efficiently

Recently I designed an algorithm that evaluates N(x) really frequently.
In this case, both of the above are not the best choice.
If one can withstand an error of other_ncdf_10.gif, keeping 1201 exact values of N(x) between [-6, 6] and using qudratic interpolation will work more efficiently.
When x is out of the interval [-6, 6], we set N(x) to 0 or 1.
The error caused in this part this is, as shown in the following computations, always less than other_ncdf_11.gif.

Besides, althought the error due to qudratic interpolations depends on the derivative of N(x), as shown in the figure, its absolute value is quite small.

other_ncdf_12.gif

other_ncdf_13.gif

other_ncdf_14.gif

other_ncdf_15.gif

other_ncdf_16.gif

other_ncdf_17.gif

Spikey Created with Wolfram Mathematica 8.0