fma | Modular
Mojo function
fma(a: Int, b: Int, c: Int) -> Int
Performs fma (fused multiply-add) on the inputs.
The result is (a * b) + c.
Args:
Returns:
Int: (a * b) + c.
fma[dtype: DType, width: Int, //](a: SIMD[dtype, width], b: SIMD[dtype, width], c: SIMD[dtype, width]) -> SIMD[dtype, width]
Performs elementwise fma (fused multiply-add) on the inputs.
Each element in the result SIMD vector is , where , and are elements at index in a, b, and c respectively.
Parameters:
- dtype (
DType): Thedtypeof the input SIMD vector. - width (
Int): The width of the input and output SIMD vector.
Args:
- a (
SIMD): The first vector of inputs. - b (
SIMD): The second vector of inputs. - c (
SIMD): The third vector of inputs.
Returns:
SIMD: Elementwise fma of a, b and c.