\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\begin{array}{l}
t_1 := 1 + \mathsf{fma}\left(b, \frac{y}{t}, a\right)\\
\mathbf{if}\;t \leq -5.099390865643201 \cdot 10^{-35}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := \frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{if}\;t \leq -5.019015735760609 \cdot 10^{-197}:\\
\;\;\;\;\frac{y}{\frac{\mathsf{fma}\left(y, b, \mathsf{fma}\left(t, a, t\right)\right)}{z}} + t_2\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := t_2 + \frac{z}{b}\\
\mathbf{if}\;t \leq 1.8963796502357436 \cdot 10^{-175}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 9975149583244896:\\
\;\;\;\;t_2 + \frac{y \cdot z}{\mathsf{fma}\left(y, b, \mathsf{fma}\left(a, t, t\right)\right)}\\
\mathbf{elif}\;t \leq 2.0973695853553908 \cdot 10^{+40}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t_1}, \frac{z}{t}, \frac{x}{t_1}\right)\\
\end{array}\\
\end{array}\\
\end{array}
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ 1.0 (fma b (/ y t) a))))
(if (<= t -5.099390865643201e-35)
(/ (fma y (/ z t) x) t_1)
(let* ((t_2 (/ x (+ 1.0 (+ a (/ (* y b) t))))))
(if (<= t -5.019015735760609e-197)
(+ (/ y (/ (fma y b (fma t a t)) z)) t_2)
(let* ((t_3 (+ t_2 (/ z b))))
(if (<= t 1.8963796502357436e-175)
t_3
(if (<= t 9975149583244896.0)
(+ t_2 (/ (* y z) (fma y b (fma a t t))))
(if (<= t 2.0973695853553908e+40)
t_3
(fma (/ y t_1) (/ z t) (/ x t_1)))))))))))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 t_1 = 1.0 + fma(b, (y / t), a);
double tmp;
if (t <= -5.099390865643201e-35) {
tmp = fma(y, (z / t), x) / t_1;
} else {
double t_2 = x / (1.0 + (a + ((y * b) / t)));
double tmp_1;
if (t <= -5.019015735760609e-197) {
tmp_1 = (y / (fma(y, b, fma(t, a, t)) / z)) + t_2;
} else {
double t_3 = t_2 + (z / b);
double tmp_2;
if (t <= 1.8963796502357436e-175) {
tmp_2 = t_3;
} else if (t <= 9975149583244896.0) {
tmp_2 = t_2 + ((y * z) / fma(y, b, fma(a, t, t)));
} else if (t <= 2.0973695853553908e+40) {
tmp_2 = t_3;
} else {
tmp_2 = fma((y / t_1), (z / t), (x / t_1));
}
tmp_1 = tmp_2;
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
| Original | 16.8 |
|---|---|
| Target | 13.4 |
| Herbie | 8.8 |
if t < -5.09939086564320129e-35Initial program 11.3
Simplified4.7
if -5.09939086564320129e-35 < t < -5.01901573576060879e-197Initial program 18.2
Simplified25.4
Taylor expanded in z around 0 14.7
Taylor expanded in z around inf 11.2
Simplified11.2
Applied associate-/l*_binary6411.8
Simplified11.8
if -5.01901573576060879e-197 < t < 1.89637965023574361e-175 or 9975149583244896 < t < 2.09736958535539077e40Initial program 28.4
Simplified35.3
Taylor expanded in z around 0 21.7
Taylor expanded in y around inf 17.9
if 1.89637965023574361e-175 < t < 9975149583244896Initial program 15.9
Simplified19.3
Taylor expanded in z around 0 13.2
Taylor expanded in z around inf 10.6
Simplified10.6
if 2.09736958535539077e40 < t Initial program 12.3
Simplified3.2
Taylor expanded in z around 0 14.3
Simplified2.4
Final simplification8.8
herbie shell --seed 2022104
(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.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))