From 5d2a88a70e3a40d93e7c6c821b9f22746b3a11a3 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 13 Feb 2001 01:23:48 +0000 Subject: Little optimization, use sincos. --- sysdeps/ieee754/dbl-64/e_jn.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'sysdeps/ieee754/dbl-64/e_jn.c') 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 { -- cgit v1.2.3