\frac{x}{y - z \cdot t}\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -\infty \lor \neg \left(z \cdot t \leq 2.3880614503696516 \cdot 10^{+206}\right):\\
\;\;\;\;\frac{1}{\frac{y}{x} - z \cdot \frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\end{array}double code(double x, double y, double z, double t) {
return (x / ((double) (y - ((double) (z * t)))));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((((double) (z * t)) <= ((double) -(((double) INFINITY)))) || !(((double) (z * t)) <= 2.3880614503696516e+206))) {
VAR = (1.0 / ((double) ((y / x) - ((double) (z * (t / x))))));
} else {
VAR = (x / ((double) (y - ((double) (z * t)))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.9 |
|---|---|
| Target | 1.7 |
| Herbie | 0.8 |
if (* z t) < -inf.0 or 2.3880614503696516e206 < (* z t) Initial program 15.5
rmApplied clear-num15.7
rmApplied div-sub18.8
Simplified4.1
if -inf.0 < (* z t) < 2.3880614503696516e206Initial program 0.1
Final simplification0.8
herbie shell --seed 2020198
(FPCore (x y z t)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:herbie-target
(if (< x -1.618195973607049e+50) (/ 1.0 (- (/ y x) (* (/ z x) t))) (if (< x 2.1378306434876444e+131) (/ x (- y (* z t))) (/ 1.0 (- (/ y x) (* (/ z x) t)))))
(/ x (- y (* z t))))