Additions from Thomas Graichen to mention each functions' floating point

counterpart.
Submitted by:	Thomas Graichen <graichen@sirius.physik.fu-berlin.de>
This commit is contained in:
Jordan K. Hubbard 1995-03-01 05:06:48 +00:00
parent ee32cbed3b
commit 7a15a32a17
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6794
27 changed files with 440 additions and 159 deletions

View File

@ -30,22 +30,27 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)acos.3 5.1 (Berkeley) 5/2/91
.\" $Id: acos.3,v 1.4 1993/10/29 22:57:17 jtc Exp $
.\" $Id: acos.3,v 1.1.1.1 1994/08/19 09:39:41 jkh Exp $
.\"
.Dd May 2, 1991
.Dt ACOS 3
.Os
.Sh NAME
.Nm acos
.Nd arc cosine function
.Nm acos ,
.Nm acosf
.Nd arc cosine functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn acos "double x"
.Ft float
.Fn acosf "float x"
.Sh DESCRIPTION
The
.Fn acos
function computes the principal value of the arc cosine of
and the
.Fn acosf
functions compute the principal value of the arc cosine of
.Fa x .
A domain error occurs for arguments not in the range [-1, +1].
For a discussion of error due to roundoff, see
@ -53,7 +58,9 @@ For a discussion of error due to roundoff, see
.Sh RETURN VALUES
The
.Fn acos
function returns the arc cosine in the range
and the
.Fn acosf
functions return the arc cosine in the range
.Bq 0 , \*(Pi
radians.
On the

View File

@ -30,22 +30,27 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)acosh.3 5.2 (Berkeley) 5/6/91
.\" $Id: acosh.3,v 1.4 1993/10/29 22:57:20 jtc Exp $
.\" $Id: acosh.3,v 1.1.1.1 1994/08/19 09:39:41 jkh Exp $
.\"
.Dd May 6, 1991
.Dt ACOSH 3
.Os BSD 4.3
.Sh NAME
.Nm acosh
.Nd inverse hyperbolic cosine function
.Nm acosh ,
.Nm acoshf
.Nd inverse hyperbolic cosine functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn acosh "double x"
.Ft float
.Fn acoshf "float x"
.Sh DESCRIPTION
The
.Fn acosh
function computes the inverse hyperbolic cosine
and the
.Fn acoshf
functions compute the inverse hyperbolic cosine
of the real
argument
.Ar x .
@ -54,8 +59,10 @@ For a discussion of error due to roundoff, see
.Sh RETURN VALUES
The
.Fn acosh
function
returns the inverse hyperbolic cosine of
and the
.Fn acoshf
functions
return the inverse hyperbolic cosine of
.Ar x .
On the
.Tn VAX

View File

@ -30,22 +30,27 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)asin.3 5.1 (Berkeley) 5/2/91
.\" $Id: asin.3,v 1.4 1993/10/29 22:57:22 jtc Exp $
.\" $Id: asin.3,v 1.1.1.1 1994/08/19 09:39:41 jkh Exp $
.\"
.Dd May 2, 1991
.Dt ASIN 3
.Os
.Sh NAME
.Nm asin
.Nd arc sine function
.Nm asin ,
.Nm asinf
.Nd arc sine functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn asin "double x"
.Ft float
.Fn asinf "float x"
.Sh DESCRIPTION
The
.Fn asin
function computes the principal value of the arc sine of
and the
.Fn asinf
functions compute the principal value of the arc sine of
.Fa x .
A domain error occurs for arguments not in the range [-1, +1].
For a discussion of error due to roundoff, see
@ -53,7 +58,9 @@ For a discussion of error due to roundoff, see
.Sh RETURN VALUES
The
.Fn asin
function returns the arc sine in the range
and the
.Fn asinf
functions return the arc sine in the range
.Bk -words
.Bq -\*(Pi/2, +\*(Pi/2
.Ek

View File

@ -30,22 +30,27 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)asinh.3 6.4 (Berkeley) 5/6/91
.\" $Id: asinh.3,v 1.4 1993/10/29 22:57:23 jtc Exp $
.\" $Id: asinh.3,v 1.1.1.1 1994/08/19 09:39:41 jkh Exp $
.\"
.Dd May 6, 1991
.Dt ASINH 3
.Os BSD 4.3
.Sh NAME
.Nm asinh
.Nd inverse hyperbolic sine function
.Nm asinh ,
.Nm asinhf
.Nd inverse hyperbolic sine functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn asinh "double x"
.Ft float
.Fn asinhf "float x"
.Sh DESCRIPTION
The
.Fn asinh
function computes the inverse hyperbolic sine
and the
.Fn asinhf
functions compute the inverse hyperbolic sine
of the real
argument
.Ar x .
@ -54,8 +59,10 @@ For a discussion of error due to roundoff, see
.Sh RETURN VALUES
The
.Fn asinh
function
returns the inverse hyperbolic sine of
and the
.Fn asinhf
functions
return the inverse hyperbolic sine of
.Ar x .
.Sh SEE ALSO
.Xr acosh 3 ,

View File

@ -30,28 +30,35 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)atan.3 5.1 (Berkeley) 5/2/91
.\" $Id: atan.3,v 1.4 1993/10/04 18:07:15 jtc Exp $
.\" $Id: atan.3,v 1.1.1.1 1994/08/19 09:39:41 jkh Exp $
.\"
.Dd May 2, 1991
.Dt ATAN 3
.Os
.Sh NAME
.Nm atan
.Nd arc tangent function of one variable
.Nm atan ,
.Nm atanf
.Nd arc tangent functions of one variable
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn atan "double x"
.Ft float
.Fn atanf "float x"
.Sh DESCRIPTION
The
.Fn atan
function computes the principal value of the arc tangent of
and the
.Fn atanf
functions compute the principal value of the arc tangent of
.Fa x .
For a discussion of error due to roundoff, see
.Xr math 3 .
.Sh RETURN VALUES
The
.Fn atan
and the
.Fn atanf
function returns the arc tangent in the range
.Bk -words
.Bq -\*(Pi/2 , +\*(Pi/2

View File

@ -30,40 +30,47 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)atan2.3 5.1 (Berkeley) 5/2/91
.\" $Id: atan2.3,v 1.3 1993/08/14 13:42:32 mycroft Exp $
.\" $Id: atan2.3,v 1.1.1.1 1994/08/19 09:39:41 jkh Exp $
.\"
.Dd May 2, 1991
.Dt ATAN2 3
.Os
.Sh NAME
.Nm atan2
.Nd arc tangent function of two variables
.Nm atan2 ,
.Nm atan2f
.Nd arc tangent functions of two variables
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn atan2 "double y" "double x"
.Ft float
.Fn atan2f "float y" "float x"
.Sh DESCRIPTION
The
.Xr atan2
function computes the principal value of the arc tangent of
.Ar y/ Ns Ar x ,
.Fn atan2
and the
.Fn atan2f
functions compute the principal value of the arc tangent of
.Fa y/ Ns Ar x ,
using the signs of both arguments to determine the quadrant of
the return value.
.Sh RETURN VALUES
The
.Xr atan2
function, if successful,
returns the arc tangent of
.Ar y/ Ns Ar x
.Fn atan2
and the
.Fn atan2f
functions, if successful,
return the arc tangent of
.Fa y/ Ns Ar x
in the range
.Bk -words
.Bq \&- Ns \*(Pi , \&+ Ns \*(Pi
.Ek
radians.
If both
.Ar x
.Fa x
and
.Ar y
.Fa y
are zero, the global variable
.Va errno
is set to

View File

@ -30,22 +30,27 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)atanh.3 5.2 (Berkeley) 5/6/91
.\" $Id: atanh.3,v 1.4 1993/10/29 22:57:24 jtc Exp $
.\" $Id: atanh.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd May 6, 1991
.Dt ATANH 3
.Os BSD 4.3
.Sh NAME
.Nm atanh
.Nd inverse hyperbolic tangent function
.Nm atanh ,
.Nm atanhf
.Nd inverse hyperbolic tangent functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn atanh "double x"
.Ft float
.Fn atanhf "float x"
.Sh DESCRIPTION
The
.Fn atanh
function computes the inverse hyperbolic tangent
and the
.Fn atanhf
functions compute the inverse hyperbolic tangent
of the real
argument
.Ar x .
@ -54,8 +59,10 @@ For a discussion of error due to roundoff, see
.Sh RETURN VALUES
The
.Fn atanh
function
returns the inverse hyperbolic tangent of
and the
.Fn atanhf
functions
return the inverse hyperbolic tangent of
.Ar x
if successful.
On the

View File

@ -30,22 +30,27 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)ceil.3 5.1 (Berkeley) 5/2/91
.\" $Id: ceil.3,v 1.6 1994/03/11 01:32:08 jtc Exp $
.\" $Id: ceil.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd March 10, 1994
.Dt CEIL 3
.Os
.Sh NAME
.Nm ceil
.Nm ceil ,
.Nm ceilf
.Nd round to smallest integral value not greater than x
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn ceil "double x"
.Ft float
.Fn ceil "float x"
.Sh DESCRIPTION
The
.Fn ceil
function returns the smallest integral value
and the
.Fn ceilf
functions return the smallest integral value
(represented as a double precision number)
greater than or equal to
.Fa x .

View File

@ -30,22 +30,27 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)cos.3 5.1 (Berkeley) 5/2/91
.\" $Id: cos.3,v 1.5 1993/10/29 22:57:25 jtc Exp $
.\" $Id: cos.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd May 2, 1991
.Dt COS 3
.Os
.Sh NAME
.Nm cos
.Nd cosine function
.Nm cos ,
.Nm cosf
.Nd cosine functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn cos "double x"
.Ft float
.Fn cos "float x"
.Sh DESCRIPTION
The
.Fn cos
function computes the cosine of
and the
.Fn cosf
functions compute the cosine of
.Fa x
(measured in radians).
A large magnitude argument may yield a result with little or no
@ -55,7 +60,9 @@ For a discussion of error due to roundoff, see
.Sh RETURN VALUES
The
.Fn cos
function returns the cosine value.
and the
.Fn cosf
functions return the cosine value.
.Sh SEE ALSO
.Xr sin 3 ,
.Xr tan 3 ,

View File

@ -30,27 +30,34 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)cosh.3 5.1 (Berkeley) 5/2/91
.\" $Id: cosh.3,v 1.4 1993/10/29 22:57:26 jtc Exp $
.\" $Id: cosh.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd May 2, 1991
.Dt COSH 3
.Os
.Sh NAME
.Nm cosh
.Nd hyperbolic cosine function
.Nm cosh ,
.Nm coshf
.Nd hyperbolic cosine functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn cosh "double x"
.Ft float
.Fn cosh "float x"
.Sh DESCRIPTION
The
.Fn cosh
function computes the hyperbolic cosine of
and the
.Fn coshf
functions compute the hyperbolic cosine of
.Fa x .
.Sh RETURN VALUES
The
.Fn cosh
function returns the hyperbolic cosine unless the magnitude
and the
.Fn coshf
functions return the hyperbolic cosine unless the magnitude
of
.Fa x
is too large; in this event, the global variable

View File

@ -30,28 +30,36 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)erf.3 6.4 (Berkeley) 4/20/91
.\" $Id: erf.3,v 1.3 1993/08/14 13:42:38 mycroft Exp $
.\" $Id: erf.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd April 20, 1991
.Dt ERF 3
.Os BSD 4.3
.Sh NAME
.Nm erf ,
.Nm erfc
.Nm erff ,
.Nm erfc ,
.Nm erfcf
.Nd error function operators
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn erf "double x"
.Ft float
.Fn erff "float x"
.Ft double
.Fn erfc "double x"
.Ft float
.Fn erfcf "float x"
.Sh DESCRIPTION
These functions calculate the error function of
.Fa x .
.Pp
The
.Fn erf
calculates the error function of x; where
and the
.Fn erff
functions calculate the error function of x; where
.Bd -filled -offset indent
.if n \{\
erf(x) = 2/sqrt(pi)\(**\|integral from 0 to x of exp(\-t\(**t) dt. \}
@ -62,7 +70,9 @@ erf\|(x) :=
.Pp
The
.Fn erfc
function calculates the complementary error function of
and the
.Fn erfcf
functions calculate the complementary error function of
.Fa x ;
that is
.Fn erfc

View File

@ -30,73 +30,110 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)exp.3 6.12 (Berkeley) 7/31/91
.\" $Id: exp.3,v 1.7 1994/02/11 18:34:05 jtc Exp $
.\" $Id: exp.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd July 31, 1991
.Dt EXP 3
.Os BSD 4
.Sh NAME
.Nm exp ,
.Nm expf ,
.Nm exp2 ,
.Nm exp2f ,
.Nm exp10 ,
.Nm exp10f ,
.Nm expm1 ,
.Nm expm1f ,
.Nm log ,
.Nm logf ,
.Nm log2 ,
.Nm log2f ,
.Nm log10 ,
.Nm log10f ,
.Nm log1p ,
.Nm pow
.Nm log1pf ,
.Nm pow ,
.Nm powf
.Nd exponential, logarithm, power functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn exp "double x"
.Ft float
.Fn expf "float x"
.Ft double
.Fn expm1 "double x"
.Ft float
.Fn expm1f "float x"
.Ft double
.Fn log "double x"
.Ft float
.Fn logf "float x"
.Ft double
.Fn log10 "double x"
.Ft float
.Fn log10f "float x"
.Ft double
.Fn log1p "double x"
.Ft float
.Fn log1pf "float x"
.Ft double
.Fn pow "double x" "double y"
.Ft float
.Fn powf "float x" "float y"
.Sh DESCRIPTION
The
.Fn exp
function computes the exponential value of the given argument
and the
.Fn expf
functions compute the exponential value of the given argument
.Fa x .
.Pp
The
.Fn expm1
function computes the value exp(x)\-1 accurately even for tiny argument
and the
.Fn expm1f
functions compute the value exp(x)\-1 accurately even for tiny argument
.Fa x .
.Pp
The
.Fn log
function computes the value of the natural logarithm of argument
and the
.Fn logf
functions compute the value of the natural logarithm of argument
.Fa x.
.Pp
The
.Fn log10
function computes the value of the logarithm of argument
and the
.Fn log10f
functions compute the value of the logarithm of argument
.Fa x
to base 10.
.Pp
The
.Fn log1p
function computes
and the
.Fn log1pf
functions compute
the value of log(1+x) accurately even for tiny argument
.Fa x .
.Pp
The
.Fn pow
computes the value
and the
.Fn powf
functions compute the value
of
.Ar x
to the exponent
.Ar y .
.Sh ERROR (due to Roundoff etc.)
exp(x), log(x), expm1(x) and log1p(x) are accurate to within
.Fn exp(x) ,
.Fn log(x) ,
.Fn expm1(x) and
.Fn log1p(x)
are accurate to within
an
.Em ulp ,
and log10(x) to within about 2
@ -145,8 +182,7 @@ These functions will return the appropriate computation unless an error
occurs or an argument is out of range.
The functions
.Fn exp ,
.Fn expm1
and
.Fn expm1 ,
.Fn pow
detect if the computed value will overflow,
set the global variable
@ -156,7 +192,7 @@ and cause a reserved operand fault on a
.Tn VAX
or
.Tn Tahoe .
The function
The functions
.Fn pow x y
checks to see if
.Fa x

View File

@ -31,27 +31,34 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)fabs.3 5.1 (Berkeley) 5/2/91
.\" $Id: fabs.3,v 1.4 1993/10/04 18:04:34 jtc Exp $
.\" $Id: fabs.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd May 2, 1991
.Dt FABS 3
.Os
.Sh NAME
.Nm fabs
.Nd floating-point absolute value function
.Nm fabs ,
.Nm fabsf
.Nd floating-point absolute value functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn fabs "double x"
.Ft float
.Fn fabsf "float x"
.Sh DESCRIPTION
The
.Fn fabs
function computes the absolute value of a floating-point number
and the
.Fn fabsf
functions compute the absolute value of a floating-point number
.Fa x .
.Sh RETURN VALUES
The
.Fn fabs
function returns the absolute value of
and the
.Fn fabsf
functions return the absolute value of
.Fa x .
.Sh SEE ALSO
.Xr abs 3 ,

View File

@ -30,21 +30,26 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)floor.3 6.5 (Berkeley) 4/19/91
.\" $Id: floor.3,v 1.5 1994/03/11 01:32:10 jtc Exp $
.\" $Id: floor.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd March 10, 1994
.Dt FLOOR 3
.Os
.Sh NAME
.Nm floor
.Nm floor ,
.Nm floorf
.Nd round to largest integral value not greater than x
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn floor "double x"
.Ft float
.Fn floorf "float x"
.Sh DESCRIPTION
The
.Fn floor
and the
.Fn floorf
function returns the largest integral value
(represented as a double precision number)
less than or equal to

View File

@ -30,27 +30,34 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)fmod.3 5.1 (Berkeley) 5/2/91
.\" $Id: fmod.3,v 1.3 1993/08/14 13:42:46 mycroft Exp $
.\" $Id: fmod.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd May 2, 1991
.Dt FMOD 3
.Os
.Sh NAME
.Nm fmod
.Nd floating-point remainder function
.Nm fmod ,
.Nm fmodf
.Nd floating-point remainder functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn fmod "double x" "double y"
.Ft float
.Fn fmodf "float x" "float y"
.Sh DESCRIPTION
The
.Fn fmod
function computes the floating-point remainder of
and the
.Fn fmodf
functions compute the floating-point remainder of
.Fa x Ns / Fa y .
.Sh RETURN VALUES
The
.Fn fmod
function returns the value
and the
.Fn fmodf
functions return the value
.Sm off
.Fa x - Em i * Fa y ,
.Sm on
@ -66,6 +73,8 @@ If
.Fa y
is zero, whether a domain error occurs or the
.Fn fmod
and the
.Fn fmodf
function returns zero is implementation-defined.
.Sh SEE ALSO
.Xr math 3

View File

@ -30,29 +30,38 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)hypot.3 6.7 (Berkeley) 5/6/91
.\" $Id: hypot.3,v 1.3 1993/08/14 13:42:48 mycroft Exp $
.\" $Id: hypot.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd May 6, 1991
.Dt HYPOT 3
.Os BSD 4
.Sh NAME
.Nm hypot ,
.Nm cabs
.Nm hypotf ,
.Nm cabs ,
.Nm cabsf
.Nd euclidean distance and complex absolute value functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn hypot "double x" "double y"
.Ft float
.Fn hypotf "float x" "float y"
.Fd struct {double x, y;} z;
.Ft double
.Fn cabs z
.Fd struct {float x, y;} z;
.Ft float
.Fn cabsf z
.Sh DESCRIPTION
The
.Fn hypot
and
.Fn hypot ,
.Fn hypotf ,
.Fn cabs
and
.Fn cabsf
functions
computes the
compute the
sqrt(x*x+y*y)
in such a way that underflow will not happen, and overflow
occurs only if the final result deserves it.

View File

@ -30,45 +30,67 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)ieee.3 6.4 (Berkeley) 5/6/91
.\" $Id: ieee.3,v 1.7 1994/03/10 18:15:07 jtc Exp $
.\" $Id: ieee.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd Feb 25, 1994
.Dt IEEE 3
.Os
.Sh NAME
.Nm copysign ,
.Nm copysignf ,
.Nm finite ,
.Nm finitef ,
.Nm ilogb ,
.Nm ilogbf ,
.Nm nextafter ,
.Nm nextafterf ,
.Nm remainder ,
.Nm scalbn
.Nm remainderf ,
.Nm scalbn ,
.Nm scalbnf
.Nd Functions for IEEE arithmetic
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn copysign "double x" "double y"
.Ft float
.Fn copysignf "float x" "float y"
.Ft int
.Fn finite "double x"
.Ft int
.Fn finitef "float x"
.Ft int
.Fn ilogb "double x"
.Ft int
.Fn ilogbf "float x"
.Ft double
.Fn nextafter "double x" "double y"
.Ft float
.Fn nextafterf "float x" "float y"
.Ft double
.Fn remainder "double x" "double y"
.Ft float
.Fn remainderf "float x" "float y"
.Ft double
.Fn scalbn "double x" "int n"
.Ft float
.Fn scalbnf "float x" "int n"
.Sh DESCRIPTION
These functions are required or recommended by
.St -ieee754 .
.Pp
.Fn copysign
returns
and
.Fn copysignf
return
.Fa x
with its sign changed to
.Fa y Ns 's.
.Pp
.Fn finite
returns the value 1 just when
and
.Fn finitef
return the value 1 just when
\-\*(If \*(Lt
.Fa x
\*(Lt +\*(If;
@ -81,7 +103,9 @@ zero is returned
is \*(Na
.Pp
.Fn ilogb
returns
and
.Fn ilogbf
return
.Fa x Ns 's exponent
.Fa n ,
in integer format.
@ -94,13 +118,17 @@ returns
.Dv INT_MIN .
.Pp
.Fn nextafter
returns the next machine representable number from
and
.Fn nextafterf
return the next machine representable number from
.Fa x
in direction
.Fa y .
.Pp
.Fn remainder
returns the remainder
and
.Fn remainderf
return the remainder
.Fa r
:=
.Fa x
@ -138,7 +166,9 @@ and
are invalid operations that produce a \*(Na.
.Pp
.Fn scalbn
returns
and
.Fn scalbnf
return
.Fa x Ns \(**(2** Ns Fa n )
computed by exponent manipulation.
.Sh SEE ALSO

View File

@ -30,31 +30,42 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)ieee.3 6.4 (Berkeley) 5/6/91
.\" $Id: ieee_test.3,v 1.1 1994/03/11 17:19:01 jtc Exp $
.\" $Id: ieee_test.3,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $
.\"
.Dd March 10, 1994
.Dt IEEE_TEST 3
.Os
.Sh NAME
.Nm logb ,
.Nm logbf ,
.Nm scalb ,
.Nm significand
.Nm scalbf ,
.Nm significand ,
.Nm significandf
.Nd IEEE test functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn logb "double x"
.Ft float
.Fn logbf "float x"
.Ft double
.Fn scalb "double x" "double n"
.Ft float
.Fn scalbf "float x" "float n"
.Ft double
.Fn significand "double x"
.Ft float
.Fn significandf "float x"
.Sh DESCRIPTION
These functions allow users to test conformance to
.St -ieee754 .
Their use is not otherwise recommended.
.Pp
.Fn logb x
returns
and
.Fn logbf x
return
.Fa x Ns 's exponent
.Fa n ,
a signed integer converted to double\-precision floating\-point.
@ -64,12 +75,16 @@ a signed integer converted to double\-precision floating\-point.
= -\*(If with a division by zero exception.
.Pp
.Fn scalbn x n
returns
and
.Fn scalbnf x n
return
.Fa x Ns \(**(2** Ns Fa n )
computed by exponent manipulation.
.Pp
.Fn significand x
returns
and
.Fn significandf x
return
.Fa sig ,
where
.Fa x
@ -79,7 +94,9 @@ with 1 \(<=
.Fa sig
< 2.
.Fn significand x
is not defined when
and
.Fn significandf x
are not defined when
.Fa x
is 0, \*(Pm\*(If, or \*(Na.
.Sh SEE ALSO

View File

@ -30,38 +30,58 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)j0.3 6.7 (Berkeley) 4/19/91
.\" $Id: j0.3,v 1.5 1994/01/11 00:46:54 jtc Exp $
.\" $Id: j0.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd April 19, 1991
.Dt J0 3
.Os BSD 4
.Sh NAME
.Nm j0 ,
.Nm j0f ,
.Nm j1 ,
.Nm j1f ,
.Nm jn ,
.Nm jnf ,
.Nm y0 ,
.Nm y0f ,
.Nm y1 ,
.Nm yn
.Nm y1f ,
.Nm yn ,
.Nm ynf
.Nd bessel functions of first and second kind
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn j0 "double x"
.Ft float
.Fn j0f "float x"
.Ft double
.Fn j1 "double x"
.Ft float
.Fn j1f "float x"
.Ft double
.Fn jn "int n" "double x"
.Ft float
.Fn jnf "int n" "float x"
.Ft double
.Fn y0 "double x"
.Ft float
.Fn y0f "float x"
.Ft double
.Fn y1 "double x"
.Ft float
.Fn y1f "float x"
.Ft double
.Fn yn "int n" "double x"
.Ft float
.Fn ynf "int n" "float x"
.Sh DESCRIPTION
The functions
.Fn j0
and
.Fn j0 ,
.Fn j0f ,
.Fn j1
and
.Fn j1f
compute the
.Em Bessel function of the first kind of the order
0 and the
@ -70,18 +90,22 @@ compute the
for the
real value
.Fa x ;
the function
the functions
.Fn jn
computes the
and
.Fn jnf
compute the
.Em Bessel function of the first kind of the integer order
.Fa n
for the real value
.Fa x .
.Pp
The functions
.Fn y0
.Fn y0 ,
.Fn y0f ,
.Fn y1 ,
and
.Fn y1
.Fn y1f
compute the linearly independent
.Em Bessel function of the second kind of the order
0 and the
@ -92,17 +116,19 @@ positive
.Em integer
value
.Fa x
(expressed as a double);
the function
(expressed as a double or float);
the functions
.Fn yn
computes the
and
.Fn ynf
compute the
.Em Bessel function of the second kind for the integer order
.Fa n
for the positive
.Em integer
value
.Fa x
(expressed as a double).
(expressed as a double or float).
.Sh RETURN VALUES
If these functions are successful,
the computed value is returned. On the

View File

@ -30,15 +30,17 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)lgamma.3 6.6 (Berkeley) 12/3/92
.\" $Id: lgamma.3,v 1.6 1994/01/11 00:46:56 jtc Exp $
.\" $Id: lgamma.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd December 3, 1992
.Dt LGAMMA 3
.Os BSD 4.3
.Sh NAME
.Nm lgamma ,
.Nm gamma
.Nd log gamma function, gamma function
.Nm lgammaf ,
.Nm gamma ,
.Nm gammaf
.Nd log gamma functions, gamma functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft extern int
@ -46,12 +48,18 @@
.sp
.Ft double
.Fn lgamma "double x"
.Ft float
.Fn lgammaf "float x"
.Ft double
.Fn gamma "double x"
.Ft float
.Fn gamma "float x"
.Sh DESCRIPTION
.Fn Lgamma x
.Fn lgamma x
and
.Fn lgammaf x
.if t \{\
returns ln\||\(*G(x)| where
return ln\||\(*G(x)| where
.Bd -unfilled -offset indent
\(*G(x) = \(is\d\s8\z0\s10\u\u\s8\(if\s10\d t\u\s8x\-1\s10\d e\u\s8\-t\s10\d dt for x > 0 and
.br
@ -65,8 +73,10 @@ The external integer
.Fa signgam
returns the sign of \(*G(x).
.Pp
.Fn Gamma x
returns \(*G(x), with no effect on
.Fn gamma x
and
.Fn gammaf x
return \(*G(x), with no effect on
.Fa signgam .
.Sh IDIOSYNCRASIES
Do not use the expression
@ -79,19 +89,25 @@ lg = lgamma(x); g = signgam\(**exp(lg);
.Pp
Only after
.Fn lgamma
or
.Fn lgammaf
has returned can signgam be correct.
.Pp
For arguments in its range,
.Fn gamma
and
.Fn gammaf
is preferred, as for positive arguments
it is accurate to within one unit in the last place.
Exponentiation of
.Fn lgamma
will lose up to 10 significant bits.
.Sh RETURN VALUES
.Fn Gamma
.Fn gamma ,
.Fn gammaf ,
.Fn lgamma ,
and
.Fn lgamma
.Fn lgammaf
return appropriate values unless an argument is out of range.
Overflow will occur for sufficiently large positive values, and
non-positive integers.

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)math.3 6.10 (Berkeley) 5/6/91
.\" $Id: math.3,v 1.4 1994/02/25 19:43:56 jtc Exp $
.\" $Id: math.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.TH MATH 3M "May 6, 1991"
.UC 4
@ -50,8 +50,11 @@ These functions constitute the C math library,
The link editor searches this library under the \*(lq\-lm\*(rq option.
Declarations for these functions may be obtained from the include file
.RI < math.h >.
The Fortran math library is described in ``man 3f intro''.
.\" The Fortran math library is described in ``man 3f intro''.
.SH "LIST OF FUNCTIONS"
Each of the following double functions has a float counterpart with the
name ending in f, as an example the float counterpart of double acos(double
x) is float acosf(float x).
.sp 2
.nf
.ta \w'copysign'u+2n +\w'infnan.3m'u+10n +\w'inverse trigonometric func'u
@ -110,11 +113,11 @@ arithmetic conforming to the IEEE Standard 754 for Binary
Floating\-Point Arithmetic. The two versions behave very
similarly, as should be expected from programs more accurate
and robust than was the norm when UNIX was born. For
instance, the programs are accurate to within the numbers
instance, the programs are accurat ere accurn the numbers
of \*(ups tabulated above; an \*(up is one \fIU\fRnit in the \fIL\fRast
\fIP\fRlace. And the programs have been cured of anomalies that
afflicted the older math library \fIlibm\fR in which incidents like
the following had been reported:
\fIP\fRlace. And the progrod the prbeen cured of anomalies that
afflicted the older mat` older math library \fIlibm\fR in which incidents like
the followineported:
.RS
sqrt(\-1.0) = 0.0 and log(\-1.0) = \-1.7e38.
.br

View File

@ -30,23 +30,28 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)rint.3 5.1 (Berkeley) 5/2/91
.\" $Id: rint.3,v 1.4 1994/03/11 01:32:11 jtc Exp $
.\" $Id: rint.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd March 10, 1994
.Dt RINT 3
.Os
.Sh NAME
.Nm rint
.Nm rint ,
.Nm rintf
.Nd round to integral value in floating-point format
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn rint "double x"
.Ft float
.Fn rintf "float x"
.Sh DESCRIPTION
The
.Fn rint
function returns the integral value (represented as a double precision number)
nearest to
and the
.Fn rintf
functions return the integral value (represented as a double or float
precision number) nearest to
.Fa x
according to the prevailing rounding mode.
.Sh SEE ALSO

View File

@ -31,22 +31,27 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)sin.3 6.7 (Berkeley) 4/19/91
.\" $Id: sin.3,v 1.4 1993/10/29 22:57:28 jtc Exp $
.\" $Id: sin.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd April 19, 1991
.Dt SIN 3
.Os
.Sh NAME
.Nm sin
.Nd sine function
.Nm sin ,
.Nm sinf
.Nd sine functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn sin "double x"
.Ft float
.Fn sinf "float x"
.Sh DESCRIPTION
The
.Fn sin
function computes the sine of
and the
.Fn sinf
functions compute the sine of
.Fa x
(measured in radians).
A large magnitude argument may yield a result with little
@ -54,7 +59,9 @@ or no significance.
.Sh RETURN VALUES
The
.Fn sin
function returns the sine value.
and the
.Fn sinf
functions return the sine value.
.Sh SEE ALSO
.Xr acos 3 ,
.Xr asin 3 ,

View File

@ -30,26 +30,33 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)sinh.3 6.6 (Berkeley) 4/19/91
.\" $Id: sinh.3,v 1.4 1993/10/29 22:57:30 jtc Exp $
.\" $Id: sinh.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.Dd April 19, 1991
.Dt SINH 3
.Os
.Sh NAME
.Nm sinh
.Nm sinh ,
.Nm sinhf
.Nd hyperbolic sine function
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn sinh "double x"
.Ft float
.Fn sinhf "float x"
.Sh DESCRIPTION
The
.Fn sinh
function computes the hyperbolic sine of
and the
.Fn sinhf
functions compute the hyperbolic sine of
.Fa x .
.Sh RETURN VALUES
The
.Fn sinh
function returns the hyperbolic sine value unless
and the
.Fn sinhf
functions return the hyperbolic sine value unless
the magnitude
of
.Fa x

View File

@ -30,39 +30,53 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)sqrt.3 6.4 (Berkeley) 5/6/91
.\" $Id: sqrt.3,v 1.3 1993/08/14 13:43:05 mycroft Exp $
.\" $Id: sqrt.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
.\"
.Dd May 6, 1991
.Dt SQRT 3
.Os
.Sh NAME
.Nm cbrt ,
.Nm sqrt
.Nm cbrtf ,
.Nm sqrt ,
.Nm sqrtf
.Nd cube root and square root functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn cbrt "double x"
.Ft float
.Fn cbrtf "float x"
.Ft double
.Fn sqrt "double x"
.Ft float
.Fn sqrtf "float x"
.Sh DESCRIPTION
The
.Fn cbrt
function computes
and the
.Fn cbrtf
functions compute
the cube root of
.Ar x .
.Pp
The
.Fn sqrt
computes the
and the
.Fn sqrtf
functions compute the
non-negative square root of x.
.Sh RETURN VALUES
The
.Fn cbrt
function returns the requested cube root.
and the
.Fn cbrtf
functions return the requested cube root.
The
.Fn sqrt
function returns the requested square root
and the
.Fn sqrtf
functions return the requested square root
unless an error occurs.
On the
.Tn VAX

View File

@ -30,22 +30,27 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)tan.3 5.1 (Berkeley) 5/2/91
.\" $Id: tan.3,v 1.4 1993/10/05 16:33:47 jtc Exp $
.\" $Id: tan.3,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $
.\"
.Dd May 2, 1991
.Dt TAN 3
.Os
.Sh NAME
.Nm tan
.Nd tangent function
.Nm tan ,
.Nm tanf
.Nd tangent functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn tan "double x"
.Ft float
.Fn tanf "float x"
.Sh DESCRIPTION
The
.Fn tan
function computes the tangent of
and the
.Fn tanf
functions compute the tangent of
.Fa x
(measured in radians).
A large magnitude argument may yield a result

View File

@ -30,29 +30,36 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)tanh.3 5.1 (Berkeley) 5/2/91
.\" $Id: tanh.3,v 1.4 1993/10/05 16:33:49 jtc Exp $
.\" $Id: tanh.3,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $
.\"
.Dd May 2, 1991
.Dt TANH 3
.Os
.Sh NAME
.Nm tanh
.Nd hyperbolic tangent function
.Nm tanh ,
.Nm tanhf
.Nd hyperbolic tangent functions
.Sh SYNOPSIS
.Fd #include <math.h>
.Ft double
.Fn tanh "double x"
.Ft float
.Fn tanhf "float x"
.Sh DESCRIPTION
The
.Fn tanh
function computes the hyperbolic tangent of
and the
.Fn tanhf
functions compute the hyperbolic tangent of
.Fa x .
For a discussion of error due to roundoff, see
.Xr math 3 .
.Sh RETURN VALUES
The
.Fn tanh
function returns the hyperbolic tangent value.
and the
.Fn tanhf
functions return the hyperbolic tangent value.
.Sh SEE ALSO
.Xr acos 3 ,
.Xr asin 3 ,