1 diff -Nrup a/math/libm-test.inc b/math/libm-test.inc
2 --- a/math/libm-test.inc 2010-05-04 05:27:23.000000000 -0600
3 +++ b/math/libm-test.inc 2012-08-06 09:54:00.821929695 -0600
4 @@ -2018,6 +2018,142 @@ cos_test (void)
8 +cos_test_tonearest (void)
10 + int save_round_mode;
13 + if (errno == ENOSYS)
14 + /* Function not implemented. */
17 + START (cos_tonearest);
19 + save_round_mode = fegetround ();
21 + if (!fesetround (FE_TONEAREST))
23 + TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
24 + TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
25 + TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
26 + TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
27 + TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
28 + TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
29 + TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
30 + TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
31 + TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
32 + TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
35 + fesetround (save_round_mode);
37 + END (cos_tonearest);
42 +cos_test_towardzero (void)
44 + int save_round_mode;
47 + if (errno == ENOSYS)
48 + /* Function not implemented. */
51 + START (cos_towardzero);
53 + save_round_mode = fegetround ();
55 + if (!fesetround (FE_TOWARDZERO))
57 + TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
58 + TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
59 + TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
60 + TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
61 + TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
62 + TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
63 + TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
64 + TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
65 + TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
66 + TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
69 + fesetround (save_round_mode);
71 + END (cos_towardzero);
76 +cos_test_downward (void)
78 + int save_round_mode;
81 + if (errno == ENOSYS)
82 + /* Function not implemented. */
85 + START (cos_downward);
87 + save_round_mode = fegetround ();
89 + if (!fesetround (FE_DOWNWARD))
91 + TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
92 + TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
93 + TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
94 + TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
95 + TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
96 + TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
97 + TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
98 + TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
99 + TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
100 + TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
103 + fesetround (save_round_mode);
105 + END (cos_downward);
110 +cos_test_upward (void)
112 + int save_round_mode;
115 + if (errno == ENOSYS)
116 + /* Function not implemented. */
119 + START (cos_upward);
121 + save_round_mode = fegetround ();
123 + if (!fesetround (FE_UPWARD))
125 + TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
126 + TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
127 + TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
128 + TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
129 + TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
130 + TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
131 + TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
132 + TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
133 + TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
134 + TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
137 + fesetround (save_round_mode);
147 @@ -2043,6 +2179,114 @@ cosh_test (void)
151 +cosh_test_tonearest (void)
153 + int save_round_mode;
156 + if (errno == ENOSYS)
157 + /* Function not implemented. */
160 + START (cosh_tonearest);
162 + save_round_mode = fegetround ();
164 + if (!fesetround (FE_TONEAREST))
166 + TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
167 + TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
168 + TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
171 + fesetround (save_round_mode);
173 + END (cosh_tonearest);
178 +cosh_test_towardzero (void)
180 + int save_round_mode;
183 + if (errno == ENOSYS)
184 + /* Function not implemented. */
187 + START (cosh_towardzero);
189 + save_round_mode = fegetround ();
191 + if (!fesetround (FE_TOWARDZERO))
193 + TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
194 + TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
195 + TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
198 + fesetround (save_round_mode);
200 + END (cosh_towardzero);
205 +cosh_test_downward (void)
207 + int save_round_mode;
210 + if (errno == ENOSYS)
211 + /* Function not implemented. */
214 + START (cosh_downward);
216 + save_round_mode = fegetround ();
218 + if (!fesetround (FE_DOWNWARD))
220 + TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
221 + TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
222 + TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
225 + fesetround (save_round_mode);
227 + END (cosh_downward);
232 +cosh_test_upward (void)
234 + int save_round_mode;
237 + if (errno == ENOSYS)
238 + /* Function not implemented. */
241 + START (cosh_upward);
243 + save_round_mode = fegetround ();
245 + if (!fesetround (FE_UPWARD))
247 + TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
248 + TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
249 + TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
252 + fesetround (save_round_mode);
262 @@ -2527,6 +2771,114 @@ exp_test (void)
266 +exp_test_tonearest (void)
268 + int save_round_mode;
271 + if (errno == ENOSYS)
272 + /* Function not implemented. */
275 + START (exp_tonearest);
277 + save_round_mode = fegetround ();
279 + if (!fesetround (FE_TONEAREST))
281 + TEST_f_f (exp, 1, M_El);
282 + TEST_f_f (exp, 2, M_E2l);
283 + TEST_f_f (exp, 3, M_E3l);
286 + fesetround (save_round_mode);
288 + END (exp_tonearest);
293 +exp_test_towardzero (void)
295 + int save_round_mode;
298 + if (errno == ENOSYS)
299 + /* Function not implemented. */
302 + START (exp_towardzero);
304 + save_round_mode = fegetround ();
306 + if (!fesetround (FE_TOWARDZERO))
308 + TEST_f_f (exp, 1, M_El);
309 + TEST_f_f (exp, 2, M_E2l);
310 + TEST_f_f (exp, 3, M_E3l);
313 + fesetround (save_round_mode);
315 + END (exp_towardzero);
320 +exp_test_downward (void)
322 + int save_round_mode;
325 + if (errno == ENOSYS)
326 + /* Function not implemented. */
329 + START (exp_downward);
331 + save_round_mode = fegetround ();
333 + if (!fesetround (FE_DOWNWARD))
335 + TEST_f_f (exp, 1, M_El);
336 + TEST_f_f (exp, 2, M_E2l);
337 + TEST_f_f (exp, 3, M_E3l);
340 + fesetround (save_round_mode);
342 + END (exp_downward);
347 +exp_test_upward (void)
349 + int save_round_mode;
352 + if (errno == ENOSYS)
353 + /* Function not implemented. */
356 + START (exp_upward);
358 + save_round_mode = fegetround ();
360 + if (!fesetround (FE_UPWARD))
362 + TEST_f_f (exp, 1, M_El);
363 + TEST_f_f (exp, 2, M_E2l);
364 + TEST_f_f (exp, 3, M_E3l);
367 + fesetround (save_round_mode);
377 @@ -4848,22 +5200,127 @@ pow_test (void)
383 -remainder_test (void)
384 +pow_test_tonearest (void)
386 + int save_round_mode;
388 - FUNC(remainder) (1.625, 1.0);
391 /* Function not implemented. */
395 + START (pow_tonearest);
397 - TEST_ff_f (remainder, 1, 0, nan_value, INVALID_EXCEPTION);
398 - TEST_ff_f (remainder, 1, minus_zero, nan_value, INVALID_EXCEPTION);
399 - TEST_ff_f (remainder, plus_infty, 1, nan_value, INVALID_EXCEPTION);
400 - TEST_ff_f (remainder, minus_infty, 1, nan_value, INVALID_EXCEPTION);
401 - TEST_ff_f (remainder, nan_value, nan_value, nan_value);
402 + save_round_mode = fegetround ();
404 + if (!fesetround (FE_TONEAREST))
406 + TEST_ff_f (pow, 1.0625L, 1.125L, 1.070582293028761362162622578677070098674L);
407 + TEST_ff_f (pow, 1.5L, 1.03125L, 1.519127098714743184071644334163037684948L);
410 + fesetround (save_round_mode);
412 + END (pow_tonearest);
417 +pow_test_towardzero (void)
419 + int save_round_mode;
422 + if (errno == ENOSYS)
423 + /* Function not implemented. */
426 + START (pow_towardzero);
428 + save_round_mode = fegetround ();
430 + if (!fesetround (FE_TOWARDZERO))
432 + TEST_ff_f (pow, 1.0625L, 1.125L, 1.070582293028761362162622578677070098674L);
433 + TEST_ff_f (pow, 1.5L, 1.03125L, 1.519127098714743184071644334163037684948L);
436 + fesetround (save_round_mode);
438 + END (pow_towardzero);
443 +pow_test_downward (void)
445 + int save_round_mode;
448 + if (errno == ENOSYS)
449 + /* Function not implemented. */
452 + START (pow_downward);
454 + save_round_mode = fegetround ();
456 + if (!fesetround (FE_DOWNWARD))
458 + TEST_ff_f (pow, 1.0625L, 1.125L, 1.070582293028761362162622578677070098674L);
459 + TEST_ff_f (pow, 1.5L, 1.03125L, 1.519127098714743184071644334163037684948L);
462 + fesetround (save_round_mode);
464 + END (pow_downward);
469 +pow_test_upward (void)
471 + int save_round_mode;
474 + if (errno == ENOSYS)
475 + /* Function not implemented. */
478 + START (pow_upward);
480 + save_round_mode = fegetround ();
482 + if (!fesetround (FE_UPWARD))
484 + TEST_ff_f (pow, 1.0625L, 1.125L, 1.070582293028761362162622578677070098674L);
485 + TEST_ff_f (pow, 1.5L, 1.03125L, 1.519127098714743184071644334163037684948L);
488 + fesetround (save_round_mode);
495 +remainder_test (void)
498 + FUNC(remainder) (1.625, 1.0);
499 + if (errno == ENOSYS)
500 + /* Function not implemented. */
505 + TEST_ff_f (remainder, 1, 0, nan_value, INVALID_EXCEPTION);
506 + TEST_ff_f (remainder, 1, minus_zero, nan_value, INVALID_EXCEPTION);
507 + TEST_ff_f (remainder, plus_infty, 1, nan_value, INVALID_EXCEPTION);
508 + TEST_ff_f (remainder, minus_infty, 1, nan_value, INVALID_EXCEPTION);
509 + TEST_ff_f (remainder, nan_value, nan_value, nan_value);
511 TEST_ff_f (remainder, 1.625, 1.0, -0.375);
512 TEST_ff_f (remainder, -1.625, 1.0, 0.375);
513 @@ -5545,6 +6002,7 @@ sin_test (void)
516 TEST_f_f (sin, 0.80190127184058835, 0.71867942238767868);
517 + TEST_f_f (sin, 2.522464e-1, 2.4957989804940911e-1);
521 @@ -5553,6 +6011,142 @@ sin_test (void)
525 +sin_test_tonearest (void)
527 + int save_round_mode;
530 + if (errno == ENOSYS)
531 + /* Function not implemented. */
534 + START (sin_tonearest);
536 + save_round_mode = fegetround ();
538 + if (!fesetround (FE_TONEAREST))
540 + TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
541 + TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
542 + TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
543 + TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
544 + TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
545 + TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
546 + TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
547 + TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
548 + TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
549 + TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
552 + fesetround (save_round_mode);
554 + END (sin_tonearest);
559 +sin_test_towardzero (void)
561 + int save_round_mode;
564 + if (errno == ENOSYS)
565 + /* Function not implemented. */
568 + START (sin_towardzero);
570 + save_round_mode = fegetround ();
572 + if (!fesetround (FE_TOWARDZERO))
574 + TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
575 + TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
576 + TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
577 + TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
578 + TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
579 + TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
580 + TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
581 + TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
582 + TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
583 + TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
586 + fesetround (save_round_mode);
588 + END (sin_towardzero);
593 +sin_test_downward (void)
595 + int save_round_mode;
598 + if (errno == ENOSYS)
599 + /* Function not implemented. */
602 + START (sin_downward);
604 + save_round_mode = fegetround ();
606 + if (!fesetround (FE_DOWNWARD))
608 + TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
609 + TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
610 + TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
611 + TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
612 + TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
613 + TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
614 + TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
615 + TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
616 + TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
617 + TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
620 + fesetround (save_round_mode);
622 + END (sin_downward);
627 +sin_test_upward (void)
629 + int save_round_mode;
632 + if (errno == ENOSYS)
633 + /* Function not implemented. */
636 + START (sin_upward);
638 + save_round_mode = fegetround ();
640 + if (!fesetround (FE_UPWARD))
642 + TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
643 + TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
644 + TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
645 + TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
646 + TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
647 + TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
648 + TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
649 + TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
650 + TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
651 + TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
654 + fesetround (save_round_mode);
663 FLOAT sin_res, cos_res;
664 @@ -5610,6 +6204,115 @@ sinh_test (void)
670 +sinh_test_tonearest (void)
672 + int save_round_mode;
675 + if (errno == ENOSYS)
676 + /* Function not implemented. */
679 + START (sinh_tonearest);
681 + save_round_mode = fegetround ();
683 + if (!fesetround (FE_TONEAREST))
685 + TEST_f_f (sinh, 22, 1792456423.065795780701106568345764104225L);
686 + TEST_f_f (sinh, 23, 4872401723.124451299966006944252978187305L);
687 + TEST_f_f (sinh, 24, 13244561064.92173614705070540368454568168L);
690 + fesetround (save_round_mode);
692 + END (sinh_tonearest);
697 +sinh_test_towardzero (void)
699 + int save_round_mode;
702 + if (errno == ENOSYS)
703 + /* Function not implemented. */
706 + START (sinh_towardzero);
708 + save_round_mode = fegetround ();
710 + if (!fesetround (FE_TOWARDZERO))
712 + TEST_f_f (sinh, 22, 1792456423.065795780701106568345764104225L);
713 + TEST_f_f (sinh, 23, 4872401723.124451299966006944252978187305L);
714 + TEST_f_f (sinh, 24, 13244561064.92173614705070540368454568168L);
717 + fesetround (save_round_mode);
719 + END (sinh_towardzero);
724 +sinh_test_downward (void)
726 + int save_round_mode;
729 + if (errno == ENOSYS)
730 + /* Function not implemented. */
733 + START (sinh_downward);
735 + save_round_mode = fegetround ();
737 + if (!fesetround (FE_DOWNWARD))
739 + TEST_f_f (sinh, 22, 1792456423.065795780701106568345764104225L);
740 + TEST_f_f (sinh, 23, 4872401723.124451299966006944252978187305L);
741 + TEST_f_f (sinh, 24, 13244561064.92173614705070540368454568168L);
744 + fesetround (save_round_mode);
746 + END (sinh_downward);
751 +sinh_test_upward (void)
753 + int save_round_mode;
756 + if (errno == ENOSYS)
757 + /* Function not implemented. */
760 + START (sinh_upward);
762 + save_round_mode = fegetround ();
764 + if (!fesetround (FE_UPWARD))
766 + TEST_f_f (sinh, 22, 1792456423.065795780701106568345764104225L);
767 + TEST_f_f (sinh, 23, 4872401723.124451299966006944252978187305L);
768 + TEST_f_f (sinh, 24, 13244561064.92173614705070540368454568168L);
771 + fesetround (save_round_mode);
780 @@ -5673,6 +6376,143 @@ tan_test (void)
786 +tan_test_tonearest (void)
788 + int save_round_mode;
791 + if (errno == ENOSYS)
792 + /* Function not implemented. */
795 + START (tan_tonearest);
797 + save_round_mode = fegetround ();
799 + if (!fesetround (FE_TONEAREST))
801 + TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
802 + TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
803 + TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
804 + TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
805 + TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
806 + TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
807 + TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
808 + TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
809 + TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
810 + TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
813 + fesetround (save_round_mode);
815 + END (tan_tonearest);
820 +tan_test_towardzero (void)
822 + int save_round_mode;
825 + if (errno == ENOSYS)
826 + /* Function not implemented. */
829 + START (tan_towardzero);
831 + save_round_mode = fegetround ();
833 + if (!fesetround (FE_TOWARDZERO))
835 + TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
836 + TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
837 + TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
838 + TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
839 + TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
840 + TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
841 + TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
842 + TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
843 + TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
844 + TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
847 + fesetround (save_round_mode);
849 + END (tan_towardzero);
854 +tan_test_downward (void)
856 + int save_round_mode;
859 + if (errno == ENOSYS)
860 + /* Function not implemented. */
863 + START (tan_downward);
865 + save_round_mode = fegetround ();
867 + if (!fesetround (FE_DOWNWARD))
869 + TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
870 + TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
871 + TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
872 + TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
873 + TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
874 + TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
875 + TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
876 + TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
877 + TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
878 + TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
881 + fesetround (save_round_mode);
883 + END (tan_downward);
888 +tan_test_upward (void)
890 + int save_round_mode;
893 + if (errno == ENOSYS)
894 + /* Function not implemented. */
897 + START (tan_upward);
899 + save_round_mode = fegetround ();
901 + if (!fesetround (FE_UPWARD))
903 + TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
904 + TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
905 + TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
906 + TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
907 + TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
908 + TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
909 + TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
910 + TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
911 + TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
912 + TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
915 + fesetround (save_round_mode);
924 @@ -6171,20 +7011,44 @@ main (int argc, char **argv)
928 + cos_test_tonearest ();
929 + cos_test_towardzero ();
930 + cos_test_downward ();
931 + cos_test_upward ();
933 + sin_test_tonearest ();
934 + sin_test_towardzero ();
935 + sin_test_downward ();
936 + sin_test_upward ();
939 + tan_test_tonearest ();
940 + tan_test_towardzero ();
941 + tan_test_downward ();
942 + tan_test_upward ();
944 /* Hyperbolic functions: */
949 + cosh_test_tonearest ();
950 + cosh_test_towardzero ();
951 + cosh_test_downward ();
952 + cosh_test_upward ();
954 + sinh_test_tonearest ();
955 + sinh_test_towardzero ();
956 + sinh_test_downward ();
957 + sinh_test_upward ();
960 /* Exponential and logarithmic functions: */
962 + exp_test_tonearest ();
963 + exp_test_towardzero ();
964 + exp_test_downward ();
965 + exp_test_upward ();
969 @@ -6207,6 +7071,10 @@ main (int argc, char **argv)
973 + pow_test_tonearest ();
974 + pow_test_towardzero ();
975 + pow_test_downward ();
976 + pow_test_upward ();
979 /* Error and gamma functions: */
980 diff -Nrup a/math/math_private.h b/math/math_private.h
981 --- a/math/math_private.h 2010-05-04 05:27:23.000000000 -0600
982 +++ b/math/math_private.h 2012-08-06 09:54:00.821929695 -0600
983 @@ -357,4 +357,41 @@ extern void __docos (double __x, double
984 #define math_force_eval(x) __asm __volatile ("" : : "m" (x))
988 +/* The standards only specify one variant of the fenv.h interfaces.
989 + But at least for some architectures we can be more efficient if we
990 + know what operations are going to be performed. Therefore we
991 + define additional interfaces. By default they refer to the normal
993 +#define libc_fegetround() fegetround ()
994 +#define libc_fegetroundf() fegetround ()
995 +#define libc_fegetroundl() fegetround ()
997 +#define libc_fesetround(r) (void) fesetround (r)
998 +#define libc_fesetroundf(r) (void) fesetround (r)
999 +#define libc_fesetroundl(r) (void) fesetround (r)
1001 +#define libc_feholdexcept(e) (void) feholdexcept (e)
1002 +#define libc_feholdexceptf(e) (void) feholdexcept (e)
1003 +#define libc_feholdexceptl(e) (void) feholdexcept (e)
1005 +#define libc_feholdexcept_setround(e, r) \
1006 + do { feholdexcept (e); fesetround (r); } while (0)
1007 +#define libc_feholdexcept_setroundf(e, r) \
1008 + do { feholdexcept (e); fesetround (r); } while (0)
1009 +#define libc_feholdexcept_setroundl(e, r) \
1010 + do { feholdexcept (e); fesetround (r); } while (0)
1012 +#define libc_fetestexcept(e) fetestexcept (e)
1013 +#define libc_fetestexceptf(e) fetestexcept (e)
1014 +#define libc_fetestexceptl(e) fetestexcept (e)
1016 +#define libc_fesetenv(e) (void) fesetenv (e)
1017 +#define libc_fesetenvf(e) (void) fesetenv (e)
1018 +#define libc_fesetenvl(e) (void) fesetenv (e)
1020 +#define libc_feupdateenv(e) (void) feupdateenv (e)
1021 +#define libc_feupdateenvf(e) (void) feupdateenv (e)
1022 +#define libc_feupdateenvl(e) (void) feupdateenv (e)
1024 #endif /* _MATH_PRIVATE_H_ */
1025 diff -Nrup a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps
1026 --- a/sysdeps/i386/fpu/libm-test-ulps 2010-05-04 05:27:23.000000000 -0600
1027 +++ b/sysdeps/i386/fpu/libm-test-ulps 2012-08-06 11:29:16.370874961 -0600
1028 @@ -9,18 +9,12 @@ ldouble: 1
1029 Test "asin (-0.5) == -pi/6":
1032 -Test "asin (-1.0) == -pi/2":
1035 Test "asin (0.5) == pi/6":
1038 Test "asin (0.75) == 0.848062078981481008052944338998418080":
1041 -Test "asin (1.0) == pi/2":
1046 Test "atanh (0.75) == 0.972955074527656652552676371721589865":
1047 @@ -35,20 +29,6 @@ ildouble: 2
1051 -Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
1058 -Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
1065 Test "Real part of: cacosh (0.75 + 1.25 i) == 1.13239363160530819522266333696834467 + 1.11752014915610270578240049553777969 i":
1068 @@ -124,8 +104,6 @@ ldouble: 1
1069 Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
1074 Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
1077 @@ -149,9 +127,7 @@ float: 1
1080 Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
1087 @@ -186,8 +162,6 @@ ifloat: 1
1088 Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
1093 Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i":
1096 @@ -262,27 +236,175 @@ ifloat: 1
1098 Test "cos (M_PI_6l * 2.0) == 0.5":
1103 Test "cos (M_PI_6l * 4.0) == -0.5":
1110 +Test "cos_downward (1) == 0.5403023058681397174009366074429766037323":
1115 +Test "cos_downward (10) == -0.8390715290764524522588639478240648345199":
1120 +Test "cos_downward (3) == -0.9899924966004454572715727947312613023937":
1123 +Test "cos_downward (4) == -0.6536436208636119146391681830977503814241":
1128 +Test "cos_downward (5) == 0.2836621854632262644666391715135573083344":
1131 +Test "cos_downward (7) == 0.7539022543433046381411975217191820122183":
1136 +Test "cos_downward (8) == -0.1455000338086135258688413818311946826093":
1139 +Test "cos_downward (9) == -0.9111302618846769883682947111811653112463":
1148 +Test "cos_tonearest (8) == -0.1455000338086135258688413818311946826093":
1151 +Test "cos_tonearest (9) == -0.9111302618846769883682947111811653112463":
1156 +Test "cos_towardzero (1) == 0.5403023058681397174009366074429766037323":
1161 +Test "cos_towardzero (10) == -0.8390715290764524522588639478240648345199":
1164 -Test "cos (pi/2) == 0":
1165 +Test "cos_towardzero (2) == -0.4161468365471423869975682295007621897660":
1172 +Test "cos_towardzero (3) == -0.9899924966004454572715727947312613023937":
1177 +Test "cos_towardzero (4) == -0.6536436208636119146391681830977503814241":
1180 +Test "cos_towardzero (5) == 0.2836621854632262644666391715135573083344":
1183 +Test "cos_towardzero (7) == 0.7539022543433046381411975217191820122183":
1188 +Test "cos_towardzero (8) == -0.1455000338086135258688413818311946826093":
1195 -Test "cosh (0.75) == 1.29468328467684468784170818539018176":
1197 +Test "cos_upward (1) == 0.5403023058681397174009366074429766037323":
1200 +Test "cos_upward (10) == -0.8390715290764524522588639478240648345199":
1203 +Test "cos_upward (2) == -0.4161468365471423869975682295007621897660":
1210 +Test "cos_upward (3) == -0.9899924966004454572715727947312613023937":
1215 +Test "cos_upward (4) == -0.6536436208636119146391681830977503814241":
1218 +Test "cos_upward (5) == 0.2836621854632262644666391715135573083344":
1223 +Test "cos_upward (6) == 0.9601702866503660205456522979229244054519":
1230 +Test "cos_upward (7) == 0.7539022543433046381411975217191820122183":
1233 +Test "cos_upward (8) == -0.1455000338086135258688413818311946826093":
1240 +Test "cosh_downward (22) == 1792456423.065795780980053377632656584997":
1244 +Test "cosh_downward (23) == 4872401723.124451300068625740569997090344":
1248 +Test "cosh_downward (24) == 13244561064.92173614708845674912733665919":
1253 +Test "cosh_tonearest (22) == 1792456423.065795780980053377632656584997":
1257 +Test "cosh_towardzero (22) == 1792456423.065795780980053377632656584997":
1261 +Test "cosh_towardzero (23) == 4872401723.124451300068625740569997090344":
1265 +Test "cosh_towardzero (24) == 13244561064.92173614708845674912733665919":
1270 +Test "cosh_upward (23) == 4872401723.124451300068625740569997090344":
1272 +Test "cosh_upward (24) == 13244561064.92173614708845674912733665919":
1276 Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
1277 @@ -353,12 +475,8 @@ double: 1
1283 Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
1290 @@ -370,40 +488,36 @@ ifloat: 1
1291 Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
1298 Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
1305 Test "Real part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
1308 Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
1317 Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
1322 Test "Imaginary part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
1329 Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i":
1332 Test "Real part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i":
1337 Test "Imaginary part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i":
1339 @@ -419,9 +533,6 @@ double: 1
1343 -Test "erfc (0.75) == 0.288844366346484868401062165408589223":
1346 Test "erfc (1.25) == 0.0770998717435417698634765188027188596":
1349 @@ -434,14 +545,6 @@ idouble: 1
1354 -Test "exp (0.75) == 2.11700001661267466854536981983709561":
1356 -Test "exp (1000.0) == 0.197007111401704699388887935224332313e435":
1358 -Test "exp (50.0) == 5184705528587072464087.45332293348538":
1362 Test "exp10 (-1) == 0.1":
1364 @@ -453,6 +556,51 @@ Test "exp10 (3) == 1000":
1369 +Test "exp_downward (1) == e":
1372 +Test "exp_downward (2) == e^2":
1379 +Test "exp_downward (3) == e^3":
1388 +Test "exp_towardzero (1) == e":
1391 +Test "exp_towardzero (2) == e^2":
1398 +Test "exp_towardzero (3) == e^3":
1407 +Test "exp_upward (1) == e":
1414 Test "expm1 (1) == M_El - 1.0":
1416 @@ -485,26 +633,24 @@ float: 1
1418 Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
1427 Test "j0 (10.0) == -0.245935764451348335197760862485328754":
1434 Test "j0 (2.0) == 0.223890779141235668051827454649948626":
1439 Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1":
1448 Test "j0 (8.0) == 0.171650807137553906090869407851972001":
1449 @@ -512,13 +658,8 @@ float: 1
1453 -Test "j1 (0.75) == 0.349243602174862192523281016426251335":
1456 Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
1463 @@ -526,9 +667,7 @@ Test "j1 (2.0) == 0.57672480775687338720
1466 Test "j1 (8.0) == 0.234636346853914624381276651590454612":
1473 @@ -536,38 +675,31 @@ ldouble: 1
1475 Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1":
1484 Test "jn (0, 10.0) == -0.245935764451348335197760862485328754":
1491 Test "jn (0, 2.0) == 0.223890779141235668051827454649948626":
1496 Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1":
1505 Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
1508 -Test "jn (1, 0.75) == 0.349243602174862192523281016426251335":
1511 Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883":
1518 @@ -575,9 +707,7 @@ Test "jn (1, 2.0) == 0.57672480775687338
1521 Test "jn (1, 8.0) == 0.234636346853914624381276651590454612":
1528 @@ -589,9 +719,7 @@ ifloat: 1
1531 Test "jn (10, 0.125) == 0.250543369809369890173993791865771547e-18":
1536 Test "jn (10, 0.75) == 0.149621713117596814698712483621682835e-10":
1538 @@ -606,38 +734,32 @@ ifloat: 1
1541 Test "jn (10, 10.0) == 0.207486106633358857697278723518753428":
1552 Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
1557 Test "jn (3, -1.0) == -0.0195633539826684059189053216217515083":
1560 Test "jn (3, 0.75) == 0.848438342327410884392755236884386804e-2":
1565 Test "jn (3, 1.0) == 0.0195633539826684059189053216217515083":
1568 Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563":
1579 Test "jn (3, 2.0) == 0.128943249474402051098793332969239835":
1585 @@ -648,9 +770,7 @@ idouble: 1
1588 Test "lgamma (0.7) == 0.260867246531666514385732417016759578":
1593 Test "lgamma (1.2) == -0.853740900033158497197028392998854470e-1":
1595 @@ -660,11 +780,6 @@ ifloat: 2
1600 -Test "log (e) == 1":
1605 Test "log10 (0.75) == -0.124938736608299953132449886193870744":
1607 @@ -675,20 +790,179 @@ ifloat: 1
1612 -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
1614 +Test "pow_downward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
1619 +Test "pow_downward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
1626 +Test "pow_towardzero (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
1631 +Test "pow_towardzero (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
1634 -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
1639 +Test "pow_upward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
1644 +Test "pow_upward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
1651 +Test "sin_downward (1) == 0.8414709848078965066525023216302989996226":
1654 +Test "sin_downward (10) == -0.5440211108893698134047476618513772816836":
1659 +Test "sin_downward (2) == 0.9092974268256816953960198659117448427023":
1662 +Test "sin_downward (3) == 0.1411200080598672221007448028081102798469":
1665 +Test "sin_downward (4) == -0.7568024953079282513726390945118290941359":
1670 +Test "sin_downward (5) == -0.9589242746631384688931544061559939733525":
1675 +Test "sin_downward (6) == -0.2794154981989258728115554466118947596280":
1680 +Test "sin_downward (7) == 0.6569865987187890903969990915936351779369":
1683 -Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res":
1684 +Test "sin_downward (8) == 0.9893582466233817778081235982452886721164":
1689 +Test "sin_downward (9) == 0.4121184852417565697562725663524351793439":
1698 +Test "sin_tonearest (10) == -0.5440211108893698134047476618513772816836":
1701 +Test "sin_tonearest (4) == -0.7568024953079282513726390945118290941359":
1704 +Test "sin_tonearest (9) == 0.4121184852417565697562725663524351793439":
1709 +Test "sin_towardzero (1) == 0.8414709848078965066525023216302989996226":
1712 +Test "sin_towardzero (10) == -0.5440211108893698134047476618513772816836":
1715 +Test "sin_towardzero (2) == 0.9092974268256816953960198659117448427023":
1718 +Test "sin_towardzero (3) == 0.1411200080598672221007448028081102798469":
1721 +Test "sin_towardzero (4) == -0.7568024953079282513726390945118290941359":
1724 +Test "sin_towardzero (5) == -0.9589242746631384688931544061559939733525":
1727 +Test "sin_towardzero (6) == -0.2794154981989258728115554466118947596280":
1730 +Test "sin_towardzero (7) == 0.6569865987187890903969990915936351779369":
1733 +Test "sin_towardzero (8) == 0.9893582466233817778081235982452886721164":
1738 +Test "sin_towardzero (9) == 0.4121184852417565697562725663524351793439":
1747 +Test "sin_upward (1) == 0.8414709848078965066525023216302989996226":
1752 +Test "sin_upward (10) == -0.5440211108893698134047476618513772816836":
1755 +Test "sin_upward (2) == 0.9092974268256816953960198659117448427023":
1760 +Test "sin_upward (3) == 0.1411200080598672221007448028081102798469":
1765 +Test "sin_upward (4) == -0.7568024953079282513726390945118290941359":
1768 +Test "sin_upward (5) == -0.9589242746631384688931544061559939733525":
1771 +Test "sin_upward (6) == -0.2794154981989258728115554466118947596280":
1774 +Test "sin_upward (7) == 0.6569865987187890903969990915936351779369":
1779 +Test "sin_upward (8) == 0.9893582466233817778081235982452886721164":
1784 +Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
1787 +Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
1791 @@ -698,66 +972,237 @@ ldouble: 1
1794 Test "sinh (0.75) == 0.822316731935829980703661634446913849":
1799 -Test "tan (pi/4) == 1":
1801 +Test "sinh_downward (22) == 1792456423.065795780701106568345764104225":
1807 +Test "sinh_downward (23) == 4872401723.124451299966006944252978187305":
1812 +Test "sinh_downward (24) == 13244561064.92173614705070540368454568168":
1818 -Test "tgamma (-0.5) == -2 sqrt (pi)":
1821 +Test "sinh_tonearest (22) == 1792456423.065795780701106568345764104225":
1823 +Test "sinh_tonearest (23) == 4872401723.124451299966006944252978187305":
1825 +Test "sinh_tonearest (24) == 13244561064.92173614705070540368454568168":
1829 +Test "sinh_towardzero (22) == 1792456423.065795780701106568345764104225":
1835 +Test "sinh_towardzero (23) == 4872401723.124451299966006944252978187305":
1840 +Test "sinh_towardzero (24) == 13244561064.92173614705070540368454568168":
1846 +Test "sinh_upward (22) == 1792456423.065795780701106568345764104225":
1848 +Test "sinh_upward (23) == 4872401723.124451299966006944252978187305":
1850 +Test "sinh_upward (24) == 13244561064.92173614705070540368454568168":
1856 +Test "tan_downward (1) == 1.5574077246549022305069748074583601730873":
1861 +Test "tan_downward (10) == 0.6483608274590866712591249330098086768169":
1864 +Test "tan_downward (2) == -2.1850398632615189916433061023136825434320":
1869 +Test "tan_downward (3) == -0.1425465430742778052956354105339134932261":
1872 +Test "tan_downward (4) == 1.1578212823495775831373424182673239231198":
1878 -Test "tgamma (0.5) == sqrt (pi)":
1879 +Test "tan_downward (5) == -3.3805150062465856369827058794473439087096":
1882 +Test "tan_downward (6) == -0.2910061913847491570536995888681755428312":
1887 -Test "tgamma (0.7) == 1.29805533264755778568117117915281162":
1888 +Test "tan_downward (7) == 0.8714479827243187364564508896003135663222":
1891 +Test "tan_downward (8) == -6.7997114552203786999252627596086333648814":
1896 +Test "tan_downward (9) == -0.4523156594418098405903708757987855343087":
1901 +Test "tan_tonearest (6) == -0.2910061913847491570536995888681755428312":
1904 +Test "tan_tonearest (8) == -6.7997114552203786999252627596086333648814":
1907 +Test "tan_tonearest (9) == -0.4523156594418098405903708757987855343087":
1912 +Test "tan_towardzero (1) == 1.5574077246549022305069748074583601730873":
1917 -Test "tgamma (4) == 6":
1918 +Test "tan_towardzero (10) == 0.6483608274590866712591249330098086768169":
1921 +Test "tan_towardzero (2) == -2.1850398632615189916433061023136825434320":
1924 +Test "tan_towardzero (3) == -0.1425465430742778052956354105339134932261":
1929 +Test "tan_towardzero (4) == 1.1578212823495775831373424182673239231198":
1934 +Test "tan_towardzero (5) == -3.3805150062465856369827058794473439087096":
1939 +Test "tan_towardzero (6) == -0.2910061913847491570536995888681755428312":
1942 +Test "tan_towardzero (7) == 0.8714479827243187364564508896003135663222":
1945 +Test "tan_towardzero (8) == -6.7997114552203786999252627596086333648814":
1950 +Test "tan_towardzero (9) == -0.4523156594418098405903708757987855343087":
1957 -Test "y0 (0.125) == -1.38968062514384052915582277745018693":
1959 +Test "tan_upward (1) == 1.5574077246549022305069748074583601730873":
1962 -Test "y0 (0.75) == -0.137172769385772397522814379396581855":
1963 +Test "tan_upward (10) == 0.6483608274590866712591249330098086768169":
1968 +Test "tan_upward (2) == -2.1850398632615189916433061023136825434320":
1971 +Test "tan_upward (3) == -0.1425465430742778052956354105339134932261":
1976 +Test "tan_upward (4) == 1.1578212823495775831373424182673239231198":
1979 +Test "tan_upward (5) == -3.3805150062465856369827058794473439087096":
1984 -Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
1985 +Test "tan_upward (6) == -0.2910061913847491570536995888681755428312":
1988 +Test "tan_upward (7) == 0.8714479827243187364564508896003135663222":
1993 +Test "tan_upward (8) == -6.7997114552203786999252627596086333648814":
1998 +Test "tan_upward (9) == -0.4523156594418098405903708757987855343087":
2005 +Test "tgamma (-0.5) == -2 sqrt (pi)":
2012 -Test "y0 (1.5) == 0.382448923797758843955068554978089862":
2013 +Test "tgamma (0.5) == sqrt (pi)":
2016 +Test "tgamma (0.7) == 1.29805533264755778568117117915281162":
2021 -Test "y0 (10.0) == 0.0556711672835993914244598774101900481":
2024 +Test "y0 (0.125) == -1.38968062514384052915582277745018693":
2027 +Test "y0 (0.75) == -0.137172769385772397522814379396581855":
2032 +Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
2035 +Test "y0 (10.0) == 0.0556711672835993914244598774101900481":
2040 Test "y0 (8.0) == 0.223521489387566220527323400498620359":
2047 @@ -766,9 +1211,6 @@ ldouble: 1
2048 Test "y1 (0.125) == -5.19993611253477499595928744876579921":
2051 -Test "y1 (1.0) == -0.781212821300288716547150000047964821":
2054 Test "y1 (10.0) == 0.249015424206953883923283474663222803":
2057 @@ -782,9 +1224,7 @@ ifloat: 2
2060 Test "y1 (8.0) == -0.158060461731247494255555266187483550":
2067 @@ -799,37 +1239,21 @@ float: 1
2070 Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628":
2077 -Test "yn (0, 1.5) == 0.382448923797758843955068554978089862":
2082 Test "yn (0, 10.0) == 0.0556711672835993914244598774101900481":
2089 Test "yn (0, 8.0) == 0.223521489387566220527323400498620359":
2096 Test "yn (1, 0.125) == -5.19993611253477499595928744876579921":
2099 -Test "yn (1, 1.0) == -0.781212821300288716547150000047964821":
2102 Test "yn (1, 10.0) == 0.249015424206953883923283474663222803":
2105 @@ -843,17 +1267,13 @@ ifloat: 2
2108 Test "yn (1, 8.0) == -0.158060461731247494255555266187483550":
2115 Test "yn (10, 0.125) == -127057845771019398.252538486899753195":
2122 Test "yn (10, 0.75) == -2133501638.90573424452445412893839236":
2123 @@ -862,28 +1282,22 @@ ifloat: 1
2126 Test "yn (10, 1.0) == -121618014.278689189288130426667971145":
2131 Test "yn (10, 10.0) == -0.359814152183402722051986577343560609":
2138 Test "yn (10, 2.0) == -129184.542208039282635913145923304214":
2143 Test "yn (3, 0.125) == -2612.69757350066712600220955744091741":
2146 Test "yn (3, 0.75) == -12.9877176234475433186319774484809207":
2153 Test "yn (3, 10.0) == -0.251362657183837329779204747654240998":
2154 @@ -892,15 +1306,13 @@ float: 1
2157 Test "yn (3, 2.0) == -1.12778377684042778608158395773179238":
2163 # Maximal error of functions:
2172 @@ -917,18 +1329,6 @@ ildouble: 2
2175 Function: Real part of "cacosh":
2183 -Function: Imaginary part of "cacosh":
2191 @@ -1033,8 +1433,6 @@ double: 1
2200 @@ -1044,16 +1442,58 @@ ifloat: 1
2205 +Function: "cos_downward":
2213 +Function: "cos_tonearest":
2217 +Function: "cos_towardzero":
2225 +Function: "cos_upward":
2233 +Function: "cosh_downward":
2238 +Function: "cosh_tonearest":
2241 +Function: "cosh_towardzero":
2246 +Function: "cosh_upward":
2250 Function: Real part of "cpow":
2260 Function: Imaginary part of "cpow":
2262 @@ -1086,38 +1526,32 @@ double: 1
2269 Function: Real part of "ctan":
2277 Function: Imaginary part of "ctan":
2285 Function: Real part of "ctanh":
2295 Function: Imaginary part of "ctanh":
2307 @@ -1125,19 +1559,36 @@ idouble: 1
2324 +Function: "exp_downward":
2332 +Function: "exp_towardzero":
2340 +Function: "exp_upward":
2349 @@ -1151,10 +1602,10 @@ Function: "hypot":
2364 @@ -1167,10 +1618,10 @@ ildouble: 1
2379 @@ -1192,6 +1643,58 @@ ifloat: 1
2383 +Function: "pow_downward":
2391 +Function: "pow_towardzero":
2399 +Function: "pow_upward":
2407 +Function: "sin_downward":
2415 +Function: "sin_tonearest":
2419 +Function: "sin_towardzero":
2427 +Function: "sin_upward":
2438 @@ -1201,13 +1704,62 @@ ildouble: 1
2445 +Function: "sinh_downward":
2452 +Function: "sinh_tonearest":
2455 +Function: "sinh_towardzero":
2462 +Function: "sinh_upward":
2471 +Function: "tan_downward":
2479 +Function: "tan_tonearest":
2483 +Function: "tan_towardzero":
2491 +Function: "tan_upward":
2502 @@ -1217,9 +1769,9 @@ ildouble: 1
2514 diff -Nrup a/sysdeps/ieee754/dbl-64/e_exp.c b/sysdeps/ieee754/dbl-64/e_exp.c
2515 --- a/sysdeps/ieee754/dbl-64/e_exp.c 2010-05-04 05:27:23.000000000 -0600
2516 +++ b/sysdeps/ieee754/dbl-64/e_exp.c 2012-08-06 09:54:00.823929687 -0600
2519 * IBM Accurate Mathematical Library
2520 * written by International Business Machines Corp.
2521 - * Copyright (C) 2001 Free Software Foundation
2522 + * Copyright (C) 2001-2012 Free Software Foundation
2524 * This program is free software; you can redistribute it and/or modify
2525 * it under the terms of the GNU Lesser General Public License as published by
2527 #include "MathLib.h"
2529 #include "math_private.h"
2532 double __slowexp(double);
2534 @@ -53,6 +54,10 @@ double __ieee754_exp(double x) {
2541 + libc_feholdexcept_setround (&env, FE_TONEAREST);
2544 m = junk1.i[HIGH_HALF];
2545 @@ -85,18 +90,19 @@ double __ieee754_exp(double x) {
2546 rem=(bet + bet*eps)+al*eps;
2548 cor = (al - res) + rem;
2549 - if (res == (res+cor*err_0)) return res*binexp.x;
2550 - else return __slowexp(x); /*if error is over bound */
2551 + if (res == (res+cor*err_0)) { retval = res*binexp.x; goto ret; }
2552 + else { retval = __slowexp(x); goto ret; } /*if error is over bound */
2555 - if (n <= smallint) return 1.0;
2556 + if (n <= smallint) { retval = 1.0; goto ret; }
2559 - if (n > infint) return(x+x); /* x is NaN */
2560 - if (n < infint) return ( (x>0) ? (hhuge*hhuge) : (tiny*tiny) );
2561 + if (n > infint) { retval = x+x; goto ret; } /* x is NaN */
2562 + if (n < infint) { retval = (x>0) ? (hhuge*hhuge) : (tiny*tiny); goto ret; }
2563 /* x is finite, cause either overflow or underflow */
2564 - if (junk1.i[LOW_HALF] != 0) return (x+x); /* x is NaN */
2565 - return ((x>0)?inf.x:zero ); /* |x| = inf; return either inf or 0 */
2566 + if (junk1.i[LOW_HALF] != 0) { retval = x+x; goto ret; } /* x is NaN */
2567 + retval = (x>0)?inf.x:zero; /* |x| = inf; return either inf or 0 */
2571 y = x*log2e.x + three51.x;
2572 @@ -121,8 +127,8 @@ double __ieee754_exp(double x) {
2573 if (res < 1.0) {res+=res; cor+=cor; ex-=1;}
2575 binexp.i[HIGH_HALF] = (1023+ex)<<20;
2576 - if (res == (res+cor*err_0)) return res*binexp.x;
2577 - else return __slowexp(x); /*if error is over bound */
2578 + if (res == (res+cor*err_0)) { retval = res*binexp.x; goto ret; }
2579 + else { retval = __slowexp(x); goto ret; } /*if error is over bound */
2582 binexp.i[HIGH_HALF] = (1023-ex)<<20;
2583 @@ -135,15 +141,19 @@ double __ieee754_exp(double x) {
2585 if (res == (res + eps*cor))
2586 { binexp.i[HIGH_HALF] = 0x00100000;
2587 - return (res-1.0)*binexp.x;
2588 + retval = (res-1.0)*binexp.x;
2591 - else return __slowexp(x); /* if error is over bound */
2592 + else { retval = __slowexp(x); goto ret; } /* if error is over bound */
2595 binexp.i[HIGH_HALF] =(junk1.i[LOW_HALF]+767)<<20;
2596 - if (res == (res+cor*err_0)) return res*binexp.x*t256.x;
2597 - else return __slowexp(x);
2598 + if (res == (res+cor*err_0)) { retval = res*binexp.x*t256.x; goto ret; }
2599 + else { retval = __slowexp(x); goto ret; }
2602 + libc_feupdateenv (&env);
2606 /************************************************************************/
2607 diff -Nrup a/sysdeps/ieee754/dbl-64/e_exp2.c b/sysdeps/ieee754/dbl-64/e_exp2.c
2608 --- a/sysdeps/ieee754/dbl-64/e_exp2.c 2010-05-04 05:27:23.000000000 -0600
2609 +++ b/sysdeps/ieee754/dbl-64/e_exp2.c 2012-08-06 09:54:00.824929683 -0600
2611 17 (1), March 1991, pp. 26-45.
2612 It has been slightly modified to compute 2^x instead of e^x.
2614 -#ifndef _GNU_SOURCE
2615 -#define _GNU_SOURCE
2619 #include <ieee754.h>
2624 -/* XXX I know the assembler generates a warning about incorrect section
2625 - attributes. But without the attribute here the compiler places the
2626 - constants in the .data section. Ideally the constant is placed in
2627 - .rodata.cst8 so that it can be merged, but gcc sucks, it ICEs when
2628 - we try to force this section on it. --drepper */
2629 -static const volatile double TWO1023 = 8.988465674311579539e+307;
2630 -static const volatile double TWOM1000 = 9.3326361850321887899e-302;
2631 +static const double TWO1023 = 8.988465674311579539e+307;
2632 +static const double TWOM1000 = 9.3326361850321887899e-302;
2635 __ieee754_exp2 (double x)
2636 @@ -60,11 +52,7 @@ __ieee754_exp2 (double x)
2637 union ieee754_double ex2_u, scale_u;
2640 - feholdexcept (&oldenv);
2641 -#ifdef FE_TONEAREST
2642 - /* If we don't have this, it's too bad. */
2643 - fesetround (FE_TONEAREST);
2645 + libc_feholdexcept_setround (&oldenv, FE_TONEAREST);
2647 /* 1. Argument reduction.
2648 Choose integers ex, -256 <= t < 256, and some real
2649 @@ -108,9 +96,10 @@ __ieee754_exp2 (double x)
2650 * x + .055504110254308625)
2651 * x + .240226506959100583)
2652 * x + .69314718055994495) * ex2_u.d;
2653 + math_opt_barrier (x22);
2655 /* 5. Return (2^x2-1) * 2^(t/512+e+ex) + 2^(t/512+e+ex). */
2656 - fesetenv (&oldenv);
2657 + libc_fesetenv (&oldenv);
2659 result = x22 * x + ex2_u.d;
2661 diff -Nrup a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
2662 --- a/sysdeps/ieee754/dbl-64/e_pow.c 2010-05-04 05:27:23.000000000 -0600
2663 +++ b/sysdeps/ieee754/dbl-64/e_pow.c 2012-08-06 09:54:00.824929683 -0600
2665 #include "MathLib.h"
2667 #include "math_private.h"
2671 double __exp1(double x, double xx, double error);
2672 @@ -79,6 +80,11 @@ double __ieee754_pow(double x, double y)
2673 (u.i[HIGH_HALF]==0 && u.i[LOW_HALF]!=0)) &&
2674 /* 2^-1023< x<= 2^-1023 * 0x1.0000ffffffff */
2675 (v.i[HIGH_HALF]&0x7fffffff) < 0x4ff00000) { /* if y<-1 or y>1 */
2679 + libc_feholdexcept_setround (&env, FE_TONEAREST);
2681 z = log1(x,&aa,&error); /* x^y =e^(y log (X)) */
2684 @@ -92,7 +98,10 @@ double __ieee754_pow(double x, double y)
2686 error = error*ABS(y);
2687 t = __exp1(a1,a2,1.9e16*error); /* return -10 or 0 if wasn't computed exactly */
2688 - return (t>0)?t:power1(x,y);
2689 + retval = (t>0)?t:power1(x,y);
2691 + libc_feupdateenv (&env);
2696 diff -Nrup a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c
2697 --- a/sysdeps/ieee754/dbl-64/s_sin.c 2010-05-04 05:27:23.000000000 -0600
2698 +++ b/sysdeps/ieee754/dbl-64/s_sin.c 2012-08-06 09:54:00.827929671 -0600
2700 #include "MathLib.h"
2701 #include "sincos.tbl"
2702 #include "math_private.h"
2706 sn3 = -1.66666666666664880952546298448555E-01,
2707 @@ -97,12 +98,16 @@ double __sin(double x){
2712 + double retval = 0;
2714 + libc_feholdexcept_setround (&env, FE_TONEAREST);
2718 k = 0x7fffffff&m; /* no sign */
2719 if (k < 0x3e500000) /* if x->0 =>sin(x)=x */
2721 + { retval = x; goto ret; }
2722 /*---------------------------- 2^-26 < |x|< 0.25 ----------------------*/
2723 else if (k < 0x3fd00000){
2725 @@ -110,7 +115,8 @@ double __sin(double x){
2726 t = ((((s5.x*xx + s4.x)*xx + s3.x)*xx + s2.x)*xx + s1.x)*(xx*x);
2729 - return (res == res + 1.07*cor)? res : slow(x);
2730 + retval = (res == res + 1.07*cor)? res : slow(x);
2732 } /* else if (k < 0x3fd00000) */
2733 /*---------------------------- 0.25<|x|< 0.855469---------------------- */
2734 else if (k < 0x3feb6000) {
2735 @@ -127,7 +133,8 @@ double __sin(double x){
2736 cor=(ssn+s*ccs-sn*c)+cs*s;
2739 - return (res==res+1.025*cor)? res : slow1(x);
2740 + retval = (res==res+1.096*cor)? res : slow1(x);
2742 } /* else if (k < 0x3feb6000) */
2744 /*----------------------- 0.855469 <|x|<2.426265 ----------------------*/
2745 @@ -153,7 +160,8 @@ double __sin(double x){
2746 cor=(ccs-s*ssn-cs*c)-sn*s;
2749 - return (res==res+1.020*cor)? ((m>0)?res:-res) : slow2(x);
2750 + retval = (res==res+1.020*cor)? ((m>0)?res:-res) : slow2(x);
2752 } /* else if (k < 0x400368fd) */
2754 /*-------------------------- 2.426265<|x|< 105414350 ----------------------*/
2755 @@ -179,7 +187,8 @@ double __sin(double x){
2758 cor = (cor>0)? 1.02*cor+eps : 1.02*cor -eps;
2759 - return (res == res + cor)? res : sloww(a,da,x);
2760 + retval = (res == res + cor)? res : sloww(a,da,x);
2765 @@ -200,7 +209,8 @@ double __sin(double x){
2768 cor = (cor>0)? 1.035*cor+eps : 1.035*cor-eps;
2769 - return (res==res+cor)? ((m)?res:-res) : sloww1(a,da,x);
2770 + retval = (res==res+cor)? ((m)?res:-res) : sloww1(a,da,x);
2775 @@ -222,7 +232,8 @@ double __sin(double x){
2778 cor = (cor>0)? 1.025*cor+eps : 1.025*cor-eps;
2779 - return (res==res+cor)? ((n&2)?-res:res) : sloww2(a,da,x,n);
2780 + retval = (res==res+cor)? ((n&2)?-res:res) : sloww2(a,da,x,n);
2785 @@ -258,7 +269,8 @@ double __sin(double x){
2788 cor = (cor>0)? 1.02*cor+eps : 1.02*cor -eps;
2789 - return (res == res + cor)? res : bsloww(a,da,x,n);
2790 + retval = (res == res + cor)? res : bsloww(a,da,x,n);
2794 if (a>0) {m=1;t=a;db=da;}
2795 @@ -277,7 +289,8 @@ double __sin(double x){
2798 cor = (cor>0)? 1.035*cor+eps : 1.035*cor-eps;
2799 - return (res==res+cor)? ((m)?res:-res) : bsloww1(a,da,x,n);
2800 + retval = (res==res+cor)? ((m)?res:-res) : bsloww1(a,da,x,n);
2805 @@ -299,7 +312,8 @@ double __sin(double x){
2808 cor = (cor>0)? 1.025*cor+eps : 1.025*cor-eps;
2809 - return (res==res+cor)? ((n&2)?-res:res) : bsloww2(a,da,x,n);
2810 + retval = (res==res+cor)? ((n&2)?-res:res) : bsloww2(a,da,x,n);
2815 @@ -313,17 +327,20 @@ double __sin(double x){
2816 n = __branred(x,&a,&da);
2819 - if (a*a < 0.01588) return bsloww(a,da,x,n);
2820 - else return bsloww1(a,da,x,n);
2821 + if (a*a < 0.01588) retval = bsloww(a,da,x,n);
2822 + else retval = bsloww1(a,da,x,n);
2826 - if (a*a < 0.01588) return bsloww(-a,-da,x,n);
2827 - else return bsloww1(-a,-da,x,n);
2828 + if (a*a < 0.01588) retval = bsloww(-a,-da,x,n);
2829 + else retval = bsloww1(-a,-da,x,n);
2835 - return bsloww2(a,da,x,n);
2836 + retval = bsloww2(a,da,x,n);
2841 @@ -333,9 +350,13 @@ double __sin(double x){
2843 if (k == 0x7ff00000 && u.i[LOW_HALF] == 0)
2849 - return 0; /* unreachable */
2852 + libc_feupdateenv (&env);
2857 @@ -350,11 +371,16 @@ double __cos(double x)
2862 + double retval = 0;
2864 + libc_feholdexcept_setround (&env, FE_TONEAREST);
2870 - if (k < 0x3e400000 ) return 1.0; /* |x|<2^-27 => cos(x)=1 */
2871 + if (k < 0x3e400000 ) { retval = 1.0; goto ret; } /* |x|<2^-27 => cos(x)=1 */
2873 else if (k < 0x3feb6000 ) {/* 2^-27 < |x| < 0.855469 */
2875 @@ -371,7 +397,8 @@ double __cos(double x)
2876 cor=(ccs-s*ssn-cs*c)-sn*s;
2879 - return (res==res+1.020*cor)? res : cslow2(x);
2880 + retval = (res==res+1.020*cor)? res : cslow2(x);
2883 } /* else if (k < 0x3feb6000) */
2885 @@ -385,7 +412,8 @@ double __cos(double x)
2888 cor = (cor>0)? 1.02*cor+1.0e-31 : 1.02*cor -1.0e-31;
2889 - return (res == res + cor)? res : csloww(a,da,x);
2890 + retval = (res == res + cor)? res : csloww(a,da,x);
2894 if (a>0) {m=1;t=a;db=da;}
2895 @@ -404,7 +432,8 @@ double __cos(double x)
2898 cor = (cor>0)? 1.035*cor+1.0e-31 : 1.035*cor-1.0e-31;
2899 - return (res==res+cor)? ((m)?res:-res) : csloww1(a,da,x);
2900 + retval = (res==res+cor)? ((m)?res:-res) : csloww1(a,da,x);
2904 } /* else if (k < 0x400368fd) */
2905 @@ -431,7 +460,8 @@ double __cos(double x)
2908 cor = (cor>0)? 1.02*cor+eps : 1.02*cor -eps;
2909 - return (res == res + cor)? res : csloww(a,da,x);
2910 + retval = (res == res + cor)? res : csloww(a,da,x);
2914 if (a>0) {m=1;t=a;db=da;}
2915 @@ -450,7 +480,8 @@ double __cos(double x)
2918 cor = (cor>0)? 1.035*cor+eps : 1.035*cor-eps;
2919 - return (res==res+cor)? ((m)?res:-res) : csloww1(a,da,x);
2920 + retval = (res==res+cor)? ((m)?res:-res) : csloww1(a,da,x);
2925 @@ -471,7 +502,8 @@ double __cos(double x)
2928 cor = (cor>0)? 1.025*cor+eps : 1.025*cor-eps;
2929 - return (res==res+cor)? ((n)?-res:res) : csloww2(a,da,x,n);
2930 + retval = (res==res+cor)? ((n)?-res:res) : csloww2(a,da,x,n);
2935 @@ -506,7 +538,8 @@ double __cos(double x)
2938 cor = (cor>0)? 1.02*cor+eps : 1.02*cor -eps;
2939 - return (res == res + cor)? res : bsloww(a,da,x,n);
2940 + retval = (res == res + cor)? res : bsloww(a,da,x,n);
2944 if (a>0) {m=1;t=a;db=da;}
2945 @@ -525,7 +558,8 @@ double __cos(double x)
2948 cor = (cor>0)? 1.035*cor+eps : 1.035*cor-eps;
2949 - return (res==res+cor)? ((m)?res:-res) : bsloww1(a,da,x,n);
2950 + retval = (res==res+cor)? ((m)?res:-res) : bsloww1(a,da,x,n);
2955 @@ -546,7 +580,8 @@ double __cos(double x)
2958 cor = (cor>0)? 1.025*cor+eps : 1.025*cor-eps;
2959 - return (res==res+cor)? ((n)?-res:res) : bsloww2(a,da,x,n);
2960 + retval = (res==res+cor)? ((n)?-res:res) : bsloww2(a,da,x,n);
2965 @@ -558,17 +593,20 @@ double __cos(double x)
2966 n = __branred(x,&a,&da);
2969 - if (a*a < 0.01588) return bsloww(-a,-da,x,n);
2970 - else return bsloww1(-a,-da,x,n);
2971 + if (a*a < 0.01588) retval = bsloww(-a,-da,x,n);
2972 + else retval = bsloww1(-a,-da,x,n);
2976 - if (a*a < 0.01588) return bsloww(a,da,x,n);
2977 - else return bsloww1(a,da,x,n);
2978 + if (a*a < 0.01588) retval = bsloww(a,da,x,n);
2979 + else retval = bsloww1(a,da,x,n);
2985 - return bsloww2(a,da,x,n);
2986 + retval = bsloww2(a,da,x,n);
2991 @@ -580,10 +618,13 @@ double __cos(double x)
2993 if (k == 0x7ff00000 && u.i[LOW_HALF] == 0)
2995 - return x / x; /* |x| > 2^1024 */
2996 + retval = x / x; /* |x| > 2^1024 */
3002 + libc_feupdateenv (&env);
3006 /************************************************************************/
3007 diff -Nrup a/sysdeps/ieee754/dbl-64/s_tan.c b/sysdeps/ieee754/dbl-64/s_tan.c
3008 --- a/sysdeps/ieee754/dbl-64/s_tan.c 2010-05-04 05:27:23.000000000 -0600
3009 +++ b/sysdeps/ieee754/dbl-64/s_tan.c 2012-08-06 09:54:00.828929666 -0600
3012 #include "MathLib.h"
3014 +#include "math_private.h"
3017 static double tanMp(double);
3018 void __mptan(double, mp_no *, int);
3019 @@ -58,21 +60,27 @@ double tan(double x) {
3026 int __branred(double, double *, double *);
3027 int __mpranred(double, mp_no *, int);
3029 + libc_feholdexcept_setround (&env, FE_TONEAREST);
3031 /* x=+-INF, x=NaN */
3032 num.d = x; ux = num.i[HIGH_HALF];
3033 if ((ux&0x7ff00000)==0x7ff00000) {
3034 if ((ux&0x7fffffff)==0x7ff00000)
3041 w=(x<ZERO) ? -x : x;
3043 /* (I) The case abs(x) <= 1.259e-8 */
3044 - if (w<=g1.d) return x;
3045 + if (w<=g1.d) { retval = x; goto ret; }
3047 /* (II) The case 1.259e-8 < abs(x) <= 0.0608 */
3049 @@ -80,7 +88,7 @@ double tan(double x) {
3052 t2 = x*x2*(d3.d+x2*(d5.d+x2*(d7.d+x2*(d9.d+x2*d11.d))));
3053 - if ((y=x+(t2-u1.d*t2)) == x+(t2+u1.d*t2)) return y;
3054 + if ((y=x+(t2-u1.d*t2)) == x+(t2+u1.d*t2)) { retval = y; goto ret; }
3057 c1 = x2*(a15.d+x2*(a17.d+x2*(a19.d+x2*(a21.d+x2*(a23.d+x2*(a25.d+
3058 @@ -100,8 +108,9 @@ double tan(double x) {
3059 MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8)
3060 MUL2(x ,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8)
3061 ADD2(x ,zero.d,c2,cc2,c1,cc1,t1,t2)
3062 - if ((y=c1+(cc1-u2.d*c1)) == c1+(cc1+u2.d*c1)) return y;
3064 + if ((y=c1+(cc1-u2.d*c1)) == c1+(cc1+u2.d*c1)) { retval = y; goto ret; }
3065 + retval = tanMp(x);
3069 /* (III) The case 0.0608 < abs(x) <= 0.787 */
3070 @@ -112,10 +121,10 @@ double tan(double x) {
3071 z = w-xfg[i][0].d; z2 = z*z; s = (x<ZERO) ? MONE : ONE;
3072 pz = z+z*z2*(e0.d+z2*e1.d);
3073 fi = xfg[i][1].d; gi = xfg[i][2].d; t2 = pz*(gi+fi)/(gi-pz);
3074 - if ((y=fi+(t2-fi*u3.d))==fi+(t2+fi*u3.d)) return (s*y);
3075 + if ((y=fi+(t2-fi*u3.d))==fi+(t2+fi*u3.d)) { retval = (s*y); goto ret; }
3076 t3 = (t2<ZERO) ? -t2 : t2;
3077 t4 = fi*ua3.d+t3*ub3.d;
3078 - if ((y=fi+(t2-t4))==fi+(t2+t4)) return (s*y);
3079 + if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (s*y); goto ret; }
3083 @@ -133,8 +142,9 @@ double tan(double x) {
3084 SUB2(one.d,zero.d,c3,cc3,c1,cc1,t1,t2)
3085 DIV2(c2,cc2,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
3087 - if ((y=c3+(cc3-u4.d*c3))==c3+(cc3+u4.d*c3)) return (s*y);
3089 + if ((y=c3+(cc3-u4.d*c3))==c3+(cc3+u4.d*c3)) { retval = (s*y); goto ret; }
3090 + retval = tanMp(x);
3094 /* (---) The case 0.787 < abs(x) <= 25 */
3095 @@ -152,7 +162,7 @@ double tan(double x) {
3096 else {ya= a; yya= da; sy= ONE;}
3098 /* (IV),(V) The case 0.787 < abs(x) <= 25, abs(y) <= 1e-7 */
3099 - if (ya<=gy1.d) return tanMp(x);
3100 + if (ya<=gy1.d) { retval = tanMp(x); goto ret; }
3102 /* (VI) The case 0.787 < abs(x) <= 25, 1e-7 < abs(y) <= 0.0608 */
3104 @@ -162,10 +172,10 @@ double tan(double x) {
3105 /* First stage -cot */
3107 DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
3108 - if ((y=c+(dc-u6.d*c))==c+(dc+u6.d*c)) return (-y); }
3109 + if ((y=c+(dc-u6.d*c))==c+(dc+u6.d*c)) { retval = (-y); goto ret; } }
3111 /* First stage tan */
3112 - if ((y=a+(t2-u5.d*a))==a+(t2+u5.d*a)) return y; }
3113 + if ((y=a+(t2-u5.d*a))==a+(t2+u5.d*a)) { retval = y; goto ret; } }
3115 /* Range reduction by algorithm ii */
3116 t = (x*hpinv.d + toint.d);
3117 @@ -203,11 +213,12 @@ double tan(double x) {
3119 /* Second stage -cot */
3120 DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
3121 - if ((y=c2+(cc2-u8.d*c2)) == c2+(cc2+u8.d*c2)) return (-y); }
3122 + if ((y=c2+(cc2-u8.d*c2)) == c2+(cc2+u8.d*c2)) { retval = (-y); goto ret; } }
3124 /* Second stage tan */
3125 - if ((y=c1+(cc1-u7.d*c1)) == c1+(cc1+u7.d*c1)) return y; }
3127 + if ((y=c1+(cc1-u7.d*c1)) == c1+(cc1+u7.d*c1)) { retval = y; goto ret; } }
3128 + retval = tanMp(x);
3132 /* (VII) The case 0.787 < abs(x) <= 25, 0.0608 < abs(y) <= 0.787 */
3133 @@ -221,17 +232,17 @@ double tan(double x) {
3136 t2 = pz*(fi+gi)/(fi+pz);
3137 - if ((y=gi-(t2-gi*u10.d))==gi-(t2+gi*u10.d)) return (-sy*y);
3138 + if ((y=gi-(t2-gi*u10.d))==gi-(t2+gi*u10.d)) { retval = (-sy*y); goto ret; }
3139 t3 = (t2<ZERO) ? -t2 : t2;
3140 t4 = gi*ua10.d+t3*ub10.d;
3141 - if ((y=gi-(t2-t4))==gi-(t2+t4)) return (-sy*y); }
3142 + if ((y=gi-(t2-t4))==gi-(t2+t4)) { retval = (-sy*y); goto ret; } }
3145 t2 = pz*(gi+fi)/(gi-pz);
3146 - if ((y=fi+(t2-fi*u9.d))==fi+(t2+fi*u9.d)) return (sy*y);
3147 + if ((y=fi+(t2-fi*u9.d))==fi+(t2+fi*u9.d)) { retval = (sy*y); goto ret; }
3148 t3 = (t2<ZERO) ? -t2 : t2;
3149 t4 = fi*ua9.d+t3*ub9.d;
3150 - if ((y=fi+(t2-t4))==fi+(t2+t4)) return (sy*y); }
3151 + if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (sy*y); goto ret; } }
3155 @@ -252,13 +263,14 @@ double tan(double x) {
3158 DIV2(c1,cc1,c2,cc2,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
3159 - if ((y=c3+(cc3-u12.d*c3))==c3+(cc3+u12.d*c3)) return (-sy*y); }
3160 + if ((y=c3+(cc3-u12.d*c3))==c3+(cc3+u12.d*c3)) { retval = (-sy*y); goto ret; } }
3163 DIV2(c2,cc2,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
3164 - if ((y=c3+(cc3-u11.d*c3))==c3+(cc3+u11.d*c3)) return (sy*y); }
3165 + if ((y=c3+(cc3-u11.d*c3))==c3+(cc3+u11.d*c3)) { retval = (sy*y); goto ret; } }
3168 + retval = tanMp(x);
3172 /* (---) The case 25 < abs(x) <= 1e8 */
3173 @@ -280,7 +292,7 @@ double tan(double x) {
3174 else {ya= a; yya= da; sy= ONE;}
3176 /* (+++) The case 25 < abs(x) <= 1e8, abs(y) <= 1e-7 */
3177 - if (ya<=gy1.d) return tanMp(x);
3178 + if (ya<=gy1.d) { retval = tanMp(x); goto ret; }
3180 /* (VIII) The case 25 < abs(x) <= 1e8, 1e-7 < abs(y) <= 0.0608 */
3182 @@ -290,10 +302,10 @@ double tan(double x) {
3183 /* First stage -cot */
3185 DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
3186 - if ((y=c+(dc-u14.d*c))==c+(dc+u14.d*c)) return (-y); }
3187 + if ((y=c+(dc-u14.d*c))==c+(dc+u14.d*c)) { retval = (-y); goto ret; } }
3189 /* First stage tan */
3190 - if ((y=a+(t2-u13.d*a))==a+(t2+u13.d*a)) return y; }
3191 + if ((y=a+(t2-u13.d*a))==a+(t2+u13.d*a)) { retval = y; goto ret; } }
3194 MUL2(a,da,a,da,x2,xx2,t1,t2,t3,t4,t5,t6,t7,t8)
3195 @@ -317,11 +329,12 @@ double tan(double x) {
3197 /* Second stage -cot */
3198 DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
3199 - if ((y=c2+(cc2-u16.d*c2)) == c2+(cc2+u16.d*c2)) return (-y); }
3200 + if ((y=c2+(cc2-u16.d*c2)) == c2+(cc2+u16.d*c2)) { retval = (-y); goto ret; } }
3202 /* Second stage tan */
3203 - if ((y=c1+(cc1-u15.d*c1)) == c1+(cc1+u15.d*c1)) return (y); }
3205 + if ((y=c1+(cc1-u15.d*c1)) == c1+(cc1+u15.d*c1)) { retval = (y); goto ret; } }
3206 + retval = tanMp(x);
3210 /* (IX) The case 25 < abs(x) <= 1e8, 0.0608 < abs(y) <= 0.787 */
3211 @@ -334,17 +347,17 @@ double tan(double x) {
3214 t2 = pz*(fi+gi)/(fi+pz);
3215 - if ((y=gi-(t2-gi*u18.d))==gi-(t2+gi*u18.d)) return (-sy*y);
3216 + if ((y=gi-(t2-gi*u18.d))==gi-(t2+gi*u18.d)) { retval = (-sy*y); goto ret; }
3217 t3 = (t2<ZERO) ? -t2 : t2;
3218 t4 = gi*ua18.d+t3*ub18.d;
3219 - if ((y=gi-(t2-t4))==gi-(t2+t4)) return (-sy*y); }
3220 + if ((y=gi-(t2-t4))==gi-(t2+t4)) { retval = (-sy*y); goto ret; } }
3223 t2 = pz*(gi+fi)/(gi-pz);
3224 - if ((y=fi+(t2-fi*u17.d))==fi+(t2+fi*u17.d)) return (sy*y);
3225 + if ((y=fi+(t2-fi*u17.d))==fi+(t2+fi*u17.d)) { retval = (sy*y); goto ret; }
3226 t3 = (t2<ZERO) ? -t2 : t2;
3227 t4 = fi*ua17.d+t3*ub17.d;
3228 - if ((y=fi+(t2-t4))==fi+(t2+t4)) return (sy*y); }
3229 + if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (sy*y); goto ret; } }
3233 @@ -365,12 +378,13 @@ double tan(double x) {
3236 DIV2(c1,cc1,c2,cc2,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
3237 - if ((y=c3+(cc3-u20.d*c3))==c3+(cc3+u20.d*c3)) return (-sy*y); }
3238 + if ((y=c3+(cc3-u20.d*c3))==c3+(cc3+u20.d*c3)) { retval = (-sy*y); goto ret; } }
3241 DIV2(c2,cc2,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
3242 - if ((y=c3+(cc3-u19.d*c3))==c3+(cc3+u19.d*c3)) return (sy*y); }
3244 + if ((y=c3+(cc3-u19.d*c3))==c3+(cc3+u19.d*c3)) { retval = (sy*y); goto ret; } }
3245 + retval = tanMp(x);
3249 /* (---) The case 1e8 < abs(x) < 2**1024 */
3250 @@ -381,7 +395,7 @@ double tan(double x) {
3251 else {ya= a; yya= da; sy= ONE;}
3253 /* (+++) The case 1e8 < abs(x) < 2**1024, abs(y) <= 1e-7 */
3254 - if (ya<=gy1.d) return tanMp(x);
3255 + if (ya<=gy1.d) { retval = tanMp(x); goto ret; }
3257 /* (X) The case 1e8 < abs(x) < 2**1024, 1e-7 < abs(y) <= 0.0608 */
3259 @@ -391,10 +405,10 @@ double tan(double x) {
3260 /* First stage -cot */
3262 DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
3263 - if ((y=c+(dc-u22.d*c))==c+(dc+u22.d*c)) return (-y); }
3264 + if ((y=c+(dc-u22.d*c))==c+(dc+u22.d*c)) { retval = (-y); goto ret; } }
3266 /* First stage tan */
3267 - if ((y=a+(t2-u21.d*a))==a+(t2+u21.d*a)) return y; }
3268 + if ((y=a+(t2-u21.d*a))==a+(t2+u21.d*a)) { retval = y; goto ret; } }
3271 /* Reduction by algorithm iv */
3272 @@ -423,11 +437,12 @@ double tan(double x) {
3274 /* Second stage -cot */
3275 DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
3276 - if ((y=c2+(cc2-u24.d*c2)) == c2+(cc2+u24.d*c2)) return (-y); }
3277 + if ((y=c2+(cc2-u24.d*c2)) == c2+(cc2+u24.d*c2)) { retval = (-y); goto ret; } }
3279 /* Second stage tan */
3280 - if ((y=c1+(cc1-u23.d*c1)) == c1+(cc1+u23.d*c1)) return y; }
3282 + if ((y=c1+(cc1-u23.d*c1)) == c1+(cc1+u23.d*c1)) { retval = y; goto ret; } }
3283 + retval = tanMp(x);
3287 /* (XI) The case 1e8 < abs(x) < 2**1024, 0.0608 < abs(y) <= 0.787 */
3288 @@ -440,17 +455,17 @@ double tan(double x) {
3291 t2 = pz*(fi+gi)/(fi+pz);
3292 - if ((y=gi-(t2-gi*u26.d))==gi-(t2+gi*u26.d)) return (-sy*y);
3293 + if ((y=gi-(t2-gi*u26.d))==gi-(t2+gi*u26.d)) { retval = (-sy*y); goto ret; }
3294 t3 = (t2<ZERO) ? -t2 : t2;
3295 t4 = gi*ua26.d+t3*ub26.d;
3296 - if ((y=gi-(t2-t4))==gi-(t2+t4)) return (-sy*y); }
3297 + if ((y=gi-(t2-t4))==gi-(t2+t4)) { retval = (-sy*y); goto ret; } }
3300 t2 = pz*(gi+fi)/(gi-pz);
3301 - if ((y=fi+(t2-fi*u25.d))==fi+(t2+fi*u25.d)) return (sy*y);
3302 + if ((y=fi+(t2-fi*u25.d))==fi+(t2+fi*u25.d)) { retval = (sy*y); goto ret; }
3303 t3 = (t2<ZERO) ? -t2 : t2;
3304 t4 = fi*ua25.d+t3*ub25.d;
3305 - if ((y=fi+(t2-t4))==fi+(t2+t4)) return (sy*y); }
3306 + if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (sy*y); goto ret; } }
3310 @@ -471,15 +486,19 @@ double tan(double x) {
3313 DIV2(c1,cc1,c2,cc2,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
3314 - if ((y=c3+(cc3-u28.d*c3))==c3+(cc3+u28.d*c3)) return (-sy*y); }
3315 + if ((y=c3+(cc3-u28.d*c3))==c3+(cc3+u28.d*c3)) { retval = (-sy*y); goto ret; } }
3318 DIV2(c2,cc2,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
3319 - if ((y=c3+(cc3-u27.d*c3))==c3+(cc3+u27.d*c3)) return (sy*y); }
3321 + if ((y=c3+(cc3-u27.d*c3))==c3+(cc3+u27.d*c3)) { retval = (sy*y); goto ret; } }
3322 + retval = tanMp(x);
3326 + libc_feupdateenv (&env);
3331 /* multiple precision stage */
3332 /* Convert x to multi precision number,compute tan(x) by mptan() routine */
3333 /* and converts result back to double */
3334 diff -Nrup a/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
3335 --- a/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c 2010-05-04 05:27:23.000000000 -0600
3336 +++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c 2012-08-06 09:54:00.828929666 -0600
3339 #include "math_private.h"
3347 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
3348 -4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */
3352 - double __nearbyint(double x)
3354 - double __nearbyint(x)
3358 +__nearbyint(double x)
3362 @@ -47,20 +39,19 @@ TWO52[2]={
3363 EXTRACT_WORDS64(i0,x);
3365 j0 = ((i0>>52)&0x7ff)-0x3ff;
3367 + if(__builtin_expect(j0<52, 1)) {
3369 if((i0&UINT64_C(0x7fffffffffffffff))==0) return x;
3370 uint64_t i = i0 & UINT64_C(0xfffffffffffff);
3371 i0 &= UINT64_C(0xfffe000000000000);
3372 i0 |= (((i|-i) >> 12) & UINT64_C(0x8000000000000));
3373 INSERT_WORDS64(x,i0);
3374 - feholdexcept (&env);
3375 + libc_feholdexcept (&env);
3376 double w = TWO52[sx]+x;
3377 double t = w-TWO52[sx];
3379 - EXTRACT_WORDS64(i0,t);
3380 - INSERT_WORDS64(t,(i0&UINT64_C(0x7fffffffffffffff))|(sx<<63));
3382 + math_opt_barrier(t);
3383 + libc_fesetenv (&env);
3384 + return copysign(t, x);
3386 uint64_t i = UINT64_C(0x000fffffffffffff)>>j0;
3387 if((i0&i)==0) return x; /* x is integral */
3388 @@ -73,10 +64,11 @@ TWO52[2]={
3389 else return x; /* x is integral */
3391 INSERT_WORDS64(x,i0);
3392 - feholdexcept (&env);
3393 + libc_feholdexcept (&env);
3394 double w = TWO52[sx]+x;
3395 double t = w-TWO52[sx];
3397 + math_opt_barrier (t);
3398 + libc_fesetenv (&env);
3401 weak_alias (__nearbyint, nearbyint)
3402 diff -Nrup a/sysdeps/ieee754/flt-32/e_exp2f.c b/sysdeps/ieee754/flt-32/e_exp2f.c
3403 --- a/sysdeps/ieee754/flt-32/e_exp2f.c 2010-05-04 05:27:23.000000000 -0600
3404 +++ b/sysdeps/ieee754/flt-32/e_exp2f.c 2012-08-06 09:54:00.829929661 -0600
3405 @@ -56,11 +56,7 @@ __ieee754_exp2f (float x)
3406 union ieee754_float ex2_u, scale_u;
3409 - feholdexcept (&oldenv);
3410 -#ifdef FE_TONEAREST
3411 - /* If we don't have this, it's too bad. */
3412 - fesetround (FE_TONEAREST);
3414 + libc_feholdexcept_setroundf (&oldenv, FE_TONEAREST);
3416 /* 1. Argument reduction.
3417 Choose integers ex, -128 <= t < 128, and some real
3418 @@ -103,7 +99,7 @@ __ieee754_exp2f (float x)
3419 x22 = (.24022656679f * x + .69314736128f) * ex2_u.f;
3421 /* 5. Return (2^x2-1) * 2^(t/512+e+ex) + 2^(t/512+e+ex). */
3422 - fesetenv (&oldenv);
3423 + libc_fesetenv (&oldenv);
3425 result = x22 * x + ex2_u.f;
3427 diff -Nrup a/sysdeps/ieee754/flt-32/e_expf.c b/sysdeps/ieee754/flt-32/e_expf.c
3428 --- a/sysdeps/ieee754/flt-32/e_expf.c 2010-05-04 05:27:23.000000000 -0600
3429 +++ b/sysdeps/ieee754/flt-32/e_expf.c 2012-08-06 09:54:00.829929661 -0600
3431 to perform an 'accurate table method' expf, because of the range reduction
3432 overhead (compare exp2f).
3434 -#ifndef _GNU_SOURCE
3435 -#define _GNU_SOURCE
3438 #include <ieee754.h>
3441 extern const float __exp_deltatable[178];
3442 extern const double __exp_atable[355] /* __attribute__((mode(DF))) */;
3444 -static const volatile float TWOM100 = 7.88860905e-31;
3445 -static const volatile float TWO127 = 1.7014118346e+38;
3446 +static const float TWOM100 = 7.88860905e-31;
3447 +static const float TWO127 = 1.7014118346e+38;
3450 __ieee754_expf (float x)
3451 @@ -86,10 +83,7 @@ __ieee754_expf (float x)
3452 union ieee754_double ex2_u;
3455 - feholdexcept (&oldenv);
3456 -#ifdef FE_TONEAREST
3457 - fesetround (FE_TONEAREST);
3459 + libc_feholdexcept_setroundf (&oldenv, FE_TONEAREST);
3462 n = x * M_1_LN2 + THREEp22;
3463 @@ -119,7 +113,7 @@ __ieee754_expf (float x)
3464 x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta;
3466 /* Return result. */
3467 - fesetenv (&oldenv);
3468 + libc_fesetenvf (&oldenv);
3470 result = x22 * ex2_u.d + ex2_u.d;
3471 return (float) result;
3472 diff -Nrup a/sysdeps/ieee754/flt-32/s_nearbyintf.c b/sysdeps/ieee754/flt-32/s_nearbyintf.c
3473 --- a/sysdeps/ieee754/flt-32/s_nearbyintf.c 2010-05-04 05:27:23.000000000 -0600
3474 +++ b/sysdeps/ieee754/flt-32/s_nearbyintf.c 2012-08-06 09:54:00.891929402 -0600
3477 #include "math_private.h"
3485 8.3886080000e+06, /* 0x4b000000 */
3486 -8.3886080000e+06, /* 0xcb000000 */
3490 - float __nearbyintf(float x)
3492 - float __nearbyintf(x)
3496 +__nearbyintf(float x)
3500 @@ -50,13 +42,13 @@ TWO23[2]={
3502 i0 |= ((i1|-i1)>>9)&0x400000;
3503 SET_FLOAT_WORD(x,i0);
3504 - feholdexcept (&env);
3508 + libc_feholdexceptf (&env);
3511 + libc_fesetenvf (&env);
3512 GET_FLOAT_WORD(i0,t);
3513 SET_FLOAT_WORD(t,(i0&0x7fffffff)|(sx<<31));
3517 i = (0x007fffff)>>j0;
3518 if((i0&i)==0) return x; /* x is integral */
3519 @@ -64,14 +56,14 @@ TWO23[2]={
3520 if((i0&i)!=0) i0 = (i0&(~i))|((0x100000)>>j0);
3523 - if(j0==0x80) return x+x; /* inf or NaN */
3524 + if(__builtin_expect(j0==0x80, 0)) return x+x; /* inf or NaN */
3525 else return x; /* x is integral */
3527 SET_FLOAT_WORD(x,i0);
3528 - feholdexcept (&env);
3529 + libc_feholdexceptf (&env);
3533 + libc_fesetenvf (&env);
3536 weak_alias (__nearbyintf, nearbyintf)
3537 diff -Nrup a/sysdeps/powerpc/fpu/libm-test-ulps b/sysdeps/powerpc/fpu/libm-test-ulps
3538 --- a/sysdeps/powerpc/fpu/libm-test-ulps 2010-05-04 05:27:23.000000000 -0600
3539 +++ b/sysdeps/powerpc/fpu/libm-test-ulps 2012-08-06 10:03:24.424569052 -0600
3540 @@ -37,16 +37,9 @@ ildouble: 1
3544 -Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
3549 Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
3558 Test "Real part of: casin (-2 - 3 i) == -0.57065278432109940071028387968566963 - 1.9833870299165354323470769028940395 i":
3559 @@ -84,8 +77,6 @@ ifloat: 1
3562 Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
3567 Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
3568 @@ -93,23 +84,14 @@ double: 1
3572 -Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
3577 Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
3580 -Test "Imaginary part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
3583 Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
3586 -Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
3591 Test "cbrt (-27.0) == -3.0":
3592 @@ -167,8 +149,6 @@ ldouble: 1
3595 Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
3600 Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
3601 @@ -197,9 +177,7 @@ ildouble: 1
3603 Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
3610 Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i":
3611 @@ -298,23 +276,165 @@ ldouble: 1
3613 Test "cos (M_PI_6l * 2.0) == 0.5":
3618 Test "cos (M_PI_6l * 4.0) == -0.5":
3623 -Test "cos (pi/2) == 0":
3627 +Test "cos_downward (1) == 0.5403023058681397174009366074429766037323":
3632 +Test "cos_downward (10) == -0.8390715290764524522588639478240648345199":
3635 +Test "cos_downward (2) == -0.4161468365471423869975682295007621897660":
3638 +Test "cos_downward (3) == -0.9899924966004454572715727947312613023937":
3641 +Test "cos_downward (4) == -0.6536436208636119146391681830977503814241":
3644 +Test "cos_downward (5) == 0.2836621854632262644666391715135573083344":
3647 +Test "cos_downward (6) == 0.9601702866503660205456522979229244054519":
3650 +Test "cos_downward (7) == 0.7539022543433046381411975217191820122183":
3653 +Test "cos_downward (8) == -0.1455000338086135258688413818311946826093":
3658 +Test "cos_downward (9) == -0.9111302618846769883682947111811653112463":
3663 +Test "cos_tonearest (7) == 0.7539022543433046381411975217191820122183":
3668 +Test "cos_towardzero (1) == 0.5403023058681397174009366074429766037323":
3671 +Test "cos_towardzero (10) == -0.8390715290764524522588639478240648345199":
3674 +Test "cos_towardzero (2) == -0.4161468365471423869975682295007621897660":
3677 +Test "cos_towardzero (3) == -0.9899924966004454572715727947312613023937":
3680 +Test "cos_towardzero (4) == -0.6536436208636119146391681830977503814241":
3683 +Test "cos_towardzero (5) == 0.2836621854632262644666391715135573083344":
3686 +Test "cos_towardzero (7) == 0.7539022543433046381411975217191820122183":
3689 +Test "cos_towardzero (8) == -0.1455000338086135258688413818311946826093":
3693 -Test "cos (16.0) == -0.9576594803233846418996372326511034717803"
3698 +Test "cos_upward (1) == 0.5403023058681397174009366074429766037323":
3701 +Test "cos_upward (10) == -0.8390715290764524522588639478240648345199":
3706 +Test "cos_upward (4) == -0.6536436208636119146391681830977503814241":
3709 +Test "cos_upward (5) == 0.2836621854632262644666391715135573083344":
3712 +Test "cos_upward (6) == 0.9601702866503660205456522979229244054519":
3715 +Test "cos_upward (7) == 0.7539022543433046381411975217191820122183":
3720 +Test "cos_upward (9) == -0.9111302618846769883682947111811653112463":
3725 +Test "cosh_downward (22) == 1792456423.065795780980053377632656584997":
3728 +ildouble: 5269156250720
3729 +ldouble: 5269156250720
3730 +Test "cosh_downward (23) == 4872401723.124451300068625740569997090344":
3733 +ildouble: 484603564240
3734 +ldouble: 484603564240
3735 +Test "cosh_downward (24) == 13244561064.92173614708845674912733665919":
3738 +ildouble: 89137844202
3739 +ldouble: 89137844202
3742 +Test "cosh_tonearest (22) == 1792456423.065795780980053377632656584997":
3743 +ildouble: 5269156250719
3744 +ldouble: 5269156250719
3745 +Test "cosh_tonearest (23) == 4872401723.124451300068625740569997090344":
3746 +ildouble: 484603564240
3747 +ldouble: 484603564240
3748 +Test "cosh_tonearest (24) == 13244561064.92173614708845674912733665919":
3749 +ildouble: 89137844202
3750 +ldouble: 89137844202
3753 +Test "cosh_towardzero (22) == 1792456423.065795780980053377632656584997":
3756 +ildouble: 5269156250720
3757 +ldouble: 5269156250720
3758 +Test "cosh_towardzero (23) == 4872401723.124451300068625740569997090344":
3761 +ildouble: 484603564240
3762 +ldouble: 484603564240
3763 +Test "cosh_towardzero (24) == 13244561064.92173614708845674912733665919":
3766 +ildouble: 89137844202
3767 +ldouble: 89137844202
3770 +Test "cosh_upward (22) == 1792456423.065795780980053377632656584997":
3771 +ildouble: 5269156250719
3772 +ldouble: 5269156250719
3773 +Test "cosh_upward (23) == 4872401723.124451300068625740569997090344":
3774 +ildouble: 484603564240
3775 +ldouble: 484603564240
3776 +Test "cosh_upward (24) == 13244561064.92173614708845674912733665919":
3777 +ildouble: 89137844200
3778 +ldouble: 89137844200
3781 Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
3783 @@ -386,12 +506,6 @@ float: 1
3787 -Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
3790 -Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
3793 Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
3796 @@ -463,6 +577,33 @@ Test "exp2 (10) == 1024":
3801 +Test "exp_downward (2) == e^2":
3804 +Test "exp_downward (3) == e^3":
3811 +Test "exp_towardzero (2) == e^2":
3814 +Test "exp_towardzero (3) == e^3":
3821 +Test "exp_upward (1) == e":
3828 Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
3830 @@ -505,40 +646,27 @@ ifloat: 1
3832 Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
3841 Test "j0 (10.0) == -0.245935764451348335197760862485328754":
3850 -Test "j0 (2.0) == 0.223890779141235668051827454649948626":
3853 Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1":
3862 Test "j0 (8.0) == 0.171650807137553906090869407851972001":
3869 Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
3874 Test "j1 (2.0) == 0.576724807756873387202448242269137087":
3877 @@ -551,38 +679,25 @@ ldouble: 1
3879 Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1":
3888 Test "jn (0, 10.0) == -0.245935764451348335197760862485328754":
3897 -Test "jn (0, 2.0) == 0.223890779141235668051827454649948626":
3900 Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1":
3909 Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
3914 Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883":
3919 Test "jn (1, 2.0) == 0.576724807756873387202448242269137087":
3922 @@ -615,11 +730,8 @@ ifloat: 1
3925 Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
3928 -Test "jn (3, -1.0) == -0.0195633539826684059189053216217515083":
3933 Test "jn (3, 0.125) == 0.406503832554912875023029337653442868e-4":
3936 @@ -628,21 +740,18 @@ ifloat: 1
3937 Test "jn (3, 0.75) == 0.848438342327410884392755236884386804e-2":
3940 -Test "jn (3, 1.0) == 0.0195633539826684059189053216217515083":
3943 Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563":
3952 Test "jn (3, 2.0) == 0.128943249474402051098793332969239835":
3962 @@ -675,115 +784,350 @@ Test "log1p (-0.25) == -0.28768207245178
3967 -Test "log2 (e) == M_LOG2El":
3969 +Test "pow_downward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
3974 -Test "sin (16.0) == -0.2879033166650652947844562482186175296207"
3979 -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
3984 -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
3986 +Test "pow_downward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
3990 -Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res":
3994 +Test "pow_towardzero (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
3997 +Test "pow_towardzero (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
4001 -Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
4004 +Test "pow_upward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
4009 -Test "sinh (0.75) == 0.822316731935829980703661634446913849":
4010 +Test "pow_upward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
4015 -Test "tan (pi/4) == 1":
4019 +Test "sin_downward (1) == 0.8414709848078965066525023216302989996226":
4022 +Test "sin_downward (10) == -0.5440211108893698134047476618513772816836":
4025 +Test "sin_downward (2) == 0.9092974268256816953960198659117448427023":
4030 -Test "tanh (-0.75) == -0.635148952387287319214434357312496495":
4031 +Test "sin_downward (3) == 0.1411200080598672221007448028081102798469":
4036 +Test "sin_downward (4) == -0.7568024953079282513726390945118290941359":
4039 -Test "tanh (0.75) == 0.635148952387287319214434357312496495":
4040 +Test "sin_downward (5) == -0.9589242746631384688931544061559939733525":
4043 +Test "sin_downward (6) == -0.2794154981989258728115554466118947596280":
4048 +Test "sin_downward (8) == 0.9893582466233817778081235982452886721164":
4053 -Test "tgamma (-0.5) == -2 sqrt (pi)":
4056 +Test "sin_tonearest (1) == 0.8414709848078965066525023216302989996226":
4060 -Test "tgamma (0.5) == sqrt (pi)":
4063 +Test "sin_towardzero (1) == 0.8414709848078965066525023216302989996226":
4066 -Test "tgamma (0.7) == 1.29805533264755778568117117915281162":
4070 +Test "sin_towardzero (10) == -0.5440211108893698134047476618513772816836":
4076 -Test "y0 (0.125) == -1.38968062514384052915582277745018693":
4077 +Test "sin_towardzero (2) == 0.9092974268256816953960198659117448427023":
4080 -Test "y0 (0.75) == -0.137172769385772397522814379396581855":
4081 +Test "sin_towardzero (3) == 0.1411200080598672221007448028081102798469":
4084 -Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
4086 +Test "sin_towardzero (4) == -0.7568024953079282513726390945118290941359":
4089 +Test "sin_towardzero (5) == -0.9589242746631384688931544061559939733525":
4093 +Test "sin_towardzero (8) == 0.9893582466233817778081235982452886721164":
4096 -Test "y0 (1.5) == 0.382448923797758843955068554978089862":
4098 +Test "sin_towardzero (9) == 0.4121184852417565697562725663524351793439":
4102 -Test "y0 (10.0) == 0.0556711672835993914244598774101900481":
4107 +Test "sin_upward (1) == 0.8414709848078965066525023216302989996226":
4112 +Test "sin_upward (2) == 0.9092974268256816953960198659117448427023":
4115 +Test "sin_upward (3) == 0.1411200080598672221007448028081102798469":
4118 +Test "sin_upward (4) == -0.7568024953079282513726390945118290941359":
4123 +Test "sin_upward (6) == -0.2794154981989258728115554466118947596280":
4126 +Test "sin_upward (9) == 0.4121184852417565697562725663524351793439":
4131 +Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
4134 +Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
4139 +Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
4144 +Test "sinh (0.75) == 0.822316731935829980703661634446913849":
4147 -Test "y0 (2.0) == 0.510375672649745119596606592727157873":
4150 +Test "sinh_downward (22) == 1792456423.065795780701106568345764104225":
4153 +ildouble: 5269156250718
4154 +ldouble: 5269156250718
4155 +Test "sinh_downward (23) == 4872401723.124451299966006944252978187305":
4158 +ildouble: 484603564240
4159 +ldouble: 484603564240
4160 +Test "sinh_downward (24) == 13244561064.92173614705070540368454568168":
4163 +ildouble: 89137844201
4164 +ldouble: 89137844201
4167 +Test "sinh_tonearest (22) == 1792456423.065795780701106568345764104225":
4168 +ildouble: 5269156250719
4169 +ldouble: 5269156250719
4170 +Test "sinh_tonearest (23) == 4872401723.124451299966006944252978187305":
4171 +ildouble: 484603564241
4172 +ldouble: 484603564241
4173 +Test "sinh_tonearest (24) == 13244561064.92173614705070540368454568168":
4174 +ildouble: 89137844201
4175 +ldouble: 89137844201
4178 +Test "sinh_towardzero (22) == 1792456423.065795780701106568345764104225":
4181 +ildouble: 5269156250718
4182 +ldouble: 5269156250718
4183 +Test "sinh_towardzero (23) == 4872401723.124451299966006944252978187305":
4186 +ildouble: 484603564240
4187 +ldouble: 484603564240
4188 +Test "sinh_towardzero (24) == 13244561064.92173614705070540368454568168":
4191 +ildouble: 89137844201
4192 +ldouble: 89137844201
4195 +Test "sinh_upward (22) == 1792456423.065795780701106568345764104225":
4196 +ildouble: 5269156250719
4197 +ldouble: 5269156250719
4198 +Test "sinh_upward (23) == 4872401723.124451299966006944252978187305":
4199 +ildouble: 484603564241
4200 +ldouble: 484603564241
4201 +Test "sinh_upward (24) == 13244561064.92173614705070540368454568168":
4202 +ildouble: 89137844202
4203 +ldouble: 89137844202
4206 +Test "tan (pi/4) == 1":
4211 +Test "tan_downward (1) == 1.5574077246549022305069748074583601730873":
4216 +Test "tan_downward (10) == 0.6483608274590866712591249330098086768169":
4221 +Test "tan_downward (2) == -2.1850398632615189916433061023136825434320":
4226 +Test "tan_downward (6) == -0.2910061913847491570536995888681755428312":
4231 +Test "tan_downward (8) == -6.7997114552203786999252627596086333648814":
4234 +Test "tan_downward (9) == -0.4523156594418098405903708757987855343087":
4241 +Test "tan_tonearest (10) == 0.6483608274590866712591249330098086768169":
4244 +Test "tan_tonearest (4) == 1.1578212823495775831373424182673239231198":
4247 +Test "tan_tonearest (7) == 0.8714479827243187364564508896003135663222":
4252 +Test "tan_towardzero (10) == 0.6483608274590866712591249330098086768169":
4257 +Test "tan_towardzero (3) == -0.1425465430742778052956354105339134932261":
4262 +Test "tan_towardzero (4) == 1.1578212823495775831373424182673239231198":
4267 +Test "tan_towardzero (5) == -3.3805150062465856369827058794473439087096":
4270 +Test "tan_towardzero (6) == -0.2910061913847491570536995888681755428312":
4273 +Test "tan_towardzero (7) == 0.8714479827243187364564508896003135663222":
4276 +Test "tan_towardzero (9) == -0.4523156594418098405903708757987855343087":
4283 +Test "tan_upward (10) == 0.6483608274590866712591249330098086768169":
4286 +Test "tan_upward (3) == -0.1425465430742778052956354105339134932261":
4291 +Test "tan_upward (5) == -3.3805150062465856369827058794473439087096":
4296 +Test "tan_upward (6) == -0.2910061913847491570536995888681755428312":
4299 +Test "tan_upward (7) == 0.8714479827243187364564508896003135663222":
4302 +Test "tan_upward (9) == -0.4523156594418098405903708757987855343087":
4307 +Test "tanh (-0.75) == -0.635148952387287319214434357312496495":
4310 +Test "tanh (0.75) == 0.635148952387287319214434357312496495":
4315 +Test "tgamma (-0.5) == -2 sqrt (pi)":
4319 -Test "y0 (8.0) == 0.223521489387566220527323400498620359":
4321 +Test "tgamma (0.5) == sqrt (pi)":
4324 +Test "tgamma (0.7) == 1.29805533264755778568117117915281162":
4331 +Test "y0 (0.125) == -1.38968062514384052915582277745018693":
4336 -Test "y1 (0.125) == -5.19993611253477499595928744876579921":
4337 +Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
4344 +Test "y0 (1.5) == 0.382448923797758843955068554978089862":
4349 +Test "y0 (10.0) == 0.0556711672835993914244598774101900481":
4354 +Test "y0 (2.0) == 0.510375672649745119596606592727157873":
4357 -Test "y1 (1.5) == -0.412308626973911295952829820633445323":
4358 +Test "y0 (8.0) == 0.223521489387566220527323400498620359":
4367 Test "y1 (10.0) == 0.249015424206953883923283474663222803":
4370 @@ -794,30 +1138,27 @@ ldouble: 2
4371 Test "y1 (2.0) == -0.107032431540937546888370772277476637":
4378 Test "y1 (8.0) == -0.158060461731247494255555266187483550":
4389 Test "yn (0, 0.125) == -1.38968062514384052915582277745018693":
4392 -Test "yn (0, 0.75) == -0.137172769385772397522814379396581855":
4395 Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628":
4404 Test "yn (0, 1.5) == 0.382448923797758843955068554978089862":
4407 @@ -828,8 +1169,6 @@ double: 1
4413 Test "yn (0, 2.0) == 0.510375672649745119596606592727157873":
4416 @@ -838,14 +1177,8 @@ double: 1
4422 -Test "yn (1, 0.125) == -5.19993611253477499595928744876579921":
4425 -Test "yn (1, 1.5) == -0.412308626973911295952829820633445323":
4430 Test "yn (1, 10.0) == 0.249015424206953883923283474663222803":
4433 @@ -863,14 +1196,8 @@ double: 1
4439 -Test "yn (3, 0.125) == -2612.69757350066712600220955744091741":
4442 -Test "yn (10, 0.125) == -127057845771019398.252538486899753195":
4447 Test "yn (10, 0.75) == -2133501638.90573424452445412893839236":
4450 @@ -881,21 +1208,14 @@ float: 2
4452 Test "yn (10, 10.0) == -0.359814152183402722051986577343560609":
4459 Test "yn (10, 2.0) == -129184.542208039282635913145923304214":
4466 -Test "yn (3, 0.125) == -2612.69757350066712600220955744091741":
4471 Test "yn (3, 0.75) == -12.9877176234475433186319774484809207":
4474 @@ -904,8 +1224,8 @@ double: 1
4482 Test "yn (3, 2.0) == -1.12778377684042778608158395773179238":
4485 @@ -950,18 +1270,12 @@ ildouble: 1
4488 Function: Real part of "cacosh":
4496 Function: Imaginary part of "cacosh":
4504 Function: Real part of "casin":
4506 @@ -992,8 +1306,6 @@ ildouble: 1
4509 Function: Real part of "catan":
4515 @@ -1009,10 +1321,6 @@ Function: Real part of "catanh":
4519 -Function: Imaginary part of "catanh":
4526 @@ -1066,8 +1374,6 @@ ildouble: 2
4529 Function: Imaginary part of "clog":
4535 @@ -1079,9 +1385,9 @@ ldouble: 3
4537 Function: Imaginary part of "clog10":
4547 @@ -1093,10 +1399,54 @@ ifloat: 1
4551 +Function: "cos_downward":
4557 +Function: "cos_tonearest":
4563 +Function: "cos_towardzero":
4569 +Function: "cos_upward":
4579 +Function: "cosh_downward":
4582 +ildouble: 5269156250720
4583 +ldouble: 5269156250720
4585 +Function: "cosh_tonearest":
4586 +ildouble: 5269156250719
4587 +ldouble: 5269156250719
4589 +Function: "cosh_towardzero":
4592 +ildouble: 5269156250720
4593 +ldouble: 5269156250720
4595 +Function: "cosh_upward":
4596 +ildouble: 5269156250719
4597 +ldouble: 5269156250719
4599 Function: Real part of "cpow":
4602 @@ -1113,10 +1463,6 @@ ifloat: 2
4606 -Function: Imaginary part of "cproj":
4610 Function: Real part of "csin":
4613 @@ -1146,8 +1492,6 @@ ildouble: 1
4616 Function: Real part of "ctan":
4622 @@ -1201,6 +1545,28 @@ Function: "exp2":
4626 +Function: "exp_downward":
4632 +Function: "exp_tonearest":
4636 +Function: "exp_towardzero":
4642 +Function: "exp_upward":
4651 @@ -1218,10 +1584,10 @@ ildouble: 1
4666 @@ -1235,9 +1601,9 @@ ldouble: 1
4678 @@ -1264,8 +1630,6 @@ ldouble: 1
4687 @@ -1275,10 +1639,52 @@ Function: "pow":
4691 +Function: "pow_downward":
4697 +Function: "pow_towardzero":
4703 +Function: "pow_upward":
4713 +Function: "sin_downward":
4719 +Function: "sin_tonearest":
4725 +Function: "sin_towardzero":
4731 +Function: "sin_upward":
4740 @@ -1291,12 +1697,54 @@ Function: "sinh":
4744 +Function: "sinh_downward":
4747 +ildouble: 5269156250718
4748 +ldouble: 5269156250718
4750 +Function: "sinh_tonearest":
4751 +ildouble: 5269156250719
4752 +ldouble: 5269156250719
4754 +Function: "sinh_towardzero":
4757 +ildouble: 5269156250718
4758 +ldouble: 5269156250718
4760 +Function: "sinh_upward":
4761 +ildouble: 5269156250719
4762 +ldouble: 5269156250719
4770 +Function: "tan_downward":
4776 +Function: "tan_tonearest":
4780 +Function: "tan_towardzero":
4786 +Function: "tan_upward":
4795 diff -Nrup a/sysdeps/s390/fpu/libm-test-ulps b/sysdeps/s390/fpu/libm-test-ulps
4796 --- a/sysdeps/s390/fpu/libm-test-ulps 2010-05-04 05:27:23.000000000 -0600
4797 +++ b/sysdeps/s390/fpu/libm-test-ulps 2012-08-06 09:54:38.324772546 -0600
4798 @@ -31,16 +31,9 @@ ildouble: 1
4802 -Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
4807 Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
4817 @@ -83,17 +76,11 @@ ildouble: 1
4821 -Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
4824 Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
4829 -Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
4832 Test "Imaginary part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
4835 @@ -102,17 +89,12 @@ ldouble: 1
4836 Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
4839 -Test "Imaginary part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
4842 Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
4847 Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
4853 @@ -185,9 +167,6 @@ ildouble: 1
4857 -Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
4860 Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
4863 @@ -210,9 +189,7 @@ ildouble: 1
4865 Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
4872 Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i":
4873 @@ -288,9 +265,7 @@ ifloat: 1
4875 Test "cos (M_PI_6l * 2.0) == 0.5":
4882 Test "cos (M_PI_6l * 4.0) == -0.5":
4883 @@ -300,11 +275,159 @@ idouble: 2
4887 -Test "cos (pi/2) == 0":
4891 +Test "cos_downward (1) == 0.5403023058681397174009366074429766037323":
4896 +Test "cos_downward (10) == -0.8390715290764524522588639478240648345199":
4899 +Test "cos_downward (2) == -0.4161468365471423869975682295007621897660":
4904 +Test "cos_downward (3) == -0.9899924966004454572715727947312613023937":
4909 +Test "cos_downward (4) == -0.6536436208636119146391681830977503814241":
4914 +Test "cos_downward (5) == 0.2836621854632262644666391715135573083344":
4919 +Test "cos_downward (6) == 0.9601702866503660205456522979229244054519":
4922 +Test "cos_downward (7) == 0.7539022543433046381411975217191820122183":
4927 +Test "cos_downward (8) == -0.1455000338086135258688413818311946826093":
4934 +Test "cos_tonearest (7) == 0.7539022543433046381411975217191820122183":
4939 +Test "cos_towardzero (1) == 0.5403023058681397174009366074429766037323":
4942 +Test "cos_towardzero (10) == -0.8390715290764524522588639478240648345199":
4945 +Test "cos_towardzero (2) == -0.4161468365471423869975682295007621897660":
4950 +Test "cos_towardzero (3) == -0.9899924966004454572715727947312613023937":
4955 +Test "cos_towardzero (4) == -0.6536436208636119146391681830977503814241":
4958 +Test "cos_towardzero (5) == 0.2836621854632262644666391715135573083344":
4963 +Test "cos_towardzero (6) == 0.9601702866503660205456522979229244054519":
4966 +Test "cos_towardzero (7) == 0.7539022543433046381411975217191820122183":
4971 +Test "cos_towardzero (8) == -0.1455000338086135258688413818311946826093":
4978 +Test "cos_upward (10) == -0.8390715290764524522588639478240648345199":
4981 +Test "cos_upward (6) == 0.9601702866503660205456522979229244054519":
4984 +Test "cos_upward (7) == 0.7539022543433046381411975217191820122183":
4987 +Test "cos_upward (9) == -0.9111302618846769883682947111811653112463":
4994 +Test "cosh_downward (22) == 1792456423.065795780980053377632656584997":
4999 +Test "cosh_downward (23) == 4872401723.124451300068625740569997090344":
5004 +Test "cosh_downward (24) == 13244561064.92173614708845674912733665919":
5011 +Test "cosh_tonearest (22) == 1792456423.065795780980053377632656584997":
5016 +Test "cosh_towardzero (22) == 1792456423.065795780980053377632656584997":
5021 +Test "cosh_towardzero (23) == 4872401723.124451300068625740569997090344":
5026 +Test "cosh_towardzero (24) == 13244561064.92173614708845674912733665919":
5034 +Test "cosh_upward (22) == 1792456423.065795780980053377632656584997":
5037 +Test "cosh_upward (23) == 4872401723.124451300068625740569997090344":
5040 +Test "cosh_upward (24) == 13244561064.92173614708845674912733665919":
5045 Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
5046 @@ -393,8 +516,6 @@ ldouble: 1
5049 Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
5054 Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
5055 @@ -467,6 +588,37 @@ Test "exp2 (10) == 1024":
5060 +Test "exp_downward (2) == e^2":
5065 +Test "exp_downward (3) == e^3":
5072 +Test "exp_towardzero (2) == e^2":
5077 +Test "exp_towardzero (3) == e^3":
5084 +Test "exp_upward (1) == e":
5091 Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
5093 @@ -513,29 +665,27 @@ ifloat: 1
5095 Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
5102 Test "j0 (0.75) == 0.864242275166648623555731103820923211":
5105 Test "j0 (10.0) == -0.245935764451348335197760862485328754":
5114 Test "j0 (2.0) == 0.223890779141235668051827454649948626":
5119 Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1":
5126 Test "j0 (8.0) == 0.171650807137553906090869407851972001":
5129 @@ -569,29 +719,27 @@ ldouble: 4
5131 Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1":
5138 Test "jn (0, 0.75) == 0.864242275166648623555731103820923211":
5141 Test "jn (0, 10.0) == -0.245935764451348335197760862485328754":
5150 Test "jn (0, 2.0) == 0.223890779141235668051827454649948626":
5155 Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1":
5162 Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
5165 @@ -640,15 +788,13 @@ Test "jn (10, 1.0) == 0.2630615123687453
5168 Test "jn (10, 10.0) == 0.207486106633358857697278723518753428":
5177 Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
5182 Test "jn (3, 0.125) == 0.406503832554912875023029337653442868e-4":
5185 @@ -661,16 +807,16 @@ idouble: 1
5187 Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563":
5196 Test "jn (3, 2.0) == 0.128943249474402051098793332969239835":
5205 Test "lgamma (-0.5) == log(2*sqrt(pi))":
5206 @@ -713,71 +859,315 @@ Test "log2 (0.75) == -.41503749927884381
5211 -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
5214 +Test "pow_downward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
5220 -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
5224 +Test "pow_towardzero (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
5229 +Test "pow_upward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
5235 -Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res":
5239 +Test "sin_downward (1) == 0.8414709848078965066525023216302989996226":
5242 +Test "sin_downward (10) == -0.5440211108893698134047476618513772816836":
5246 -Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
5247 +Test "sin_downward (2) == 0.9092974268256816953960198659117448427023":
5250 +Test "sin_downward (3) == 0.1411200080598672221007448028081102798469":
5255 -Test "sqrt (2) == M_SQRT2l":
5260 -Test "tan (pi/4) == 1":
5265 -Test "tanh (-0.75) == -0.635148952387287319214434357312496495":
5266 +Test "sin_downward (4) == -0.7568024953079282513726390945118290941359":
5269 -Test "tanh (-1.0) == -0.7615941559557648881194582826047935904":
5270 +Test "sin_downward (5) == -0.9589242746631384688931544061559939733525":
5275 -Test "tanh (0.75) == 0.635148952387287319214434357312496495":
5276 +Test "sin_downward (6) == -0.2794154981989258728115554466118947596280":
5281 -Test "tanh (1.0) == 0.7615941559557648881194582826047935904":
5282 +Test "sin_downward (8) == 0.9893582466233817778081235982452886721164":
5287 -Test "tgamma (-0.5) == -2 sqrt (pi)":
5290 +Test "sin_tonearest (1) == 0.8414709848078965066525023216302989996226":
5296 -Test "tgamma (0.5) == sqrt (pi)":
5297 +Test "sin_tonearest (3) == 0.1411200080598672221007448028081102798469":
5300 +Test "sin_tonearest (6) == -0.2794154981989258728115554466118947596280":
5303 +Test "sin_tonearest (9) == 0.4121184852417565697562725663524351793439":
5308 +Test "sin_towardzero (1) == 0.8414709848078965066525023216302989996226":
5311 -Test "tgamma (0.7) == 1.29805533264755778568117117915281162":
5313 +Test "sin_towardzero (10) == -0.5440211108893698134047476618513772816836":
5317 -Test "tgamma (4) == 6":
5318 +Test "sin_towardzero (2) == 0.9092974268256816953960198659117448427023":
5321 +Test "sin_towardzero (3) == 0.1411200080598672221007448028081102798469":
5324 +Test "sin_towardzero (4) == -0.7568024953079282513726390945118290941359":
5327 +Test "sin_towardzero (5) == -0.9589242746631384688931544061559939733525":
5332 +Test "sin_towardzero (6) == -0.2794154981989258728115554466118947596280":
5335 +Test "sin_towardzero (8) == 0.9893582466233817778081235982452886721164":
5338 +Test "sin_towardzero (9) == 0.4121184852417565697562725663524351793439":
5345 +Test "sin_upward (1) == 0.8414709848078965066525023216302989996226":
5350 +Test "sin_upward (10) == -0.5440211108893698134047476618513772816836":
5353 +Test "sin_upward (2) == 0.9092974268256816953960198659117448427023":
5356 +Test "sin_upward (3) == 0.1411200080598672221007448028081102798469":
5359 +Test "sin_upward (4) == -0.7568024953079282513726390945118290941359":
5364 +Test "sin_upward (7) == 0.6569865987187890903969990915936351779369":
5367 +Test "sin_upward (9) == 0.4121184852417565697562725663524351793439":
5374 +Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
5379 +Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
5386 +Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
5391 +Test "sinh_downward (22) == 1792456423.065795780701106568345764104225":
5396 +Test "sinh_downward (23) == 4872401723.124451299966006944252978187305":
5401 +Test "sinh_downward (24) == 13244561064.92173614705070540368454568168":
5408 +Test "sinh_towardzero (22) == 1792456423.065795780701106568345764104225":
5413 +Test "sinh_towardzero (23) == 4872401723.124451299966006944252978187305":
5418 +Test "sinh_towardzero (24) == 13244561064.92173614705070540368454568168":
5423 +Test "sinh_upward (22) == 1792456423.065795780701106568345764104225":
5426 +Test "sinh_upward (23) == 4872401723.124451299966006944252978187305":
5429 +Test "sinh_upward (24) == 13244561064.92173614705070540368454568168":
5434 +Test "sqrt (2) == M_SQRT2l":
5439 +Test "tan_downward (1) == 1.5574077246549022305069748074583601730873":
5444 +Test "tan_downward (10) == 0.6483608274590866712591249330098086768169":
5447 +Test "tan_downward (2) == -2.1850398632615189916433061023136825434320":
5452 +Test "tan_downward (6) == -0.2910061913847491570536995888681755428312":
5455 +Test "tan_downward (8) == -6.7997114552203786999252627596086333648814":
5460 +Test "tan_downward (9) == -0.4523156594418098405903708757987855343087":
5465 +Test "tan_towardzero (10) == 0.6483608274590866712591249330098086768169":
5468 +Test "tan_towardzero (3) == -0.1425465430742778052956354105339134932261":
5473 +Test "tan_towardzero (4) == 1.1578212823495775831373424182673239231198":
5478 +Test "tan_towardzero (5) == -3.3805150062465856369827058794473439087096":
5483 +Test "tan_towardzero (6) == -0.2910061913847491570536995888681755428312":
5486 +Test "tan_towardzero (9) == -0.4523156594418098405903708757987855343087":
5493 +Test "tan_upward (1) == 1.5574077246549022305069748074583601730873":
5496 +Test "tan_upward (10) == 0.6483608274590866712591249330098086768169":
5501 +Test "tan_upward (2) == -2.1850398632615189916433061023136825434320":
5504 +Test "tan_upward (3) == -0.1425465430742778052956354105339134932261":
5509 +Test "tan_upward (4) == 1.1578212823495775831373424182673239231198":
5512 +Test "tan_upward (5) == -3.3805150062465856369827058794473439087096":
5517 +Test "tan_upward (6) == -0.2910061913847491570536995888681755428312":
5520 +Test "tan_upward (9) == -0.4523156594418098405903708757987855343087":
5525 +Test "tanh (-0.75) == -0.635148952387287319214434357312496495":
5528 +Test "tanh (-1.0) == -0.7615941559557648881194582826047935904":
5531 +Test "tanh (0.75) == 0.635148952387287319214434357312496495":
5534 +Test "tanh (1.0) == 0.7615941559557648881194582826047935904":
5539 +Test "tgamma (-0.5) == -2 sqrt (pi)":
5546 +Test "tgamma (0.5) == sqrt (pi)":
5549 +Test "tgamma (0.7) == 1.29805533264755778568117117915281162":
5554 +Test "tgamma (4) == 6":
5558 @@ -917,17 +1307,13 @@ ifloat: 2
5561 Test "yn (10, 1.0) == -121618014.278689189288130426667971145":
5568 Test "yn (10, 10.0) == -0.359814152183402722051986577343560609":
5575 Test "yn (10, 2.0) == -129184.542208039282635913145923304214":
5576 @@ -941,9 +1327,7 @@ Test "yn (3, 0.125) == -2612.69757350066
5579 Test "yn (3, 0.75) == -12.9877176234475433186319774484809207":
5586 @@ -973,17 +1357,9 @@ Function: Imaginary part of "cacos":
5590 -Function: Real part of "cacosh":
5596 Function: Imaginary part of "cacosh":
5606 @@ -1013,10 +1389,6 @@ ifloat: 6
5610 -Function: Real part of "catan":
5614 Function: Imaginary part of "catan":
5617 @@ -1032,8 +1404,6 @@ ildouble: 1
5620 Function: Imaginary part of "catanh":
5626 @@ -1089,10 +1459,6 @@ ifloat: 1
5630 -Function: Imaginary part of "clog":
5634 Function: Real part of "clog10":
5637 @@ -1101,9 +1467,9 @@ ldouble: 1
5639 Function: Imaginary part of "clog10":
5649 @@ -1115,6 +1481,48 @@ ifloat: 1
5653 +Function: "cos_downward":
5659 +Function: "cos_tonearest":
5663 +Function: "cos_towardzero":
5669 +Function: "cos_upward":
5675 +Function: "cosh_downward":
5681 +Function: "cosh_tonearest":
5685 +Function: "cosh_towardzero":
5691 +Function: "cosh_upward":
5695 Function: Real part of "cpow":
5698 @@ -1162,8 +1570,6 @@ ildouble: 1
5701 Function: Real part of "ctan":
5707 @@ -1211,6 +1617,24 @@ Function: "exp2":
5711 +Function: "exp_downward":
5717 +Function: "exp_towardzero":
5723 +Function: "exp_upward":
5732 @@ -1228,10 +1652,10 @@ float: 1
5747 @@ -1244,10 +1668,10 @@ ildouble: 4
5762 @@ -1277,6 +1701,44 @@ Function: "log2":
5766 +Function: "pow_downward":
5770 +Function: "pow_towardzero":
5774 +Function: "pow_upward":
5780 +Function: "sin_downward":
5786 +Function: "sin_tonearest":
5792 +Function: "sin_towardzero":
5798 +Function: "sin_upward":
5807 @@ -1285,6 +1747,22 @@ ifloat: 1
5811 +Function: "sinh_downward":
5817 +Function: "sinh_towardzero":
5823 +Function: "sinh_upward":
5830 @@ -1293,6 +1771,24 @@ Function: "tan":
5834 +Function: "tan_downward":
5840 +Function: "tan_towardzero":
5846 +Function: "tan_upward":
5855 diff -Nrup a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps
5856 --- a/sysdeps/x86_64/fpu/libm-test-ulps 2010-05-04 05:27:23.000000000 -0600
5857 +++ b/sysdeps/x86_64/fpu/libm-test-ulps 2012-08-06 11:02:14.602759422 -0600
5858 @@ -42,26 +42,13 @@ ldouble: 1
5861 Test "Imaginary part of: cacos (0.75 + 1.25 i) == 1.11752014915610270578240049553777969 - 1.13239363160530819522266333696834467 i":
5868 -Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
5875 Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
5884 Test "Real part of: cacosh (0.75 + 1.25 i) == 1.13239363160530819522266333696834467 + 1.11752014915610270578240049553777969 i":
5887 @@ -75,8 +62,6 @@ ifloat: 1
5890 Test "Imaginary part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
5896 @@ -103,21 +88,15 @@ double: 1
5905 -Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
5908 Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
5913 -Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
5918 Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
5919 @@ -125,15 +104,9 @@ double: 4
5923 -Test "Imaginary part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
5926 Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
5929 -Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
5934 Test "cbrt (-0.001) == -0.1":
5935 @@ -152,14 +125,9 @@ ildouble: 1
5939 -Test "Real part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
5942 Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
5947 Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
5950 @@ -168,19 +136,17 @@ ifloat: 1
5953 Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
5962 Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
5965 Test "Imaginary part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
5972 @@ -205,9 +171,6 @@ ildouble: 1
5976 -Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
5979 Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
5982 @@ -227,11 +190,7 @@ idouble: 1
5984 Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
5991 Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i":
5994 @@ -276,9 +235,7 @@ float: 1
5997 Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
6004 @@ -306,33 +263,164 @@ ifloat: 1
6006 Test "cos (M_PI_6l * 2.0) == 0.5":
6011 Test "cos (M_PI_6l * 4.0) == -0.5":
6018 +Test "cos_downward (1) == 0.5403023058681397174009366074429766037323":
6023 -Test "cos (pi/2) == 0":
6025 +Test "cos_downward (2) == -0.4161468365471423869975682295007621897660":
6028 +Test "cos_downward (3) == -0.9899924966004454572715727947312613023937":
6031 +Test "cos_downward (4) == -0.6536436208636119146391681830977503814241":
6037 -Test "cos (0.80190127184058835) == 0.69534156199418473":
6040 +Test "cos_downward (5) == 0.2836621854632262644666391715135573083344":
6043 +Test "cos_downward (7) == 0.7539022543433046381411975217191820122183":
6048 +Test "cos_downward (8) == -0.1455000338086135258688413818311946826093":
6053 +Test "cos_downward (9) == -0.9111302618846769883682947111811653112463":
6058 +Test "cos_tonearest (7) == 0.7539022543433046381411975217191820122183":
6061 +Test "cos_tonearest (8) == -0.1455000338086135258688413818311946826093":
6064 +Test "cos_tonearest (9) == -0.9111302618846769883682947111811653112463":
6069 +Test "cos_towardzero (1) == 0.5403023058681397174009366074429766037323":
6072 +Test "cos_towardzero (10) == -0.8390715290764524522588639478240648345199":
6075 +Test "cos_towardzero (2) == -0.4161468365471423869975682295007621897660":
6080 +Test "cos_towardzero (3) == -0.9899924966004454572715727947312613023937":
6085 +Test "cos_towardzero (5) == 0.2836621854632262644666391715135573083344":
6088 +Test "cos_towardzero (7) == 0.7539022543433046381411975217191820122183":
6093 +Test "cos_towardzero (8) == -0.1455000338086135258688413818311946826093":
6098 +Test "cos_upward (10) == -0.8390715290764524522588639478240648345199":
6103 +Test "cos_upward (2) == -0.4161468365471423869975682295007621897660":
6106 +Test "cos_upward (3) == -0.9899924966004454572715727947312613023937":
6109 +Test "cos_upward (5) == 0.2836621854632262644666391715135573083344":
6112 +Test "cos_upward (6) == 0.9601702866503660205456522979229244054519":
6117 +Test "cos_upward (7) == 0.7539022543433046381411975217191820122183":
6120 +Test "cos_upward (9) == -0.9111302618846769883682947111811653112463":
6125 +Test "cosh_downward (22) == 1792456423.065795780980053377632656584997":
6130 +Test "cosh_downward (23) == 4872401723.124451300068625740569997090344":
6135 +Test "cosh_downward (24) == 13244561064.92173614708845674912733665919":
6142 +Test "cosh_tonearest (22) == 1792456423.065795780980053377632656584997":
6147 +Test "cosh_towardzero (22) == 1792456423.065795780980053377632656584997":
6152 +Test "cosh_towardzero (23) == 4872401723.124451300068625740569997090344":
6157 +Test "cosh_towardzero (24) == 13244561064.92173614708845674912733665919":
6164 +Test "cosh_upward (23) == 4872401723.124451300068625740569997090344":
6169 Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
6175 Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
6178 @@ -363,9 +451,9 @@ ildouble: 1
6180 Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
6187 Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
6190 @@ -383,22 +471,11 @@ ldouble: 1
6191 Test "Real part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
6194 -Test "Imaginary part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
6197 -Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
6202 -Test "Real part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
6205 Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
6210 Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
6213 @@ -418,37 +495,31 @@ ifloat: 1
6216 Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
6223 Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
6230 Test "Real part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
6233 Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
6242 Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
6253 Test "Imaginary part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
6258 Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i":
6261 @@ -456,10 +527,10 @@ Test "Real part of: ctanh (0.75 + 1.25 i
6264 Test "Imaginary part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i":
6273 Test "erf (1.25) == 0.922900128256458230136523481197281140":
6274 @@ -481,26 +552,61 @@ ldouble: 1
6277 Test "exp10 (-1) == 0.1":
6284 -Test "exp10 (0.75) == 5.62341325190349080394951039776481231":
6292 +Test "exp10 (0.75) == 5.62341325190349080394951039776481231":
6299 Test "exp10 (3) == 1000":
6312 +Test "exp_downward (1) == e":
6315 +Test "exp_downward (2) == e^2":
6320 +Test "exp_downward (3) == e^3":
6327 +Test "exp_towardzero (1) == e":
6330 +Test "exp_towardzero (2) == e^2":
6335 +Test "exp_towardzero (3) == e^3":
6342 +Test "exp_upward (1) == e":
6347 Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
6348 @@ -570,9 +676,7 @@ ifloat: 1
6351 Test "j0 (8.0) == 0.171650807137553906090869407851972001":
6358 @@ -617,9 +721,7 @@ ifloat: 1
6361 Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
6366 Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883":
6368 @@ -714,12 +816,12 @@ ldouble: 1
6371 Test "log10 (0.75) == -0.124938736608299953132449886193870744":
6382 Test "log10 (e) == log10(e)":
6385 @@ -731,37 +833,309 @@ Test "log1p (-0.25) == -0.28768207245178
6390 -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
6395 -Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
6401 +Test "pow_downward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
6404 -Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res":
6406 +Test "pow_downward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
6412 -Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
6415 +Test "pow_towardzero (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
6418 +Test "pow_towardzero (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
6425 +Test "pow_upward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
6430 +Test "pow_upward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
6435 +Test "sin_downward (1) == 0.8414709848078965066525023216302989996226":
6438 +Test "sin_downward (10) == -0.5440211108893698134047476618513772816836":
6443 +Test "sin_downward (3) == 0.1411200080598672221007448028081102798469":
6448 +Test "sin_downward (4) == -0.7568024953079282513726390945118290941359":
6451 +Test "sin_downward (5) == -0.9589242746631384688931544061559939733525":
6456 +Test "sin_downward (6) == -0.2794154981989258728115554466118947596280":
6459 +Test "sin_downward (7) == 0.6569865987187890903969990915936351779369":
6462 +Test "sin_downward (8) == 0.9893582466233817778081235982452886721164":
6465 +Test "sin_downward (9) == 0.4121184852417565697562725663524351793439":
6470 +Test "sin_tonearest (1) == 0.8414709848078965066525023216302989996226":
6473 +Test "sin_tonearest (10) == -0.5440211108893698134047476618513772816836":
6476 +Test "sin_tonearest (4) == -0.7568024953079282513726390945118290941359":
6479 +Test "sin_tonearest (9) == 0.4121184852417565697562725663524351793439":
6484 +Test "sin_towardzero (1) == 0.8414709848078965066525023216302989996226":
6487 -Test "sincos (0.80190127184058835, &sin_res, &cos_res) puts 0.69534156199418473 in cos_res":
6490 +Test "sin_towardzero (10) == -0.5440211108893698134047476618513772816836":
6493 +Test "sin_towardzero (3) == 0.1411200080598672221007448028081102798469":
6496 +Test "sin_towardzero (4) == -0.7568024953079282513726390945118290941359":
6499 +Test "sin_towardzero (5) == -0.9589242746631384688931544061559939733525":
6502 +Test "sin_towardzero (6) == -0.2794154981989258728115554466118947596280":
6505 +Test "sin_towardzero (7) == 0.6569865987187890903969990915936351779369":
6508 +Test "sin_towardzero (8) == 0.9893582466233817778081235982452886721164":
6511 +Test "sin_towardzero (9) == 0.4121184852417565697562725663524351793439":
6518 +Test "sin_upward (1) == 0.8414709848078965066525023216302989996226":
6521 +Test "sin_upward (2) == 0.9092974268256816953960198659117448427023":
6526 +Test "sin_upward (4) == -0.7568024953079282513726390945118290941359":
6529 +Test "sin_upward (6) == -0.2794154981989258728115554466118947596280":
6532 +Test "sin_upward (9) == 0.4121184852417565697562725663524351793439":
6537 +Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
6542 -Test "tan (pi/4) == 1":
6543 +Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
6550 +Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
6555 +Test "sinh_downward (22) == 1792456423.065795780701106568345764104225":
6560 +Test "sinh_downward (23) == 4872401723.124451299966006944252978187305":
6563 +Test "sinh_downward (24) == 13244561064.92173614705070540368454568168":
6570 +Test "sinh_tonearest (22) == 1792456423.065795780701106568345764104225":
6573 +Test "sinh_tonearest (23) == 4872401723.124451299966006944252978187305":
6576 +Test "sinh_tonearest (24) == 13244561064.92173614705070540368454568168":
6581 +Test "sinh_towardzero (22) == 1792456423.065795780701106568345764104225":
6586 +Test "sinh_towardzero (23) == 4872401723.124451299966006944252978187305":
6589 +Test "sinh_towardzero (24) == 13244561064.92173614705070540368454568168":
6596 +Test "sinh_upward (22) == 1792456423.065795780701106568345764104225":
6599 +Test "sinh_upward (23) == 4872401723.124451299966006944252978187305":
6602 +Test "sinh_upward (24) == 13244561064.92173614705070540368454568168":
6607 +Test "tan_downward (1) == 1.5574077246549022305069748074583601730873":
6610 +Test "tan_downward (10) == 0.6483608274590866712591249330098086768169":
6613 +Test "tan_downward (2) == -2.1850398632615189916433061023136825434320":
6616 +Test "tan_downward (4) == 1.1578212823495775831373424182673239231198":
6619 +Test "tan_downward (5) == -3.3805150062465856369827058794473439087096":
6622 +Test "tan_downward (6) == -0.2910061913847491570536995888681755428312":
6625 +Test "tan_downward (8) == -6.7997114552203786999252627596086333648814":
6630 +Test "tan_downward (9) == -0.4523156594418098405903708757987855343087":
6635 +Test "tan_tonearest (6) == -0.2910061913847491570536995888681755428312":
6638 +Test "tan_tonearest (8) == -6.7997114552203786999252627596086333648814":
6641 +Test "tan_tonearest (9) == -0.4523156594418098405903708757987855343087":
6646 +Test "tan_towardzero (10) == 0.6483608274590866712591249330098086768169":
6649 +Test "tan_towardzero (2) == -2.1850398632615189916433061023136825434320":
6652 +Test "tan_towardzero (3) == -0.1425465430742778052956354105339134932261":
6657 +Test "tan_towardzero (4) == 1.1578212823495775831373424182673239231198":
6662 +Test "tan_towardzero (5) == -3.3805150062465856369827058794473439087096":
6665 +Test "tan_towardzero (6) == -0.2910061913847491570536995888681755428312":
6668 +Test "tan_towardzero (8) == -6.7997114552203786999252627596086333648814":
6671 +Test "tan_towardzero (9) == -0.4523156594418098405903708757987855343087":
6678 +Test "tan_upward (1) == 1.5574077246549022305069748074583601730873":
6683 +Test "tan_upward (10) == 0.6483608274590866712591249330098086768169":
6688 +Test "tan_upward (2) == -2.1850398632615189916433061023136825434320":
6691 +Test "tan_upward (3) == -0.1425465430742778052956354105339134932261":
6696 +Test "tan_upward (5) == -3.3805150062465856369827058794473439087096":
6699 +Test "tan_upward (6) == -0.2910061913847491570536995888681755428312":
6702 +Test "tan_upward (7) == 0.8714479827243187364564508896003135663222":
6705 +Test "tan_upward (8) == -6.7997114552203786999252627596086333648814":
6708 +Test "tan_upward (9) == -0.4523156594418098405903708757987855343087":
6713 Test "tgamma (-0.5) == -2 sqrt (pi)":
6714 @@ -779,9 +1153,6 @@ double: 1
6718 -Test "tgamma (4) == 6":
6723 Test "y0 (0.125) == -1.38968062514384052915582277745018693":
6724 @@ -960,27 +1331,17 @@ ildouble: 1
6727 Function: Imaginary part of "cacos":
6733 Function: Real part of "cacosh":
6741 -Function: Imaginary part of "cacosh":
6749 +Function: Imaginary part of "cacosh":
6753 Function: Real part of "casin":
6756 @@ -990,8 +1351,6 @@ ildouble: 2
6759 Function: Imaginary part of "casin":
6765 @@ -1011,10 +1370,6 @@ ifloat: 6
6769 -Function: Real part of "catan":
6773 Function: Imaginary part of "catan":
6776 @@ -1027,10 +1382,6 @@ idouble: 4
6780 -Function: Imaginary part of "catanh":
6787 @@ -1058,9 +1409,7 @@ idouble: 1
6790 Function: Imaginary part of "ccosh":
6797 @@ -1081,25 +1430,17 @@ ifloat: 1
6801 -Function: Imaginary part of "clog":
6805 Function: Real part of "clog10":
6813 Function: Imaginary part of "clog10":
6825 @@ -1109,11 +1450,55 @@ ifloat: 1
6829 +Function: "cos_downward":
6835 +Function: "cos_tonearest":
6841 +Function: "cos_towardzero":
6847 +Function: "cos_upward":
6853 +Function: "cosh_downward":
6859 +Function: "cosh_tonearest":
6863 +Function: "cosh_towardzero":
6869 +Function: "cosh_upward":
6873 Function: Real part of "cpow":
6883 @@ -1129,16 +1514,8 @@ Function: Real part of "csin":
6887 -Function: Imaginary part of "csin":
6893 Function: Real part of "csinh":
6900 @@ -1148,24 +1525,18 @@ double: 1
6907 Function: Real part of "csqrt":
6911 Function: Real part of "ctan":
6919 Function: Imaginary part of "ctan":
6927 @@ -1174,16 +1545,16 @@ double: 1
6936 Function: Imaginary part of "ctanh":
6950 @@ -1196,12 +1567,28 @@ ildouble: 1
6965 +Function: "exp_downward":
6971 +Function: "exp_towardzero":
6977 +Function: "exp_upward":
6983 @@ -1250,17 +1637,59 @@ ildouble: 1
7000 +Function: "pow_downward":
7006 +Function: "pow_towardzero":
7012 +Function: "pow_upward":
7018 +Function: "sin_downward":
7024 +Function: "sin_tonearest":
7030 +Function: "sin_towardzero":
7036 +Function: "sin_upward":
7045 @@ -1269,10 +1698,52 @@ ifloat: 1
7049 +Function: "sinh_downward":
7055 +Function: "sinh_tonearest":
7059 +Function: "sinh_towardzero":
7065 +Function: "sinh_upward":
7073 +Function: "tan_downward":
7079 +Function: "tan_tonearest":
7083 +Function: "tan_towardzero":
7089 +Function: "tan_upward":
7098 diff -Nrup a/sysdeps/x86_64/fpu/math_private.h b/sysdeps/x86_64/fpu/math_private.h
7099 --- a/sysdeps/x86_64/fpu/math_private.h 2010-05-04 05:27:23.000000000 -0600
7100 +++ b/sysdeps/x86_64/fpu/math_private.h 2012-08-06 09:54:00.893929393 -0600
7101 @@ -56,3 +56,82 @@ do { \
7107 +/* Specialized variants of the <fenv.h> interfaces which only handle
7108 + either the FPU or the SSE unit. */
7109 +#undef libc_fegetround
7110 +#define libc_fegetround() \
7112 + unsigned int mxcsr; \
7113 + asm volatile ("stmxcsr %0" : "=m" (*&mxcsr)); \
7114 + (mxcsr & 0x6000) >> 3; \
7116 +#undef libc_fegetroundf
7117 +#define libc_fegetroundf() libc_fegetround ()
7118 +// #define libc_fegetroundl() fegetround ()
7120 +#undef libc_fesetround
7121 +#define libc_fesetround(r) \
7123 + unsigned int mxcsr; \
7124 + asm ("stmxcsr %0" : "=m" (*&mxcsr)); \
7125 + mxcsr = (mxcsr & ~0x6000) | ((r) << 3); \
7126 + asm volatile ("ldmxcsr %0" : : "m" (*&mxcsr)); \
7128 +#undef libc_fesetroundf
7129 +#define libc_fesetroundf(r) libc_fesetround (r)
7130 +// #define libc_fesetroundl(r) (void) fesetround (r)
7132 +#undef libc_feholdexcept
7133 +#define libc_feholdexcept(e) \
7135 + unsigned int mxcsr; \
7136 + asm ("stmxcsr %0" : "=m" (*&mxcsr)); \
7137 + (e)->__mxcsr = mxcsr; \
7138 + mxcsr = (mxcsr | 0x1f80) & ~0x3f; \
7139 + asm volatile ("ldmxcsr %0" : : "m" (*&mxcsr)); \
7141 +#undef libc_feholdexceptf
7142 +#define libc_feholdexceptf(e) libc_feholdexcept (e)
7143 +// #define libc_feholdexceptl(e) (void) feholdexcept (e)
7145 +#undef libc_feholdexcept_setround
7146 +#define libc_feholdexcept_setround(e, r) \
7148 + unsigned int mxcsr; \
7149 + asm ("stmxcsr %0" : "=m" (*&mxcsr)); \
7150 + (e)->__mxcsr = mxcsr; \
7151 + mxcsr = ((mxcsr | 0x1f80) & ~0x603f) | ((r) << 3); \
7152 + asm volatile ("ldmxcsr %0" : : "m" (*&mxcsr)); \
7154 +#undef libc_feholdexcept_setroundf
7155 +#define libc_feholdexcept_setroundf(e, r) libc_feholdexcept_setround (e, r)
7156 +// #define libc_feholdexcept_setroundl(e, r) ...
7158 +#undef libc_fetestexcept
7159 +#define libc_fetestexcept(e) \
7160 + ({ unsigned int mxcsr; asm volatile ("stmxcsr %0" : "=m" (*&mxcsr)); \
7161 + mxcsr & (e) & FE_ALL_EXCEPT; })
7162 +#undef libc_fetestexceptf
7163 +#define libc_fetestexceptf(e) libc_fetestexcept (e)
7164 +// #define libc_fetestexceptl(e) fetestexcept (e)
7166 +#undef libc_fesetenv
7167 +#define libc_fesetenv(e) \
7168 + asm volatile ("ldmxcsr %0" : : "m" ((e)->__mxcsr))
7169 +#undef libc_fesetenvf
7170 +#define libc_fesetenvf(e) libc_fesetenv (e)
7171 +// #define libc_fesetenvl(e) (void) fesetenv (e)
7173 +#undef libc_feupdateenv
7174 +#define libc_feupdateenv(e) \
7176 + unsigned int mxcsr; \
7177 + asm volatile ("stmxcsr %0" : "=m" (*&mxcsr)); \
7178 + asm volatile ("ldmxcsr %0" : : "m" ((e)->__mxcsr)); \
7179 + feraiseexcept (mxcsr & FE_ALL_EXCEPT); \
7181 +#undef libc_feupdateenvf
7182 +#define libc_feupdateenvf(e) libc_feupdateenv (e)
7183 +// #define libc_feupdateenvl(e) (void) feupdateenv (e)