\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := \frac{x}{1 + \left(a + t_1\right)}\\
t_3 := \frac{z}{b} + t_2\\
\mathbf{if}\;y \leq -6.04812534866938 \cdot 10^{+167}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 3.67379042608604 \cdot 10^{+52}:\\
\;\;\;\;t_2 + \frac{y \cdot z}{\mathsf{fma}\left(y, b, \mathsf{fma}\left(a, t, t\right)\right)}\\
\mathbf{elif}\;y \leq 1.244253742756409 \cdot 10^{+146}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{t_1 + \left(1 + a\right)}\\
\mathbf{elif}\;y \leq 5.1233805809014946 \cdot 10^{+247}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{\mathsf{fma}\left(y, b, \mathsf{fma}\left(t, a, t\right)\right)} + \frac{x}{1 + \left(a + \frac{y}{\frac{t}{b}}\right)}\\
\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 (/ (* y b) t))
(t_2 (/ x (+ 1.0 (+ a t_1))))
(t_3 (+ (/ z b) t_2)))
(if (<= y -6.04812534866938e+167)
t_3
(if (<= y 3.67379042608604e+52)
(+ t_2 (/ (* y z) (fma y b (fma a t t))))
(if (<= y 1.244253742756409e+146)
(/ (+ x (/ y (/ t z))) (+ t_1 (+ 1.0 a)))
(if (<= y 5.1233805809014946e+247)
t_3
(+
(* y (/ z (fma y b (fma t a t))))
(/ x (+ 1.0 (+ a (/ y (/ t b))))))))))))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 = (y * b) / t;
double t_2 = x / (1.0 + (a + t_1));
double t_3 = (z / b) + t_2;
double tmp;
if (y <= -6.04812534866938e+167) {
tmp = t_3;
} else if (y <= 3.67379042608604e+52) {
tmp = t_2 + ((y * z) / fma(y, b, fma(a, t, t)));
} else if (y <= 1.244253742756409e+146) {
tmp = (x + (y / (t / z))) / (t_1 + (1.0 + a));
} else if (y <= 5.1233805809014946e+247) {
tmp = t_3;
} else {
tmp = (y * (z / fma(y, b, fma(t, a, t)))) + (x / (1.0 + (a + (y / (t / b)))));
}
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.2 |
|---|---|
| Target | 13.1 |
| Herbie | 9.6 |
if y < -6.04812534866938001e167 or 1.24425374275640895e146 < y < 5.12338058090149459e247Initial program 37.9
Taylor expanded in x around 0 36.5
Taylor expanded in y around inf 19.6
if -6.04812534866938001e167 < y < 3.6737904260860398e52Initial program 7.6
Taylor expanded in x around 0 6.5
Taylor expanded in z around inf 4.5
Simplified4.5
Applied *-un-lft-identity_binary644.5
Applied *-un-lft-identity_binary644.5
Applied times-frac_binary644.5
Simplified4.5
if 3.6737904260860398e52 < y < 1.24425374275640895e146Initial program 23.0
Applied associate-/l*_binary6419.7
if 5.12338058090149459e247 < y Initial program 44.8
Taylor expanded in x around 0 42.5
Taylor expanded in z around inf 39.4
Simplified38.9
Applied *-un-lft-identity_binary6438.9
Applied times-frac_binary6432.2
Simplified32.2
Simplified32.2
Applied associate-/l*_binary6429.1
Final simplification9.6
herbie shell --seed 2022005
(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))))