\frac{x}{y - z \cdot t}\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -6.441805727740121 \cdot 10^{+268} \lor \neg \left(z \cdot t \leq 1.442209764012471 \cdot 10^{+297}\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)) <= -6.441805727740121e+268) || !(((double) (z * t)) <= 1.442209764012471e+297))) {
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.7 |
|---|---|
| Target | 1.6 |
| Herbie | 0.7 |
if (* z t) < -6.44180572774012081e268 or 1.44220976401247092e297 < (* z t) Initial program 18.1
rmApplied clear-num18.1
rmApplied div-sub21.7
Simplified4.2
if -6.44180572774012081e268 < (* z t) < 1.44220976401247092e297Initial program 0.1
Final simplification0.7
herbie shell --seed 2020199
(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))))