fmal man page on FreeBSD

Man page or keyword search:  
man Server   9747 pages
apropos Keyword Search (all sections)
Output format
FreeBSD logo
[printable version]

FMA(3)			 BSD Library Functions Manual			FMA(3)

     fma, fmaf, fmal — fused multiply-add

     Math Library (libm, -lm)

     #include <math.h>

     fma(double x, double y, double z);

     fmaf(float x, float y, float z);

     long double
     fmal(long double x, long double y, long double z);

     The fma(), fmaf(), and fmal() functions return (x * y) + z, computed with
     only one rounding error.  Using the ordinary multiplication and addition
     operators, by contrast, results in two roundings: one for the intermedi‐
     ate product and one for the final result.

     For instance, the expression 1.2e100 * 2.0e208 - 1.4e308 produces ∞ due
     to overflow in the intermediate product, whereas fma(1.2e100, 2.0e208,
     -1.4e308) returns approximately 1.0e308.

     The fused multiply-add operation is often used to improve the accuracy of
     calculations such as dot products.	 It may also be used to improve per‐
     formance on machines that implement it natively.  The macros FP_FAST_FMA,
     FP_FAST_FMAF and FP_FAST_FMAL may be defined in <math.h> to indicate that
     fma(), fmaf(), and fmal() (respectively) have comparable or faster speed
     than a multiply operation followed by an add operation.

     In general, these routines will behave as one would expect if x * y + z
     were computed with unbounded precision and range, then rounded to the
     precision of the return type.  However, on some platforms, if z is NaN,
     these functions may not raise an exception even when the computation of x
     * y would have otherwise generated an invalid exception.

     fenv(3), math(3)

     The fma(), fmaf(), and fmal() functions conform to ISO/IEC 9899:1999
     (“ISO C99”).  A fused multiply-add operation with virtually identical
     characteristics appears in IEEE draft standard 754R.

     The fma() and fmaf() routines first appeared in FreeBSD 5.4, and fmal()
     appeared in FreeBSD 6.0.

BSD			       January 22, 2005				   BSD

List of man pages available for FreeBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net