1 /* Begin include file math.h */
 2 /*        @(#)math.h          2.5       */
 3 
 4 #ifndef _POLY9
 5 extern int errno, signgam;
 6 
 7 extern double atof(), frexp(), ldexp(), modf();
 8 extern double j0(), j1(), jn(), y0(), y1(), yn();
 9 extern double erf(), erfc();
10 extern double exp(), log(), log10(), pow(), sqrt();
11 extern double floor(), ceil(), fmod(), fabs();
12 extern double gamma();
13 extern double hypot();
14 extern int matherr();
15 extern double sinh(), cosh(), tanh();
16 extern double sin(), cos(), tan(), asin(), acos(), atan(), atan2();
17 
18 /* some useful constants */
19 #define M_E                   2.718281828459045235260
20 #define M_LOG2E               1.442695040888963407360
21 #define M_LOG10E    0.43429448190325182765113
22 #define M_LN2                 0.69314718055994530941723
23 #define M_LN10                2.302585092994045684018
24 #define M_PI                  3.1415926535897932384626
25 #define M_PI_2                1.5707963267948966192313
26 #define M_PI_4                0.78539816339744830961566
27 #define M_1_PI                0.31830988618379067153777
28 #define M_2_PI                0.63661977236758134307554
29 #define M_2_SQRTPI  1.1283791670955125738962
30 #define M_SQRT2               1.4142135623730950488017
31 #define M_SQRT1_2   0.70710678118654752440084
32 
33 #define MAXFLOAT    ((float)1.7014118219281863150e+38)
34 
35 #define HUGE        MAXFLOAT
36 
37 #define _ABS(x)     ((x) < 0 ? -(x) : (x))
38 #define _REDUCE(TYPE, X, XN, C1, C2)    { \
39           double x1 = (double)(TYPE)X, x2 = X - x1; \
40           X = x1 - (XN) * (C1); X += x2; X -= (XN) * (C2); }
41 #define _POLY1(x, c)          ((c)[0] * (x) + (c)[1])
42 #define _POLY2(x, c)          (_POLY1((x), (c)) * (x) + (c)[2])
43 #define _POLY3(x, c)          (_POLY2((x), (c)) * (x) + (c)[3])
44 #define _POLY4(x, c)          (_POLY3((x), (c)) * (x) + (c)[4])
45 #define _POLY5(x, c)          (_POLY4((x), (c)) * (x) + (c)[5])
46 #define _POLY6(x, c)          (_POLY5((x), (c)) * (x) + (c)[6])
47 #define _POLY7(x, c)          (_POLY6((x), (c)) * (x) + (c)[7])
48 #define _POLY8(x, c)          (_POLY7((x), (c)) * (x) + (c)[8])
49 #define _POLY9(x, c)          (_POLY8((x), (c)) * (x) + (c)[9])
50 
51 struct exception {
52           int type;
53           char *name;
54           double arg1;
55           double arg2;
56           double retval;
57 };
58 
59 #define DOMAIN                1
60 #define   SING                2
61 #define   OVERFLOW  3
62 #define   UNDERFLOW 4
63 #define   TLOSS               5
64 #define   PLOSS               6
65 #endif
66 
67 /* End include file math.h */