\left(1 - x\right) \cdot y + x \cdot z
\mathsf{fma}\left(z, x, y \cdot 1 + y \cdot \left(-x\right)\right)double code(double x, double y, double z) {
return (((1.0 - x) * y) + (x * z));
}
double code(double x, double y, double z) {
return fma(z, x, ((y * 1.0) + (y * -x)));
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 0.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 0.0
rmApplied add-sqr-sqrt31.9
Applied associate-*r*31.9
Taylor expanded around 0 0.0
Simplified0.0
rmApplied sub-neg0.0
Applied distribute-lft-in0.0
Final simplification0.0
herbie shell --seed 2020105 +o rules:numerics
(FPCore (x y z)
:name "Diagrams.Color.HSV:lerp from diagrams-contrib-1.3.0.5"
:precision binary64
:herbie-target
(- y (* x (- y z)))
(+ (* (- 1 x) y) (* x z)))