\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;t \le -1.4106828041523268 \cdot 10^{51}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + \mathsf{fma}\left(\frac{y}{t}, b, 1\right)}\\
\mathbf{elif}\;t \le 7.22267405639126453 \cdot 10^{27}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \left(y \cdot b\right) \cdot \frac{1}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}}{a + \mathsf{fma}\left(\frac{y}{t}, b, 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 VAR;
if ((t <= -1.4106828041523268e+51)) {
VAR = ((x + (y * (z / t))) / (a + fma((y / t), b, 1.0)));
} else {
double VAR_1;
if ((t <= 7.222674056391265e+27)) {
VAR_1 = ((x + ((y * z) / t)) / ((a + 1.0) + ((y * b) * (1.0 / t))));
} else {
VAR_1 = ((x + ((y / (cbrt(t) * cbrt(t))) * (z / cbrt(t)))) / (a + fma((y / t), b, 1.0)));
}
VAR = VAR_1;
}
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.7 |
|---|---|
| Target | 13.3 |
| Herbie | 12.8 |
if t < -1.4106828041523268e+51Initial program 11.5
rmApplied associate-+l+11.5
Simplified8.4
rmApplied *-un-lft-identity8.4
Applied times-frac3.2
Simplified3.2
if -1.4106828041523268e+51 < t < 7.222674056391265e+27Initial program 20.8
rmApplied div-inv20.8
if 7.222674056391265e+27 < t Initial program 12.0
rmApplied associate-+l+12.0
Simplified8.3
rmApplied add-cube-cbrt8.4
Applied times-frac3.3
Final simplification12.8
herbie shell --seed 2020105 +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))))