\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;t \le -453438913939.10449 \lor \neg \left(t \le 1.599714736526996 \cdot 10^{-7}\right):\\
\;\;\;\;\left(x + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(\sqrt[3]{\frac{y \cdot z}{t}} \cdot \sqrt[3]{\frac{y \cdot z}{t}}\right) \cdot \sqrt[3]{\frac{y \cdot z}{t}}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\end{array}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 temp;
if (((t <= -453438913939.1045) || !(t <= 1.599714736526996e-07))) {
temp = ((x + ((y / (cbrt(t) * cbrt(t))) * (z / cbrt(t)))) * (1.0 / ((a + 1.0) + (y / (t / b)))));
} else {
temp = ((x + ((cbrt(((y * z) / t)) * cbrt(((y * z) / t))) * cbrt(((y * z) / t)))) / ((a + 1.0) + ((y * b) / t)));
}
return temp;
}




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.4 |
|---|---|
| Target | 13.2 |
| Herbie | 12.9 |
if t < -453438913939.1045 or 1.599714736526996e-07 < t Initial program 11.2
rmApplied add-cube-cbrt11.3
Applied times-frac7.9
rmApplied associate-/l*4.1
rmApplied div-inv4.2
if -453438913939.1045 < t < 1.599714736526996e-07Initial program 21.9
rmApplied add-cube-cbrt22.1
Final simplification12.9
herbie shell --seed 2020057 +o rules:numerics
(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 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b)))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1) (/ (* y b) t))))