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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 24.7 |
|---|---|
| Target | 16.3 |
| Herbie | 7.8 |
if z < -6.91730396541497873e-4Initial program 11.9
Simplified11.9
rmApplied clear-num11.9
Simplified11.9
if -6.91730396541497873e-4 < z Initial program 30.2
Simplified15.6
Taylor expanded around 0 7.0
Simplified6.0
Final simplification7.8
herbie shell --seed 2020190
(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)))