libm - C math library
c99 [ flag... ] file... -lm [ library... ]
Functions in this library provide common elementary mathematical functions and floating point environment routines defined by System V, ANSI C, POSIX, and so on. See standards(5). Additional functions in this library provide extended support for handling floating point exceptions.
The shared object libm.so.2 provides the public interfaces defined below. See Intro(3) for additional information on shared object interfaces.
acos | acosf |
acosh | acoshf |
acoshl | |
asin | |
asinh | |
asinhl | |
atan | |
atan2f | |
atanf | |
atanhf | |
atanl | |
cabsf | |
cacos | |
cacosh | |
cacoshl | |
carg | |
cargl | |
casinf | |
casinhf | |
casinl | |
catanf | |
catanhf | |
catanl | |
cbrtf | |
ccos | |
ccosh | |
ccoshl | |
ceil | |
ceill | |
cexpf | |
cimag | |
cimagl | |
clogf | |
conj | |
conjl | |
copysignf | |
cos | |
cosh | |
coshl | |
cpow | |
cpowl | |
cprojf | |
creal | |
creall | |
csinf | |
csinhf | |
csinl | |
csqrtf | |
ctan | |
ctanh | |
ctanhl | |
erf | |
erfcf | |
erff | |
exp | |
exp2f | |
expf | |
expm1 | |
expm1l | |
fabsf | |
fdim | |
fdiml | |
fegetenv | |
fegetround | |
feraiseexcept | |
fesetexceptflag | |
fetestexcept | |
fex_get_handling | |
fex_get_log_depth | |
fex_log_entry | |
fex_set_handling | |
fex_set_log_depth | |
floor | |
floorl | |
fmaf | |
fmax | |
fmaxl | |
fminf | |
fmod | |
fmodl | |
frexpf | |
gamma | |
gammaf | |
gammal | |
hypot | |
hypotl | |
ilogbf | |
isnan | |
j0f | |
j1 | |
j1l | |
jnf | |
ldexp | |
ldexpl | |
lgamma_r | |
lgammaf_r | |
lgammal_r | |
llrintf | |
llround | |
llroundl | |
log10 | |
log10l | |
log1pf | |
log2 | |
log2l | |
logbf | |
logf | |
lrint | |
lrintl | |
lroundf | |
matherr | |
modff | |
nan | |
nanl | |
nearbyintf | |
nextafter | |
nextafterl | |
nexttowardf | |
pow | |
powl | |
remainderf | |
remquo | |
remquol | |
rintf | |
round | |
roundl | |
scalbf | |
scalbln | |
scalblnl | |
scalbnf | |
signgam | |
signgaml | |
significandf | |
sin | |
sincosf | |
sinf | |
sinhf | |
sinl | |
sqrtf | |
tan | |
tanh | |
tanhl | |
tgamma | |
tgammal | |
truncf | |
y0 | |
y0l | |
y1f | |
yn | |
ynl |
The following interfaces are unique to the x86 and x64 versions of this library:
fegetprec | fesetprec |
ISO/IEC 9899:1999, also known as C99, specifies the functions listed in the following tables and states that the accuracy of these functions is "implementation-defined". The information below characterizes the accuracy of these functions as implemented in libm.so.2. For each function, the tables provide an upper bound on the largest error possible for any argument and the largest error actually observed among a large sample of arguments. Errors are expressed in "units in the last place", or ulps, relative to the exact function value for each argument (regarding the argument as exact). Ulps depend on the precision of the floating point format: if y is the exact function value, x and x' are adjacent floating point numbers such that x < y < x', and x'' is the computed function value, then provided x, x', and x'' all lie in the same binade, the error in x'' is |y - x''| / |x - x'| ulps. In particular, when the error is less than one ulp, the computed value is one of the two floating point numbers adjacent to the exact value.
The bounds and observed errors listed below apply only in the default floating point modes. Specifically, on SPARC, these bounds assume the rounding direction is round-to-nearest and non-standard mode is disabled. On x86, the bounds assume the rounding direction is round-to-nearest and the rounding precision is round-to-64-bits. Moreover, on x86, floating point function values are returned in a floating point register in extended double precision format, but the bounds below assume that the result value is then stored to memory in the format corresponding to the function's type. On x64, the bounds assume the rounding direction in both the x87 floating point control word and the MXCSR is round-to-nearest, the rounding precision in the x87 control word is round-to-64-bits, and the FTZ and DAZ modes are disabled.
The error bounds listed below are believed to be correct, but smaller bounds might be proved later. The observed errors are the largest ones currently known, but larger errors might be discovered later. Numbers in the notes column refer to the notes following the tables.
error bound | largest error | ||
function | (ulps) | observed (ulps) | notes |
acosf | |||
acoshf | |||
asinf | |||
asinhf | |||
atanf | |||
atan2f | |||
atanhf | |||
cbrtf | |||
cosf | |||
coshf | |||
erff | |||
erfcf | |||
expf | |||
exp2f | |||
expm1f | |||
hypotf | |||
lgammaf | |||
logf | |||
log10f | |||
log1pf | |||
log2f | |||
powf | |||
sinf | |||
sinhf | |||
sqrtf | |||
tanf | |||
tanhf | |||
tgammaf |
error bound | largest error | ||
function | (ulps) | observed (ulps) | notes |
acos | |||
acosh | |||
asin | |||
asinh | |||
atan | |||
atan2 | |||
atanh | |||
cbrt | |||
cos | |||
cosh | |||
erf | |||
erfc | |||
exp | |||
exp2 | |||
expm1 | |||
hypot | |||
lgamma | |||
log | |||
log10 | |||
log1p | |||
log2 | |||
pow | |||
sin | |||
sinh | |||
sqrt | |||
tan | |||
tanh | |||
tgamma |
error bound | largest error | ||
function | (ulps) | observed (ulps) | notes |
acos | |||
acosh | |||
asin | |||
asinh | |||
atan | |||
atan2 | |||
atanh | |||
cbrt | |||
cos | |||
cosh | |||
erf | |||
erfc | |||
exp | |||
exp2 | |||
expm1 | |||
hypot | |||
lgamma | |||
log | |||
log10 | |||
log1p | |||
log2 | |||
pow | |||
sin | |||
sinh | |||
sqrt | |||
tan | |||
tanh | |||
tgamma |
error bound | largest error | ||
function | (ulps) | observed (ulps) | notes |
acosl | |||
acoshl | |||
asinl | |||
asinhl | |||
atanl | |||
atan2l | |||
atanhl | |||
cbrtl | |||
cosl | |||
coshl | |||
erfl | |||
erfcl | |||
expl | |||
exp2l | |||
expm1l | |||
hypotl | |||
lgammal | |||
logl | |||
log10l | |||
log1pl | |||
log2l | |||
powl | |||
sinl | |||
sinhl | |||
sqrtl | |||
tanl | |||
tanhl | |||
tgammal |
error bound | largest error | ||
function | (ulps) | observed (ulps) | notes |
acosl | |||
acoshl | |||
asinl | |||
asinhl | |||
atanl | |||
atan2l | |||
atanhl | |||
cbrtl | |||
cosl | |||
coshl | |||
erfl | |||
erfcl | |||
expl | |||
exp2l | |||
expm1l | |||
hypotl | |||
lgammal | |||
logl | |||
log10l | |||
log1pl | |||
log2l | |||
powl | |||
sinl | |||
sinhl | |||
sqrtl | |||
tanl | |||
tanhl | |||
tgammal |
[1]
[2]
The real-valued complex functions cabsf, cabs, cabsl, cargf, carg, and cargl are equivalent to the real functions hypotf, hypot, hypotl, atan2f, atan2, and atan2l, respectively. The error bounds and observed errors given above for the latter functions also apply to the former.
The complex functions listed below are complex-valued. For each function, the error bound shown applies separately to both the real and imaginary parts of the result. (For example, both the real and imaginary parts of cacosf(z) are accurate to within 1 ulp regardless of their magnitudes.) Similarly, the largest observed error shown is the largest error found in either the real or the imaginary part of the result.
error bound | largest error | ||
function | (ulps) | observed (ulps) | notes |
cacosf, cacoshf | |||
casinf, casinhf | |||
catanf, catanhf | |||
ccosf, ccoshf | |||
cexpf | |||
clogf | |||
cpowf | |||
csinf, csinhf | |||
csqrtf | |||
ctanf, ctanhf |
error bound | largest error | ||
function | (ulps) | observed (ulps) | notes |
cacosf, cacoshf | |||
casinf, casinhf | |||
catanf, catanhf | |||
ccosf, ccoshf | |||
cexpf | |||
clogf | |||
cpowf | |||
csinf, csinhf | |||
csqrtf | |||
ctanf, ctanhf |
error bound | largest error | ||
function | (ulps) | observed (ulps) | notes |
cacos, cacosh | |||
casin, casinh | |||
catan, catanh | |||
ccos, ccosh | |||
cexp | |||
clog | |||
cpow | |||
csin, csinh | |||
csqrt | |||
ctan, ctanh |
error bound | largest error | ||
function | (ulps) | observed (ulps) | notes |
cacos, cacosh | |||
casin, casinh | |||
catan, catanh | |||
ccos, ccosh | |||
cexp | |||
clog | |||
cpow | |||
csin, csinh | |||
csqrt | |||
ctan, ctanh |
error bound | largest error | ||
function | (ulps) | observed (ulps) | notes |
cacosl, cacoshl | |||
casinl, casinhl | |||
catanl, catanhl | |||
ccosl, ccoshl | |||
cexpl | |||
clogl | |||
cpowl | |||
csinl, csinhl | |||
csqrtl | |||
ctanl, ctanhl |
error bound | largest error | ||
function | (ulps) | observed (ulps) | notes |
cacosl, cacoshl | |||
casinl, casinhl | |||
catanl, catanhl | |||
ccosl, ccoshl | |||
cexpl | |||
clogl | |||
cpowl | |||
csinl, csinhl | |||
csqrtl | |||
ctanl, ctanhl |
[1]
[2]
/lib/libm.so.2
/lib/64/libm.so.2
See attributes(5) for descriptions of the following attributes:
|
As described on the lgamma(3M) manual page, gamma() and lgamma() and their float and long double counterparts are Unsafe. All other functions in libm.so.2 are MT-Safe.
Intro(3), lgamma(3M), math.h(3HEAD), attributes(5), standards(5)
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |