\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\begin{array}{l}
\mathbf{if}\;z \leq -2.642073336958404 \cdot 10^{-86} \lor \neg \left(z \leq 1.3583837970033708 \cdot 10^{-139}\right):\\
\;\;\;\;\frac{-\left(x + z \cdot \frac{y}{t}\right)}{-\left(\left(a + 1\right) + \frac{y}{t} \cdot b\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(x + \frac{z \cdot y}{t}\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\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 (or (<= z -2.642073336958404e-86) (not (<= z 1.3583837970033708e-139))) (/ (- (+ x (* z (/ y t)))) (- (+ (+ a 1.0) (* (/ y t) b)))) (* (+ x (/ (* z y) t)) (/ 1.0 (+ (+ a 1.0) (/ (* y b) t))))))
double code(double x, double y, double z, double t, double a, double b) {
return (((double) (x + (((double) (y * z)) / t))) / ((double) (((double) (a + 1.0)) + (((double) (y * b)) / t))));
}
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((z <= -2.642073336958404e-86) || !(z <= 1.3583837970033708e-139))) {
tmp = (((double) -(((double) (x + ((double) (z * (y / t))))))) / ((double) -(((double) (((double) (a + 1.0)) + ((double) ((y / t) * b)))))));
} else {
tmp = ((double) (((double) (x + (((double) (z * y)) / t))) * (1.0 / ((double) (((double) (a + 1.0)) + (((double) (y * b)) / 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
Results
| Original | 16.7 |
|---|---|
| Target | 13.2 |
| Herbie | 13.7 |
if z < -2.64207333695840391e-86 or 1.3583837970033708e-139 < z Initial program 20.7
rmApplied add-cube-cbrt_binary6421.0
Applied associate-/r*_binary6421.0
Simplified18.9
rmApplied *-un-lft-identity_binary6418.9
Applied associate-/r*_binary6418.9
Simplified18.7
rmApplied frac-2neg_binary6418.7
Simplified16.3
if -2.64207333695840391e-86 < z < 1.3583837970033708e-139Initial program 8.3
rmApplied div-inv_binary648.4
Final simplification13.7
herbie shell --seed 2020205
(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))))