\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;y \le -6.67772489405608202 \cdot 10^{32} \lor \neg \left(y \le 1.153339796061393 \cdot 10^{76} \lor \neg \left(y \le 1.2925577614671244 \cdot 10^{272}\right)\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{\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 temp;
if (((y <= -6.677724894056082e+32) || !((y <= 1.153339796061393e+76) || !(y <= 1.2925577614671244e+272)))) {
temp = ((x + (y * (z / t))) / ((a + 1.0) + (y / (t / b))));
} else {
temp = (fma((y / t), z, x) / ((a + 1.0) + ((y / t) * 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.8 |
|---|---|
| Target | 13.6 |
| Herbie | 13.0 |
if y < -6.677724894056082e+32 or 1.153339796061393e+76 < y < 1.2925577614671244e+272Initial program 32.1
rmApplied associate-/l*28.7
rmApplied *-un-lft-identity28.7
Applied times-frac23.0
Simplified23.0
if -6.677724894056082e+32 < y < 1.153339796061393e+76 or 1.2925577614671244e+272 < y Initial program 7.5
rmApplied associate-/l*10.1
rmApplied associate-/r/7.3
rmApplied *-un-lft-identity7.3
Applied associate-/r*7.3
Simplified6.9
Final simplification13.0
herbie shell --seed 2020060 +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))))