x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\begin{array}{l}
\mathbf{if}\;z \le -208.32873466379357:\\
\;\;\;\;x - \frac{\log \left(1 + \left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot e^{z}\right) - y\right)\right)}{t}\\
\mathbf{elif}\;z \le -2.0391679135262321 \cdot 10^{-80}:\\
\;\;\;\;x - \frac{\log \left(1 + y \cdot \left(z + \left(z \cdot z\right) \cdot \left(z \cdot \frac{1}{6} + \frac{1}{2}\right)\right)\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \left(1 \cdot \left(y \cdot \frac{z}{t}\right) + \frac{\log 1}{t}\right)\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (x - ((double) (((double) log(((double) (((double) (1.0 - y)) + ((double) (y * ((double) exp(z)))))))) / t))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((z <= -208.32873466379357)) {
VAR = ((double) (x - ((double) (((double) log(((double) (1.0 + ((double) (((double) (((double) (((double) cbrt(y)) * ((double) cbrt(y)))) * ((double) (((double) cbrt(y)) * ((double) exp(z)))))) - y)))))) / t))));
} else {
double VAR_1;
if ((z <= -2.039167913526232e-80)) {
VAR_1 = ((double) (x - ((double) (((double) log(((double) (1.0 + ((double) (y * ((double) (z + ((double) (((double) (z * z)) * ((double) (((double) (z * 0.16666666666666666)) + 0.5)))))))))))) / t))));
} else {
VAR_1 = ((double) (x - ((double) (((double) (1.0 * ((double) (y * ((double) (z / t)))))) + ((double) (((double) log(1.0)) / t))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 24.9 |
|---|---|
| Target | 16.2 |
| Herbie | 7.7 |
if z < -208.32873466379357Initial program 10.6
Simplified10.6
rmApplied add-cube-cbrt10.6
Applied associate-*l*10.6
Simplified10.6
if -208.32873466379357 < z < -2.0391679135262321e-80Initial program 27.4
Simplified20.1
Taylor expanded around 0 12.4
Simplified12.4
if -2.0391679135262321e-80 < z Initial program 31.5
Simplified15.8
rmApplied div-inv15.8
Taylor expanded around 0 6.6
Simplified6.6
Taylor expanded around 0 6.6
Simplified5.7
Final simplification7.7
herbie shell --seed 2020179
(FPCore (x y z t)
:name "System.Random.MWC.Distributions:truncatedExp from mwc-random-0.13.3.2"
:precision binary64
:herbie-target
(if (< z -2.8874623088207947e+119) (- (- x (/ (/ (neg 0.5) (* y t)) (* z z))) (* (/ (neg 0.5) (* y t)) (/ (/ 2.0 z) (* z z)))) (- x (/ (log (+ 1.0 (* z y))) t)))
(- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))