svn commit: r275476 - head/lib/msun/src
Steve Kargl
kargl at FreeBSD.org
Thu Dec 4 15:57:59 UTC 2014
Author: kargl
Date: Thu Dec 4 15:57:58 2014
New Revision: 275476
URL: https://svnweb.freebsd.org/changeset/base/275476
Log:
Fix a 20+ year bug by using an appropriate constant for
the transition from one asymptotic approximation to another
for the zeroth order Bessel and Neumann functions.
Reviewed by: bde
Modified:
head/lib/msun/src/e_j0f.c
Modified: head/lib/msun/src/e_j0f.c
==============================================================================
--- head/lib/msun/src/e_j0f.c Thu Dec 4 15:54:45 2014 (r275475)
+++ head/lib/msun/src/e_j0f.c Thu Dec 4 15:57:58 2014 (r275476)
@@ -62,7 +62,7 @@ __ieee754_j0f(float x)
* j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
* y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
*/
- if(ix>0x80000000) z = (invsqrtpi*cc)/sqrtf(x);
+ if(ix>0x54000000) z = (invsqrtpi*cc)/sqrtf(x);
else {
u = pzerof(x); v = qzerof(x);
z = invsqrtpi*(u*cc-v*ss)/sqrtf(x);
@@ -136,7 +136,7 @@ __ieee754_y0f(float x)
if ((s*c)<zero) cc = z/ss;
else ss = z/cc;
}
- if(ix>0x80000000) z = (invsqrtpi*ss)/sqrtf(x);
+ if(ix>0x54800000) z = (invsqrtpi*ss)/sqrtf(x);
else {
u = pzerof(x); v = qzerof(x);
z = invsqrtpi*(u*ss+v*cc)/sqrtf(x);
More information about the svn-src-head
mailing list