\frac{x}{y - z \cdot t}\begin{array}{l}
\mathbf{if}\;x \leq -7.598287989168853 \cdot 10^{+57} \lor \neg \left(x \leq 1.0663212078845744 \cdot 10^{+46}\right) \land x \leq 7.2338309609106325 \cdot 10^{+196}:\\
\;\;\;\;\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 (((x <= -7.598287989168853e+57) || (!(x <= 1.0663212078845744e+46) && (x <= 7.2338309609106325e+196)))) {
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.8 |
| Herbie | 1.7 |
if x < -7.5982879891688527e57 or 1.06632120788457444e46 < x < 7.23383096091063247e196Initial program Error: 6.4 bits
rmApplied clear-numError: 6.5 bits
rmApplied div-subError: 6.5 bits
SimplifiedError: 3.1 bits
if -7.5982879891688527e57 < x < 1.06632120788457444e46 or 7.23383096091063247e196 < x Initial program Error: 1.1 bits
Final simplificationError: 1.7 bits
herbie shell --seed 2020200
(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))))