\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;y \le -1139782057002262.25 \lor \neg \left(y \le 944905759679005.75\right):\\
\;\;\;\;\left(x + y \cdot \frac{z}{t}\right) \cdot \frac{1}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{1}{\frac{t}{y \cdot z}}}{\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 VAR;
if (((y <= -1139782057002262.2) || !(y <= 944905759679005.8))) {
VAR = ((x + (y * (z / t))) * (1.0 / ((a + 1.0) + (y * (b / t)))));
} else {
VAR = ((x + (1.0 / (t / (y * z)))) / ((a + 1.0) + ((y * b) / t)));
}
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.5 |
| Herbie | 12.6 |
if y < -1139782057002262.2 or 944905759679005.8 < y Initial program 30.8
rmApplied *-un-lft-identity30.8
Applied times-frac26.7
Simplified26.7
rmApplied *-un-lft-identity26.7
Applied times-frac22.1
Simplified22.1
rmApplied div-inv22.1
if -1139782057002262.2 < y < 944905759679005.8Initial program 4.3
rmApplied clear-num4.3
Final simplification12.6
herbie shell --seed 2020091 +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))))