Mojo function
fma
fma(a: Int, b: Int, c: Int) -> Int
Performs fma
(fused multiply-add) on the inputs.
The result is (a * b) + c
.
Args:
- βa (
Int
): The first input. - βb (
Int
): The second input. - βc (
Int
): The third input.
Returns:
(a * b) + c
.
fma[type: DType, simd_width: Int](a: SIMD[type, simd_width], b: SIMD[type, simd_width], c: SIMD[type, simd_width]) -> SIMD[$0, $1]
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:
- βtype (
DType
): Thedtype
of the input SIMD vector. - βsimd_width (
Int
): The width of the input and output SIMD vector.
Args:
- βa (
SIMD[type, simd_width]
): The first vector of inputs. - βb (
SIMD[type, simd_width]
): The second vector of inputs. - βc (
SIMD[type, simd_width]
): The third vector of inputs.
Returns:
Elementwise fma
of a, b and c.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
If you'd like to share more information, please report an issue on GitHub
π What went wrong?