mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
48 lines
1.8 KiB
Plaintext
48 lines
1.8 KiB
Plaintext
/* origin: FreeBSD /usr/src/lib/msun/src/s_atan.c
|
|
* ====================================================
|
|
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
|
*
|
|
* Developed at SunPro, a Sun Microsystems, Inc. business.
|
|
* Permission to use, copy, modify, and distribute this
|
|
* software is freely granted, provided that this notice
|
|
* is preserved.
|
|
* ====================================================
|
|
*/
|
|
/* atan(x)
|
|
* Method
|
|
* 1. Reduce x to positive by atan(x) = -atan(-x).
|
|
* 2. According to the integer k=4t+0.25 chopped, t=x, the argument
|
|
* is further reduced to one of the following intervals and the
|
|
* arctangent of t is evaluated by the corresponding formula:
|
|
*
|
|
* [0,7/16] atan(x) = t-t^3*(a1+t^2*(a2+...(a10+t^2*a11)...)
|
|
* [7/16,11/16] atan(x) = atan(1/2) + atan( (t-0.5)/(1+t/2) )
|
|
* [11/16.19/16] atan(x) = atan( 1 ) + atan( (t-1)/(1+t) )
|
|
* [19/16,39/16] atan(x) = atan(3/2) + atan( (t-1.5)/(1+1.5t) )
|
|
* [39/16,INF] atan(x) = atan(INF) + atan( -1/t )
|
|
*
|
|
* Constants:
|
|
* The hexadecimal values are the intended ones for the following
|
|
* constants. The decimal values may be used, provided that the
|
|
* compiler will convert from decimal to binary accurately enough
|
|
* to produce the hexadecimal values shown.
|
|
*/
|
|
/* origin: FreeBSD /usr/src/lib/msun/src/s_atanf.c */
|
|
/*
|
|
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
|
*/
|
|
/*
|
|
* ====================================================
|
|
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
|
*
|
|
* Developed at SunPro, a Sun Microsystems, Inc. business.
|
|
* Permission to use, copy, modify, and distribute this
|
|
* software is freely granted, provided that this notice
|
|
* is preserved.
|
|
* ====================================================
|
|
*/
|
|
module std::math;
|
|
|
|
|
|
|