fix accuracy problems in argument ranges where j0(x) is small, closes

PR lib/44170 by Henning Petersen
(originally from Steven G. Kargl per FreeBSD PR bin/144306)
This commit is contained in:
drochner 2010-11-29 15:10:06 +00:00
parent ccaf75eba7
commit 240e9917d0
2 changed files with 14 additions and 4 deletions

View File

@ -12,7 +12,7 @@
#include <sys/cdefs.h>
#if defined(LIBM_SCCS) && !defined(lint)
__RCSID("$NetBSD: e_jn.c,v 1.13 2007/08/20 16:01:39 drochner Exp $");
__RCSID("$NetBSD: e_jn.c,v 1.14 2010/11/29 15:10:06 drochner Exp $");
#endif
/*
@ -203,7 +203,12 @@ __ieee754_jn(int n, double x)
}
}
}
b = (t*__ieee754_j0(x)/b);
z = __ieee754_j0(x);
w = __ieee754_j1(x);
if (fabs(z) >= fabs(w))
b = (t*z/b);
else
b = (t*w/a);
}
}
if(sgn==1) return -b; else return b;

View File

@ -15,7 +15,7 @@
#include <sys/cdefs.h>
#if defined(LIBM_SCCS) && !defined(lint)
__RCSID("$NetBSD: e_jnf.c,v 1.10 2009/01/19 05:58:27 lukem Exp $");
__RCSID("$NetBSD: e_jnf.c,v 1.11 2010/11/29 15:10:06 drochner Exp $");
#endif
#include "math.h"
@ -157,7 +157,12 @@ __ieee754_jnf(int n, float x)
}
}
}
b = (t*__ieee754_j0f(x)/b);
z = __ieee754_j0f(x);
w = __ieee754_j1f(x);
if (fabsf(z) >= fabsf(w))
b = (t*z/b);
else
b = (t*w/a);
}
}
if(sgn==1) return -b; else return b;