summaryrefslogtreecommitdiff
path: root/libc/sysdeps/ieee754/ldbl-128/e_jnl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/ieee754/ldbl-128/e_jnl.c')
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_jnl.c35
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)