\frac{x - y \cdot z}{t - a \cdot z}\begin{array}{l}
\mathbf{if}\;z \leq -3.490398922392778 \cdot 10^{-57} \lor \neg \left(z \leq 2.045405544225239 \cdot 10^{+16}\right):\\
\;\;\;\;\frac{x}{t - z \cdot a} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\end{array}(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.490398922392778e-57) (not (<= z 2.045405544225239e+16))) (- (/ x (- t (* z a))) (/ y (- (/ t z) a))) (/ (- x (* z y)) (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
return (((double) (x - ((double) (y * z)))) / ((double) (t - ((double) (a * z)))));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((z <= -3.490398922392778e-57) || !(z <= 2.045405544225239e+16))) {
tmp = ((double) ((x / ((double) (t - ((double) (z * a))))) - (y / ((double) ((t / z) - a)))));
} else {
tmp = (((double) (x - ((double) (z * y)))) / ((double) (t - ((double) (z * a)))));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.9 |
|---|---|
| Target | 1.9 |
| Herbie | 1.8 |
if z < -3.49039892239277772e-57 or 20454055442252392 < z Initial program Error: 20.7 bits
rmApplied div-subError: 20.7 bits
SimplifiedError: 20.7 bits
SimplifiedError: 13.0 bits
rmApplied pow1Error: 13.0 bits
Applied pow1Error: 13.0 bits
Applied pow-prod-downError: 13.0 bits
SimplifiedError: 3.2 bits
if -3.49039892239277772e-57 < z < 20454055442252392Initial program Error: 0.1 bits
Final simplificationError: 1.8 bits
herbie shell --seed 2020204
(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))))