x + \frac{y \cdot y}{z}x + \frac{y}{\frac{z}{y}}double f(double x, double y, double z) {
double r542026 = x;
double r542027 = y;
double r542028 = r542027 * r542027;
double r542029 = z;
double r542030 = r542028 / r542029;
double r542031 = r542026 + r542030;
return r542031;
}
double f(double x, double y, double z) {
double r542032 = x;
double r542033 = y;
double r542034 = z;
double r542035 = r542034 / r542033;
double r542036 = r542033 / r542035;
double r542037 = r542032 + r542036;
return r542037;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.4 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 6.4
Simplified0.1
rmApplied fma-udef0.1
Simplified6.4
rmApplied sqr-pow6.4
Applied associate-/l*0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019303 +o rules:numerics
(FPCore (x y z)
:name "Crypto.Random.Test:calculate from crypto-random-0.0.9"
:precision binary64
:herbie-target
(+ x (* y (/ y z)))
(+ x (/ (* y y) z)))