summaryrefslogtreecommitdiffstats
path: root/modules/fdlibm/patches/04_include_fdlibm_h_from_math_private_h.patch
blob: 9c0569e27d9f19bbd832d577844e9dcc160ca0e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
diff --git a/modules/fdlibm/src/e_acos.cpp b/modules/fdlibm/src/e_acos.cpp
--- a/modules/fdlibm/src/e_acos.cpp
+++ b/modules/fdlibm/src/e_acos.cpp
@@ -35,17 +35,16 @@
  *	if x is NaN, return x itself;
  *	if |x|>1, return NaN with invalid signal.
  *
  * Function needed: sqrt
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double
 one=  1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
 pi =  3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */
 pio2_hi =  1.57079632679489655800e+00; /* 0x3FF921FB, 0x54442D18 */
 static volatile double
 pio2_lo =  6.12323399573676603587e-17; /* 0x3C91A626, 0x33145C07 */
diff --git a/modules/fdlibm/src/e_acosh.cpp b/modules/fdlibm/src/e_acosh.cpp
--- a/modules/fdlibm/src/e_acosh.cpp
+++ b/modules/fdlibm/src/e_acosh.cpp
@@ -26,17 +26,16 @@
  *
  * Special cases:
  *	acosh(x) is NaN with signal if x<1.
  *	acosh(NaN) is NaN without signal.
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double
 one	= 1.0,
 ln2	= 6.93147180559945286227e-01;  /* 0x3FE62E42, 0xFEFA39EF */
 
 double
 __ieee754_acosh(double x)
diff --git a/modules/fdlibm/src/e_asin.cpp b/modules/fdlibm/src/e_asin.cpp
--- a/modules/fdlibm/src/e_asin.cpp
+++ b/modules/fdlibm/src/e_asin.cpp
@@ -41,17 +41,16 @@
  * Special cases:
  *	if x is NaN, return x itself;
  *	if |x|>1, return NaN with invalid signal.
  *
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double
 one =  1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
 huge =  1.000e+300,
 pio2_hi =  1.57079632679489655800e+00, /* 0x3FF921FB, 0x54442D18 */
 pio2_lo =  6.12323399573676603587e-17, /* 0x3C91A626, 0x33145C07 */
 pio4_hi =  7.85398163397448278999e-01, /* 0x3FE921FB, 0x54442D18 */
diff --git a/modules/fdlibm/src/e_atan2.cpp b/modules/fdlibm/src/e_atan2.cpp
--- a/modules/fdlibm/src/e_atan2.cpp
+++ b/modules/fdlibm/src/e_atan2.cpp
@@ -39,17 +39,16 @@
  * 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.
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static volatile double
 tiny  = 1.0e-300;
 static const double
 zero  = 0.0,
 pi_o_4  = 7.8539816339744827900E-01, /* 0x3FE921FB, 0x54442D18 */
 pi_o_2  = 1.5707963267948965580E+00, /* 0x3FF921FB, 0x54442D18 */
diff --git a/modules/fdlibm/src/e_atanh.cpp b/modules/fdlibm/src/e_atanh.cpp
--- a/modules/fdlibm/src/e_atanh.cpp
+++ b/modules/fdlibm/src/e_atanh.cpp
@@ -30,17 +30,16 @@
  *	atanh(x) is NaN if |x| > 1 with signal;
  *	atanh(NaN) is that NaN with no signal;
  *	atanh(+-1) is +-INF with signal.
  *
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double one = 1.0, huge = 1e300;
 static const double zero = 0.0;
 
 double
 __ieee754_atanh(double x)
 {
diff --git a/modules/fdlibm/src/e_cosh.cpp b/modules/fdlibm/src/e_cosh.cpp
--- a/modules/fdlibm/src/e_cosh.cpp
+++ b/modules/fdlibm/src/e_cosh.cpp
@@ -32,17 +32,16 @@
  *
  * Special cases:
  *	cosh(x) is |x| if x is +INF, -INF, or NaN.
  *	only cosh(0)=1 is exact for finite x.
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double one = 1.0, half=0.5, huge = 1.0e300;
 
 double
 __ieee754_cosh(double x)
 {
 	double t,w;
diff --git a/modules/fdlibm/src/e_exp.cpp b/modules/fdlibm/src/e_exp.cpp
--- a/modules/fdlibm/src/e_exp.cpp
+++ b/modules/fdlibm/src/e_exp.cpp
@@ -73,17 +73,16 @@
  * 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.
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double
 one	= 1.0,
 halF[2]	= {0.5,-0.5,},
 o_threshold=  7.09782712893383973096e+02,  /* 0x40862E42, 0xFEFA39EF */
 u_threshold= -7.45133219101941108420e+02,  /* 0xc0874910, 0xD52D3051 */
 ln2HI[2]   ={ 6.93147180369123816490e-01,  /* 0x3fe62e42, 0xfee00000 */
diff --git a/modules/fdlibm/src/e_hypot.cpp b/modules/fdlibm/src/e_hypot.cpp
--- a/modules/fdlibm/src/e_hypot.cpp
+++ b/modules/fdlibm/src/e_hypot.cpp
@@ -43,17 +43,16 @@
  *
  * Accuracy:
  * 	hypot(x,y) returns sqrt(x^2+y^2) with error less 
  * 	than 1 ulps (units in the last place) 
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 double
 __ieee754_hypot(double x, double y)
 {
 	double a,b,t1,t2,y1,y2,w;
 	int32_t j,k,ha,hb;
 
diff --git a/modules/fdlibm/src/e_log.cpp b/modules/fdlibm/src/e_log.cpp
--- a/modules/fdlibm/src/e_log.cpp
+++ b/modules/fdlibm/src/e_log.cpp
@@ -62,17 +62,16 @@
  * 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.
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double
 ln2_hi  =  6.93147180369123816490e-01,	/* 3fe62e42 fee00000 */
 ln2_lo  =  1.90821492927058770002e-10,	/* 3dea39ef 35793c76 */
 two54   =  1.80143985094819840000e+16,  /* 43500000 00000000 */
 Lg1 = 6.666666666666735130e-01,  /* 3FE55555 55555593 */
 Lg2 = 3.999999999940941908e-01,  /* 3FD99999 9997FA04 */
diff --git a/modules/fdlibm/src/e_log10.cpp b/modules/fdlibm/src/e_log10.cpp
--- a/modules/fdlibm/src/e_log10.cpp
+++ b/modules/fdlibm/src/e_log10.cpp
@@ -19,17 +19,16 @@
  * comments.
  *
  *    log10(x) = (f - 0.5*f*f + k_log1p(f)) / ln10 + k * log10(2)
  * in not-quite-routine extra precision.
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 #include "k_log.h"
 
 static const double
 two54      =  1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
 ivln10hi   =  4.34294481878168880939e-01, /* 0x3fdbcb7b, 0x15200000 */
 ivln10lo   =  2.50829467116452752298e-11, /* 0x3dbb9438, 0xca9aadd5 */
 log10_2hi  =  3.01029995663611771306e-01, /* 0x3FD34413, 0x509F6000 */
diff --git a/modules/fdlibm/src/e_log2.cpp b/modules/fdlibm/src/e_log2.cpp
--- a/modules/fdlibm/src/e_log2.cpp
+++ b/modules/fdlibm/src/e_log2.cpp
@@ -21,17 +21,16 @@
  * This reduces x to {k, 1+f} exactly as in e_log.c, then calls the kernel,
  * then does the combining and scaling steps
  *    log2(x) = (f - 0.5*f*f + k_log1p(f)) / ln2 + k
  * in not-quite-routine extra precision.
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 #include "k_log.h"
 
 static const double
 two54      =  1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
 ivln2hi    =  1.44269504072144627571e+00, /* 0x3ff71547, 0x65200000 */
 ivln2lo    =  1.67517131648865118353e-10; /* 0x3de705fc, 0x2eefa200 */
 
diff --git a/modules/fdlibm/src/e_pow.cpp b/modules/fdlibm/src/e_pow.cpp
--- a/modules/fdlibm/src/e_pow.cpp
+++ b/modules/fdlibm/src/e_pow.cpp
@@ -52,17 +52,16 @@
  *
  * 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.
  */
 
-#include "math.h"
 #include "math_private.h"
 
 static const double
 bp[] = {1.0, 1.5,},
 dp_h[] = { 0.0, 5.84962487220764160156e-01,}, /* 0x3FE2B803, 0x40000000 */
 dp_l[] = { 0.0, 1.35003920212974897128e-08,}, /* 0x3E4CFDEB, 0x43CFD006 */
 zero    =  0.0,
 one	=  1.0,
diff --git a/modules/fdlibm/src/e_sinh.cpp b/modules/fdlibm/src/e_sinh.cpp
--- a/modules/fdlibm/src/e_sinh.cpp
+++ b/modules/fdlibm/src/e_sinh.cpp
@@ -29,17 +29,16 @@
  *
  * Special cases:
  *	sinh(x) is |x| if x is +INF, -INF, or NaN.
  *	only sinh(0)=0 is exact for finite x.
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double one = 1.0, shuge = 1.0e307;
 
 double
 __ieee754_sinh(double x)
 {
 	double t,h;
diff --git a/modules/fdlibm/src/e_sqrt.cpp b/modules/fdlibm/src/e_sqrt.cpp
--- a/modules/fdlibm/src/e_sqrt.cpp
+++ b/modules/fdlibm/src/e_sqrt.cpp
@@ -81,17 +81,16 @@
  *	sqrt(NaN) = NaN		... with invalid signal for signaling NaN
  *
  * Other methods : see the appended file at the end of the program below.
  *---------------
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static	const double	one	= 1.0, tiny=1.0e-300;
 
 double
 __ieee754_sqrt(double x)
 {
 	double z;
diff --git a/modules/fdlibm/src/k_exp.cpp b/modules/fdlibm/src/k_exp.cpp
--- a/modules/fdlibm/src/k_exp.cpp
+++ b/modules/fdlibm/src/k_exp.cpp
@@ -24,17 +24,16 @@
  * SUCH DAMAGE.
  */
 
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
 #include <complex.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const uint32_t k = 1799;		/* constant for reduction */
 static const double kln2 =  1246.97177782734161156;	/* k * ln2 */
 
 /*
  * Compute exp(x), scaled to avoid spurious overflow.  An exponent is
  * returned separately in 'expt'.
diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private.h
--- a/modules/fdlibm/src/math_private.h
+++ b/modules/fdlibm/src/math_private.h
@@ -15,16 +15,18 @@
  */
 
 #ifndef _MATH_PRIVATE_H_
 #define	_MATH_PRIVATE_H_
 
 #include <sys/types.h>
 #include <machine/endian.h>
 
+#include "fdlibm.h"
+
 /*
  * The original fdlibm code used statements like:
  *	n0 = ((*(int*)&one)>>29)^1;		* index of high word *
  *	ix0 = *(n0+(int*)&x);			* high word of x *
  *	ix1 = *((1-n0)+(int*)&x);		* low word of x *
  * to dig two 32 bit words out of the 64 bit IEEE floating point
  * value.  That is non-ANSI, and, moreover, the gcc instruction
  * scheduler gets it wrong.  We instead use the following macros.
diff --git a/modules/fdlibm/src/s_asinh.cpp b/modules/fdlibm/src/s_asinh.cpp
--- a/modules/fdlibm/src/s_asinh.cpp
+++ b/modules/fdlibm/src/s_asinh.cpp
@@ -21,17 +21,16 @@
  *	asinh(x) := x  if  1+x*x=1,
  *		 := sign(x)*(log(x)+ln2)) for large |x|, else
  *		 := sign(x)*log(2|x|+1/(|x|+sqrt(x*x+1))) if|x|>2, else
  *		 := sign(x)*log1p(|x| + x^2/(1 + sqrt(1+x^2)))
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double
 one =  1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
 ln2 =  6.93147180559945286227e-01, /* 0x3FE62E42, 0xFEFA39EF */
 huge=  1.00000000000000000000e+300;
 
 double
diff --git a/modules/fdlibm/src/s_atan.cpp b/modules/fdlibm/src/s_atan.cpp
--- a/modules/fdlibm/src/s_atan.cpp
+++ b/modules/fdlibm/src/s_atan.cpp
@@ -30,17 +30,16 @@
  * 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.
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double atanhi[] = {
   4.63647609000806093515e-01, /* atan(0.5)hi 0x3FDDAC67, 0x0561BB4F */
   7.85398163397448278999e-01, /* atan(1.0)hi 0x3FE921FB, 0x54442D18 */
   9.82793723247329054082e-01, /* atan(1.5)hi 0x3FEF730B, 0xD281F69B */
   1.57079632679489655800e+00, /* atan(inf)hi 0x3FF921FB, 0x54442D18 */
 };
diff --git a/modules/fdlibm/src/s_cbrt.cpp b/modules/fdlibm/src/s_cbrt.cpp
--- a/modules/fdlibm/src/s_cbrt.cpp
+++ b/modules/fdlibm/src/s_cbrt.cpp
@@ -10,17 +10,16 @@
  * ====================================================
  *
  * Optimized by Bruce D. Evans.
  */
 
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
-#include "math.h"
 #include "math_private.h"
 
 /* cbrt(x)
  * Return cube root of x
  */
 static const u_int32_t
 	B1 = 715094163, /* B1 = (1023-1023/3-0.03306235651)*2**20 */
 	B2 = 696219795; /* B2 = (1023-1023/3-54/3-0.03306235651)*2**20 */
diff --git a/modules/fdlibm/src/s_ceil.cpp b/modules/fdlibm/src/s_ceil.cpp
--- a/modules/fdlibm/src/s_ceil.cpp
+++ b/modules/fdlibm/src/s_ceil.cpp
@@ -19,17 +19,16 @@
  * Method:
  *	Bit twiddling.
  * Exception:
  *	Inexact flag raised if x not equal to ceil(x).
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double huge = 1.0e300;
 
 double
 ceil(double x)
 {
 	int32_t i0,i1,j0;
diff --git a/modules/fdlibm/src/s_ceilf.cpp b/modules/fdlibm/src/s_ceilf.cpp
--- a/modules/fdlibm/src/s_ceilf.cpp
+++ b/modules/fdlibm/src/s_ceilf.cpp
@@ -11,17 +11,16 @@
  * software is freely granted, provided that this notice
  * is preserved.
  * ====================================================
  */
 
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
-#include "math.h"
 #include "math_private.h"
 
 static const float huge = 1.0e30;
 
 float
 ceilf(float x)
 {
 	int32_t i0,j0;
diff --git a/modules/fdlibm/src/s_copysign.cpp b/modules/fdlibm/src/s_copysign.cpp
--- a/modules/fdlibm/src/s_copysign.cpp
+++ b/modules/fdlibm/src/s_copysign.cpp
@@ -14,17 +14,16 @@
 __FBSDID("$FreeBSD$");
 
 /*
  * copysign(double x, double y)
  * copysign(x,y) returns a value with the magnitude of x and
  * with the sign bit of y.
  */
 
-#include "math.h"
 #include "math_private.h"
 
 double
 copysign(double x, double y)
 {
 	u_int32_t hx,hy;
 	GET_HIGH_WORD(hx,x);
 	GET_HIGH_WORD(hy,y);
diff --git a/modules/fdlibm/src/s_expm1.cpp b/modules/fdlibm/src/s_expm1.cpp
--- a/modules/fdlibm/src/s_expm1.cpp
+++ b/modules/fdlibm/src/s_expm1.cpp
@@ -105,17 +105,16 @@
  * 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.
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double
 one		= 1.0,
 tiny		= 1.0e-300,
 o_threshold	= 7.09782712893383973096e+02,/* 0x40862E42, 0xFEFA39EF */
 ln2_hi		= 6.93147180369123816490e-01,/* 0x3fe62e42, 0xfee00000 */
 ln2_lo		= 1.90821492927058770002e-10,/* 0x3dea39ef, 0x35793c76 */
diff --git a/modules/fdlibm/src/s_fabs.cpp b/modules/fdlibm/src/s_fabs.cpp
--- a/modules/fdlibm/src/s_fabs.cpp
+++ b/modules/fdlibm/src/s_fabs.cpp
@@ -13,17 +13,16 @@
 #ifndef lint
 static char rcsid[] = "$FreeBSD$";
 #endif
 
 /*
  * fabs(x) returns the absolute value of x.
  */
 
-#include "math.h"
 #include "math_private.h"
 
 double
 fabs(double x)
 {
 	u_int32_t high;
 	GET_HIGH_WORD(high,x);
 	SET_HIGH_WORD(x,high&0x7fffffff);
diff --git a/modules/fdlibm/src/s_floor.cpp b/modules/fdlibm/src/s_floor.cpp
--- a/modules/fdlibm/src/s_floor.cpp
+++ b/modules/fdlibm/src/s_floor.cpp
@@ -19,17 +19,16 @@
  * Method:
  *	Bit twiddling.
  * Exception:
  *	Inexact flag raised if x not equal to floor(x).
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double huge = 1.0e300;
 
 double
 floor(double x)
 {
 	int32_t i0,i1,j0;
diff --git a/modules/fdlibm/src/s_floorf.cpp b/modules/fdlibm/src/s_floorf.cpp
--- a/modules/fdlibm/src/s_floorf.cpp
+++ b/modules/fdlibm/src/s_floorf.cpp
@@ -20,17 +20,16 @@
  * floorf(x)
  * Return x rounded toward -inf to integral value
  * Method:
  *	Bit twiddling.
  * Exception:
  *	Inexact flag raised if x not equal to floorf(x).
  */
 
-#include "math.h"
 #include "math_private.h"
 
 static const float huge = 1.0e30;
 
 float
 floorf(float x)
 {
 	int32_t i0,j0;
diff --git a/modules/fdlibm/src/s_log1p.cpp b/modules/fdlibm/src/s_log1p.cpp
--- a/modules/fdlibm/src/s_log1p.cpp
+++ b/modules/fdlibm/src/s_log1p.cpp
@@ -75,17 +75,16 @@
  *		if(u==1.0) return x ; else
  *			   return log(u)*(x/(u-1.0));
  *
  *	 See HP-15C Advanced Functions Handbook, p.193.
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double
 ln2_hi  =  6.93147180369123816490e-01,	/* 3fe62e42 fee00000 */
 ln2_lo  =  1.90821492927058770002e-10,	/* 3dea39ef 35793c76 */
 two54   =  1.80143985094819840000e+16,  /* 43500000 00000000 */
 Lp1 = 6.666666666666735130e-01,  /* 3FE55555 55555593 */
 Lp2 = 3.999999999940941908e-01,  /* 3FD99999 9997FA04 */
diff --git a/modules/fdlibm/src/s_nearbyint.cpp b/modules/fdlibm/src/s_nearbyint.cpp
--- a/modules/fdlibm/src/s_nearbyint.cpp
+++ b/modules/fdlibm/src/s_nearbyint.cpp
@@ -23,17 +23,17 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
 
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
 #include <fenv.h>
-#include <math.h>
+#include "math_private.h"
 
 /*
  * We save and restore the floating-point environment to avoid raising
  * an inexact exception.  We can get away with using fesetenv()
  * instead of feclearexcept()/feupdateenv() to restore the environment
  * because the only exception defined for rint() is overflow, and
  * rounding can't overflow as long as emax >= p.
  *
diff --git a/modules/fdlibm/src/s_rint.cpp b/modules/fdlibm/src/s_rint.cpp
--- a/modules/fdlibm/src/s_rint.cpp
+++ b/modules/fdlibm/src/s_rint.cpp
@@ -20,17 +20,16 @@
  * Method:
  *	Using floating addition.
  * Exception:
  *	Inexact flag raised if x not equal to rint(x).
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double
 TWO52[2]={
   4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
  -4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */
 };
 
diff --git a/modules/fdlibm/src/s_rintf.cpp b/modules/fdlibm/src/s_rintf.cpp
--- a/modules/fdlibm/src/s_rintf.cpp
+++ b/modules/fdlibm/src/s_rintf.cpp
@@ -14,17 +14,16 @@
  */
 
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
 #include <float.h>
 #include <stdint.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const float
 TWO23[2]={
   8.3886080000e+06, /* 0x4b000000 */
  -8.3886080000e+06, /* 0xcb000000 */
 };
 
diff --git a/modules/fdlibm/src/s_scalbn.cpp b/modules/fdlibm/src/s_scalbn.cpp
--- a/modules/fdlibm/src/s_scalbn.cpp
+++ b/modules/fdlibm/src/s_scalbn.cpp
@@ -19,17 +19,16 @@ static char rcsid[] = "$FreeBSD$";
  * scalbn(x,n) returns x* 2**n  computed by  exponent
  * manipulation rather than by actually performing an
  * exponentiation or a multiplication.
  */
 
 #include <sys/cdefs.h>
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double
 two54   =  1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
 twom54  =  5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
 huge   = 1.0e+300,
 tiny   = 1.0e-300;
 
diff --git a/modules/fdlibm/src/s_tanh.cpp b/modules/fdlibm/src/s_tanh.cpp
--- a/modules/fdlibm/src/s_tanh.cpp
+++ b/modules/fdlibm/src/s_tanh.cpp
@@ -34,17 +34,16 @@
  *
  * Special cases:
  *	tanh(NaN) is NaN;
  *	only tanh(0)=0 is exact for finite argument.
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const volatile double tiny = 1.0e-300;
 static const double one = 1.0, two = 2.0, huge = 1.0e300;
 
 double
 tanh(double x)
 {
diff --git a/modules/fdlibm/src/s_trunc.cpp b/modules/fdlibm/src/s_trunc.cpp
--- a/modules/fdlibm/src/s_trunc.cpp
+++ b/modules/fdlibm/src/s_trunc.cpp
@@ -19,17 +19,16 @@
  * Method:
  *	Bit twiddling.
  * Exception:
  *	Inexact flag raised if x not equal to trunc(x).
  */
 
 #include <float.h>
 
-#include "math.h"
 #include "math_private.h"
 
 static const double huge = 1.0e300;
 
 double
 trunc(double x)
 {
 	int32_t i0,i1,j0;
diff --git a/modules/fdlibm/src/s_truncf.cpp b/modules/fdlibm/src/s_truncf.cpp
--- a/modules/fdlibm/src/s_truncf.cpp
+++ b/modules/fdlibm/src/s_truncf.cpp
@@ -17,17 +17,16 @@
  * truncf(x)
  * Return x rounded toward 0 to integral value
  * Method:
  *	Bit twiddling.
  * Exception:
  *	Inexact flag raised if x not equal to truncf(x).
  */
 
-#include "math.h"
 #include "math_private.h"
 
 static const float huge = 1.0e30F;
 
 float
 truncf(float x)
 {
 	int32_t i0,j0;