diff options
author | Joseph Myers <joseph@codesourcery.com> | 2012-04-09 09:42:05 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2012-04-09 09:42:05 +0000 |
commit | c483f6b4a4277bc209820efc1ae35d976af57b4e (patch) | |
tree | 501d3025d498d3e27308f32db0838e19c13f826e /math/libm-test.inc | |
parent | d2de7579f257386ba5c28dfca94fa8aef143b4e0 (diff) | |
download | glibc-c483f6b4a4277bc209820efc1ae35d976af57b4e.tar.gz glibc-c483f6b4a4277bc209820efc1ae35d976af57b4e.tar.xz glibc-c483f6b4a4277bc209820efc1ae35d976af57b4e.zip |
Fix x86 pow inaccuracy for large integer exponents (bug 706).
Diffstat (limited to 'math/libm-test.inc')
-rw-r--r-- | math/libm-test.inc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc index 35d014b72f..b9ff9f3ad2 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -6070,6 +6070,32 @@ pow_test (void) /* Bug 13872: spurious OVERFLOW exception may be present. */ TEST_ff_f (pow, -min_value, max_value, plus_zero, OVERFLOW_EXCEPTION_OK); +#ifndef TEST_LDOUBLE /* Bug 13881. */ + TEST_ff_f (pow, 0x0.ffffffp0, 10, 0.999999403953712118183885036774764444747L); + TEST_ff_f (pow, 0x0.ffffffp0, 100, 0.999994039553108359406305079606228341585L); + TEST_ff_f (pow, 0x0.ffffffp0, 1000, 0.9999403971297699052276650144650733772182L); + TEST_ff_f (pow, 0x0.ffffffp0, 0x1p24, 0.3678794302077803437135155590023422899744L); + TEST_ff_f (pow, 0x0.ffffffp0, 0x1p30, 1.603807831524924233828134753069728224044e-28L); + TEST_ff_f (pow, 0x0.ffffffp0, 0x1.234566p30, 2.374884712135295099971443365381007297732e-32L); + TEST_ff_f (pow, 0x0.ffffffp0, -10, 1.000000596046643153205170848674671339688L); + TEST_ff_f (pow, 0x0.ffffffp0, -100, 1.000005960482418779499387594989252621451L); + TEST_ff_f (pow, 0x0.ffffffp0, -1000, 1.000059606422943986382898964231519867906L); + TEST_ff_f (pow, 0x0.ffffffp0, -0x1p24, 2.7182819094701610539628664526874952929416L); + TEST_ff_f (pow, 0x0.ffffffp0, -0x1p30, 6.2351609734265057988914412331288163636075e+27L); + TEST_ff_f (pow, 0x0.ffffffp0, -0x1.234566p30, 4.2107307141696353498921307077142537353515e+31L); + TEST_ff_f (pow, 0x1.000002p0, 0x1p24, 7.3890552180866447284268641248075832310141L); + TEST_ff_f (pow, 0x1.000002p0, 0x1.234566p29, 4.2107033006507495188536371520637025716256e+31L); + TEST_ff_f (pow, 0x1.000002p0, -0x1.234566p29, 2.3749001736727769098946062325205705312166e-32L); +#endif + + /* Bug 13881: powl inaccurate so these tests disabled for long double. */ +#if !defined TEST_FLOAT && !defined TEST_LDOUBLE + TEST_ff_f (pow, 0x0.fffffffffffff8p0L, 0x1.23456789abcdfp62L, 1.0118762747827252817436395051178295138220e-253L); + TEST_ff_f (pow, 0x0.fffffffffffff8p0L, -0x1.23456789abcdfp62L, 9.8826311568054561811190162420900667121992e+252L); + TEST_ff_f (pow, 0x1.0000000000001p0L, 0x1.23456789abcdfp61L, 9.8826311568044974397135026217687399395481e+252L); + TEST_ff_f (pow, 0x1.0000000000001p0L, -0x1.23456789abcdfp61L, 1.0118762747828234466621210689458255908670e-253L); +#endif + END (pow); } |