From 0e9be4db8f655d3dc006c5b101f15a5912a5846f Mon Sep 17 00:00:00 2001 From: Wilco Dijkstra Date: Fri, 15 May 2015 10:53:55 +0000 Subject: Remove various ABS macros and replace uses with fabs (or in one case abs) which is more efficient on all targets. --- sysdeps/ieee754/dbl-64/e_asin.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'sysdeps/ieee754/dbl-64/e_asin.c') diff --git a/sysdeps/ieee754/dbl-64/e_asin.c b/sysdeps/ieee754/dbl-64/e_asin.c index b87e557988..a7684d1078 100644 --- a/sysdeps/ieee754/dbl-64/e_asin.c +++ b/sysdeps/ieee754/dbl-64/e_asin.c @@ -104,9 +104,9 @@ __ieee754_asin(double x){ __doasin(x,0,w); if (w[0]==(w[0]+1.00000001*w[1])) return w[0]; else { - y=ABS(x); - res=ABS(w[0]); - res1=ABS(w[0]+1.1*w[1]); + y=fabs(x); + res=fabs(w[0]); + res1=fabs(w[0]+1.1*w[1]); return (m>0)?__sin32(y,res,res1):-__sin32(y,res,res1); } } @@ -135,11 +135,11 @@ __ieee754_asin(double x){ res1=res+1.1*cor; z=0.5*(res1-res); __dubsin(res,z,w); - z=(w[0]-ABS(x))+w[1]; + z=(w[0]-fabs(x))+w[1]; if (z>1.0e-27) return (m>0)?min(res,res1):-min(res,res1); else if (z<-1.0e-27) return (m>0)?max(res,res1):-max(res,res1); else { - y=ABS(x); + y=fabs(x); return (m>0)?__sin32(y,res,res1):-__sin32(y,res,res1); } } @@ -168,11 +168,11 @@ __ieee754_asin(double x){ res1=res+1.1*cor; z=0.5*(res1-res); __dubsin(res,z,w); - z=(w[0]-ABS(x))+w[1]; + z=(w[0]-fabs(x))+w[1]; if (z>1.0e-27) return (m>0)?min(res,res1):-min(res,res1); else if (z<-1.0e-27) return (m>0)?max(res,res1):-max(res,res1); else { - y=ABS(x); + y=fabs(x); return (m>0)?__sin32(y,res,res1):-__sin32(y,res,res1); } } @@ -203,11 +203,11 @@ __ieee754_asin(double x){ y=hp0.x-res; z=((hp0.x-y)-res)+(hp1.x-z); __dubcos(y,z,w); - z=(w[0]-ABS(x))+w[1]; + z=(w[0]-fabs(x))+w[1]; if (z>1.0e-27) return (m>0)?min(res,res1):-min(res,res1); else if (z<-1.0e-27) return (m>0)?max(res,res1):-max(res,res1); else { - y=ABS(x); + y=fabs(x); return (m>0)?__sin32(y,res,res1):-__sin32(y,res,res1); } } @@ -241,11 +241,11 @@ __ieee754_asin(double x){ z=y+hp1.x; y=(y-z)+hp1.x; __dubcos(z,y,w); - z=(w[0]-ABS(x))+w[1]; + z=(w[0]-fabs(x))+w[1]; if (z>1.0e-27) return (m>0)?min(res,res1):-min(res,res1); else if (z<-1.0e-27) return (m>0)?max(res,res1):-max(res,res1); else { - y=ABS(x); + y=fabs(x); return (m>0)?__sin32(y,res,res1):-__sin32(y,res,res1); } } @@ -280,11 +280,11 @@ __ieee754_asin(double x){ z=y+hp1.x; y=(y-z)+hp1.x; __dubcos(z,y,w); - z=(w[0]-ABS(x))+w[1]; + z=(w[0]-fabs(x))+w[1]; if (z>1.0e-27) return (m>0)?min(res,res1):-min(res,res1); else if (z<-1.0e-27) return (m>0)?max(res,res1):-max(res,res1); else { - y=ABS(x); + y=fabs(x); return (m>0)?__sin32(y,res,res1):-__sin32(y,res,res1); } } @@ -318,7 +318,7 @@ __ieee754_asin(double x){ cor = (res1-res)+cor; if (res==(res+1.0000001*cor)) return (m>0)?res:-res; else { - y=ABS(x); + y=fabs(x); res1=res+1.1*cor; return (m>0)?__sin32(y,res,res1):-__sin32(y,res,res1); } -- cgit v1.2.3