\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}\left(x \cdot 0.5 - y\right) \cdot \left(\left({z}^{\frac{1}{2}} \cdot \sqrt{2}\right) \cdot \left(\left(\sqrt[3]{{\left(e^{t}\right)}^{\left(\frac{t}{2}\right)}} \cdot \sqrt[3]{{\left(e^{t}\right)}^{\left(\frac{t}{2}\right)}}\right) \cdot \sqrt[3]{{\left(e^{t}\right)}^{\left(\frac{t}{2}\right)}}\right)\right)double code(double x, double y, double z, double t) {
return ((((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0)));
}
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * ((pow(z, 0.5) * sqrt(2.0)) * ((cbrt(pow(exp(t), (t / 2.0))) * cbrt(pow(exp(t), (t / 2.0)))) * cbrt(pow(exp(t), (t / 2.0))))));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 0.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.5 |
Initial program 0.3
rmApplied associate-*l*0.3
rmApplied *-un-lft-identity0.3
Applied times-frac0.3
Applied exp-prod0.3
Simplified0.3
rmApplied add-cube-cbrt0.3
rmApplied sqrt-prod0.5
Simplified0.5
Final simplification0.5
herbie shell --seed 2020057 +o rules:numerics
(FPCore (x y z t)
:name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
:precision binary64
:herbie-target
(* (* (- (* x 0.5) y) (sqrt (* z 2))) (pow (exp 1) (/ (* t t) 2)))
(* (* (- (* x 0.5) y) (sqrt (* z 2))) (exp (/ (* t t) 2))))