\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \leq -1.7627119181849528 \cdot 10^{-76}:\\
\;\;\;\;\frac{z}{\frac{t \cdot \left(a + \left(1 + \frac{y \cdot b}{t}\right)\right)}{y}} + \frac{x}{a + \left(1 + \frac{y \cdot b}{t}\right)}\\
\mathbf{elif}\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \leq 2.6002272848639343 \cdot 10^{+225}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{b}{\sqrt[3]{t}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + \left(1 + \frac{y \cdot b}{t}\right)} + \frac{z}{b}\\
\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
(if (<=
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))
-1.7627119181849528e-76)
(+
(/ z (/ (* t (+ a (+ 1.0 (/ (* y b) t)))) y))
(/ x (+ a (+ 1.0 (/ (* y b) t)))))
(if (<=
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))
2.6002272848639343e+225)
(/
(+ x (/ (* y z) t))
(+ (+ a 1.0) (* (/ y (* (cbrt t) (cbrt t))) (/ b (cbrt t)))))
(+ (/ x (+ a (+ 1.0 (/ (* y b) t)))) (/ z 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 tmp;
if (((x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))) <= -1.7627119181849528e-76) {
tmp = (z / ((t * (a + (1.0 + ((y * b) / t)))) / y)) + (x / (a + (1.0 + ((y * b) / t))));
} else if (((x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))) <= 2.6002272848639343e+225) {
tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y / (cbrt(t) * cbrt(t))) * (b / cbrt(t))));
} else {
tmp = (x / (a + (1.0 + ((y * b) / t)))) + (z / 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
Results
| Original | 16.6 |
|---|---|
| Target | 12.9 |
| Herbie | 6.7 |
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.76271191818495e-76Initial program 9.7
Taylor expanded around 0 6.4
Simplified6.4
rmApplied associate-/l*_binary641.5
if -1.76271191818495e-76 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.6002272848639343e225Initial program 8.3
rmApplied add-cube-cbrt_binary648.5
Applied times-frac_binary647.1
if 2.6002272848639343e225 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 56.4
Taylor expanded around 0 48.1
Simplified48.1
Taylor expanded around inf 13.0
Final simplification6.7
herbie shell --seed 2021118
(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))))