\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t_1 \leq -5.984824460587897 \cdot 10^{+215}:\\
\;\;\;\;\frac{x}{a + 1} - \left(\frac{y \cdot \left(x \cdot b\right)}{t \cdot {\left(a + 1\right)}^{2}} + \frac{y}{-1 - a} \cdot \frac{z}{t}\right)\\
\mathbf{elif}\;t_1 \leq 7.503591931827809 \cdot 10^{+298}:\\
\;\;\;\;\begin{array}{l}
t_2 := \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}}\\
\frac{x + \frac{z \cdot t_2}{\sqrt[3]{t}}}{\left(a + 1\right) + t_2 \cdot \frac{b}{\sqrt[3]{t}}}
\end{array}\\
\mathbf{else}:\\
\;\;\;\;\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 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 -5.984824460587897e+215)
(-
(/ x (+ a 1.0))
(+
(/ (* y (* x b)) (* t (pow (+ a 1.0) 2.0)))
(* (/ y (- -1.0 a)) (/ z t))))
(if (<= t_1 7.503591931827809e+298)
(let* ((t_2 (/ y (* (cbrt t) (cbrt t)))))
(/ (+ x (/ (* z t_2) (cbrt t))) (+ (+ a 1.0) (* t_2 (/ b (cbrt t))))))
(/ 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 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -5.984824460587897e+215) {
tmp = (x / (a + 1.0)) - (((y * (x * b)) / (t * pow((a + 1.0), 2.0))) + ((y / (-1.0 - a)) * (z / t)));
} else if (t_1 <= 7.503591931827809e+298) {
double t_2 = y / (cbrt(t) * cbrt(t));
tmp = (x + ((z * t_2) / cbrt(t))) / ((a + 1.0) + (t_2 * (b / cbrt(t))));
} else {
tmp = 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.5 |
|---|---|
| Target | 13.1 |
| Herbie | 9.5 |
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -5.98482446058789688e215Initial program 39.5
rmApplied add-cube-cbrt_binary6439.6
Applied associate-/r*_binary6439.6
Simplified28.2
Taylor expanded around -inf 43.0
Simplified33.9
if -5.98482446058789688e215 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 7.5035919318278092e298Initial program 6.5
rmApplied add-cube-cbrt_binary646.8
Applied associate-/r*_binary646.8
Simplified8.2
rmApplied add-cube-cbrt_binary648.2
Applied times-frac_binary646.8
if 7.5035919318278092e298 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 63.1
Taylor expanded around inf 13.0
Final simplification9.5
herbie shell --seed 2021198
(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))))