diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2011-10-25 00:37:10 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2011-10-25 00:37:10 +0000 |
commit | 4bbe4e2185c5484328182720ff7b3bb4f9593bff (patch) | |
tree | cd67e40a74928c0f58d4f5b79d2e260e4099fee7 /libc/sysdeps/ieee754/ldbl-128/e_jnl.c | |
parent | 91b4be71461f78cabe1fb5f164cea71b60e9e98a (diff) | |
download | eglibc2-4bbe4e2185c5484328182720ff7b3bb4f9593bff.tar.gz |
Merge changes between r15223 and r15532 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@15545 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/ieee754/ldbl-128/e_jnl.c')
-rw-r--r-- | libc/sysdeps/ieee754/ldbl-128/e_jnl.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_jnl.c b/libc/sysdeps/ieee754/ldbl-128/e_jnl.c index a4a4e24cf..81591634b 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_jnl.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_jnl.c @@ -11,9 +11,9 @@ /* Modifications for 128-bit long double are Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov> - and are incorporated herein by permission of the author. The author + and are incorporated herein by permission of the author. The author reserves the right to distribute this material elsewhere under different - copying permissions. These modifications are distributed here under + copying permissions. These modifications are distributed here under the following terms: This library is free software; you can redistribute it and/or @@ -59,26 +59,15 @@ #include "math.h" #include "math_private.h" -#ifdef __STDC__ static const long double -#else -static long double -#endif invsqrtpi = 5.6418958354775628694807945156077258584405E-1L, two = 2.0e0L, one = 1.0e0L, zero = 0.0L; -#ifdef __STDC__ long double __ieee754_jnl (int n, long double x) -#else -long double -__ieee754_jnl (n, x) - int n; - long double x; -#endif { u_int32_t se; int32_t i, ix, sgn; @@ -285,7 +274,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) @@ -293,16 +291,10 @@ __ieee754_jnl (n, x) else return b; } +strong_alias (__ieee754_jnl, __jnl_finite) -#ifdef __STDC__ long double __ieee754_ynl (int n, long double x) -#else -long double -__ieee754_ynl (n, x) - int n; - long double x; -#endif { u_int32_t se; int32_t i, ix; @@ -398,3 +390,4 @@ __ieee754_ynl (n, x) else return -b; } +strong_alias (__ieee754_ynl, __ynl_finite) |