\frac{x - y \cdot z}{t - a \cdot z}\frac{x - y \cdot z}{t - z \cdot a}(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* z a))))
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 - (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.6 |
|---|---|
| Target | 2.0 |
| Herbie | 10.6 |
| Alternative 1 | |
|---|---|
| Accuracy | 27.7 |
| Cost | 1481 |
| Alternative 2 | |
|---|---|
| Accuracy | 37.6 |
| Cost | 896 |
Initial program 10.6
rmApplied sub-neg_binary64_1780310.6
Simplified10.6
rmApplied *-un-lft-identity_binary64_1781010.6
rmApplied sub-neg_binary64_1780310.6
rmApplied unsub-neg_binary64_1780410.6
Final simplification10.6
herbie shell --seed 2020322
(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))))