\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\begin{array}{l}
\mathbf{if}\;z \leq -8.82873067419859 \cdot 10^{+141}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{elif}\;z \leq 5.6823258675690636 \cdot 10^{+138}:\\
\;\;\;\;\begin{array}{l}
t_1 := z \cdot t - x\\
\frac{z \cdot y}{\left(x + 1\right) \cdot t_1} + \frac{x - \frac{x}{t_1}}{x + 1}
\end{array}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y}{t \cdot \left(x + 1\right)} + \frac{x}{x + 1}\right) - \frac{x}{t \cdot \left(z \cdot \left(x + 1\right)\right)}\\
\end{array}
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
(FPCore (x y z t)
:precision binary64
(if (<= z -8.82873067419859e+141)
(/ (+ x (/ y t)) (+ x 1.0))
(if (<= z 5.6823258675690636e+138)
(let* ((t_1 (- (* z t) x)))
(+ (/ (* z y) (* (+ x 1.0) t_1)) (/ (- x (/ x t_1)) (+ x 1.0))))
(-
(+ (/ y (* t (+ x 1.0))) (/ x (+ x 1.0)))
(/ x (* t (* z (+ x 1.0))))))))double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.82873067419859e+141) {
tmp = (x + (y / t)) / (x + 1.0);
} else if (z <= 5.6823258675690636e+138) {
double t_1 = (z * t) - x;
tmp = ((z * y) / ((x + 1.0) * t_1)) + ((x - (x / t_1)) / (x + 1.0));
} else {
tmp = ((y / (t * (x + 1.0))) + (x / (x + 1.0))) - (x / (t * (z * (x + 1.0))));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.3 |
|---|---|
| Target | 0.3 |
| Herbie | 3.5 |
if z < -8.82873067419859e141Initial program 21.7
Taylor expanded around inf 6.9
if -8.82873067419859e141 < z < 5.6823258675690636e138Initial program 2.3
rmApplied add-cbrt-cube_binary6414.1
Simplified14.1
Taylor expanded around 0 2.3
Simplified2.3
if 5.6823258675690636e138 < z Initial program 21.2
Taylor expanded around inf 7.1
Final simplification3.5
herbie shell --seed 2021196
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))