1 '\" te
   2 .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
   3 .\" Copyright 2020 Joyent, Inc.
   4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   7 .TH libm 3LIB "Feb 27, 2020"
   8 .SH NAME
   9 libm \- C math library
  10 .SH SYNOPSIS
  11 .nf
  12 c99 [ \fIflag\fR... ] \fIfile\fR... \fB-lm\fR [ \fIlibrary\fR... ]
  13 .fi
  14 
  15 .SH DESCRIPTION
  16 Functions in this library provide common elementary mathematical functions and
  17 floating point environment routines defined by System V, ANSI C, POSIX, and so
  18 on. See \fBstandards\fR(5). Additional functions in this library provide
  19 extended support for handling floating point exceptions.
  20 .SH INTERFACES
  21 The shared object \fBlibm.so.2\fR provides the public interfaces defined below.
  22 See \fBIntro\fR(3) for additional information on shared object interfaces.
  23 .sp
  24 
  25 .sp
  26 .TS
  27 tab(    );
  28 lw(2.75i) lw(2.75i)
  29 lw(2.75i) lw(2.75i)
  30 .
  31 \fBacos\fR      \fBacosf\fR
  32 \fBacosh\fR     \fBacoshf\fR
  33 \fBacoshl\fR    \fBacosl\fR
  34 \fBasin\fR      \fBasinf\fR
  35 \fBasinh\fR     \fBasinhf\fR
  36 \fBasinhl\fR    \fBasinl\fR
  37 \fBatan\fR      \fBatan2\fR
  38 \fBatan2f\fR    \fBatan2l\fR
  39 \fBatanf\fR     \fBatanh\fR
  40 \fBatanhf\fR    \fBatanhl\fR
  41 \fBatanl\fR     \fBcabs\fR
  42 \fBcabsf\fR     \fBcabsl\fR
  43 \fBcacos\fR     \fBcacosf\fR
  44 \fBcacosh\fR    \fBcacoshf\fR
  45 \fBcacoshl\fR   \fBcacosl\fR
  46 \fBcarg\fR      \fBcargf\fR
  47 \fBcargl\fR     \fBcasin\fR
  48 \fBcasinf\fR    \fBcasinh\fR
  49 \fBcasinhf\fR   \fBcasinhl\fR
  50 \fBcasinl\fR    \fBcatan\fR
  51 \fBcatanf\fR    \fBcatanh\fR
  52 \fBcatanhf\fR   \fBcatanhl\fR
  53 \fBcatanl\fR    \fBcbrt\fR
  54 \fBcbrtf\fR     \fBcbrtl\fR
  55 \fBccos\fR      \fBccosf\fR
  56 \fBccosh\fR     \fBccoshf\fR
  57 \fBccoshl\fR    \fBccosl\fR
  58 \fBceil\fR      \fBceilf\fR
  59 \fBceill\fR     \fBcexp\fR
  60 \fBcexpf\fR     \fBcexpl\fR
  61 \fBcimag\fR     \fBcimagf\fR
  62 \fBcimagl\fR    \fBclog\fR
  63 \fBclogf\fR     \fBclogl\fR
  64 \fBconj\fR      \fBconjf\fR
  65 \fBconjl\fR     \fBcopysign\fR
  66 \fBcopysignf\fR \fBcopysignl\fR
  67 \fBcos\fR       \fBcosf\fR
  68 \fBcosh\fR      \fBcoshf\fR
  69 \fBcoshl\fR     \fBcosl\fR
  70 \fBcpow\fR      \fBcpowf\fR
  71 \fBcpowl\fR     \fBcproj\fR
  72 \fBcprojf\fR    \fBcprojl\fR
  73 \fBcreal\fR     \fBcrealf\fR
  74 \fBcreall\fR    \fBcsin\fR
  75 \fBcsinf\fR     \fBcsinh\fR
  76 \fBcsinhf\fR    \fBcsinhl\fR
  77 \fBcsinl\fR     \fBcsqrt\fR
  78 \fBcsqrtf\fR    \fBcsqrtl\fR
  79 \fBctan\fR      \fBctanf\fR
  80 \fBctanh\fR     \fBctanhf\fR
  81 \fBctanhl\fR    \fBctanl\fR
  82 \fBerf\fR       \fBerfc\fR
  83 \fBerfcf\fR     \fBerfcl\fR
  84 \fBerff\fR      \fBerfl\fR
  85 \fBexp\fR       \fBexp2\fR
  86 \fBexp2f\fR     \fBexp2l\fR
  87 \fBexpf\fR      \fBexpl\fR
  88 \fBexpm1\fR     \fBexpm1f\fR
  89 \fBexpm1l\fR    \fBfabs\fR
  90 \fBfabsf\fR     \fBfabsl\fR
  91 \fBfdim\fR      \fBfdimf\fR
  92 \fBfdiml\fR     \fBfeclearexcept\fR
  93 \fBfegetenv\fR  \fBfegetexceptflag\fR
  94 \fBfegetround\fR        \fBfeholdexcept\fR
  95 \fBferaiseexcept\fR     \fBfesetenv\fR
  96 \fBfesetexceptflag\fR   \fBfesetround\fR
  97 \fBfetestexcept\fR      \fBfeupdateenv\fR
  98 \fBfex_get_handling\fR  \fBfex_get_log\fR
  99 \fBfex_get_log_depth\fR \fBfex_getexcepthandler\fR
 100 \fBfex_log_entry\fR     \fBfex_merge_flags\fR
 101 \fBfex_set_handling\fR  \fBfex_set_log\fR
 102 \fBfex_set_log_depth\fR \fBfex_setexcepthandler\fR
 103 \fBfloor\fR     \fBfloorf\fR
 104 \fBfloorl\fR    \fBfma\fR
 105 \fBfmaf\fR      \fBfmal\fR
 106 \fBfmax\fR      \fBfmaxf\fR
 107 \fBfmaxl\fR     \fBfmin\fR
 108 \fBfminf\fR     \fBfminl\fR
 109 \fBfmod\fR      \fBfmodf\fR
 110 \fBfmodl\fR     \fBfrexp\fR
 111 \fBfrexpf\fR    \fBfrexpl\fR
 112 \fBgamma\fR     \fBgamma_r\fR
 113 \fBgammaf\fR    \fBgammaf_r\fR
 114 \fBgammal\fR    \fBgammal_r\fR
 115 \fBhypot\fR     \fBhypotf\fR
 116 \fBhypotl\fR    \fBilogb\fR
 117 \fBilogbf\fR    \fBilogbl\fR
 118 \fBisnan\fR     \fBj0\fR
 119 \fBj0f\fR       \fBj0l\fR
 120 \fBj1\fR        \fBj1f\fR
 121 \fBj1l\fR       \fBjn\fR
 122 \fBjnf\fR       \fBjnl\fR
 123 \fBldexp\fR     \fBldexpf\fR
 124 \fBldexpl\fR    \fBlgamma\fR
 125 \fBlgamma_r\fR  \fBlgammaf\fR
 126 \fBlgammaf_r\fR \fBlgammal\fR
 127 \fBlgammal_r\fR \fBllrint\fR
 128 \fBllrintf\fR   \fBllrintl\fR
 129 \fBllround\fR   \fBllroundf\fR
 130 \fBllroundl\fR  \fBlog\fR
 131 \fBlog10\fR     \fBlog10f\fR
 132 \fBlog10l\fR    \fBlog1p\fR
 133 \fBlog1pf\fR    \fBlog1pl\fR
 134 \fBlog2\fR      \fBlog2f\fR
 135 \fBlog2l\fR     \fBlogb\fR
 136 \fBlogbf\fR     \fBlogbl\fR
 137 \fBlogf\fR      \fBlogl\fR
 138 \fBlrint\fR     \fBlrintf\fR
 139 \fBlrintl\fR    \fBlround\fR
 140 \fBlroundf\fR   \fBlroundl\fR
 141 \fBmatherr\fR   \fBmodf\fR
 142 \fBmodff\fR     \fBmodfl\fR
 143 \fBnan\fR       \fBnanf\fR
 144 \fBnanl\fR      \fBnearbyint\fR
 145 \fBnearbyintf\fR        \fBnearbyintl\fR
 146 \fBnextafter\fR \fBnextafterf\fR
 147 \fBnextafterl\fR        \fBnexttoward\fR
 148 \fBnexttowardf\fR       \fBnexttowardl\fR
 149 \fBpow\fR       \fBpowf\fR
 150 \fBpowl\fR      \fBremainder\fR
 151 \fBremainderf\fR        \fBremainderl\fR
 152 \fBremquo\fR    \fBremquof\fR
 153 \fBremquol\fR   \fBrint\fR
 154 \fBrintf\fR     \fBrintl\fR
 155 \fBround\fR     \fBroundf\fR
 156 \fBroundl\fR    \fBscalb\fR
 157 \fBscalbf\fR    \fBscalbl\fR
 158 \fBscalbln\fR   \fBscalblnf\fR
 159 \fBscalblnl\fR  \fBscalbn\fR
 160 \fBscalbnf\fR   \fBscalbnl\fR
 161 \fBsigngam\fR   \fBsigngamf\fR
 162 \fBsigngaml\fR  \fBsignificand\fR
 163 \fBsignificandf\fR      \fBsignificandl\fR
 164 \fBsin\fR       \fBsincos\fR
 165 \fBsincosf\fR   \fBsincosl\fR
 166 \fBsinf\fR      \fBsinh\fR
 167 \fBsinhf\fR     \fBsinhl\fR
 168 \fBsinl\fR      \fBsqrt\fR
 169 \fBsqrtf\fR     \fBsqrtl\fR
 170 \fBtan\fR       \fBtanf\fR
 171 \fBtanh\fR      \fBtanhf\fR
 172 \fBtanhl\fR     \fBtanl\fR
 173 \fBtgamma\fR    \fBtgammaf\fR
 174 \fBtgammal\fR   \fBtrunc\fR
 175 \fBtruncf\fR    \fBtruncl\fR
 176 \fBy0\fR        \fBy0f\fR
 177 \fBy0l\fR       \fBy1\fR
 178 \fBy1f\fR       \fBy1l\fR
 179 \fByn\fR        \fBynf\fR
 180 \fBynl\fR       \fB\fR
 181 .TE
 182 
 183 .sp
 184 .LP
 185 The following interfaces are unique to the x86 and amd64 versions of this library:
 186 .sp
 187 
 188 .sp
 189 .TS
 190 tab(    );
 191 lw(2.75i) lw(2.75i)
 192 .
 193 \fBfegetprec\fR \fBfesetprec\fR
 194 .TE
 195 
 196 .SH ACCURACY
 197 ISO/IEC 9899:1999, also known as C99, specifies the functions listed in the
 198 following tables and states that the accuracy of these functions is
 199 "implementation-defined". The information below characterizes the accuracy
 200 of these functions as implemented in \fBlibm.so.2\fR. For each function,
 201 the tables provide an upper bound on the largest error possible for any
 202 argument and the largest error actually observed among a large sample of
 203 arguments. Errors are expressed in "units in the last place", or ulps, relative
 204 to the exact function value for each argument (regarding the argument as
 205 exact). Ulps depend on the precision of the floating point format: if \fIy\fR
 206 is the exact function value, \fIx\fR and \fIx\fR' are adjacent floating point
 207 numbers such that \fIx\fR < \fIy\fR < \fIx\fR', and \fIx\fR'' is the computed
 208 function value, then provided \fIx\fR, \fIx\fR', and \fIx\fR'' all lie in the
 209 same binade, the error in \fIx\fR'' is |\fIy\fR - \fIx\fR''| / |\fIx\fR -
 210 \fIx\fR'| ulps. In particular, when the error is less than one ulp, the computed
 211 value is one of the two floating point numbers adjacent to the exact value.
 212 .sp
 213 .LP
 214 The bounds and observed errors listed below apply only in the default floating
 215 point modes. Specifically, on SPARC, these bounds assume the rounding direction
 216 is round-to-nearest and non-standard mode is disabled. On x86, the bounds assume
 217 the rounding direction is round-to-nearest and the rounding precision is
 218 round-to-64-bits. Moreover, on x86, floating point function values are returned
 219 in a floating point register in extended double precision format, but the bounds
 220 below assume that the result value is then stored to memory in the format
 221 corresponding to the function's type. On amd64, the bounds assume the rounding
 222 direction in both the x87 floating point control word and the MXCSR is
 223 round-to-nearest, the rounding precision in the x87 control word is
 224 round-to-64-bits, and the FTZ and DAZ modes are disabled.
 225 .sp
 226 .LP
 227 The error bounds listed below are believed to be correct, but smaller bounds
 228 might be proved later. The observed errors are the largest ones currently known,
 229 but larger errors might be discovered later. Numbers in the notes column refer
 230 to the notes following the tables.
 231 .SS "Real Functions"
 232 .SS "Single precision real functions (SPARC, x86, and amd64)"
 233 
 234 .TS
 235 tab(    );
 236 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 237 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 238 .
 239         error bound     largest error
 240 function         (ulps) observed (ulps) notes
 241 \fBacosf\fR     1.0     < 1
 242 \fBacoshf\fR    1.0     < 1
 243 \fBasinf\fR     1.0     < 1
 244 \fBasinhf\fR    1.0     < 1
 245 \fBatanf\fR     1.0     < 1
 246 \fBatan2f\fR    1.0     < 1
 247 \fBatanhf\fR    1.0     < 1
 248 \fBcbrtf\fR     1.0     < 1
 249 \fBcosf\fR      1.0     < 1
 250 \fBcoshf\fR     1.0     < 1
 251 \fBerff\fR      1.0     < 1
 252 \fBerfcf\fR     1.0     < 1
 253 \fBexpf\fR      1.0     < 1
 254 \fBexp2f\fR     1.0     < 1
 255 \fBexpm1f\fR    1.0     < 1
 256 \fBhypotf\fR    1.0     < 1
 257 \fBlgammaf\fR   1.0     < 1
 258 \fBlogf\fR      1.0     < 1
 259 \fBlog10f\fR    1.0     < 1
 260 \fBlog1pf\fR    1.0     < 1
 261 \fBlog2f\fR     1.0     < 1
 262 \fBpowf\fR      1.0     < 1
 263 \fBsinf\fR      1.0     < 1
 264 \fBsinhf\fR     1.0     < 1
 265 \fBsqrtf\fR     0.5     0.500   [1]
 266 \fBtanf\fR      1.0     < 1
 267 \fBtanhf\fR     1.0     < 1
 268 \fBtgammaf\fR   1.0     < 1
 269 .TE
 270 
 271 .SS "Double precision real functions (SPARC and amd64)"
 272 
 273 .TS
 274 tab(    );
 275 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 276 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 277 .
 278         error bound     largest error
 279 function         (ulps) observed (ulps) notes
 280 \fBacos\fR      1.0     < 1
 281 \fBacosh\fR     4.0     1.878
 282 \fBasin\fR      1.0     < 1
 283 \fBasinh\fR     7.0     1.653
 284 \fBatan\fR      1.0     <1
 285 \fBatan2\fR     2.5     1.475
 286 \fBatanh\fR     4.0     1.960
 287 \fBcbrt\fR      1.0     < 1
 288 \fBcos\fR       1.0     < 1
 289 \fBcosh\fR      3.0     1.168
 290 \fBerf\fR       4.0     0.959
 291 \fBerfc\fR      6.0     2.816
 292 \fBexp\fR       1.0     < 1
 293 \fBexp2\fR      2.0     1.050
 294 \fBexpm1\fR     1.0     < 1
 295 \fBhypot\fR     1.0     < 1
 296 \fBlgamma\fR    61.5    5.629   [2]
 297 \fBlog\fR       1.0     < 1
 298 \fBlog10\fR     3.5     1.592
 299 \fBlog1p\fR     1.0     < 1
 300 \fBlog2\fR      1.0     < 1
 301 \fBpow\fR       1.0     < 1
 302 \fBsin\fR       1.0     < 1
 303 \fBsinh\fR      4.0     2.078
 304 \fBsqrt\fR      0.5     0.500   [1]
 305 \fBtan\fR       1.0     < 1
 306 \fBtanh\fR      3.5     2.136
 307 \fBtgamma\fR    1.0     < 1
 308 .TE
 309 
 310 .SS "Double precision real functions (x86)"
 311 
 312 .TS
 313 tab(    );
 314 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 315 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 316 .
 317         error bound     largest error
 318 function         (ulps) observed (ulps) notes
 319 \fBacos\fR      1.0     < 1
 320 \fBacosh\fR     4.0     1.694
 321 \fBasin\fR      1.0     < 1
 322 \fBasinh\fR     7.0     1.493
 323 \fBatan\fR      1.0     < 1
 324 \fBatan2\fR     1.0     < 1
 325 \fBatanh\fR     4.0     1.445
 326 \fBcbrt\fR      1.0     < 1
 327 \fBcos\fR       1.0     < 1
 328 \fBcosh\fR      3.0     1.001
 329 \fBerf\fR       4.0     0.932
 330 \fBerfc\fR      6.0     2.728
 331 \fBexp\fR       1.0     < 1
 332 \fBexp2\fR      1.0     < 1
 333 \fBexpm1\fR     1.0     < 1
 334 \fBhypot\fR     1.0     < 1
 335 \fBlgamma\fR    61.5    2.654   [2]
 336 \fBlog\fR       1.0     < 1
 337 \fBlog10\fR     1.0     < 1
 338 \fBlog1p\fR     1.0     < 1
 339 \fBlog2\fR      1.0     < 1
 340 \fBpow\fR       1.0     < 1
 341 \fBsin\fR       1.0     < 1
 342 \fBsinh\fR      4.0     1.458
 343 \fBsqrt\fR      0.5003  0.500   [1]
 344 \fBtan\fR       1.0     < 1
 345 \fBtanh\fR      3.5     1.592
 346 \fBtgamma\fR    1.0     < 1
 347 .TE
 348 
 349 .SS "Quadruple precision real functions (SPARC)"
 350 
 351 .TS
 352 tab(    );
 353 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 354 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 355 .
 356         error bound     largest error
 357 function         (ulps) observed (ulps) notes
 358 \fBacosl\fR     3.5     1.771
 359 \fBacoshl\fR    8.0     1.275
 360 \fBasinl\fR     4.0     2.007
 361 \fBasinhl\fR    9.0     1.823
 362 \fBatanl\fR     1.0     < 1
 363 \fBatan2l\fR    2.5     1.102
 364 \fBatanhl\fR    4.0     1.970
 365 \fBcbrtl\fR     1.0     < 1
 366 \fBcosl\fR      1.0     < 1
 367 \fBcoshl\fR     3.5     0.985
 368 \fBerfl\fR      2.0     0.779
 369 \fBerfcl\fR     68.5    13.923
 370 \fBexpl\fR      1.0     < 1
 371 \fBexp2l\fR     2.0     0.714
 372 \fBexpm1l\fR    2.0     1.020
 373 \fBhypotl\fR    1.0     < 1
 374 \fBlgammal\fR   18.5    2.916   [2]
 375 \fBlogl\fR      1.0     < 1
 376 \fBlog10l\fR    3.5     1.156
 377 \fBlog1pl\fR    2.0     1.216
 378 \fBlog2l\fR     3.5     1.675
 379 \fBpowl\fR      1.0     < 1
 380 \fBsinl\fR      1.0     < 1
 381 \fBsinhl\fR     4.5     1.589
 382 \fBsqrtl\fR     0.5     0.500   [1]
 383 \fBtanl\fR      4.5     2.380
 384 \fBtanhl\fR     4.5     1.692
 385 \fBtgammal\fR   1.0     < 1
 386 .TE
 387 
 388 .SS "Extended precision real functions (x86 and amd64)"
 389 
 390 .TS
 391 tab(    );
 392 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 393 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 394 .
 395         error bound     largest error
 396 function         (ulps) observed (ulps) notes
 397 \fBacosl\fR     3.0     1.868
 398 \fBacoshl\fR    8.0     2.352
 399 \fBasinl\fR     3.0     1.716
 400 \fBasinhl\fR    9.0     2.346
 401 \fBatanl\fR     1.0     < 1
 402 \fBatan2l\fR    1.0     < 1
 403 \fBatanhl\fR    4.0     2.438
 404 \fBcbrtl\fR     1.0     < 1
 405 \fBcosl\fR      1.0     < 1
 406 \fBcoshl\fR     3.5     1.288
 407 \fBerfl\fR      1.0     < 1
 408 \fBerfcl\fR     78.5    13.407
 409 \fBexpl\fR      3.5     1.291
 410 \fBexp2l\fR     1.5     0.807
 411 \fBexpm1l\fR    4.0     1.936
 412 \fBhypotl\fR    3.5     2.087
 413 \fBlgammal\fR   22.5    4.197   [2]
 414 \fBlogl\fR      2.0     0.881
 415 \fBlog10l\fR    2.0     1.284
 416 \fBlog1pl\fR    5.0     2.370
 417 \fBlog2l\fR     1.0     < 1
 418 \fBpowl\fR      32770.0 4478.132
 419 \fBsinl\fR      1.0     < 1
 420 \fBsinhl\fR     4.5     2.356
 421 \fBsqrtl\fR     0.5     0.500   [1]
 422 \fBtanl\fR      4.5     2.366
 423 \fBtanhl\fR     4.5     2.417
 424 \fBtgammal\fR   1.0     < 1
 425 .TE
 426 
 427 .SS "Notes:"
 428 .ne 2
 429 .mk
 430 .na
 431 \fB[1]\fR
 432 .ad
 433 .RS 7n
 434 .rt
 435 On SPARC and amd64, \fBsqrtf\fR, \fBsqrt\fR, and \fBsqrtl\fR are correctly
 436 rounded in accordance with IEEE 754. On x86, \fBsqrtl\fR is correctly rounded,
 437 \fBsqrtf\fR is correctly rounded provided the result is narrowed to single
 438 precision as discussed above, but \fBsqrt\fR might not be correctly rounded due
 439 to "double rounding": when the intermediate value computed to extended precision
 440 lies exactly halfway between two representable numbers in double precision, the
 441 result of rounding the intermediate value to double precision is determined by
 442 the round-ties-to-even rule. If this rule causes the second rounding to round in
 443 the same direction as the first, the net rounding error can exceed 0.5 ulps.
 444 (The error is bounded instead by 0.5*(1 + 2^-11) ulps.)
 445 .RE
 446 
 447 .sp
 448 .ne 2
 449 .mk
 450 .na
 451 \fB[2]\fR
 452 .ad
 453 .RS 7n
 454 .rt
 455 Error bounds for lgamma and lgammal apply only for positive arguments.
 456 .RE
 457 
 458 .SS "Complex functions"
 459 The real-valued complex functions \fBcabsf\fR, \fBcabs\fR, \fBcabsl\fR,
 460 \fBcargf\fR, \fBcarg\fR, and \fBcargl\fR are equivalent to the real functions
 461 \fBhypotf\fR, \fBhypot\fR, \fBhypotl\fR, \fBatan2f\fR, \fBatan2\fR, and
 462 \fBatan2l\fR, respectively. The error bounds and observed errors given above for
 463 the latter functions also apply to the former.
 464 .sp
 465 .LP
 466 The complex functions listed below are complex-valued. For each function, the
 467 error bound shown applies separately to both the real and imaginary parts of the
 468 result. (For example, both the real and imaginary parts of \fBcacosf\fR(\fIz\fR)
 469 are accurate to within 1 ulp regardless of their magnitudes.) Similarly, the
 470 largest observed error shown is the largest error found in either the real or
 471 the imaginary part of the result.
 472 .SS "Single precision complex functions (SPARC and amd64)"
 473 
 474 .TS
 475 tab(    );
 476 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 477 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 478 .
 479         error bound     largest error
 480 function         (ulps) observed (ulps) notes
 481 \fBcacosf\fR, \fBcacoshf\fR     1       < 1  [1]
 482 \fBcasinf\fR, \fBcasinhf\fR     1       < 1
 483 \fBcatanf\fR, \fBcatanhf\fR     6       < 1
 484 \fBccosf\fR, \fBccoshf\fR       10      2.012
 485 \fBcexpf\fR     3       2.239
 486 \fBclogf\fR     3       < 1
 487 \fBcpowf\fR     \(em    < 1  [2]
 488 \fBcsinf\fR, \fBcsinhf\fR       10      2.009
 489 \fBcsqrtf\fR    4       < 1
 490 \fBctanf\fR, \fBctanhf\fR       13      6.987
 491 .TE
 492 
 493 .SS "Single precision complex functions (x86)"
 494 
 495 .TS
 496 tab(    );
 497 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 498 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 499 .
 500         error bound     largest error
 501 function         (ulps) observed (ulps) notes
 502 \fBcacosf\fR, \fBcacoshf\fR     1       < 1  [1]
 503 \fBcasinf\fR, \fBcasinhf\fR     1       < 1
 504 \fBcatanf\fR, \fBcatanhf\fR     6       < 1
 505 \fBccosf\fR, \fBccoshf\fR       10      1.984
 506 \fBcexpf\fR     3       1.984
 507 \fBclogf\fR     3       < 1
 508 \fBcpowf\fR     \(em    < 1  [2]
 509 \fBcsinf\fR, \fBcsinhf\fR       10      1.973
 510 \fBcsqrtf\fR    4       < 1
 511 \fBctanf\fR, \fBctanhf\fR       13      4.657
 512 .TE
 513 
 514 .SS "Double precision complex functions (SPARC and amd64)"
 515 
 516 .TS
 517 tab(    );
 518 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 519 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 520 .
 521         error bound     largest error
 522 function         (ulps) observed (ulps) notes
 523 \fBcacos\fR, \fBcacosh\fR       9       3.831   [1]
 524 \fBcasin\fR, \fBcasinh\fR       9       3.732
 525 \fBcatan\fR, \fBcatanh\fR       6       4.179
 526 \fBccos\fR, \fBccosh\fR 10      3.832
 527 \fBcexp\fR      3       2.255
 528 \fBclog\fR      3       2.870
 529 \fBcpow\fR      -       -       [2]
 530 \fBcsin\fR, \fBcsinh\fR 10      3.722
 531 \fBcsqrt\fR     4       3.204
 532 \fBctan\fR, \fBctanh\fR 13      7.143
 533 .TE
 534 
 535 .SS "Double precision complex functions (x86)"
 536 
 537 .TS
 538 tab(    );
 539 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 540 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 541 .
 542         error bound     largest error
 543 function         (ulps) observed (ulps) notes
 544 \fBcacos\fR, \fBcacosh\fR       9       3.624   [1]
 545 \fBcasin\fR, \fBcasinh\fR       9       3.624
 546 \fBcatan\fR, \fBcatanh\fR       6       2.500
 547 \fBccos\fR, \fBccosh\fR 10      2.929
 548 \fBcexp\fR      3       2.147
 549 \fBclog\fR      3       1.927
 550 \fBcpow\fR      -       -       [2]
 551 \fBcsin\fR, \fBcsinh\fR 10      2.918
 552 \fBcsqrt\fR     4       1.914
 553 \fBctan\fR, \fBctanh\fR 13      4.630
 554 .TE
 555 
 556 .SS "Quadruple precision complex functions (SPARC)"
 557 
 558 .TS
 559 tab(    );
 560 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 561 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 562 .
 563         error bound     largest error
 564 function         (ulps) observed (ulps) notes
 565 \fBcacosl\fR, \fBcacoshl\fR     9       3       [1]
 566 \fBcasinl\fR, \fBcasinhl\fR     9       3
 567 \fBcatanl\fR, \fBcatanhl\fR     6       3
 568 \fBccosl\fR, \fBccoshl\fR       10      3
 569 \fBcexpl\fR     3       2
 570 \fBclogl\fR     3       2
 571 \fBcpowl\fR     -       -       [2]
 572 \fBcsinl\fR, \fBcsinhl\fR       10      3
 573 \fBcsqrtl\fR    4       3
 574 \fBctanl\fR, \fBctanhl\fR       13      5
 575 .TE
 576 
 577 .SS "Extended precision complex functions (x86 and amd64)"
 578 
 579 .TS
 580 tab(    );
 581 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 582 cw(1.38i) cw(1.38i) cw(1.38i) cw(1.38i)
 583 .
 584         error bound     largest error
 585 function         (ulps) observed (ulps) notes
 586 \fBcacosl\fR, \fBcacoshl\fR     9       2       [1]
 587 \fBcasinl\fR, \fBcasinhl\fR     9       2
 588 \fBcatanl\fR, \fBcatanhl\fR     6       2
 589 \fBccosl\fR, \fBccoshl\fR       10      3
 590 \fBcexpl\fR     3       2.699
 591 \fBclogl\fR     3       1
 592 \fBcpowl\fR     -       -       [2]
 593 \fBcsinl\fR, \fBcsinhl\fR       10      3
 594 \fBcsqrtl\fR    4       1.452
 595 \fBctanl\fR, \fBctanhl\fR       13      5
 596 .TE
 597 
 598 .SS "Notes:"
 599 .ne 2
 600 .mk
 601 .na
 602 \fB[1]\fR
 603 .ad
 604 .RS 7n
 605 .rt
 606 The complex hyperbolic trigonometric functions are equivalent by symmetries to
 607 their circular trigonometric counterparts. Because the implementations of these
 608 functions exploit these symmetries, corresponding functions have the same error
 609 bounds and observed errors.
 610 .RE
 611 
 612 .sp
 613 .ne 2
 614 .mk
 615 .na
 616 \fB[2]\fR
 617 .ad
 618 .RS 7n
 619 .rt
 620 For large arguments, the results computed by \fBcpowf\fR, \fBcpow\fR, and
 621 \fBcpowl\fR can have unbounded relative error. It might be possible to give
 622 error bounds for specific domains, but no such bounds are currently available.
 623 The observed errors shown are for the domain {(\fIz\fR,\fIw\fR) :
 624 \fBmax\fR(|\fBRe\fR \fIz\fR|, |\fBIm\fR \fIz\fR|, |\fBRe\fR \fIw\fR|, |\fBIm\fR
 625 \fIw\fR|) <= 1}.
 626 .RE
 627 
 628 .SH FILES
 629 .ne 2
 630 .mk
 631 .na
 632 \fB\fB/lib/libm.so.2\fR\fR
 633 .ad
 634 .RS 21n
 635 .rt
 636 shared object
 637 .RE
 638 
 639 .sp
 640 .ne 2
 641 .mk
 642 .na
 643 \fB\fB/lib/64/libm.so.2\fR\fR
 644 .ad
 645 .RS 21n
 646 .rt
 647 64-bit shared object
 648 .RE
 649 
 650 .SH ATTRIBUTES
 651 See \fBattributes\fR(5) for descriptions of the following attributes:
 652 .sp
 653 
 654 .sp
 655 .TS
 656 tab(    ) box;
 657 cw(2.75i) |cw(2.75i)
 658 lw(2.75i) |lw(2.75i)
 659 .
 660 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 661 _
 662 MT-Level        Safe with exceptions
 663 .TE
 664 
 665 .sp
 666 .LP
 667 As described on the \fBlgamma\fR(3M) manual page, \fBgamma()\fR and
 668 \fBlgamma()\fR and their \fBfloat\fR and \fBlong double\fR counterparts are
 669 Unsafe. All other functions in \fBlibm.so.2\fR are MT-Safe.
 670 .SH SEE ALSO
 671 \fBIntro\fR(3), \fBlgamma\fR(3M), \fBmath.h\fR(3HEAD), \fBattributes\fR(5),
 672 \fBstandards\fR(5)