\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;z \le -3.5472664252508322 \cdot 10^{-9} \lor \neg \left(z \le 2.45143159650892174 \cdot 10^{-200}\right):\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{\left(a + 1\right) + \frac{b}{\frac{t}{y}}}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{\mathsf{fma}\left(\frac{b}{t}, y, a + 1\right)}\\
\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 temp;
if (((z <= -3.547266425250832e-09) || !(z <= 2.4514315965089217e-200))) {
temp = ((x + (z / (t / y))) / ((a + 1.0) + (b / (t / y))));
} else {
temp = (1.0 * (fma((z / t), y, x) / fma((b / t), y, (a + 1.0))));
}
return temp;
}




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.2 |
| Herbie | 14.0 |
if z < -3.547266425250832e-09 or 2.4514315965089217e-200 < z Initial program 20.4
rmApplied *-un-lft-identity20.4
Applied *-commutative20.4
Applied times-frac19.7
Simplified19.7
rmApplied *-commutative19.7
Applied associate-/l*16.4
rmApplied clear-num16.4
Applied un-div-inv16.4
if -3.547266425250832e-09 < z < 2.4514315965089217e-200Initial program 9.4
rmApplied *-un-lft-identity9.4
Applied *-commutative9.4
Applied times-frac9.9
Simplified9.9
rmApplied *-commutative9.9
Applied associate-/l*11.0
rmApplied clear-num11.0
Applied un-div-inv10.7
rmApplied *-un-lft-identity10.7
Applied *-un-lft-identity10.7
Applied times-frac10.7
Simplified10.7
Simplified9.5
Final simplification14.0
herbie shell --seed 2020066 +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))))