\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;z \le -6248321.01002647448 \lor \neg \left(z \le 1.22925357211897382 \cdot 10^{-192}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{a + \mathsf{fma}\left(\frac{y}{t}, b, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y}{\frac{t}{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 (((z <= -6248321.0100264745) || !(z <= 1.2292535721189738e-192))) {
VAR = (fma((y / t), z, x) / (a + fma((y / t), b, 1.0)));
} 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.6 |
|---|---|
| Target | 13.1 |
| Herbie | 13.7 |
if z < -6248321.0100264745 or 1.2292535721189738e-192 < z Initial program 20.9
rmApplied frac-2neg20.9
Simplified20.0
rmApplied frac-2neg20.0
Simplified16.7
Simplified16.7
if -6248321.0100264745 < z < 1.2292535721189738e-192Initial program 9.1
rmApplied associate-/l*8.6
Final simplification13.7
herbie shell --seed 2020078 +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))))