\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;z \le -1.6642546363229162 \cdot 10^{-134} \lor \neg \left(z \le 1.2255216464227784 \cdot 10^{-277}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{\left(a + 1\right) + \frac{y}{-t} \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\end{array}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 VAR;
if (((z <= -1.6642546363229162e-134) || !(z <= 1.2255216464227784e-277))) {
VAR = ((x + (z * (y / t))) / ((a + 1.0) + ((y / -t) * -b)));
} else {
VAR = ((x + (y / (t / z))) / ((a + 1.0) + (y / (t / b))));
}
return VAR;
}




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.6 |
|---|---|
| Target | 13.1 |
| Herbie | 13.8 |
if z < -1.6642546363229162e-134 or 1.2255216464227784e-277 < z Initial program 18.5
rmApplied associate-/l*19.1
rmApplied frac-2neg19.1
Applied associate-/r/17.6
rmApplied *-commutative17.6
Applied associate-/l*15.3
rmApplied div-inv15.4
Simplified15.3
if -1.6642546363229162e-134 < z < 1.2255216464227784e-277Initial program 7.1
rmApplied associate-/l*6.5
rmApplied associate-/l*6.5
Final simplification13.8
herbie shell --seed 2020078
(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 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b)))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1) (/ (* y b) t))))