Next: , Previous: , Up: Mathematics   [Contents][Index]


19.7 Known Maximum Errors in Math Functions

This section lists the known errors of the functions in the math library. Errors are measured in “units of the last place”. This is a measure for the relative error. For a number z with the representation d.d…d·2^e (we assume IEEE floating-point numbers with base 2) the ULP is represented by

|d.d...d - (z / 2^e)| / 2^(p - 1)

where p is the number of bits in the mantissa of the floating-point number representation. Ideally the error for all functions is always less than 0.5ulps. Using rounding bits this is also possible and normally implemented for the basic operations. To achieve the same for the complex math functions requires a lot more work and this has not yet been done.

Therefore many of the functions in the math library have errors. The table lists the maximum error for each function which is exposed by one of the existing tests in the test suite. The table tries to cover as much as possible and list the actual maximum error (or at least a ballpark figure) but this is often not achieved due to the large search space.

The table lists the ULP values for different architectures. Different architectures have different results since their hardware support for floating-point operations varies and also the existing hardware support is different.

FunctionARMhppa/fpuM68kMIPSpowerpc/nofpu
acosf-----
acos-----
acosl-----
acoshf-----
acosh-----
acoshl--1--
asinf2----
asin1----
asinl-----
asinhf-----
asinh-----
asinhl--1--
atanf-----
atan-----
atanl-----
atanhf-1-11
atanh1----
atanhl--1--
atan2f-3-33
atan2-----
atan2l--1--
cabsf1----
cabs1----
cabsl-----
cacosf1 + i 1-2 + i 1--
cacos1 + i 0----
cacosl--1 + i 2--
cacoshf7 + i 37 + i 37 + i 17 + i 37 + i 3
cacosh1 + i 11 + i 11 + i 11 + i 11 + i 1
cacoshl--6 + i 2--
cargf-----
carg-----
cargl-----
casinf2 + i 11 + i 05 + i 11 + i 01 + i 0
casin3 + i 01 + i 01 + i 01 + i 01 + i 0
casinl--3 + i 2--
casinhf1 + i 61 + i 619 + i 11 + i 61 + i 6
casinh5 + i 35 + i 36 + i 135 + i 35 + i 3
casinhl--5 + i 6--
catanf4 + i 14 + i 10 + i 14 + i 14 + i 1
catan0 + i 10 + i 10 + i 10 + i 10 + i 1
catanl--1 + i 0--
catanhf1 + i 60 + i 6-0 + i 60 + i 6
catanh4 + i 14 + i 0-4 + i 04 + i 0
catanhl--1 + i 0--
cbrtf-----
cbrt11-11
cbrtl--1--
ccosf0 + i 11 + i 11 + i 11 + i 11 + i 1
ccos1 + i 11 + i 0-1 + i 01 + i 0
ccosl--1 + i 1--
ccoshf1 + i 11 + i 11 + i 11 + i 11 + i 1
ccosh1 + i 11 + i 0-1 + i 01 + i 0
ccoshl--0 + i 1--
ceilf-----
ceil-----
ceill-----
cexpf1 + i 11 + i 12 + i 11 + i 11 + i 1
cexp1 + i 0----
cexpl--0 + i 1--
cimagf-----
cimag-----
cimagl-----
clogf0 + i 31 + i 31 + i 01 + i 31 + i 3
clog0 + i 1----
clogl--1 + i 1--
clog10f1 + i 51 + i 51 + i 11 + i 51 + i 5
clog101 + i 10 + i 11 + i 10 + i 10 + i 1
clog10l--1 + i 2--
conjf-----
conj-----
conjl-----
copysignf-----
copysign-----
copysignl-----
cosf11111
cos22222
cosl--1--
coshf-----
cosh-----
coshl-----
cpowf4 + i 24 + i 22 + i 64 + i 24 + i 2
cpow1 + i 1.10312 + i 21 + i 22 + i 22 + i 2
cpowl--15 + i 2--
cprojf-----
cproj-----
cprojl-----
crealf-----
creal-----
creall-----
csinf0 + i 1-1 + i 1--
csin-----
csinl--1 + i 0--
csinhf1 + i 11 + i 11 + i 11 + i 11 + i 1
csinh0 + i 10 + i 1-0 + i 10 + i 1
csinhl--1 + i 0--
csqrtf1 + i 11 + i 0-1 + i 01 + i 0
csqrt1 + i 0----
csqrtl-----
ctanf1 + i 1----
ctan1 + i 11 + i 11 + i 01 + i 11 + i 1
ctanl--1 + i 2--
ctanhf2 + i 12 + i 10 + i 12 + i 12 + i 1
ctanh2 + i 21 + i 00 + i 11 + i 01 + i 0
ctanhl--0 + i 1--
erff-----
erf-1-11
erfl-----
erfcf12-1--
erfc241-11
erfcl--1--
expf-----
exp-----
expl-----
exp10f22-22
exp1066-66
exp10l-----
exp2f-----
exp2-----
exp2l-----
expm1f11-11
expm1-1-11
expm1l--1--
fabsf-----
fabs-----
fabsl-----
fdimf-----
fdim-----
fdiml-----
floorf-----
floor-----
floorl-----
fmaf-----
fma-----
fmal-----
fmaxf-----
fmax-----
fmaxl-----
fminf-----
fmin-----
fminl-----
fmodf1----
fmod2----
fmodl-----
frexpf-----
frexp-----
frexpl-----
gammaf-----
gamma-----
gammal--1--
hypotf11111
hypot1----
hypotl-----
ilogbf-----
ilogb-----
ilogbl-----
j0f22122
j022122
j0l--1--
j1f22222
j111-11
j1l--1--
jnf44544
jn64144
jnl--2--
lgammaf22222
lgamma11111
lgammal--1--
lrintf-----
lrint-----
lrintl-----
llrintf-----
llrint-----
llrintl-----
logf1-1--
log1----
logl--1--
log10f12122
log1011-11
log10l--2--
log1pf11-11
log1p1----
log1pl--1--
log2f1----
log21----
log2l--1--
logbf-----
logb-----
logbl-----
lroundf-----
lround-----
lroundl-----
llroundf-----
llround-----
llroundl-----
modff-----
modf-----
modfl-----
nearbyintf-----
nearbyint-----
nearbyintl-----
nextafterf-----
nextafter-----
nextafterl-----
nexttowardf-----
nexttoward-----
nexttowardl-----
powf-----
pow-----
powl--1--
remainderf-----
remainder-----
remainderl-----
remquof-----
remquo-----
remquol-----
rintf-----
rint-----
rintl-----
roundf-----
round-----
roundl-----
scalbf-----
scalb-----
scalbl-----
scalbnf-----
scalbn-----
scalbnl-----
scalblnf-----
scalbln-----
scalblnl-----
sinf-----
sin-----
sinl-----
sincosf11111
sincos11111
sincosl--1--
sinhf1----
sinh1----
sinhl--1--
sqrtf-----
sqrt-----
sqrtl-----
tanf-----
tan0.51111
tanl--1--
tanhf1----
tanh1----
tanhl-----
tgammaf11111
tgamma11111
tgammal--1--
truncf-----
trunc-----
truncl-----
y0f11111
y022122
y0l--2--
y1f22222
y133133
y1l--1--
ynf22222
yn33133
ynl--4--
FunctionAlphaGenericix86IA64PowerPC
acosf-----
acos-----
acosl--622-1
acoshf-----
acosh-----
acoshl----1
asinf-----
asin-----
asinl--1-2
asinhf-----
asinh-----
asinhl----1
atanf-----
atan-----
atanl-----
atanhf1---1
atanh-----
atanhl--1--
atan2f6---1
atan2-----
atan2l----1
cabsf-----
cabs-----
cabsl----1
cacosf--0 + i 10 + i 1-
cacos-----
cacosl--0 + i 20 + i 21 + i 1
cacoshf7 + i 3-9 + i 47 + i 07 + i 3
cacosh1 + i 1-1 + i 11 + i 11 + i 1
cacoshl--6 + i 17 + i 11 + i 0
cargf-----
carg-----
cargl-----
casinf1 + i 0-1 + i 11 + i 11 + i 0
casin1 + i 0-1 + i 01 + i 01 + i 0
casinl--2 + i 22 + i 21 + i 1
casinhf1 + i 6-1 + i 61 + i 61 + i 6
casinh5 + i 3-5 + i 35 + i 35 + i 3
casinhl--5 + i 55 + i 54 + i 1
catanf4 + i 1-0 + i 10 + i 14 + i 1
catan0 + i 1-0 + i 10 + i 10 + i 1
catanl----1 + i 1
catanhf0 + i 6-1 + i 0-0 + i 6
catanh4 + i 0-2 + i 04 + i 04 + i 0
catanhl--1 + i 01 + i 0-
cbrtf-----
cbrt1---1
cbrtl--1-1
ccosf1 + i 1-0 + i 10 + i 11 + i 1
ccos1 + i 0-1 + i 01 + i 01 + i 0
ccosl--1 + i 11 + i 11 + i 1
ccoshf1 + i 1-1 + i 11 + i 11 + i 1
ccosh1 + i 0-1 + i 11 + i 11 + i 0
ccoshl--0 + i 10 + i 11 + i 2
ceilf-----
ceil-----
ceill-----
cexpf1 + i 1--1 + i 11 + i 1
cexp-----
cexpl--1 + i 10 + i 12 + i 1
cimagf-----
cimag-----
cimagl-----
clogf1 + i 3-1 + i 01 + i 01 + i 3
clog-----
clogl--1 + i 01 + i 02 + i 1
clog10f1 + i 5-1 + i 11 + i 11 + i 5
clog100 + i 1-1 + i 11 + i 10 + i 1
clog10l--1 + i 11 + i 12 + i 1
conjf-----
conj-----
conjl-----
copysignf-----
copysign-----
copysignl-----
cosf1-111
cos2-222
cosl--111
coshf-----
cosh-----
coshl----1
cpowf4 + i 2-4 + i 35 + i 35 + i 2
cpow2 + i 2-1 + i 22 + i 22 + i 2
cpowl--763 + i 26 + i 42 + i 2
cprojf-----
cproj-----
cprojl----0 + i 1
crealf-----
creal-----
creall-----
csinf--1 + i 11 + i 1-
csin-----
csinl--1 + i 01 + i 01 + i 0
csinhf1 + i 1-1 + i 11 + i 11 + i 1
csinh0 + i 1-1 + i 11 + i 10 + i 1
csinhl--1 + i 21 + i 21 + i 1
csqrtf1 + i 0--1 + i 01 + i 0
csqrt-----
csqrtl----1 + i 1
ctanf--0 + i 10 + i 1-
ctan0 + i 1-1 + i 11 + i 11 + i 1
ctanl--439 + i 32 + i 11 + i 1
ctanhf2 + i 1-1 + i 10 + i 12 + i 1
ctanh1 + i 0-1 + i 11 + i 11 + i 0
ctanhl--5 + i 251 + i 241 + i 1
erff-----
erf1-111
erfl----1
erfcf--111
erfc1-111
erfcl--111
expf-----
exp-----
expl----1
exp10f2--22
exp106--66
exp10l--838
exp2f-----
exp2-----
exp2l----2
expm1f1---1
expm11---1
expm1l---1-
fabsf-----
fabs-----
fabsl-----
fdimf-----
fdim-----
fdiml-----
floorf-----
floor-----
floorl-----
fmaf-----
fma-----
fmal-----
fmaxf-----
fmax-----
fmaxl-----
fminf-----
fmin-----
fminl-----
fmodf-----
fmod-----
fmodl-----
frexpf-----
frexp-----
frexpl-----
gammaf-----
gamma--1--
gammal--111
hypotf1-111
hypot-----
hypotl----1
ilogbf-----
ilogb-----
ilogbl-----
j0f2-222
j02-333
j0l--121
j1f2-122
j11-111
j1l--111
jnf4-244
jn4-533
jnl--224
lgammaf2-222
lgamma1-111
lgammal--113
lrintf-----
lrint-----
lrintl-----
llrintf-----
llrint-----
llrintl-----
logf--11-
log-----
logl----1
log10f2-112
log101---1
log10l--111
log1pf1---1
log1p-----
log1pl----1
log2f-----
log2-----
log2l----1
logbf-----
logb-----
logbl-----
lroundf-----
lround-----
lroundl-----
llroundf-----
llround-----
llroundl-----
modff-----
modf-----
modfl-----
nearbyintf-----
nearbyint-----
nearbyintl-----
nextafterf-----
nextafter-----
nextafterl-----
nexttowardf-----
nexttoward-----
nexttowardl-----
powf-----
pow-----
powl----1
remainderf-----
remainder-----
remainderl-----
remquof-----
remquo-----
remquol-----
rintf-----
rint-----
rintl-----
roundf-----
round-----
roundl-----
scalbf-----
scalb-----
scalbl-----
scalbnf-----
scalbn-----
scalbnl-----
scalblnf-----
scalbln-----
scalblnl-----
sinf-----
sin-----
sinl----1
sincosf1-111
sincos1-111
sincosl--111
sinhf-----
sinh--1--
sinhl----1
sqrtf-----
sqrt-----
sqrtl-----
tanf-----
tan1-111
tanl----1
tanhf-----
tanh-----
tanhl----1
tgammaf1-111
tgamma1-211
tgammal--111
truncf-----
trunc-----
truncl-----
y0f1-111
y02-222
y0l--111
y1f2-222
y13-233
y1l--112
ynf2-322
yn3-233
ynl--422
FunctionS/390SH4Sparc 32-bitSparc 64-bitx86_64/fpu
acosf-----
acos-----
acosl----1
acoshf-----
acosh-----
acoshl-----
asinf-2---
asin-1---
asinl----1
asinhf-----
asinh-----
asinhl-----
atanf-----
atan-----
atanl-----
atanhf1-111
atanh-1---
atanhl----1
atan2f14661
atan2-----
atan2l1-11-
cabsf-1---
cabs-1---
cabsl-----
cacosf-1 + i 1--0 + i 1
cacos-1 + i 0---
cacosl0 + i 1-0 + i 10 + i 10 + i 2
cacoshf7 + i 37 + i 37 + i 37 + i 37 + i 3
cacosh1 + i 11 + i 11 + i 11 + i 11 + i 1
cacoshl0 + i 1-5 + i 15 + i 16 + i 1
cargf-----
carg-----
cargl-----
casinf1 + i 02 + i 11 + i 01 + i 01 + i 1
casin1 + i 03 + i 01 + i 01 + i 01 + i 0
casinl0 + i 1-0 + i 10 + i 12 + i 2
casinhf1 + i 61 + i 61 + i 61 + i 61 + i 6
casinh5 + i 35 + i 35 + i 35 + i 35 + i 3
casinhl4 + i 2-4 + i 24 + i 25 + i 5
catanf4 + i 14 + i 14 + i 14 + i 14 + i 1
catan0 + i 10 + i 10 + i 10 + i 10 + i 1
catanl0 + i 1-0 + i 10 + i 1-
catanhf0 + i 61 + i 60 + i 60 + i 60 + i 6
catanh4 + i 04 + i 14 + i 04 + i 04 + i 0
catanhl1 + i 1-1 + i 11 + i 11 + i 0
cbrtf-----
cbrt11111
cbrtl1-111
ccosf1 + i 10 + i 11 + i 11 + i 11 + i 1
ccos1 + i 01 + i 11 + i 01 + i 01 + i 0
ccosl1 + i 1-1 + i 11 + i 11 + i 1
ccoshf1 + i 11 + i 11 + i 11 + i 11 + i 1
ccosh1 + i 01 + i 11 + i 01 + i 01 + i 1
ccoshl1 + i 1-1 + i 11 + i 10 + i 1
ceilf-----
ceil-----
ceill-----
cexpf1 + i 11 + i 11 + i 11 + i 11 + i 1
cexp-1 + i 0---
cexpl1 + i 1-1 + i 11 + i 10 + i 1
cimagf-----
cimag-----
cimagl-----
clogf1 + i 30 + i 31 + i 31 + i 31 + i 3
clog-0 + i 1---
clogl1 + i 0-1 + i 01 + i 01 + i 0
clog10f1 + i 51 + i 51 + i 51 + i 51 + i 5
clog100 + i 11 + i 10 + i 10 + i 11 + i 1
clog10l1 + i 1-1 + i 11 + i 11 + i 1
conjf-----
conj-----
conjl-----
copysignf-----
copysign-----
copysignl-----
cosf11111
cos22222
cosl1-111
coshf-----
cosh-----
coshl-----
cpowf4 + i 24 + i 24 + i 24 + i 25 + i 2
cpow2 + i 21 + i 1.10312 + i 22 + i 22 + i 2
cpowl10 + i 1-10 + i 110 + i 15 + i 2
cprojf-----
cproj-----
cprojl-----
crealf-----
creal-----
creall-----
csinf-0 + i 1--0 + i 1
csin----0 + i 1
csinl1 + i 1-1 + i 11 + i 11 + i 0
csinhf1 + i 11 + i 11 + i 11 + i 11 + i 1
csinh0 + i 10 + i 10 + i 10 + i 11 + i 1
csinhl1 + i 0-1 + i 01 + i 01 + i 2
csqrtf1 + i 01 + i 11 + i 01 + i 01 + i 0
csqrt-1 + i 0---
csqrtl1 + i 1-1 + i 11 + i 1-
ctanf-1 + i 1--0 + i 1
ctan1 + i 11 + i 11 + i 11 + i 11 + i 1
ctanl1 + i 2-1 + i 21 + i 2439 + i 3
ctanhf2 + i 12 + i 12 + i 12 + i 12 + i 1
ctanh1 + i 02 + i 21 + i 01 + i 01 + i 1
ctanhl1 + i 1-1 + i 11 + i 15 + i 25
erff-----
erf1-111
erfl-----
erfcf112---
erfc124111
erfcl1-111
expf-----
exp-----
expl-----
exp10f22222
exp1066666
exp10l1-118
exp2f-----
exp2-----
exp2l2-22-
expm1f11111
expm11-111
expm1l1-11-
fabsf-----
fabs-----
fabsl-----
fdimf-----
fdim-----
fdiml-----
floorf-----
floor-----
floorl-----
fmaf-----
fma-----
fmal-----
fmaxf-----
fmax-----
fmaxl-----
fminf-----
fmin-----
fminl-----
fmodf-1---
fmod-2---
fmodl-----
frexpf-----
frexp-----
frexpl-----
gammaf-----
gamma-----
gammal1-111
hypotf11111
hypot-1---
hypotl-----
ilogbf-----
ilogb-----
ilogbl-----
j0f22222
j022222
j0l2-221
j1f22222
j111111
j1l4-441
jnf44444
jn46444
jnl4-442
lgammaf22222
lgamma11111
lgammal1-111
lrintf-----
lrint-----
lrintl-----
llrintf-----
llrint-----
llrintl-----
logf-1---
log-1---
logl-----
log10f21222
log1011111
log10l1-111
log1pf11111
log1p-1---
log1pl1-11-
log2f-1---
log2-1---
log2l1-11-
logbf-----
logb-----
logbl-----
lroundf-----
lround-----
lroundl-----
llroundf-----
llround-----
llroundl-----
modff-----
modf-----
modfl-----
nearbyintf-----
nearbyint-----
nearbyintl-----
nextafterf-----
nextafter-----
nextafterl-----
nexttowardf-----
nexttoward-----
nexttowardl-----
powf-----
pow-----
powl-----
remainderf-----
remainder-----
remainderl-----
remquof-----
remquo-----
remquol-----
rintf-----
rint-----
rintl-----
roundf-----
round-----
roundl-----
scalbf-----
scalb-----
scalbl-----
scalbnf-----
scalbn-----
scalbnl-----
scalblnf-----
scalbln-----
scalblnl-----
sinf-----
sin-----
sinl-----
sincosf11111
sincos11111
sincosl1-111
sinhf-1---
sinh-1---
sinhl-----
sqrtf-----
sqrt-----
sqrtl1-11-
tanf-----
tan10.5111
tanl-----
tanhf-1---
tanh-1---
tanhl1-11-
tgammaf11111
tgamma11111
tgammal1-111
truncf-----
trunc-----
truncl-----
y0f11111
y022222
y0l3-331
y1f22222
y133333
y1l1-111
ynf22222
yn33333
ynl5-554

Next: , Previous: , Up: Mathematics   [Contents][Index]