\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;t \le -1.07099712939921002 \cdot 10^{-15} \lor \neg \left(t \le 8.50855217814580292 \cdot 10^{98}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + \frac{\frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}}}{\frac{\sqrt[3]{t}}{b}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{1}{\frac{t}{y \cdot b}}}\\
\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 <= -1.07099712939921e-15) || !(t <= 8.508552178145803e+98))) {
temp = ((x + (y * (z / t))) / ((a + 1.0) + ((y / (cbrt(t) * cbrt(t))) / (cbrt(t) / b))));
} else {
temp = ((x + ((y * z) / t)) / ((a + 1.0) + (1.0 / (t / (y * b)))));
}
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.6 |
|---|---|
| Target | 13.5 |
| Herbie | 13.0 |
if t < -1.07099712939921e-15 or 8.508552178145803e+98 < t Initial program 12.0
rmApplied clear-num12.0
rmApplied add-cube-cbrt12.1
Applied times-frac8.7
Applied associate-/r*8.7
Simplified8.7
rmApplied *-un-lft-identity8.7
Applied times-frac4.0
Simplified4.0
if -1.07099712939921e-15 < t < 8.508552178145803e+98Initial program 20.4
rmApplied clear-num20.5
Final simplification13.0
herbie shell --seed 2020049 +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))))