(FPCore (x y z) :precision binary64 (+ (* (- 1.0 x) y) (* x z)))
(FPCore (x y z) :precision binary64 (fma x (- z y) y))
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(x, (z - y), y);
}
function code(x, y, z) return Float64(Float64(Float64(1.0 - x) * y) + Float64(x * z)) end
function code(x, y, z) return fma(x, Float64(z - y), y) end
code[x_, y_, z_] := N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := N[(x * N[(z - y), $MachinePrecision] + y), $MachinePrecision]
\left(1 - x\right) \cdot y + x \cdot z
\mathsf{fma}\left(x, z - y, y\right)




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 0.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2022131
(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.0 x) y) (* x z)))