\frac{x - y \cdot z}{t - a \cdot z}\frac{x}{t - a \cdot z} - \frac{y}{\frac{t}{z} - \frac{a}{1}}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 / (t - (a * z))) - (y / ((t / z) - (a / 1.0))));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.3 |
|---|---|
| Target | 1.5 |
| Herbie | 2.7 |
Initial program 10.3
rmApplied div-sub10.3
rmApplied associate-/l*7.7
rmApplied div-sub7.7
Simplified2.7
Final simplification2.7
herbie shell --seed 2020057 +o rules:numerics
(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))))