\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;t \le -426148184416.34888 \lor \neg \left(t \le 7.8347097730170958 \cdot 10^{-43}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{\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 (((t <= -426148184416.3489) || !(t <= 7.834709773017096e-43))) {
VAR = (fma((y / t), z, x) / ((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.8 |
|---|---|
| Target | 13.4 |
| Herbie | 13.0 |
if t < -426148184416.3489 or 7.834709773017096e-43 < t Initial program 11.9
rmApplied *-un-lft-identity11.9
Applied associate-/r*11.9
Simplified8.7
rmApplied *-un-lft-identity8.7
Applied times-frac4.8
Simplified4.8
if -426148184416.3489 < t < 7.834709773017096e-43Initial program 22.5
rmApplied clear-num22.5
Final simplification13.0
herbie shell --seed 2020103 +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))))