diff options
author | Petr Baudis <pasky@suse.cz> | 2011-09-09 22:16:10 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-09-09 22:16:10 -0400 |
commit | 1248c1c41508387ff282b208636737e8cdc9b5b0 (patch) | |
tree | f2de6f410de805293483964814aa29efefbe8daa /sysdeps/ieee754/ldbl-128ibm | |
parent | f19009c1551a396ee8eff96a83254243ce25a090 (diff) | |
download | glibc-1248c1c41508387ff282b208636737e8cdc9b5b0.zip glibc-1248c1c41508387ff282b208636737e8cdc9b5b0.tar.gz glibc-1248c1c41508387ff282b208636737e8cdc9b5b0.tar.bz2 |
Fix jn precision
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm')
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_jnl.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_jnl.c b/sysdeps/ieee754/ldbl-128ibm/e_jnl.c index 0eea745..372f942 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_jnl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_jnl.c @@ -286,7 +286,16 @@ __ieee754_jnl (n, x) } } } - b = (t * __ieee754_j0l (x) / b); + /* j0() and j1() suffer enormous loss of precision at and + * near zero; however, we know that their zero points never + * coincide, so just choose the one further away from zero. + */ + z = __ieee754_j0l (x); + w = __ieee754_j1l (x); + if (fabsl (z) >= fabsl (w)) + b = (t * z / b); + else + b = (t * w / a); } } if (sgn == 1) |