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 ((((double) exp(z)) <= 0.9999997033391638)) {
VAR = ((double) (x - ((double) (((double) log(((double) (1.0 + ((double) (((double) (((double) (((double) cbrt(y)) * ((double) cbrt(y)))) * ((double) (((double) exp(z)) * ((double) cbrt(y)))))) - y)))))) / t))));
} else {
VAR = ((double) (x - ((double) (((double) (((double) log(1.0)) / t)) + ((double) (1.0 * ((double) (y * ((double) (z / t))))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 24.8 |
|---|---|
| Target | 16.2 |
| Herbie | 7.9 |
if (exp z) < 0.99999970333916377Initial program 11.3
Simplified11.3
rmApplied add-cube-cbrt11.3
Applied associate-*l*11.3
Simplified11.3
if 0.99999970333916377 < (exp z) Initial program 30.7
Simplified15.7
Taylor expanded around 0 7.1
Simplified6.3
rmApplied add-cube-cbrt6.5
Applied *-un-lft-identity6.5
Applied times-frac6.5
Applied associate-*r*8.0
Simplified8.0
Taylor expanded around 0 7.1
Simplified6.4
Final simplification7.9
herbie shell --seed 2020192
(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)))