x - y \cdot z
\left(x + y \cdot z\right) \cdot \frac{x - y \cdot z}{x + y \cdot z}double code(double x, double y, double z) {
return (x - (y * z));
}
double code(double x, double y, double z) {
return ((x + (y * z)) * ((x - (y * z)) / (x + (y * z))));
}




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 flip--28.8
rmApplied *-un-lft-identity28.8
Applied difference-of-squares28.8
Applied times-frac0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020057
(FPCore (x y z)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, C"
:precision binary64
:herbie-target
(/ (+ x (* y z)) (/ (+ x (* y z)) (- x (* y z))))
(- x (* y z)))