\frac{x}{y - z \cdot t}\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -\infty \lor \neg \left(z \cdot t \leq 1.2483258801050027 \cdot 10^{+142}\right):\\
\;\;\;\;\frac{1}{\frac{y}{x} - z \cdot \frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\end{array}(FPCore (x y z t) :precision binary64 (/ x (- y (* z t))))
(FPCore (x y z t) :precision binary64 (if (or (<= (* z t) (- INFINITY)) (not (<= (* z t) 1.2483258801050027e+142))) (/ 1.0 (- (/ y x) (* z (/ t x)))) (/ x (- y (* z t)))))
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 tmp;
if (((((double) (z * t)) <= ((double) -(((double) INFINITY)))) || !(((double) (z * t)) <= 1.2483258801050027e+142))) {
tmp = (1.0 / ((double) ((y / x) - ((double) (z * (t / x))))));
} else {
tmp = (x / ((double) (y - ((double) (z * t)))));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.8 |
|---|---|
| Target | 1.7 |
| Herbie | 1.3 |
if (* z t) < -inf.0 or 1.2483258801050027e142 < (* z t) Initial program Error: 12.5 bits
rmApplied clear-numError: 13.0 bits
rmApplied div-subError: 16.7 bits
SimplifiedError: 5.6 bits
if -inf.0 < (* z t) < 1.2483258801050027e142Initial program Error: 0.1 bits
Final simplificationError: 1.3 bits
herbie shell --seed 2020204
(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))))