Mercurial > hg > octave-lyh
changeset 14771:10ed11922f19
maint: code cleanup for new erfcinv function.
* NEWS: Place erfcinv alphabetically in list of new functions.
* contributors.in: Add Axel Mathéi to list of contributors.
* lo-specfun.cc: Adjust spacing to use Octave code conventions.
* mappers.cc: Use eps ("single") rather than 1e-8 in assert tests.
Re-arrange See Also links in docstring.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Thu, 14 Jun 2012 21:34:39 -0700 |
parents | cb85e836d035 |
children | 39a2e91a246e |
files | NEWS doc/interpreter/contributors.in liboctave/lo-specfun.cc src/mappers.cc |
diffstat | 4 files changed, 15 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS +++ b/NEWS @@ -74,11 +74,10 @@ ** Other new functions added in 3.8.0: - colorcube splinefit - lines tetramesh - rgbplot shrinkfaces - findfigs erfcinv - + colorcube lines splinefit + erfcinv rgbplot tetramesh + findfigs shrinkfaces + ** Deprecated functions. The following functions were deprecated in Octave 3.4 and have been
--- a/doc/interpreter/contributors.in +++ b/doc/interpreter/contributors.in @@ -157,6 +157,7 @@ Rob Mahurin Ricardo Marranita Orestes Mas +Axel Mathéi Makoto Matsumoto Tatsuro Matsuoka Laurent Mazet
--- a/liboctave/lo-specfun.cc +++ b/liboctave/lo-specfun.cc @@ -3240,7 +3240,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 pi = 3.14159265358979323846; static const double pbreak = 0.95150; double y; @@ -3274,7 +3274,7 @@ if (refine) { // One iteration of Halley's method gives full precision. - double u = (erf(y) - (1-x)) * spi2 * exp (y*y); + double u = (erf (y) - (1-x)) * spi2 * exp (y*y); y -= u / (1 + y*u); }
--- a/src/mappers.cc +++ b/src/mappers.cc @@ -596,7 +596,7 @@ @example\n\ erf (@var{y}) == @var{x}\n\ @end example\n\ -@seealso{erf, erfc, erfcinv, erfcx}\n\ +@seealso{erf, erfc, erfcx, erfcinv}\n\ @end deftypefn") { octave_value retval; @@ -611,10 +611,10 @@ /* ## middle region %!assert (erf (erfinv ([-0.9 -0.3 0 0.4 0.8])), [-0.9 -0.3 0 0.4 0.8], eps) -%!assert (erf (erfinv (single ([-0.9 -0.3 0 0.4 0.8]))), single ([-0.9 -0.3 0 0.4 0.8]), 1e-8) +%!assert (erf (erfinv (single ([-0.9 -0.3 0 0.4 0.8]))), single ([-0.9 -0.3 0 0.4 0.8]), eps ("single")) ## tail region %!assert (erf (erfinv ([-0.999 -0.99 0.9999 0.99999])), [-0.999 -0.99 0.9999 0.99999], eps) -%!assert (erf (erfinv (single ([-0.999 -0.99 0.9999 0.99999]))), single ([-0.999 -0.99 0.9999 0.99999]), 1e-8) +%!assert (erf (erfinv (single ([-0.999 -0.99 0.9999 0.99999]))), single ([-0.999 -0.99 0.9999 0.99999]), eps ("single")) ## backward - loss of accuracy %!assert (erfinv (erf ([-3 -1 -0.4 0.7 1.3 2.8])), [-3 -1 -0.4 0.7 1.3 2.8], -1e-12) %!assert (erfinv (erf (single ([-3 -1 -0.4 0.7 1.3 2.8]))), single ([-3 -1 -0.4 0.7 1.3 2.8]), -1e-4) @@ -634,7 +634,7 @@ @example\n\ erfc (@var{y}) == @var{x}\n\ @end example\n\ -@seealso{erfinv, erf, erfc, erfcx}\n\ +@seealso{erfc, erf, erfcx, erfinv}\n\ @end deftypefn") { octave_value retval; @@ -649,10 +649,10 @@ /* ## middle region %!assert (erfc (erfcinv ([1.9 1.3 1 0.6 0.2])), [1.9 1.3 1 0.6 0.2], eps) -%!assert (erfc (erfcinv (single ([1.9 1.3 1 0.6 0.2]))), single ([1.9 1.3 1 0.6 0.2]), 1e-8) +%!assert (erfc (erfcinv (single ([1.9 1.3 1 0.6 0.2]))), single ([1.9 1.3 1 0.6 0.2]), eps ("single")) ## tail region %!assert (erfc (erfcinv ([0.001 0.01 1.9999 1.99999])), [0.001 0.01 1.9999 1.99999], eps) -%!assert (erfc (erfcinv (single ([0.001 0.01 1.9999 1.99999]))), single ([0.001 0.01 1.9999 1.99999]), 1e-8) +%!assert (erfc (erfcinv (single ([0.001 0.01 1.9999 1.99999]))), single ([0.001 0.01 1.9999 1.99999]), eps ("single")) ## backward - loss of accuracy %!assert (erfcinv (erfc ([-3 -1 -0.4 0.7 1.3 2.8])), [-3 -1 -0.4 0.7 1.3 2.8], -1e-12) %!assert (erfcinv (erfc (single ([-3 -1 -0.4 0.7 1.3 2.8]))), single ([-3 -1 -0.4 0.7 1.3 2.8]), -1e-4) @@ -674,7 +674,7 @@ @ifnottex\n\ @w{@code{1 - erf (@var{z})}}.\n\ @end ifnottex\n\ -@seealso{erfcx, erf, erfinv, erfcinv}\n\ +@seealso{erfcinv, erfcx, erf, erfinv}\n\ @end deftypefn") { octave_value retval; @@ -711,7 +711,7 @@ @end example\n\ \n\ @end ifnottex\n\ -@seealso{erfc, erf, erfinv}\n\ +@seealso{erfc, erf, erfinv, erfcinv}\n\ @end deftypefn") { octave_value retval;