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 .\" 4. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" from: @(#)math.3 6.10 (Berkeley) 5/6/91
36 .Nd "floating-point mathematical library"
42 These functions constitute the C math library.
43 .Sh "LIST OF FUNCTIONS"
50 appended to the name and a
67 .Fn acosl "long double x" ,
69 The classification macros and silent order predicates are type generic and
70 should not be suffixed with
75 .Bl -column "isgreaterequal" "bessel function of the second kind of the order 0"
76 .Em "Name Description"
78 .Ss Algebraic Functions
81 fma fused multiply-add
82 hypot Euclidean distance
85 .Ss Classification Macros
87 fpclassify classify a floating-point value
88 isfinite determine whether a value is finite
89 isinf determine whether a value is infinite
90 isnan determine whether a value is \*(Na
91 isnormal determine whether a value is normalized
93 .Ss Exponent Manipulation Functions
95 frexp extract exponent and mantissa
96 ilogb extract exponent
97 ldexp multiply by power of 2
99 scalbln adjust exponent
100 scalbn adjust exponent
102 .Ss Extremum- and Sign-Related Functions
104 copysign copy sign bit
106 fdim positive difference
107 fmax maximum function
108 fmin minimum function
109 signbit extract sign bit
111 .Ss Not a Number Functions
113 nan generate a quiet \*(Na
115 .Ss Residue and Rounding Functions
117 ceil integer no less than
118 floor integer no greater than
119 fmod positive remainder
120 llrint round to integer in fixed-point format
121 llround round to nearest integer in fixed-point format
122 lrint round to integer in fixed-point format
123 lround round to nearest integer in fixed-point format
124 modf extract integer and fractional parts
125 nearbyint round to integer (silent)
126 nextafter next representable value
127 nexttoward next representable value
129 remquo remainder with partial quotient
130 rint round to integer
131 round round to nearest integer
132 trunc integer no greater in magnitude than
143 functions round in predetermined directions, whereas
148 round according to the current (dynamic) rounding mode.
149 For more information on controlling the dynamic rounding mode, see
153 .Ss Silent Order Predicates
155 isgreater greater than relation
156 isgreaterequal greater than or equal to relation
157 isless less than relation
158 islessequal less than or equal to relation
159 islessgreater less than or greater than relation
160 isunordered unordered relation
162 .Ss Transcendental Functions
165 acosh inverse hyperbolic cosine
167 asinh inverse hyperbolic sine
169 atanh inverse hyperbolic tangent
170 atan2 atan(y/x); complex argument
172 cosh hyperbolic cosine
174 erfc complementary error function
175 exp exponential base e
176 exp2 exponential base 2
178 j0 Bessel function of the first kind of the order 0
179 j1 Bessel function of the first kind of the order 1
180 jn Bessel function of the first kind of the order n
181 lgamma log gamma function
182 log natural logarithm
183 log10 logarithm to base 10
185 log2 base 2 logarithm
187 sin trigonometric function
188 sinh hyperbolic function
189 tan trigonometric function
190 tanh hyperbolic function
191 tgamma gamma function
192 y0 Bessel function of the second kind of the order 0
193 y1 Bessel function of the second kind of the order 1
194 yn Bessel function of the second kind of the order n
198 in this section might not produce a result that is correctly rounded,
199 so reproducible results cannot be guaranteed across platforms.
200 For most of these functions, however, incorrect rounding occurs
201 rarely, and then only in very-close-to-halfway cases.
207 A math library with many of the present functions appeared in
209 The library was substantially rewritten for
212 better accuracy and speed on machines supporting either VAX
213 or IEEE 754 floating-point.
214 Most of this library was replaced with FDLIBM, developed at Sun
217 Additional routines, including ones for
221 values, were written for or imported into subsequent versions of FreeBSD.
229 Many of the routines to compute transcendental functions produce
230 inaccurate results in other than the default rounding mode.
232 On the i386 platform, trigonometric argument reduction is not
233 performed accurately for huge arguments, resulting in
235 for such arguments to