\frac{x - y \cdot z}{t - a \cdot z}\begin{array}{l}
\mathbf{if}\;z \le -1.5705429284626735 \cdot 10^{-232} \lor \neg \left(z \le 7.31263565366992034 \cdot 10^{-188}\right):\\
\;\;\;\;\frac{x}{t - z \cdot a} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{else}:\\
\;\;\;\;\left(x - z \cdot y\right) \cdot \frac{1}{t - z \cdot a}\\
\end{array}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.5705429284626735e-232) || !(z <= 7.31263565366992e-188))) {
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 | 10.7 |
|---|---|
| Target | 1.6 |
| Herbie | 2.3 |
if z < -1.5705429284626735e-232 or 7.31263565366992034e-188 < z Initial program 12.7
rmApplied div-sub12.7
Simplified12.7
Simplified8.8
rmApplied pow18.8
Applied pow18.8
Applied pow-prod-down8.8
Simplified2.6
if -1.5705429284626735e-232 < z < 7.31263565366992034e-188Initial program 0.1
rmApplied div-inv0.3
Simplified0.3
Final simplification2.3
herbie shell --seed 2020185
(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))))