\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + t_1}\\
\mathbf{if}\;t_2 \leq -5.881257533664626 \cdot 10^{-213}:\\
\;\;\;\;\begin{array}{l}
t_3 := 1 + \left(a + t_1\right)\\
\frac{\frac{y}{t \cdot t_3}}{\frac{1}{z}} + \frac{x}{t_3}
\end{array}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_4 := \frac{x}{1 + \left(a + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{b}{\sqrt[3]{t}}\right)}\\
\mathbf{if}\;t_2 \leq 6.91683988960966 \cdot 10^{+260}:\\
\;\;\;\;\frac{y \cdot z}{y \cdot b + \left(t + t \cdot a\right)} + t_4\\
\mathbf{else}:\\
\;\;\;\;t_4 + \frac{z}{b}\\
\end{array}\\
\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
(let* ((t_1 (/ (* y b) t)) (t_2 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) t_1))))
(if (<= t_2 -5.881257533664626e-213)
(let* ((t_3 (+ 1.0 (+ a t_1))))
(+ (/ (/ y (* t t_3)) (/ 1.0 z)) (/ x t_3)))
(let* ((t_4
(/
x
(+ 1.0 (+ a (* (/ y (* (cbrt t) (cbrt t))) (/ b (cbrt t))))))))
(if (<= t_2 6.91683988960966e+260)
(+ (/ (* y z) (+ (* y b) (+ t (* t a)))) t_4)
(+ t_4 (/ z 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 t_1 = (y * b) / t;
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + t_1);
double tmp;
if (t_2 <= -5.881257533664626e-213) {
double t_3_1 = 1.0 + (a + t_1);
tmp = ((y / (t * t_3_1)) / (1.0 / z)) + (x / t_3_1);
} else {
double t_4 = x / (1.0 + (a + ((y / (cbrt(t) * cbrt(t))) * (b / cbrt(t)))));
double tmp_2;
if (t_2 <= 6.91683988960966e+260) {
tmp_2 = ((y * z) / ((y * b) + (t + (t * a)))) + t_4;
} else {
tmp_2 = t_4 + (z / b);
}
tmp = tmp_2;
}
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 | 6.0 |
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -5.8812575336646258e-213Initial program 8.2
Taylor expanded in x around 0 5.8
Applied associate-/l*_binary644.2
Applied div-inv_binary644.2
Applied associate-/r*_binary642.5
Simplified2.5
if -5.8812575336646258e-213 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 6.91683988960965953e260Initial program 10.0
Taylor expanded in x around 0 10.9
Applied add-cube-cbrt_binary6410.9
Applied times-frac_binary649.1
Taylor expanded in z around inf 6.9
if 6.91683988960965953e260 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 59.4
Taylor expanded in x around 0 50.0
Applied add-cube-cbrt_binary6450.0
Applied times-frac_binary6450.0
Taylor expanded in y around inf 11.1
Final simplification6.0
herbie shell --seed 2021313
(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))))