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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.9 |
|---|---|
| Target | 1.8 |
| Herbie | 3.1 |
Initial program 10.9
rmApplied div-sub10.9
rmApplied associate-/l*8.4
rmApplied div-sub8.4
Simplified3.1
Final simplification3.1
herbie shell --seed 2020150
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))
(/ (- x (* y z)) (- t (* a z))))