From 1bead169c32a3a688de863709b863207b7aafddd Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 28 Nov 2012 13:40:54 +0000 Subject: Fix powl inaccuracy for x86_64 and x86 (bug 13881). --- math/libm-test.inc | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'math') diff --git a/math/libm-test.inc b/math/libm-test.inc index c0265113ca..21590645f9 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -8431,7 +8431,6 @@ pow_test (void) #endif TEST_ff_f (pow, -min_value, max_value, plus_zero, UNDERFLOW_EXCEPTION); -#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); @@ -8447,16 +8446,44 @@ pow_test (void) 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 +#if !defined TEST_FLOAT 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 +#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 64 && LDBL_MAX_EXP >= 16384 + TEST_ff_f (pow, 0x0.ffffffffffffffffp0L, 0x1.23456789abcdef0ep77L, 1.2079212226420368189981778807634890018840e-4048L); + TEST_ff_f (pow, 0x0.ffffffffffffffffp0L, -0x1.23456789abcdef0ep77L, 8.2786855736563746280496724205839522148001e+4047L); + TEST_ff_f (pow, 0x1.0000000000000002p0L, 0x1.23456789abcdef0ep76L, 8.2786855736563683535324500168799315131570e+4047L); + TEST_ff_f (pow, 0x1.0000000000000002p0L, -0x1.23456789abcdef0ep76L, 1.2079212226420377344964713407722652880280e-4048L); +#endif + +#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 113 + TEST_ff_f (pow, 0x0.ffffffffffffffffffffffffffff8p0L, 0x1.23456789abcdef0123456789abcdp126L, 1.2079212226420440237790185999151440179953e-4048L); + TEST_ff_f (pow, 0x0.ffffffffffffffffffffffffffff8p0L, -0x1.23456789abcdef0123456789abcdp126L, 8.2786855736563252489063231915535105363602e+4047L); + TEST_ff_f (pow, 0x1.0000000000000000000000000001p0L, 0x1.23456789abcdef0123456789abcdp125L, 8.2786855736563252489063231915423647547782e+4047L); + TEST_ff_f (pow, 0x1.0000000000000000000000000001p0L, -0x1.23456789abcdef0123456789abcdp125L, 1.2079212226420440237790185999167702696503e-4048L); +#endif + +#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384 + TEST_ff_f (pow, 1e4932L, 0.75L, 1e3699L); + TEST_ff_f (pow, 1e4928L, 0.75L, 1e3696L); + TEST_ff_f (pow, 1e4924L, 0.75L, 1e3693L); + TEST_ff_f (pow, 1e4920L, 0.75L, 1e3690L); + TEST_ff_f (pow, 10.0L, 4932.0L, 1e4932L); + TEST_ff_f (pow, 10.0L, 4931.0L, 1e4931L); + TEST_ff_f (pow, 10.0L, 4930.0L, 1e4930L); + TEST_ff_f (pow, 10.0L, 4929.0L, 1e4929L); + TEST_ff_f (pow, 10.0L, -4931.0L, 1e-4931L); + TEST_ff_f (pow, 10.0L, -4930.0L, 1e-4930L); + TEST_ff_f (pow, 10.0L, -4929.0L, 1e-4929L); + TEST_ff_f (pow, 1e27L, 182.0L, 1e4914L); + TEST_ff_f (pow, 1e27L, -182.0L, 1e-4914L); +#endif + TEST_ff_f (pow, min_subnorm_value, min_subnorm_value, 1.0L); TEST_ff_f (pow, min_subnorm_value, -min_subnorm_value, 1.0L); TEST_ff_f (pow, max_value, min_subnorm_value, 1.0L); -- cgit v1.2.3