\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;t \le -5.1919322239711118 \cdot 10^{38}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{\left(a + 1\right) + \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{t}} \cdot \left(\frac{\sqrt[3]{y}}{\sqrt[3]{t}} \cdot \frac{b}{\sqrt[3]{t}}\right)}\\
\mathbf{elif}\;t \le 2.8348539215726955 \cdot 10^{-78}:\\
\;\;\;\;\frac{1}{\frac{\left(a + 1\right) + \frac{y \cdot b}{t}}{x + \frac{y \cdot z}{t}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{\left(a + 1\right) + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{b}{\sqrt[3]{\sqrt{t}} \cdot \sqrt[3]{\sqrt{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 VAR;
if ((t <= -5.191932223971112e+38)) {
VAR = (fma((y / t), z, x) / ((a + 1.0) + (((cbrt(y) * cbrt(y)) / cbrt(t)) * ((cbrt(y) / cbrt(t)) * (b / cbrt(t))))));
} else {
double VAR_1;
if ((t <= 2.8348539215726955e-78)) {
VAR_1 = (1.0 / (((a + 1.0) + ((y * b) / t)) / (x + ((y * z) / t))));
} else {
VAR_1 = (fma((y / t), z, x) / ((a + 1.0) + ((y / (cbrt(t) * cbrt(t))) * (b / (cbrt(sqrt(t)) * cbrt(sqrt(t)))))));
}
VAR = VAR_1;
}
return VAR;
}




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.8 |
|---|---|
| Target | 12.9 |
| Herbie | 13.1 |
if t < -5.191932223971112e+38Initial program 11.6
rmApplied add-cube-cbrt11.6
Applied times-frac8.7
rmApplied *-un-lft-identity8.7
Applied associate-/r*8.7
Simplified3.6
rmApplied add-cube-cbrt3.6
Applied times-frac3.6
Applied associate-*l*3.6
if -5.191932223971112e+38 < t < 2.8348539215726955e-78Initial program 22.6
rmApplied clear-num22.7
if 2.8348539215726955e-78 < t Initial program 12.5
rmApplied add-cube-cbrt12.6
Applied times-frac10.2
rmApplied *-un-lft-identity10.2
Applied associate-/r*10.2
Simplified6.6
rmApplied add-sqr-sqrt6.6
Applied cbrt-prod6.6
Final simplification13.1
herbie shell --seed 2020102 +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))))