1
.\" Copyright (c) 1985 Regents of the University of California.
2
.\" All rights reserved.
4
.\" Redistribution and use in source and binary forms, with or without
5
.\" modification, are permitted provided that the following conditions
7
.\" 1. Redistributions of source code must retain the above copyright
8
.\" notice, this list of conditions and the following disclaimer.
9
.\" 2. Redistributions in binary form must reproduce the above copyright
10
.\" notice, this list of conditions and the following disclaimer in the
11
.\" documentation and/or other materials provided with the distribution.
12
.\" 3. All advertising materials mentioning features or use of this software
13
.\" must display the following acknowledgement:
14
.\" This product includes software developed by the University of
15
.\" California, Berkeley and its contributors.
16
.\" 4. Neither the name of the University nor the names of its contributors
17
.\" may be used to endorse or promote products derived from this software
18
.\" without specific prior written permission.
20
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32
.\" from: @(#)math.3 6.10 (Berkeley) 5/6/91
33
.\" $FreeBSD: src/lib/msun/man/math.3,v 1.27 2005/11/17 13:00:00 ru Exp $
43
.Nd "floating-point mathematical library"
49
These functions constitute the C math library.
50
.Sh "LIST OF FUNCTIONS"
57
appended to the name and a
74
.Fn acosl "long double x" ,
77
.Bl -column "isgreaterequal" "bessel function of the second kind of the order 0"
78
.Em "Name Description"
80
.Ss Algebraic Functions
83
fma fused multiply-add
84
hypot Euclidean distance
87
.Ss Classification Functions
89
fpclassify classify a floating-point value
90
isfinite determine whether a value is finite
91
isinf determine whether a value is infinite
92
isnan determine whether a value is \*(Na
93
isnormal determine whether a value is normalized
95
.Ss Exponent Manipulation Functions
97
frexp extract exponent and mantissa
98
ilogb extract exponent
99
ldexp multiply by power of 2
100
logb extract exponent
101
scalbln adjust exponent
102
scalbn adjust exponent
104
.Ss Extremum- and Sign-Related Functions
106
copysign copy sign bit
108
fdim positive difference
109
fmax maximum function
110
fmin minimum function
111
signbit extract sign bit
115
.\" nan return quiet \*(Na) 0
117
.Ss Residue and Rounding Functions
119
ceil integer no less than
120
floor integer no greater than
121
fmod positive remainder
122
llrint round to integer in fixed-point format
123
llround round to nearest integer in fixed-point format
124
lrint round to integer in fixed-point format
125
lround round to nearest integer in fixed-point format
126
modf extract integer and fractional parts
127
nearbyint round to integer (silent)
128
nextafter next representable value
129
nexttoward next representable value
131
remquo remainder with partial quotient
132
rint round to integer
133
round round to nearest integer
134
trunc integer no greater in magnitude than
145
functions round in predetermined directions, whereas
150
round according to the current (dynamic) rounding mode.
151
For more information on controlling the dynamic rounding mode, see
155
.Ss Silent Order Predicates
157
isgreater greater than relation
158
isgreaterequal greater than or equal to relation
159
isless less than relation
160
islessequal less than or equal to relation
161
islessgreater less than or greater than relation
162
isunordered unordered relation
164
.Ss Transcendental Functions
167
acosh inverse hyperbolic cosine
169
asinh inverse hyperbolic sine
171
atanh inverse hyperbolic tangent
172
atan2 atan(y/x); complex argument
174
cosh hyperbolic cosine
176
erfc complementary error function
177
exp exponential base e
178
exp2 exponential base 2
180
j0 Bessel function of the first kind of the order 0
181
j1 Bessel function of the first kind of the order 1
182
jn Bessel function of the first kind of the order n
183
lgamma log gamma function
184
log natural logarithm
185
log10 logarithm to base 10
187
.\" log2 base 2 logarithm
189
sin trigonometric function
190
sinh hyperbolic function
191
tan trigonometric function
192
tanh hyperbolic function
193
tgamma gamma function
194
y0 Bessel function of the second kind of the order 0
195
y1 Bessel function of the second kind of the order 1
196
yn Bessel function of the second kind of the order n
199
Unlike the algebraic functions listed earlier, the routines
200
in this section may not produce a result that is correctly rounded,
201
so reproducible results cannot be guaranteed across platforms.
202
For most of these functions, however, incorrect rounding occurs
203
rarely, and then only in very-close-to-halfway cases.
208
A math library with many of the present functions appeared in
210
The library was substantially rewritten for
213
better accuracy and speed on machines supporting either VAX
214
or IEEE 754 floating-point.
215
Most of this library was replaced with FDLIBM, developed at Sun
218
Additional routines, including ones for
222
values, were written for or imported into subsequent versions of FreeBSD.
228
functions are missing, and many functions are not available in their
232
Many of the routines to compute transcendental functions produce
233
inaccurate results in other than the default rounding mode.
235
On some architectures, trigonometric argument reduction is not
236
performed accurately, resulting in errors greater than 1
238
for large arguments to