Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 9/08/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

IEEE_FMA

Elemental Module Intrinsic Function (Generic): Returns the result of a fused multiply-add operation. This is equivalent to the IEEE fusedMultiplyAdd operation.

Module

USE, INTRINSIC :: IEEE_ARITHMETIC

Syntax

result = IEEE_FMA (a,b,c)

a

(Input) Must be of type REAL.

b

(Input) Must be of type REAL with the same kind type parameter as a.

c

(Input) Must be of type REAL with the same kind type parameter as a.

Results

The result type is REAL with the same kind type parameter as a. When the result is in range, the value of the result is the mathematical value of (a * b) + c rounded according to the rounding mode of the representation method of a. Only the final step in the calculation may cause IEEE_INEXACT, IEEE_OVERFLOW, or IEEE_UNDERFLOW to signal; intermediate calculations do not.

This is the fusedMultiplyAdd operation as specified in the ISO/IEC/IEEE 60559:2011 standard.

Example

The result value of IEEE_FMA (TINY(0.0), TINY(0.0) 1.0) is equal to 1.0 when the rounding mode is set to NEAREST. The exception IEEE_INEXACT is signaled.