Re: HP30B/20B Repurposing Project  Status? Message #23 Posted by Dieter on 30 Jan 2011, 12:20 p.m., in response to message #22 by Paul Dale
Pauli, thank you very much for this information. Let me add a few more thoughts.
Using the solver for the quantile functions is an option if
(and only if) the whole calculation is done with the internal
15digit precision. Otherwise this method is not accurate since
the quantile may change by several ULPs and still provide the
same probability returned by the solver.
Example:
Probability p = 0,18
Normal quantile z = 0,9153 6508 7842 8140 4978 ...
12digit result z = 0,9153 6508 7843
Value for z Normal CDF (12 digits)

0,9153 6808 7840 0,1800 0000 0001
0,9153 6508 7841 0,1800 0000 0000
0,9153 6508 7842 0,1800 0000 0000
0,9153 6508 7843 0,1800 0000 0000
0,9153 6508 7844 0,1800 0000 0000
0,9153 6508 7845 0,1799 9999 9999

But I think you will have access to the full internal 15digit precision, so the solver should be okay.
Both for the Normal CDF as well as its inverse there are rational approximations, leading to fast execution and very accurate
results (full double precision, i.e. 1516 sign. digits). For instance, take a look at the wellknown AS241 algorithm. It uses three (7;7) rational approximations with 45 numeric constants. As long as these constants are given with 20 significant digits the relative error is less than 10^{16} over the whole doubleprecision range, i.e. down to p = 10^{308}. At the working limit of our HPs (10^{499}) the error still is less than 0,2 ULP.
Of course you can also find your own rational approximation optimized for your specific working range and with exactly the precision you need. In many cases usual spreadsheet software like Excel is all you need. ;)
Another possible way is a much simpler approximation, giving 7 significant digits, followed by one single NewtonHalley iteration, which should provide the desired 12digit result.
If you're interested in series approximations, in any case take a look at the papers by Shaw and Steinbrecher where several possible solutions can be found. For instance, the Normal Quantile can be evaluated to full 12 significant digits (+/ 1 ULP) for values below approx. 10^{90} with a simple series evaluated to just three terms.
Yes, it's an interesting topic, this quantile thing... :)
Dieter
