Mercurial > hg > octave-nkf
changeset 14781:e190f6da40f6
maint: Correct comments and use Octave spacing conventions for erfinv.
lo-specfun.cc (do_erfinv): Correct comment about Halley's 3rd order method.
Use space between function call and open parenthesis.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Tue, 19 Jun 2012 10:05:01 -0700 |
parents | 1d83d1539b2b |
children | 566cf544d020 |
files | liboctave/lo-specfun.cc |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/lo-specfun.cc +++ b/liboctave/lo-specfun.cc @@ -3152,7 +3152,7 @@ // This algorithm is due to P. J. Acklam. // See http://home.online.no/~pjacklam/notes/invnorm/ // The rational approximation has relative accuracy 1.15e-9 in the whole region. -// For doubles, it is refined by a single step of Higham's 3rd order method. +// For doubles, it is refined by a single step of Halley's 3rd order method. // For single precision, the accuracy is already OK, so we skip it to get // faster evaluation. @@ -3175,7 +3175,7 @@ { 7.784695709041462e-03, 3.224671290700398e-01, 2.445134137142996e+00, 3.754408661907416e+00 }; - static const double spi2 = 8.862269254527579e-01; // sqrt(pi)/2. + static const double spi2 = 8.862269254527579e-01; // sqrt(pi)/2. static const double pbreak = 0.95150; double ax = fabs (x), y; @@ -3204,7 +3204,7 @@ if (refine) { // One iteration of Halley's method gives full precision. - double u = (erf(y) - x) * spi2 * exp (y*y); + double u = (erf (y) - x) * spi2 * exp (y*y); y -= u / (1 + y*u); }