diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-02-13 01:23:48 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-02-13 01:23:48 +0000 |
commit | 5d2a88a70e3a40d93e7c6c821b9f22746b3a11a3 (patch) | |
tree | aad692051ec8635ec14fcebf8aa714f637f3b569 /sysdeps/ieee754/dbl-64/e_jn.c | |
parent | 8de5da94ce5a2f01369ecc9dbe63684e6245dbdd (diff) | |
download | glibc-5d2a88a70e3a40d93e7c6c821b9f22746b3a11a3.tar glibc-5d2a88a70e3a40d93e7c6c821b9f22746b3a11a3.tar.gz glibc-5d2a88a70e3a40d93e7c6c821b9f22746b3a11a3.tar.bz2 glibc-5d2a88a70e3a40d93e7c6c821b9f22746b3a11a3.zip |
Little optimization, use sincos.
Diffstat (limited to 'sysdeps/ieee754/dbl-64/e_jn.c')
-rw-r--r-- | sysdeps/ieee754/dbl-64/e_jn.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_jn.c b/sysdeps/ieee754/dbl-64/e_jn.c index 68abc90462..64ba79929d 100644 --- a/sysdeps/ieee754/dbl-64/e_jn.c +++ b/sysdeps/ieee754/dbl-64/e_jn.c @@ -103,11 +103,14 @@ static double zero = 0.00000000000000000000e+00; * 2 -s+c -c-s * 3 s+c c-s */ + double s; + double c; + __sincos (x, &s, &c); switch(n&3) { - case 0: temp = __cos(x)+__sin(x); break; - case 1: temp = -__cos(x)+__sin(x); break; - case 2: temp = -__cos(x)-__sin(x); break; - case 3: temp = __cos(x)-__sin(x); break; + case 0: temp = c + s; break; + case 1: temp = -c + s; break; + case 2: temp = -c - s; break; + case 3: temp = c - s; break; } b = invsqrtpi*temp/__ieee754_sqrt(x); } else { @@ -257,11 +260,14 @@ static double zero = 0.00000000000000000000e+00; * 2 -s+c -c-s * 3 s+c c-s */ + double c; + double s; + __sincos (x, &s, &c); switch(n&3) { - case 0: temp = __sin(x)-__cos(x); break; - case 1: temp = -__sin(x)-__cos(x); break; - case 2: temp = -__sin(x)+__cos(x); break; - case 3: temp = __sin(x)+__cos(x); break; + case 0: temp = s - c; break; + case 1: temp = -s - c; break; + case 2: temp = -s + c; break; + case 3: temp = s + c; break; } b = invsqrtpi*temp/__ieee754_sqrt(x); } else { |