For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
fma
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[dtype, width]): The first vector of inputs. - b (
SIMD[dtype, width]): The second vector of inputs. - c (
SIMD[dtype, width]): The third vector of inputs.
Returns:
SIMD[dtype, width]: Elementwise fma of a, b and c.