FMA(3G)

    .SH "NAME" fma - perform a fused multiply-add operation
    .SH "DECLARATION"

            .HP u genType fma(genType a, genType b, genType c);
            .HP u genDType fma(genDType a, genDType b, genDType c);

    .SH "PARAMETERS"

        .PP a

                    Specifies the first multiplicand.

            .RE
            .PP b

                        Specifies the second multiplicand.

                .RE
                .PP c

                            Specifies the value to be added to the result.

                    .RE

                .SH "DESCRIPTION"
                    .PP fma performs, where possible, a fused multiply-add operation, returning a * b + c. In use cases where the return value is eventually consumed by a variable declared as precise:

                •
                                    fma() is considered a single operation, whereas the expression a * b + c consumed by a variable declared as precise is considered two operations.
                                .RE

                    •
                                        The precision of fma() can differ from the precision of the expression a * b + c.
                                    .RE

                        •
                                            fma() will be computed with the same precision as any other fma() consumed by a precise variable, giving invariant results for the same input values of a, b and c.
                                        .RE

                        Otherwise, in the absence of precise consumption, there are no special constraints on the number of operations or difference in precision between fma() and the expression a * b + c.

                            .SH "VERSION SUPPORT"
                                .TS allbox tab(:); lB cB s s s s s s s s s s s lB cB cB cB cB cB cB cB cB cB cB cB cB. T{ T}:T{ OpenGL Shading Language Version T} T{ Function Name T}:T{ 1.10 T}:T{ 1.20 T}:T{ 1.30 T}:T{ 1.40 T}:T{ 1.50 T}:T{ 3.30 T}:T{ 4.00 T}:T{ 4.10 T}:T{ 4.20 T}:T{ 4.30 T}:T{ 4.40 T}:T{ 4.50 T} l c c c c c c c c c c c c l c c c c c c c c c c c c. T{ fma (genType) T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} T{ fma (genDType) T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}

                            .SH "COPYRIGHT"
                                .PP Copyright © 2011-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. https://opencontent.org/openpub/.

COPYRIGHT
Copyright © 2011-2014 Khronos Group