\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \leq -3.7807306835206855 \cdot 10^{-290}:\\
\;\;\;\;\frac{x + \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{t}} \cdot \left(\frac{\sqrt[3]{y}}{\sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\right)}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \leq 0:\\
\;\;\;\;\left(\frac{t}{y} \cdot \left(\frac{x}{b} - \frac{z}{b \cdot b}\right) - \frac{t \cdot \left(z \cdot a\right)}{y \cdot \left(b \cdot b\right)}\right) + \frac{z}{b}\\
\mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \leq 1.5841205928521936 \cdot 10^{+306}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \left(y \cdot b\right) \cdot \frac{1}{t}}\\
\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
(if (<=
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))
-3.7807306835206855e-290)
(/
(+
x
(*
(/ (* (cbrt y) (cbrt y)) (cbrt t))
(* (/ (cbrt y) (cbrt t)) (/ z (cbrt t)))))
(+ (+ a 1.0) (/ (* y b) t)))
(if (<= (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))) 0.0)
(+
(- (* (/ t y) (- (/ x b) (/ z (* b b)))) (/ (* t (* z a)) (* y (* b b))))
(/ z b))
(if (<=
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))
1.5841205928521936e+306)
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (* (* y b) (/ 1.0 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 tmp;
if (((x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))) <= -3.7807306835206855e-290) {
tmp = (x + (((cbrt(y) * cbrt(y)) / cbrt(t)) * ((cbrt(y) / cbrt(t)) * (z / cbrt(t))))) / ((a + 1.0) + ((y * b) / t));
} else if (((x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))) <= 0.0) {
tmp = (((t / y) * ((x / b) - (z / (b * b)))) - ((t * (z * a)) / (y * (b * b)))) + (z / b);
} else if (((x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))) <= 1.5841205928521936e+306) {
tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) * (1.0 / 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.2 |
| Herbie | 7.4 |
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -3.7807306835206855e-290Initial program 7.1
rmApplied add-cube-cbrt_binary64_171637.4
Applied times-frac_binary64_171346.1
rmApplied add-cube-cbrt_binary64_171636.2
Applied times-frac_binary64_171346.2
Applied associate-*l*_binary64_170695.6
if -3.7807306835206855e-290 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0Initial program 28.2
rmApplied add-cube-cbrt_binary64_1716328.2
Applied times-frac_binary64_1713431.0
rmApplied add-cube-cbrt_binary64_1716331.0
Applied times-frac_binary64_1713431.0
Applied associate-*l*_binary64_1706927.9
Simplified27.9
Taylor expanded around -inf 27.9
Simplified21.4
if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.5841205928521936e306Initial program 0.5
rmApplied div-inv_binary64_171250.5
if 1.5841205928521936e306 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 63.8
Taylor expanded around inf 11.8
Final simplification7.4
herbie shell --seed 2021024
(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))))