\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \leq -\infty \lor \neg \left(\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \leq 4.0910323826660767 \cdot 10^{+297}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + b \cdot \frac{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 (<= (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))) (- INFINITY))
(not
(<=
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))
4.0910323826660767e+297)))
(/ z b)
(/ (+ x (/ (* y z) 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 ((((x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))) <= -((double) INFINITY)) || !(((x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))) <= 4.0910323826660767e+297)) {
tmp = z / b;
} else {
tmp = (x + ((y * z) / 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.4 |
|---|---|
| Target | 13.1 |
| Herbie | 7.7 |
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0 or 4.0910323826660767e297 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 62.9
Taylor expanded around inf 17.0
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.0910323826660767e297Initial program 6.2
rmApplied associate-/l*_binary64_180966.8
rmApplied associate-/r/_binary64_180975.7
Final simplification7.7
herbie shell --seed 2021015
(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))))