\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;y \le -1.3244460391049904 \cdot 10^{-149}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y}{t} \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 VAR;
if ((y <= -1.3244460391049904e-149)) {
VAR = ((x + (y * (z / t))) / ((a + 1.0) + (y / (t / b))));
} else {
VAR = ((x + ((y * z) / t)) / ((a + 1.0) + ((y / t) * b)));
}
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.5 |
|---|---|
| Target | 13.0 |
| Herbie | 14.8 |
if y < -1.3244460391049904e-149Initial program 22.3
rmApplied associate-/l*20.7
rmApplied *-un-lft-identity20.7
Applied times-frac18.1
Simplified18.1
if -1.3244460391049904e-149 < y Initial program 13.1
rmApplied associate-/l*14.6
rmApplied associate-/r/12.8
Final simplification14.8
herbie shell --seed 2020100
(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))))