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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
Results
| Original | 16.7 |
|---|---|
| Target | 13.0 |
| Herbie | 14.5 |
if b < -3.1890092919807099e-192 or 2.02770500894770335e-113 < b Initial program 19.2
rmApplied clear-num_binary6419.2
rmApplied associate-/r*_binary6419.1
rmApplied frac-2neg_binary6419.1
Simplified19.1
Simplified16.3
if -3.1890092919807099e-192 < b < 2.02770500894770335e-113Initial program 9.0
rmApplied div-inv_binary649.0
Final simplification14.5
herbie shell --seed 2020231
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:herbie-target
(if (< t -1.3659085366310088e-271) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))