\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\begin{array}{l}
\mathbf{if}\;z \le -0.11637323540242528:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t \cdot z - x}, z, x\right) - \frac{1}{\sqrt[3]{t \cdot z - x} \cdot \sqrt[3]{t \cdot z - x}} \cdot \frac{x}{\sqrt[3]{t \cdot z - x}}}{x + 1}\\
\mathbf{elif}\;z \le 6.17993228896471188 \cdot 10^{40}:\\
\;\;\;\;\frac{1}{\frac{x + 1}{x + \frac{y \cdot z - x}{t \cdot z - x}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{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 temp;
if ((z <= -0.11637323540242528)) {
temp = ((fma((y / ((t * z) - x)), z, x) - ((1.0 / (cbrt(((t * z) - x)) * cbrt(((t * z) - x)))) * (x / cbrt(((t * z) - x))))) / (x + 1.0));
} else {
double temp_1;
if ((z <= 6.179932288964712e+40)) {
temp_1 = (1.0 / ((x + 1.0) / (x + (((y * z) - x) / ((t * z) - x)))));
} else {
temp_1 = ((x + (y / t)) / (x + 1.0));
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.4 |
|---|---|
| Target | 0.3 |
| Herbie | 3.3 |
if z < -0.11637323540242528Initial program 15.6
rmApplied div-sub15.6
Applied associate-+r-15.6
Simplified5.7
rmApplied add-cube-cbrt5.7
Applied *-un-lft-identity5.7
Applied times-frac5.7
if -0.11637323540242528 < z < 6.179932288964712e+40Initial program 0.2
rmApplied clear-num0.3
if 6.179932288964712e+40 < z Initial program 16.7
Taylor expanded around inf 8.5
Final simplification3.3
herbie shell --seed 2020049 +o rules:numerics
(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)))