+***************************************************************************
+* *
+* Copyright (c) 1985 Regents of the University of California. *
+* *
+* Use and reproduction of this software are granted in accordance with *
+* the terms and conditions specified in the Berkeley Software License *
+* Agreement (in particular, this entails acknowledgement of the programs' *
+* source, and inclusion of this notice) with the additional understanding *
+* that all recipients should regard themselves as participants in an *
+* ongoing research project and hence should feel obligated to report *
+* their experiences (good or bad) with these elementary function codes, *
+* using "sendbug 4bsd-bugs@BERKELEY", to the authors. *
+* *
+* K.C. Ng, with Z-S. Alex Liu, S. McDonald, P. Tang, W. Kahan. *
+* Revised on 5/10/85, 5/13/85, 6/14/85, 8/20/85, 8/27/85. *
+* *
+***************************************************************************
******************************************************************************
* This is a description of the upgraded elementary functions (listed in 1). *
* Bessel functions (j0, j1, jn, y0, y1, yn), floor, and fabs passed over *
******************************************************************************
* This is a description of the upgraded elementary functions (listed in 1). *
* Bessel functions (j0, j1, jn, y0, y1, yn), floor, and fabs passed over *
- ( unchanges files from 4.2BSD, total 4 )
- floor.c gamma.c
-
- ( new files for 4.3BSD, total 36 )
- IEEE/Makefile VAX/cabs.s asinh.c jn.c
- IEEE/atan2.c VAX/cbrt.s atan.c log.c
- IEEE/cabs.c VAX/infnan.s cosh.c log__L.c
- IEEE/cbrt.c VAX/support.s erf.c log1p.c
- IEEE/trig.c VAX/sincos.s exp.c pow.c
- Makefile VAX/tan.s exp__E.c sinh.c
- README VAX/argred.s expm1.c tanh.c
- VAX/Makefile acosh.c j0.c
- VAX/atan2.s asincos.c j1.c
+ IEEE/Makefile VAX/Makefile VAX/support.s erf.c lgamma.c
+ IEEE/atan2.c VAX/argred.s VAX/tan.s exp.c log.c
+ IEEE/cabs.c VAX/atan2.s acosh.c exp__E.c log10.c
+ IEEE/cbrt.c VAX/cabs.s asincos.c expm1.c log1p.c
+ IEEE/support.c VAX/cbrt.s asinh.c floor.c log__L.c
+ IEEE/trig.c VAX/infnan.s atan.c j0.c pow.c
+ Makefile VAX/sincos.s atanh.c j1.c sinh.c
+ README VAX/sqrt.s cosh.c jn.c tanh.c
- acos(x) ...in file asincos.c
- asin(x) ...in file asincos.c
- atan(x) ...in file atan.c
- atan2(x,y) ...in files IEEE/atan2.c, VAX/atan2.s
- sin(x) ...in files IEEE/trig.c , VAX/sincos.s
- cos(x) ...in files IEEE/trig.c , VAX/sincos.s
- tan(x) ...in files IEEE/trig.c , VAX/tan.s
- cabs(x,y) ...in files IEEE/cabs.c , VAX/cabs.s
- hypot(x,y) ...in files IEEE/cabs.c , VAX/cabs.s
- cbrt(x) ...in files IEEE/cbrt.c , VAX/cbrt.s
- exp(x) ...in file exp.c
- expm1(x):=exp(x)-1 ...in file expm1.c
- log(x) ...in file log.c
- log10(x) ...in file log10.c
- log1p(x):=log(1+x) ...in file log1p.c
- pow(x,y) ...in file pow.c
- sinh(x) ...in file sinh.c
- cosh(x) ...in file cosh.c
- tanh(x) ...in file cosh.c
- asinh(x) ...in file asinh.c
- acosh(x) ...in file acosh.c
- atanh(x) ...in file atanh.c
-
+ acos(x) ...in file asincos.c
+ asin(x) ...in file asincos.c
+ atan(x) ...in file atan.c
+ atan2(x,y) ...in files IEEE/atan2.c, VAX/atan2.s
+ sin(x) ...in files IEEE/trig.c , VAX/sincos.s
+ cos(x) ...in files IEEE/trig.c , VAX/sincos.s
+ tan(x) ...in files IEEE/trig.c , VAX/tan.s
+ cabs(x,y) ...in files IEEE/cabs.c , VAX/cabs.s
+ hypot(x,y) ...in files IEEE/cabs.c , VAX/cabs.s
+ cbrt(x) ...in files IEEE/cbrt.c , VAX/cbrt.s
+ exp(x) ...in file exp.c
+ expm1(x):=exp(x)-1 ...in file expm1.c
+ log(x) ...in file log.c
+ log10(x) ...in file log10.c
+ log1p(x):=log(1+x) ...in file log1p.c
+ pow(x,y) ...in file pow.c
+ sinh(x) ...in file sinh.c
+ cosh(x) ...in file cosh.c
+ tanh(x) ...in file cosh.c
+ asinh(x) ...in file asinh.c
+ acosh(x) ...in file acosh.c
+ atanh(x) ...in file atanh.c
+
- sqrt() ...in files IEEE/support.c , VAX/sqrt.s
- drem() ...in files IEEE/support.c , VAX/support.s
- finite() ...in files IEEE/support.c , VAX/support.s
- logb() ...in files IEEE/support.c , VAX/support.s
- scalb() ...in files IEEE/support.c , VAX/support.s
- copysign() ...in files IEEE/support.c , VAX/support.s
+ sqrt() ...in files IEEE/support.c , VAX/sqrt.s
+ drem() ...in files IEEE/support.c , VAX/support.s
+ finite() ...in files IEEE/support.c , VAX/support.s
+ logb() ...in files IEEE/support.c , VAX/support.s
+ scalb() ...in files IEEE/support.c , VAX/support.s
+ copysign() ...in files IEEE/support.c , VAX/support.s
+ rint() ...in file floor.c
- given in both hexadecimal and decimal. The hexadecimal values
- are the intended ones. The decimal values may be use provided
- that the compiler converts from decimal to binary accurately
- enough to produce the hexadecimal values shown. If the
- conversion is inaccurate, then one must know the exact machine
- representation of the constants and alter the assembly-
- language output from the compiler, or apply tricks like
- the following in a C program.
+ given in both hexadecimal and decimal. The hexadecimal values
+ are the intended ones. The decimal values may be use provided
+ that the compiler converts from decimal to binary accurately
+ enough to produce the hexadecimal values shown. If the
+ conversion is inaccurate, then one must know the exact machine
+ representation of the constants and alter the assembly-
+ language output from the compiler, or apply tricks like
+ the following in a C program.
- The error in pow(x,y) grows with the size of y. Nevertheless,
- for integers x and y, pow(x,y) returns the correct integer value
- on all tested machines (VAX, SUN, NATIONAL, ZILOG), provided that
- x to the power of y is representable exactly.
+ The error in pow(x,y) grows with the size of y. Nevertheless,
+ for integers x and y, pow(x,y) returns the correct integer value
+ on all tested machines (VAX, SUN, NATIONAL, ZILOG), provided that
+ x to the power of y is representable exactly.
- The errors in [sin(x)], [cos(x)], and [atan(x)] are below
- 1 ULP compared with sin(x*pi/PI), cos(x*pi/PI), and
- atan(x)*PI/pi respectively, where PI is the machine's
- value of pi rounded. [Tan(x)] returns tan(x*pi/PI) within
- about 2 ULPs; [acos(x)], [asin(x)], and [atan2(y,x)]
- return acos(x)*PI/pi, asin(x)*PI/pi, and atan2(y,x)*PI/pi
- respectively to similar accuracy.
+ The errors in [sin(x)], [cos(x)], and [atan(x)] are below
+ 1 ULP compared with sin(x*pi/PI), cos(x*pi/PI), and
+ atan(x)*PI/pi respectively, where PI is the machine's
+ value of pi rounded. [Tan(x)] returns tan(x*pi/PI) within
+ about 2 ULPs; [acos(x)], [asin(x)], and [atan2(y,x)]
+ return acos(x)*PI/pi, asin(x)*PI/pi, and atan2(y,x)*PI/pi
+ respectively to similar accuracy.
- The errors in [sin(x)], [cos(x)], and [atan(x)] are below
- 1 ULP. [Tan(x)], [atan2(y,x)], [acos(x)], and [asin(x)]
- have errors below about 2 ULPs.
+ The errors in [sin(x)], [cos(x)], and [atan(x)] are below
+ 1 ULP. [Tan(x)], [atan2(y,x)], [acos(x)], and [asin(x)]
+ have errors below about 2 ULPs.
- tan : 2.09 ULPs ...1,024,000 random arguments (machine PI)
- sin : .861 ULPs ...1,024,000 random arguments (machine PI)
- cos : .857 ULPs ...1,024,000 random arguments (machine PI)
+ tan : 2.09 ULPs ...1,024,000 random arguments (machine PI)
+ sin : .861 ULPs ...1,024,000 random arguments (machine PI)
+ cos : .857 ULPs ...1,024,000 random arguments (machine PI)
- acos : 2.07 ULPs .....200,000 random arguments (machine PI)
- asin : 2.06 ULPs .....200,000 random arguments (machine PI)
- atan2 : 1.41 ULPs .....356,000 random arguments (machine PI)
- atan : 0.86 ULPs ...1,536,000 random arguments (machine PI)
+ acos : 2.07 ULPs .....200,000 random arguments (machine PI)
+ asin : 2.06 ULPs .....200,000 random arguments (machine PI)
+ atan2 : 1.41 ULPs .....356,000 random arguments (machine PI)
+ atan : 0.86 ULPs ...1,536,000 random arguments (machine PI)
- tan : 2.15 ULPs ...1,024,000 random arguments (true pi)
- sin : .814 ULPs ...1,024,000 random arguments (true pi)
- cos : .792 ULPs ...1,024,000 random arguments (true pi)
- acos : 2.15 ULPs ...1,024,000 random arguments (true pi)
- asin : 1.99 ULPs ...1,024,000 random arguments (true pi)
- atan2 : 1.48 ULPs ...1,024,000 random arguments (true pi)
- atan : .850 ULPs ...1,024,000 random arguments (true pi)
-
- acosh : 3.30 ULPs .....512,000 random arguments
- asinh : 1.58 ULPs .....512,000 random arguments
- atanh : 1.71 ULPs .....512,000 random arguments
- cosh : 1.23 ULPs .....768,000 random arguments
- sinh : 1.93 ULPs ...1,024,000 random arguments
- tanh : 2.22 ULPs ...1,024,000 random arguments
- log10 : 1.74 ULPs ...1,536,000 random arguments
- pow : 1.79 ULPs .....100,000 random arguments, 0 < x, y < 20.
-
- exp : .768 ULPs ...1,156,000 random arguments
- expm1 : .844 ULPs ...1,166,000 random arguments
- log1p : .846 ULPs ...1,536,000 random arguments
- log : .826 ULPs ...1,536,000 random arguments
- cabs : .959 ULPs .....500,000 random arguments
+ tan : 2.15 ULPs ...1,024,000 random arguments (true pi)
+ sin : .814 ULPs ...1,024,000 random arguments (true pi)
+ cos : .792 ULPs ...1,024,000 random arguments (true pi)
+ acos : 2.15 ULPs ...1,024,000 random arguments (true pi)
+ asin : 1.99 ULPs ...1,024,000 random arguments (true pi)
+ atan2 : 1.48 ULPs ...1,024,000 random arguments (true pi)
+ atan : .850 ULPs ...1,024,000 random arguments (true pi)
+
+ acosh : 3.30 ULPs .....512,000 random arguments
+ asinh : 1.58 ULPs .....512,000 random arguments
+ atanh : 1.71 ULPs .....512,000 random arguments
+ cosh : 1.23 ULPs .....768,000 random arguments
+ sinh : 1.93 ULPs ...1,024,000 random arguments
+ tanh : 2.22 ULPs ...1,024,000 random arguments
+ log10 : 1.74 ULPs ...1,536,000 random arguments
+ pow : 1.79 ULPs .....100,000 random arguments, 0 < x, y < 20.
+
+ exp : .768 ULPs ...1,156,000 random arguments
+ expm1 : .844 ULPs ...1,166,000 random arguments
+ log1p : .846 ULPs ...1,536,000 random arguments
+ log : .826 ULPs ...1,536,000 random arguments
+ cabs : .959 ULPs .....500,000 random arguments
- Some functions coded in VAX assembly language (cabs, hypot, sqrt)
- are significantly faster than the corresponding ones in 4.2BSD.
- In general, to improve performance, all functions in IEEE/support.c
- should be written in assembler and, whenever possible, should be
- called via short subroutine calls.
+ Some functions coded in VAX assembly language (cabs, hypot, sqrt)
+ are significantly faster than the corresponding ones in 4.2BSD.
+ In general, to improve performance, all functions in IEEE/support.c
+ should be written in assembler and, whenever possible, should be
+ called via short subroutine calls.
- The modications to these routines were only in how an invalide
- floating point operations is signaled.
-
-
-7. Copyright notice, and Disclaimer:
-
-***************************************************************************
-* *
-* Copyright (c) 1985 Regents of the University of California. *
-* *
-* Use and reproduction of this software are granted in accordance with *
-* the terms and conditions specified in the Berkeley Software License *
-* Agreement (in particular, this entails acknowledgement of the programs' *
-* source, and inclusion of this notice) with the additional understanding *
-* that all recipients should regard themselves as participants in an *
-* ongoing research project and hence should feel obligated to report *
-* their experiences (good or bad) with these elementary function codes, *
-* using "sendbug 4bsd-bugs@BERKELEY", to the authors. *
-* *
-***************************************************************************
-
+ The modications to these routines were only in how an invalide
+ floating point operations is signaled.