\frac{x - y \cdot z}{t - a \cdot z}\frac{x - y \cdot z}{t - a \cdot z}double code(double x, double y, double z, double t, double a) {
return ((x - (y * z)) / (t - (a * z)));
}
double code(double x, double y, double z, double t, double a) {
return ((x - (y * z)) / (t - (a * z)));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.2 |
|---|---|
| Target | 1.8 |
| Herbie | 10.2 |
Initial program 10.2
Final simplification10.2
herbie shell --seed 2020091
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< z -32113435955957344) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))
(/ (- x (* y z)) (- t (* a z))))