OSDN Git Service

Fix no pic
[uclinux-h8/uClinux-dist.git] / lib / libm / mathf.h
1 #ifndef _MATH_H
2 #define _MATH_H
3
4 #ifndef _MCONF_H
5 typedef struct {
6  float r;
7  float i;
8 } cmplxf;
9
10 typedef struct {
11  double r;
12  double i;
13 } cmplx;
14 #endif
15
16 #ifdef mc6800
17 #include <bits/nan.h>
18 #include <bits/huge_val.h>
19 #include <float.h>
20 #endif
21
22 /* Double precision constants */
23 #define M_E             2.7182818284590452354   /* e */
24 #define M_LOG2E         1.4426950408889634074   /* log_2 e */
25 #define M_LOG10E        0.43429448190325182765  /* log_10 e */
26 #define M_LN2           0.69314718055994530942  /* log_e 2 */
27 #define M_LN10          2.30258509299404568402  /* log_e 10 */
28 #define M_PI            3.14159265358979323846  /* pi */
29 #define M_PI_2          1.57079632679489661923  /* pi/2 */
30 #define M_PI_4          0.78539816339744830962  /* pi/4 */
31 #define M_1_PI          0.31830988618379067154  /* 1/pi */
32 #define M_2_PI          0.63661977236758134308  /* 2/pi */
33 #define M_2_SQRTPI      1.12837916709551257390  /* 2/sqrt(pi) */
34 #define M_SQRT2         1.41421356237309504880  /* sqrt(2) */
35 #define M_SQRT1_2       0.70710678118654752440  /* 1/sqrt(2) */
36
37 /* Single precision constants */
38 #define M_Ef            2.7182818284f           /* e */
39 #define M_LOG2Ef        1.4426950408f           /* log_2 e */
40 #define M_LOG10Ef       0.43429448190f          /* log_10 e */
41 #define M_LN2f          0.69314718055f          /* log_e 2 */
42 #define M_LN10f         2.3025850929f           /* log_e 10 */
43 #define M_PIf           3.1415926535f           /* pi */
44 #define M_PI_2f         1.5707963267f           /* pi/2 */
45 #define M_PI_4f         0.78539816339f          /* pi/4 */
46 #define M_1_PIf         0.31830988618f          /* 1/pi */
47 #define M_2_PIf         0.63661977236f          /* 2/pi */
48 #define M_2_SQRTPIf     1.1283791670f           /* 2/sqrt(pi) */
49 #define M_SQRT2f        1.4142135623f           /* sqrt(2) */
50 #define M_SQRT1_2f      0.70710678118f          /* 1/sqrt(2) */
51
52 /* Double precision routines */
53 extern double fmod(double, double);
54 extern double modf(double, double *);
55
56 extern double acosh ( double x );
57 extern int airy ( double x, double *ai, double *aip, double *bi, double *bip );
58 extern double asin ( double x );
59 extern double acos ( double x );
60 extern double asinh ( double xx );
61 extern double atan ( double x );
62 extern double atan2 ( double y, double x );
63 extern double atanh ( double x );
64 extern double bdtrc ( int k, int n, double p );
65 extern double bdtr ( int k, int n, double p );
66 extern double bdtri ( int k, int n, double y );
67 extern double beta ( double a, double b );
68 extern double lbeta ( double a, double b );
69 extern double btdtr ( double a, double b, double x );
70 extern double cbrt ( double x );
71 extern double chbevl ( double x, double array[], int n );
72 extern double chdtrc ( double df, double x );
73 extern double chdtr ( double df, double x );
74 extern double chdtri ( double df, double y );
75 extern void clog ( cmplx *z, cmplx *w );
76 extern void cexp ( cmplx *z, cmplx *w );
77 extern void csin ( cmplx *z, cmplx *w );
78 extern void ccos ( cmplx *z, cmplx *w );
79 extern void ctan ( cmplx *z, cmplx *w );
80 extern void ccot ( cmplx *z, cmplx *w );
81 extern void casin ( cmplx *z, cmplx *w );
82 extern void cacos ( cmplx *z, cmplx *w );
83 extern void catan ( cmplx *z, cmplx *w );
84 extern void csinh ( cmplx *z, cmplx *w );
85 extern void casinh ( cmplx *z, cmplx *w );
86 extern void ccosh ( cmplx *z, cmplx *w );
87 extern void cacosh ( cmplx *z, cmplx *w );
88 extern void ctanh ( cmplx *z, cmplx *w );
89 extern void catanh ( cmplx *z, cmplx *w );
90 extern void cpow ( cmplx *a, cmplx *z, cmplx *w );
91 extern void cadd ( cmplx *a, cmplx *b, cmplx *c );
92 extern void csub ( cmplx *a, cmplx *b, cmplx *c );
93 extern void cmul ( cmplx *a, cmplx *b, cmplx *c );
94 extern void cdiv ( cmplx *a, cmplx *b, cmplx *c );
95 extern void cmov ( void *a, void *b );
96 extern void cneg ( cmplx *a );
97 extern double cabs ( cmplx *z );
98 extern void csqrt ( cmplx *z, cmplx *w );
99 extern double hypot ( double x, double y );
100 extern double cosh ( double x );
101 extern double dawsn ( double xx );
102 extern int drand ( double *a );
103 extern double ei ( double x );
104 extern double ellie ( double phi, double m );
105 extern double ellik ( double phi, double m );
106 extern double ellpe ( double x );
107 extern int ellpj ( double u, double m, double *sn, double *cn, double *dn, double *ph );
108 extern double ellpk ( double x );
109 extern double exp ( double x );
110 extern double exp10 ( double x );
111 extern double exp2 ( double x );
112 extern double expn ( int n, double x );
113 extern double expx2 ( double x, int sign );
114 extern double fabs ( double x );
115 extern double fac ( int i );
116 extern double fdtrc ( int ia, int ib, double x );
117 extern double fdtr ( int ia, int ib, double x );
118 extern double fdtri ( int ia, int ib, double y );
119 extern int fresnl ( double xxa, double *ssa, double *cca );
120 extern double gamma ( double x );
121 extern double lgam ( double x );
122 extern double gdtr ( double a, double b, double x );
123 extern double gdtrc ( double a, double b, double x );
124 extern double hyp2f1 ( double a, double b, double c, double x );
125 extern double hyperg ( double a, double b, double x );
126 extern double hyp2f0 ( double a, double b, double x, int type, double *err );
127 extern double i0 ( double x );
128 extern double i0e ( double x );
129 extern double i1 ( double x );
130 extern double i1e ( double x );
131 extern double igami ( double, double );
132 extern double incbet ( double aa, double bb, double xx );
133 extern double incbi ( double aa, double bb, double yy0 );
134 extern double igamc ( double a, double x );
135 extern double igam ( double a, double x );
136 extern int signbit ( double x );
137 extern int isnan ( double x );
138 extern int isfinite ( double x );
139 extern double iv ( double v, double x );
140 extern double j0 ( double x );
141 extern double y0 ( double x );
142 extern double j1 ( double x );
143 extern double y1 ( double x );
144 extern double jn ( int n, double x );
145 extern double jv ( double n, double x );
146 extern double k0 ( double x );
147 extern double k0e ( double x );
148 extern double k1 ( double x );
149 extern double k1e ( double x );
150 extern double kn ( int nn, double x );
151 extern double smirnov ( int n, double e );
152 extern double kolmogorov ( double y );
153 extern double smirnovi ( int n, double p );
154 extern double kolmogi ( double p );
155 extern double log ( double x );
156 extern double log2 ( double x );
157 extern double log10 ( double x );
158 extern long lrand ( void );
159 extern double nbdtrc ( int k, int n, double p );
160 extern double nbdtr ( int k, int n, double p );
161 extern double nbdtri ( int k, int n, double p );
162 extern double ndtr ( double a );
163 extern double erfc ( double a );
164 extern double erf ( double x );
165 extern double ndtri ( double );
166 extern double pdtrc ( int k, double m );
167 extern double pdtr ( int k, double m );
168 extern double pdtri ( int k, double y );
169 extern double plancki ( double w, double T );
170 extern double planckc ( double w, double T );
171 extern double planckd ( double w, double T );
172 extern double planckw ( double T );
173 extern double polevl ( double x, double coef[], int N );
174 extern double p1evl ( double x, double coef[], int N );
175 extern void polatn ( double num[], double den[], double ans[], int nn );
176 extern void polsqt ( double pol[], double ans[], int nn );
177 extern void polsin ( double x[], double y[], int nn );
178 extern void polcos ( double x[], double y[], int nn );
179 extern double polylog ( int n, double x );
180 extern void polini ( int maxdeg );
181 extern void polprt ( double a[], int na, int d );
182 extern void polclr ( double *a, int n );
183 extern void polmov ( double *a, int na, double *b );
184 extern void polmul ( double a[], int na, double b[], int nb, double c[] );
185 extern void poladd ( double a[], int na, double b[], int nb, double c[] );
186 extern void polsub ( double a[], int na, double b[], int nb, double c[] );
187 extern int poldiv ( double a[], int na, double b[], int nb, double c[] );
188 extern void polsbt ( double a[], int na, double b[], int nb, double c[] );
189 extern double poleva ( double a[], int na, double x );
190 extern double pow ( double x, double y );
191 extern double powi ( double x, int nn );
192 extern double psi ( double x );
193 extern double rgamma ( double x );
194 extern double round ( double x );
195 extern int shichi ( double x, double *si, double *ci );
196 extern int sici ( double x, double *si, double *ci );
197 extern double sin ( double x );
198 extern double cos ( double x );
199 extern double radian ( double d, double m, double s );
200 extern double sindg ( double x );
201 extern double cosdg ( double x );
202 extern double sinh ( double x );
203 extern double spence ( double x );
204 extern double stdtr ( int k, double t );
205 extern double stdtri ( int k, double p );
206 extern double onef2 ( double a, double b, double c, double x, double *err );
207 extern double threef0 ( double a, double b, double c, double x, double *err );
208 extern double struve ( double v, double x );
209 extern double yv ( double v, double x );
210 extern double tan ( double x );
211 extern double cot ( double x );
212 extern double tandg ( double x );
213 extern double cotdg ( double x );
214 extern double tanh ( double x );
215 extern double log1p ( double x );
216 extern double expm1 ( double x );
217 extern double cosm1 ( double x );
218 extern double yn ( int n, double x );
219 extern double zeta ( double x, double q );
220 extern double zetac ( double x );
221 extern double sqrt ( double x );
222 extern double ceil ( double x );
223 extern double floor ( double x );
224 extern double frexp ( double x, int *pw2 );
225 extern double ldexp ( double x, int pw2 );
226 extern int sprec ( void );
227 extern int dprec ( void );
228 extern int ldprec ( void );
229 extern int mtherr ( char *name, int code );
230
231 /* Single precision routines */
232 extern float acosf ( float x );
233 extern float acoshf ( float xx );
234 extern int airyf ( float xx, float *ai, float *aip, float *bi, float *bip );
235 extern float asinf ( float xx );
236 extern float asinhf ( float xx );
237 extern float atan2f ( float y, float x );
238 extern float atanf ( float xx );
239 extern float atanhf ( float xx );
240 extern float bdtrcf ( int k, int n, float pp );
241 extern float bdtrf ( int k, int n, float pp );
242 extern float bdtrif ( int k, int n, float yy );
243 extern float betaf ( float aa, float bb );
244 extern float cabsf ( cmplxf *z );
245 extern void cacosf ( cmplxf *z, cmplxf *w );
246 extern void caddf ( cmplxf *a, cmplxf *b, cmplxf *c );
247 extern void casinf ( cmplxf *z, cmplxf *w );
248 extern void catanf ( cmplxf *z, cmplxf *w );
249 extern float cbrtf ( float xx );
250 extern void cchshf ( float xx, float *c, float *s );
251 extern void ccosf ( cmplxf *z, cmplxf *w );
252 extern void ccotf ( cmplxf *z, cmplxf *w );
253 extern void cdivf ( cmplxf *a, cmplxf *b, cmplxf *c );
254 extern float ceilf ( float x );
255 extern void cexpf ( cmplxf *z, cmplxf *w );
256 extern float chbevlf ( float x, float *array, int n );
257 extern float chdtrcf ( float dff, float xx );
258 extern float chdtrf ( float dff, float xx );
259 extern float chdtrif ( float dff, float yy );
260 extern void clogf ( cmplxf *z, cmplxf *w );
261 extern void cmovf ( short *a, short *b );
262 extern void cmulf ( cmplxf *a, cmplxf *b, cmplxf *c );
263 extern void cnegf ( cmplxf *a );
264 extern float cosdgf ( float xx );
265 extern float cosf ( float xx );
266 extern float coshf ( float xx );
267 extern float cotdgf ( float x );
268 extern float cotf ( float x );
269 extern void csinf ( cmplxf *z, cmplxf *w );
270 extern void csqrtf ( cmplxf *z, cmplxf *w );
271 extern void csubf ( cmplxf *a, cmplxf *b, cmplxf *c );
272 extern void ctanf ( cmplxf *z, cmplxf *w );
273 extern float ctansf ( cmplxf *z );
274 extern float dawsnf ( float xxx );
275 extern int dprec ( void );
276 extern float ellief ( float phia, float ma );
277 extern float ellikf ( float phia, float ma );
278 extern float ellpef ( float xx );
279 extern int ellpjf ( float uu, float mm, float *sn, float *cn, float *dn, float *ph );
280 extern float ellpkf ( float xx );
281 extern float erfcf ( float aa );
282 extern float erff ( float xx );
283 extern float exp10f ( float xx );
284 extern float exp2f ( float xx );
285 extern float expf ( float xx );
286 extern float expnf ( int n, float xx );
287 extern float facf ( int i );
288 extern float fdtrcf ( int ia, int ib, float xx );
289 extern float fdtrf ( int ia, int ib, int xx );
290 extern float fdtrif ( int ia, int ib, float yy );
291 extern float floorf ( float x );
292 extern void fresnlf ( float xxa, float *ssa, float *cca );
293 extern float frexpf ( float x, int *pw2 );
294 extern float gammaf ( float xx );
295 extern float gdtrcf ( float aa, float bb, float xx );
296 extern float gdtrf ( float aa, float bb, float xx );
297 extern float hyp2f0f ( float aa, float bb, float xx, int type, float *err );
298 extern float hyp2f1f ( float aa, float bb, float cc, float xx );
299 extern float hypergf ( float aa, float bb, float xx );
300 extern float i0ef ( float x );
301 extern float i0f ( float x );
302 extern float i1ef ( float xx );
303 extern float i1f ( float xx );
304 extern float igamcf ( float aa, float xx );
305 extern float igamf ( float aa, float xx );
306 extern float igamif ( float aa, float yy0 );
307 extern float incbetf ( float aaa, float bbb, float xxx );
308 extern float incbif ( float aaa, float bbb, float yyy0 );
309 extern float incbpsf ( float aa, float bb, float xx );
310 extern float ivf ( float v, float x );
311 extern float j0f ( float xx );
312 extern float j1f ( float xx );
313 extern float jnf ( int n, float xx );
314 extern float jvf ( float nn, float xx );
315 extern float k0ef ( float xx );
316 extern float k0f ( float xx );
317 extern float k1ef ( float xx );
318 extern float k1f ( float xx );
319 extern float knf ( int nnn, float xx );
320 extern float ldexpf ( float x, int pw2 );
321 extern int ldprec ( void );
322 extern float lgamf ( float xx );
323 extern float log10f ( float xx );
324 extern float log2f ( float xx );
325 extern float logf ( float xx );
326 extern int mtherr ( char *name, int code );
327 extern float nbdtrcf ( int k, int n, float pp );
328 extern float nbdtrf ( int k, int n, float pp );
329 extern float ndtrf ( float aa );
330 extern float ndtrif ( float yy0 );
331 extern float onef2f ( float aa, float bb, float cc, float xx, float *err );
332 extern float p1evlf ( float xx, float *coef, int N );
333 extern float pdtrcf ( int k, float mm );
334 extern float pdtrf ( int k, float mm );
335 extern float pdtrif ( int k, float yy );
336 extern void poladdf ( float a[], int na, float b[], int nb, float c[] );
337 extern void polclrf ( float *a, int n );
338 extern int poldivf ( float a[], int na, float b[], int nb, float c[] );
339 extern float polevaf ( float *a, int na, float xx );
340 extern float polevlf ( float xx, float *coef, int N );
341 extern void polinif ( int maxdeg );
342 extern void polmovf ( float *a, int na, float *b );
343 extern void polmulf ( float a[], int na, float b[], int nb, float c[] );
344 extern void polprtf ( float *a, int na, int d );
345 extern void polsbtf ( float a[], int na, float b[], int nb, float c[] );
346 extern void polsubf ( float a[], int na, float b[], int nb, float c[] );
347 extern float powf ( float x, float y );
348 extern float powif ( float x, int nn );
349 extern float psif ( float xx );
350 extern float redupif ( float xx );
351 extern float rgammaf ( float xx );
352 extern int shichif ( float xx, float *si, float *ci );
353 extern int sicif ( float xx, float *si, float *ci );
354 extern float sindgf ( float xx );
355 extern float sinf ( float xx );
356 extern float sinhf ( float xx );
357 extern float spencef ( float xx );
358 extern int sprec ( void );
359 extern float sqrtf ( float xx );
360 extern float stdtrf ( int k, float tt );
361 extern float struvef ( float vv, float xx );
362 extern float tandgf ( float x );
363 extern float tanf ( float x );
364 extern float tanhf ( float xx );
365 extern float threef0f ( float aa, float bb, float cc, float xx, float *err );
366 extern float y0f ( float xx );
367 extern float y1f ( float xx );
368 extern float ynf ( int nn, float xx );
369 extern float yvf ( float vv, float xx );
370 extern float zetacf ( float xx );
371 extern float zetaf ( float xx, float qq );
372
373 #define rint(x) ((double) ((int) ((x) + 0.5)))
374
375 #endif