\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\begin{array}{l}
\mathbf{if}\;z \le -7.1680483536268657 \cdot 10^{54} \lor \neg \left(z \le 6.1309593021235525 \cdot 10^{123}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 1 \cdot \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\\
\end{array}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 VAR;
if (((z <= -7.168048353626866e+54) || !(z <= 6.130959302123553e+123))) {
VAR = ((x + (y / t)) / (x + 1.0));
} else {
VAR = ((x + (1.0 * (((y * z) - x) / ((t * z) - x)))) / (x + 1.0));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.4 |
|---|---|
| Target | 0.4 |
| Herbie | 3.5 |
if z < -7.168048353626866e+54 or 6.130959302123553e+123 < z Initial program 18.7
Taylor expanded around inf 7.7
if -7.168048353626866e+54 < z < 6.130959302123553e+123Initial program 1.3
rmApplied clear-num1.3
rmApplied *-un-lft-identity1.3
Applied *-un-lft-identity1.3
Applied times-frac1.3
Applied add-cube-cbrt1.3
Applied times-frac1.3
Simplified1.3
Simplified1.3
Final simplification3.5
herbie shell --seed 2020075
(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))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1)))