\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 -5.7447987803197 \cdot 10^{-311}:\\
\;\;\;\;\frac{x + \frac{z \cdot \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}}}{\sqrt[3]{t}}}{\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(x + y \cdot \frac{z}{t}\right) \cdot \frac{1}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\
\mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \leq 5.525389761919301 \cdot 10^{+251}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\
\end{array}double code(double x, double y, double z, double t, double a, double b) {
return (((double) (x + (((double) (y * z)) / t))) / ((double) (((double) (a + 1.0)) + (((double) (y * b)) / t))));
}
double code(double x, double y, double z, double t, double a, double b) {
double VAR;
if (((((double) (x + (((double) (y * z)) / t))) / ((double) (((double) (a + 1.0)) + (((double) (y * b)) / t)))) <= -5.7447987803197e-311)) {
VAR = (((double) (x + (((double) (z * (y / ((double) (((double) cbrt(t)) * ((double) cbrt(t))))))) / ((double) cbrt(t))))) / ((double) (((double) (a + 1.0)) + (((double) (y * b)) / t))));
} else {
double VAR_1;
if (((((double) (x + (((double) (y * z)) / t))) / ((double) (((double) (a + 1.0)) + (((double) (y * b)) / t)))) <= -0.0)) {
VAR_1 = ((double) (((double) (x + ((double) (y * (z / t))))) * (1.0 / ((double) (a + ((double) (1.0 + ((double) (y * (b / t))))))))));
} else {
double VAR_2;
if (((((double) (x + (((double) (y * z)) / t))) / ((double) (((double) (a + 1.0)) + (((double) (y * b)) / t)))) <= 5.525389761919301e+251)) {
VAR_2 = (((double) (x + (((double) (y * z)) / t))) / ((double) (((double) (a + 1.0)) + (((double) (y * b)) / t))));
} else {
VAR_2 = (((double) (x + ((double) ((y / ((double) (((double) cbrt(t)) * ((double) cbrt(t))))) * (z / ((double) cbrt(t))))))) / ((double) (a + ((double) (1.0 + ((double) (y * (b / t))))))));
}
VAR_1 = VAR_2;
}
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.6 |
|---|---|
| Target | 13.4 |
| Herbie | 13.1 |
if (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))) < -5.74479878031971e-311Initial program 6.7
rmApplied add-cube-cbrt7.1
Applied associate-/r*7.1
Simplified5.6
if -5.74479878031971e-311 < (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))) < -0.0Initial program 29.2
Simplified20.0
rmApplied div-inv20.1
if -0.0 < (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))) < 5.5253897619193015e251Initial program 0.2
if 5.5253897619193015e251 < (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))) Initial program 58.1
Simplified48.0
rmApplied add-cube-cbrt48.2
Applied *-un-lft-identity48.2
Applied times-frac48.2
Applied associate-*r*47.9
Simplified47.9
Final simplification13.1
herbie shell --seed 2020198
(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))))