\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;t \leq -2.777704292510519 \cdot 10^{+40} \lor \neg \left(t \leq 3.476939493132477 \cdot 10^{-115}\right):\\
\;\;\;\;\frac{z}{t} \cdot \frac{y}{a + \left(\frac{y}{\frac{t}{b}} + 1\right)} + \frac{x}{a + \left(1 + \frac{y \cdot b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + \left(1 + \frac{y \cdot b}{t}\right)} + \frac{z \cdot y}{t + \left(y \cdot b + t \cdot a\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 (<= t -2.777704292510519e+40) (not (<= t 3.476939493132477e-115)))
(+
(* (/ z t) (/ y (+ a (+ (/ y (/ t b)) 1.0))))
(/ x (+ a (+ 1.0 (/ (* y b) t)))))
(+
(/ x (+ a (+ 1.0 (/ (* y b) t))))
(/ (* z y) (+ t (+ (* y b) (* t a)))))))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 ((t <= -2.777704292510519e+40) || !(t <= 3.476939493132477e-115)) {
tmp = ((z / t) * (y / (a + ((y / (t / b)) + 1.0)))) + (x / (a + (1.0 + ((y * b) / t))));
} else {
tmp = (x / (a + (1.0 + ((y * b) / t)))) + ((z * y) / (t + ((y * b) + (t * a))));
}
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.6 |
|---|---|
| Target | 13.3 |
| Herbie | 8.7 |
if t < -2.7777042925105192e40 or 3.47693949313247707e-115 < t Initial program 12.2
Taylor expanded around 0 13.2
Simplified13.2
rmApplied times-frac_binary64_191808.6
rmApplied associate-/l*_binary64_191196.6
if -2.7777042925105192e40 < t < 3.47693949313247707e-115Initial program 22.4
Taylor expanded around 0 18.0
Simplified18.0
Taylor expanded around inf 11.6
Final simplification8.7
herbie shell --seed 2021027
(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))))