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) {
double VAR;
if (((z <= -1.7409108609623183e+20) || !(z <= 1.787817391526903e-96))) {
VAR = ((double) (((double) (x / ((double) (t - ((double) (z * a)))))) - ((double) (y / ((double) (((double) (t / z)) - a))))));
} else {
VAR = ((double) (((double) (x - ((double) (z * y)))) * ((double) (1.0 / ((double) (t - ((double) (z * a))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 11.3 |
|---|---|
| Target | 1.8 |
| Herbie | 1.9 |
if z < -174091086096231830000 or 1.787817391526903e-96 < z Initial program 19.8
rmApplied div-sub19.8
Simplified19.8
Simplified12.6
rmApplied sub-neg12.6
Simplified3.0
if -174091086096231830000 < z < 1.787817391526903e-96Initial program 0.3
rmApplied div-inv0.4
Simplified0.4
Final simplification1.9
herbie shell --seed 2020192
(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))))