Category Archives: Chebyshev

Polynomial expansion in Nspire to ease reading C code

When eyes are tired code is not as easy to read. Once such example below from a Monte Carlo CUDA sample calculating CDF.

reverse1

With the help of the expand() function in Nspire, this code snippet suddenly become obvious.reverse2

Advertisements

Chebyshev approximation of normal distribution probability

Apart from the approximation method by means of the Taylor function, another numerical technique which is considered by most as the de facto method is the Chebyshev approximation. In TI Nspire, the calculation can be done as below. The piece-wise function helps to decide the result from whether d is positive. For better performance, some constants can be pre-calculated instead of as shown below, like the square root of double π. Intensive calculations definitely will benefit from pre-calculated values.

ChebyshevApprox