\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)}\\
\mathbf{if}\;y \leq -1.5249508773597182 \cdot 10^{-19} \lor \neg \left(y \leq 6884034804144.34\right):\\
\;\;\;\;\frac{1}{\frac{t}{y \cdot z} + \mathsf{fma}\left(\frac{t}{z}, \frac{a}{y}, \frac{b}{z}\right)} + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 + \frac{y \cdot z}{\mathsf{fma}\left(y, b, \mathsf{fma}\left(a, t, t\right)\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 (/ x (+ 1.0 (+ a (/ (* y b) t))))))
(if (or (<= y -1.5249508773597182e-19) (not (<= y 6884034804144.34)))
(+ (/ 1.0 (+ (/ t (* y z)) (fma (/ t z) (/ a y) (/ b z)))) t_1)
(+ t_1 (/ (* y z) (fma y b (fma a t t)))))))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 tmp;
if ((y <= -1.5249508773597182e-19) || !(y <= 6884034804144.34)) {
tmp = (1.0 / ((t / (y * z)) + fma((t / z), (a / y), (b / z)))) + t_1;
} else {
tmp = t_1 + ((y * z) / fma(y, b, fma(a, t, t)));
}
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.1 |
| Herbie | 5.7 |
if y < -1.52495087735971815e-19 or 6884034804144.3398 < y Initial program 30.1
Applied clear-num_binary6430.1
Taylor expanded in x around 0 28.1
Applied clear-num_binary6428.1
Taylor expanded in a around 0 12.1
Simplified9.8
if -1.52495087735971815e-19 < y < 6884034804144.3398Initial program 3.8
Applied clear-num_binary643.9
Taylor expanded in x around 0 3.1
Taylor expanded in z around inf 1.7
Simplified1.7
Final simplification5.7
herbie shell --seed 2021274
(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))))