\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 := 1 + \left(a + t_1\right)\\
t_3 := x + \frac{y \cdot z}{t}\\
t_4 := \frac{t_3}{\left(a + 1\right) + t_1}\\
t_5 := \frac{x}{t_2}\\
\mathbf{if}\;t_4 \leq -\infty:\\
\;\;\;\;\frac{y}{\frac{t \cdot t_2}{z}} + t_5\\
\mathbf{elif}\;t_4 \leq 3.141174543174688 \cdot 10^{+292}:\\
\;\;\;\;\frac{t_3}{\left(a + 1\right) + \frac{b \cdot \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}}}{\sqrt[3]{t}}}\\
\mathbf{else}:\\
\;\;\;\;t_5 + \frac{z}{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
(let* ((t_1 (/ (* y b) t))
(t_2 (+ 1.0 (+ a t_1)))
(t_3 (+ x (/ (* y z) t)))
(t_4 (/ t_3 (+ (+ a 1.0) t_1)))
(t_5 (/ x t_2)))
(if (<= t_4 (- INFINITY))
(+ (/ y (/ (* t t_2) z)) t_5)
(if (<= t_4 3.141174543174688e+292)
(/ t_3 (+ (+ a 1.0) (/ (* b (/ y (* (cbrt t) (cbrt t)))) (cbrt t))))
(+ t_5 (/ 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 = 1.0 + (a + t_1);
double t_3 = x + ((y * z) / t);
double t_4 = t_3 / ((a + 1.0) + t_1);
double t_5 = x / t_2;
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = (y / ((t * t_2) / z)) + t_5;
} else if (t_4 <= 3.141174543174688e+292) {
tmp = t_3 / ((a + 1.0) + ((b * (y / (cbrt(t) * cbrt(t)))) / cbrt(t)));
} else {
tmp = t_5 + (z / 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.1 |
|---|---|
| Target | 12.9 |
| Herbie | 6.4 |
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 64.0
Applied div-inv_binary6464.0
Taylor expanded in x around 0 36.8
Applied associate-/l*_binary647.5
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 3.14117454317468818e292Initial program 5.8
Applied add-cube-cbrt_binary646.0
Applied associate-/r*_binary646.0
Simplified5.3
if 3.14117454317468818e292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 62.6
Applied div-inv_binary6462.6
Taylor expanded in x around 0 53.6
Taylor expanded in y around inf 12.2
Final simplification6.4
herbie shell --seed 2022077
(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))))