\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;z \le -1.98981247134042296 \cdot 10^{-78} \lor \neg \left(z \le 4.61495656583718254 \cdot 10^{-191}\right):\\
\;\;\;\;{\left(\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{\mathsf{fma}\left(\frac{y}{t}, b, a + 1\right)}\right)}^{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{1}{\frac{t}{y \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 temp;
if (((z <= -1.989812471340423e-78) || !(z <= 4.6149565658371825e-191))) {
temp = pow((fma((y / t), z, x) / fma((y / t), b, (a + 1.0))), 1.0);
} else {
temp = ((x + ((y * z) / t)) / ((a + 1.0) + (1.0 / (t / (y * b)))));
}
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 | 13.8 |
if z < -1.989812471340423e-78 or 4.6149565658371825e-191 < z Initial program 20.0
rmApplied *-un-lft-identity20.0
Applied associate-/r*20.0
Simplified18.3
rmApplied div-inv18.3
rmApplied pow118.3
Applied pow118.3
Applied pow-prod-down18.3
Simplified16.1
if -1.989812471340423e-78 < z < 4.6149565658371825e-191Initial program 8.4
rmApplied clear-num8.4
Final simplification13.8
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))))