aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/dbl-64/mpatan.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/dbl-64/mpatan.c')
-rw-r--r--sysdeps/ieee754/dbl-64/mpatan.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/sysdeps/ieee754/dbl-64/mpatan.c b/sysdeps/ieee754/dbl-64/mpatan.c
index ee21c25..f40873e 100644
--- a/sysdeps/ieee754/dbl-64/mpatan.c
+++ b/sysdeps/ieee754/dbl-64/mpatan.c
@@ -1,8 +1,7 @@
-
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -34,11 +33,19 @@
#include "endian.h"
#include "mpa.h"
-void __mpsqrt(mp_no *, mp_no *, int);
-void __mpatan(mp_no *x, mp_no *y, int p) {
+#ifndef SECTION
+# define SECTION
+#endif
+
#include "mpatan.h"
+void __mpsqrt(mp_no *, mp_no *, int);
+
+void
+SECTION
+__mpatan(mp_no *x, mp_no *y, int p) {
+
int i,m,n;
double dx;
mp_no
@@ -54,19 +61,19 @@ void __mpatan(mp_no *x, mp_no *y, int p) {
mp_no mps,mpsm,mpt,mpt1,mpt2,mpt3;
- /* Choose m and initiate mpone, mptwo & mptwoim1 */
+ /* Choose m and initiate mpone, mptwo & mptwoim1 */
if (EX>0) m=7;
else if (EX<0) m=0;
else {
__mp_dbl(x,&dx,p); dx=ABS(dx);
for (m=6; m>0; m--)
- {if (dx>xm[m].d) break;}
+ {if (dx>__atan_xm[m].d) break;}
}
mpone.e = mptwo.e = mptwoim1.e = 1;
mpone.d[0] = mpone.d[1] = mptwo.d[0] = mptwoim1.d[0] = ONE;
mptwo.d[1] = TWO;
- /* Reduce x m times */
+ /* Reduce x m times */
__mul(x,x,&mpsm,p);
if (m==0) __cpy(x,&mps,p);
else {
@@ -82,8 +89,8 @@ void __mpatan(mp_no *x, mp_no *y, int p) {
__mpsqrt(&mpsm,&mps,p); mps.d[0] = X[0];
}
- /* Evaluate a truncated power series for Atan(s) */
- n=np[p]; mptwoim1.d[1] = twonm1[p].d;
+ /* Evaluate a truncated power series for Atan(s) */
+ n=__atan_np[p]; mptwoim1.d[1] = __atan_twonm1[p].d;
__dvd(&mpsm,&mptwoim1,&mpt,p);
for (i=n-1; i>1; i--) {
mptwoim1.d[1] -= TWO;
@@ -94,8 +101,8 @@ void __mpatan(mp_no *x, mp_no *y, int p) {
__mul(&mps,&mpt,&mpt1,p);
__sub(&mps,&mpt1,&mpt,p);
- /* Compute Atan(x) */
- mptwoim1.d[1] = twom[m].d;
+ /* Compute Atan(x) */
+ mptwoim1.d[1] = __atan_twom[m].d;
__mul(&mptwoim1,&mpt,y,p);
return;