\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;t \leq -1.906871583581456 \cdot 10^{-64}:\\
\;\;\;\;\frac{x + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\mathbf{elif}\;t \leq 1.5175803278409141 \cdot 10^{-111}:\\
\;\;\;\;\frac{x + \frac{\frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot z}{\sqrt[3]{t}}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\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 (<= t -1.906871583581456e-64)
(/
(+ x (* (/ y (* (cbrt t) (cbrt t))) (/ z (cbrt t))))
(+ (+ a 1.0) (/ y (/ t b))))
(if (<= t 1.5175803278409141e-111)
(/
(+ x (/ (* (/ y (* (cbrt t) (cbrt t))) z) (cbrt t)))
(+ (+ a 1.0) (/ (* y b) t)))
(/ (+ x (/ y (/ t z))) (+ (+ a 1.0) (/ y (/ t b)))))))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 <= -1.906871583581456e-64) {
tmp = (x + ((y / (cbrt(t) * cbrt(t))) * (z / cbrt(t)))) / ((a + 1.0) + (y / (t / b)));
} else if (t <= 1.5175803278409141e-111) {
tmp = (x + (((y / (cbrt(t) * cbrt(t))) * z) / cbrt(t))) / ((a + 1.0) + ((y * b) / t));
} else {
tmp = (x + (y / (t / z))) / ((a + 1.0) + (y / (t / b)));
}
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.5 |
|---|---|
| Target | 13.1 |
| Herbie | 14.0 |
if t < -1.906871583581456e-64Initial program 11.7
rmApplied associate-/l*_binary64_191199.4
rmApplied add-cube-cbrt_binary64_192099.6
Applied times-frac_binary64_191805.7
if -1.906871583581456e-64 < t < 1.51758032784091412e-111Initial program 25.0
rmApplied add-cube-cbrt_binary64_1920925.3
Applied associate-/r*_binary64_1911825.3
Simplified27.3
if 1.51758032784091412e-111 < t Initial program 12.3
rmApplied associate-/l*_binary64_1911910.8
rmApplied associate-/l*_binary64_191198.0
Final simplification14.0
herbie shell --seed 2020355
(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))))