# X \* y + z does not automatically use FMA instruction

**URL:** <https://discourse.julialang.org/t/x-y-z-does-not-automatically-use-fma-instruction/100640>\
**Category:** Performance\
**Tags:** fast-math\
**Created:** [June 21, 2023, 7:07am UTC](https://discourse.julialang.org/t/x-y-z-does-not-automatically-use-fma-instruction/100640 "2023-06-21T07:07:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [June 21, 2023, 8:33am UTC](https://discourse.julialang.org/t/x-y-z-does-not-automatically-use-fma-instruction/100640/2 "2023-06-21T08:33:30Z")

</div>

> [@GLOBEX\_CORP](#):
>
> if FMA is faster and more precise, why won’t it use `fmadd` to begin with on supported machines?

Because it gives a _different_ result. You can explicitly tell the compiler that you are fine with that with `@fastmath` or by using either the `muladd` or `fma` function. See also the recent discussion [How to enable vectorized fma instruction for multiply-add vectors?](https://discourse.julialang.org/t/how-to-enable-vectorized-fma-instruction-for-multiply-add-vectors/100219).

---

_[View the full topic](https://discourse.julialang.org/t/x-y-z-does-not-automatically-use-fma-instruction/100640)._
