Document fmal.
This commit is contained in:
parent
94e03502dc
commit
66d672d8cb
@ -29,7 +29,8 @@
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm fma ,
|
||||
.Nm fmaf
|
||||
.Nm fmaf ,
|
||||
.Nm fmal
|
||||
.Nd fused multiply-add
|
||||
.Sh LIBRARY
|
||||
.Lb libm
|
||||
@ -39,11 +40,14 @@
|
||||
.Fn fma "double x" "double y" "double z"
|
||||
.Ft float
|
||||
.Fn fmaf "float x" "float y" "float z"
|
||||
.Ft long double
|
||||
.Fn fmal "long double x" "long double y" "long double z"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn fma
|
||||
.Fn fma ,
|
||||
.Fn fmaf ,
|
||||
and
|
||||
.Fn fmaf
|
||||
.Fn fmal
|
||||
functions return
|
||||
.No "(x * y) + z" ,
|
||||
computed with only one rounding error.
|
||||
@ -62,23 +66,21 @@ accuracy of calculations such as dot products.
|
||||
It may also be used to improve performance on machines that implement
|
||||
it natively.
|
||||
The macros
|
||||
.Dv FP_FAST_FMA
|
||||
and
|
||||
.Dv FP_FAST_FMA ,
|
||||
.Dv FP_FAST_FMAF
|
||||
and
|
||||
.Dv FP_FAST_FMAL
|
||||
may be defined in
|
||||
.In math.h
|
||||
to indicate that
|
||||
.Fn fma
|
||||
.Fn fma ,
|
||||
.Fn fmaf ,
|
||||
and
|
||||
.Fn fmaf
|
||||
.Fn fmal
|
||||
(respectively) have comparable or faster speed than a multiply
|
||||
operation followed by an add operation.
|
||||
.Sh IMPLEMENTATION NOTES
|
||||
In general,
|
||||
.Fn fma
|
||||
and
|
||||
.Fn fmaf
|
||||
will behave as one would expect if
|
||||
In general, these routines will behave as one would expect if
|
||||
.No "x * y + z"
|
||||
were computed with unbounded precision and range,
|
||||
then rounded to the precision of the return type.
|
||||
@ -93,13 +95,22 @@ would have otherwise generated an invalid exception.
|
||||
.Xr math 3
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Fn fma
|
||||
.Fn fma ,
|
||||
.Fn fmaf ,
|
||||
and
|
||||
.Fn fmaf
|
||||
.Fn fmal
|
||||
functions conform to
|
||||
.St -isoC-99 .
|
||||
A fused multiply-add operation with virtually identical
|
||||
characteristics appears in IEEE draft standard 754R.
|
||||
.Sh HISTORY
|
||||
These routines first appeared in
|
||||
.Fx 5.4 .
|
||||
The
|
||||
.Fn fma
|
||||
and
|
||||
.Fn fmaf
|
||||
routines first appeared in
|
||||
.Fx 5.4 ,
|
||||
and
|
||||
.Fn fmal
|
||||
appeared in
|
||||
.Fx 5.5 .
|
||||
|
Loading…
x
Reference in New Issue
Block a user