\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\begin{array}{l}
t_1 := \frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
t_2 := \frac{z}{b} + t_1\\
\mathbf{if}\;y \leq -5.981645553620746 \cdot 10^{+276}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := 1 + \mathsf{fma}\left(b, \frac{y}{t}, a\right)\\
t_4 := \frac{x}{t_3}\\
\mathbf{if}\;y \leq -1.0875447241440656 \cdot 10^{+227}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{t_3}{y}}, \frac{z}{t}, t_4\right)\\
\mathbf{elif}\;y \leq -1.884688025365851 \cdot 10^{+169}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{elif}\;y \leq 1.081035654397059 \cdot 10^{-9}:\\
\;\;\;\;t_1 + \frac{y \cdot z}{\mathsf{fma}\left(y, b, \mathsf{fma}\left(a, t, t\right)\right)}\\
\mathbf{elif}\;y \leq 6.194405303028895 \cdot 10^{+221}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t_3}, \frac{z}{t}, t_4\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\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 (/ x (+ 1.0 (+ a (/ (* y b) t))))) (t_2 (+ (/ z b) t_1)))
(if (<= y -5.981645553620746e+276)
t_2
(let* ((t_3 (+ 1.0 (fma b (/ y t) a))) (t_4 (/ x t_3)))
(if (<= y -1.0875447241440656e+227)
(fma (/ 1.0 (/ t_3 y)) (/ z t) t_4)
(if (<= y -1.884688025365851e+169)
(/ (+ z (/ (* x t) y)) b)
(if (<= y 1.081035654397059e-9)
(+ t_1 (/ (* y z) (fma y b (fma a t t))))
(if (<= y 6.194405303028895e+221)
(fma (/ y t_3) (/ z t) t_4)
t_2))))))))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 = x / (1.0 + (a + ((y * b) / t)));
double t_2 = (z / b) + t_1;
double tmp;
if (y <= -5.981645553620746e+276) {
tmp = t_2;
} else {
double t_3 = 1.0 + fma(b, (y / t), a);
double t_4 = x / t_3;
double tmp_1;
if (y <= -1.0875447241440656e+227) {
tmp_1 = fma((1.0 / (t_3 / y)), (z / t), t_4);
} else if (y <= -1.884688025365851e+169) {
tmp_1 = (z + ((x * t) / y)) / b;
} else if (y <= 1.081035654397059e-9) {
tmp_1 = t_1 + ((y * z) / fma(y, b, fma(a, t, t)));
} else if (y <= 6.194405303028895e+221) {
tmp_1 = fma((y / t_3), (z / t), t_4);
} else {
tmp_1 = t_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.6 |
| Herbie | 9.5 |
if y < -5.9816455536207457e276 or 6.194405303028895e221 < y Initial program 43.0
Simplified38.2
Taylor expanded in z around 0 40.3
Taylor expanded in y around inf 16.0
if -5.9816455536207457e276 < y < -1.0875447241440656e227Initial program 42.2
Simplified36.2
Taylor expanded in z around 0 40.0
Simplified31.5
Applied clear-num_binary6431.5
if -1.0875447241440656e227 < y < -1.884688025365851e169Initial program 37.4
Simplified28.7
Taylor expanded in z around 0 35.4
Simplified24.2
Taylor expanded in b around inf 23.2
if -1.884688025365851e169 < y < 1.081035654397059e-9Initial program 7.5
Simplified10.7
Taylor expanded in z around 0 6.1
Taylor expanded in z around inf 4.1
Simplified4.0
if 1.081035654397059e-9 < y < 6.194405303028895e221Initial program 25.5
Simplified20.4
Taylor expanded in z around 0 22.8
Simplified17.6
Final simplification9.5
herbie shell --seed 2021280
(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))))