Mercurial > octave-nkf
comparison liboctave/cruft/Faddeeva/Faddeeva.cc @ 19651:520ee3fec8eb stable
update Faddeeva.cc to latest upstream version
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 23 Jan 2015 15:20:00 -0500 |
parents | 2e30a1aadff2 |
children | 75a671fcdd73 |
comparison
equal
deleted
inserted
replaced
19638:7005044f3080 | 19651:520ee3fec8eb |
---|---|
137 15 December 2012: Portability fixes (copysign, Inf/NaN creation), | 137 15 December 2012: Portability fixes (copysign, Inf/NaN creation), |
138 use CMPLX/__builtin_complex if available in C, | 138 use CMPLX/__builtin_complex if available in C, |
139 slight accuracy improvements to erf and dawson | 139 slight accuracy improvements to erf and dawson |
140 functions near the origin. Use gnulib functions | 140 functions near the origin. Use gnulib functions |
141 if GNULIB_NAMESPACE is defined. | 141 if GNULIB_NAMESPACE is defined. |
142 18 December 2012: Slight tweaks (remove recomputation of x*x in Dawson) | |
142 */ | 143 */ |
143 | 144 |
144 ///////////////////////////////////////////////////////////////////////// | 145 ///////////////////////////////////////////////////////////////////////// |
145 /* If this file is compiled as a part of a larger project, | 146 /* If this file is compiled as a part of a larger project, |
146 support using an autoconf-style config.h header file | 147 support using an autoconf-style config.h header file |
582 y * (-15 + x2 * (24 - 4*x2) | 583 y * (-15 + x2 * (24 - 4*x2) |
583 + y2 * (4*x2 - 10 - 4*y2))); | 584 + y2 * (4*x2 - 10 - 4*y2))); |
584 } | 585 } |
585 else { | 586 else { |
586 double D = spi2 * FADDEEVA(w_im)(x); | 587 double D = spi2 * FADDEEVA(w_im)(x); |
587 double x2 = x*x, y2 = y*y; | 588 double y2 = y*y; |
588 return C | 589 return C |
589 (D + y2 * (D + x - 2*D*x2) | 590 (D + y2 * (D + x - 2*D*x2) |
590 + y2*y2 * (D * (0.5 - x2 * (2 - 0.66666666666666666667*x2)) | 591 + y2*y2 * (D * (0.5 - x2 * (2 - 0.66666666666666666667*x2)) |
591 + x * (0.83333333333333333333 | 592 + x * (0.83333333333333333333 |
592 - 0.33333333333333333333 * x2)), | 593 - 0.33333333333333333333 * x2)), |