\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;y \leq -1.7954477689789754 \cdot 10^{-82} \lor \neg \left(y \leq 1.677139076070172 \cdot 10^{-49}\right):\\
\;\;\;\;\frac{z}{b + \frac{t}{y} \cdot \left(a + 1\right)} + \frac{x}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot z}{t \cdot \left(a + \left(1 + \frac{y \cdot b}{t}\right)\right)} + \frac{x}{a + \left(1 + \left(y \cdot b\right) \cdot \frac{1}{t}\right)}\\
\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 (<= y -1.7954477689789754e-82) (not (<= y 1.677139076070172e-49)))
(+ (/ z (+ b (* (/ t y) (+ a 1.0)))) (/ x (+ a (+ 1.0 (* y (/ b t))))))
(+
(/ (* y z) (* t (+ a (+ 1.0 (/ (* y b) t)))))
(/ x (+ a (+ 1.0 (* (* y b) (/ 1.0 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 ((y <= -1.7954477689789754e-82) || !(y <= 1.677139076070172e-49)) {
tmp = (z / (b + ((t / y) * (a + 1.0)))) + (x / (a + (1.0 + (y * (b / t)))));
} else {
tmp = ((y * z) / (t * (a + (1.0 + ((y * b) / t))))) + (x / (a + (1.0 + ((y * b) * (1.0 / 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.3 |
| Herbie | 2.7 |
if y < -1.7954477689789754e-82 or 1.6771390760701721e-49 < y Initial program 25.6
Taylor expanded around 0 23.2
Simplified23.2
rmApplied associate-/l*_binary6419.3
Simplified18.2
Taylor expanded around 0 6.8
Simplified5.1
rmApplied *-un-lft-identity_binary645.1
Applied times-frac_binary643.2
Simplified3.2
if -1.7954477689789754e-82 < y < 1.6771390760701721e-49Initial program 2.5
Taylor expanded around 0 2.1
Simplified2.1
rmApplied div-inv_binary642.1
Final simplification2.7
herbie shell --seed 2021168
(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))))