\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}\left(\sqrt[3]{\sqrt{2}} \cdot \left(\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z}\right) \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right)\right)\right) \cdot e^{\frac{t \cdot t}{2}}(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
(FPCore (x y z t) :precision binary64 (* (* (cbrt (sqrt 2.0)) (* (* (- (* x 0.5) y) (sqrt z)) (* (cbrt (sqrt 2.0)) (cbrt (sqrt 2.0))))) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return ((double) (((double) (((double) (((double) (x * 0.5)) - y)) * ((double) sqrt(((double) (z * 2.0)))))) * ((double) exp((((double) (t * t)) / 2.0)))));
}
double code(double x, double y, double z, double t) {
return ((double) (((double) (((double) cbrt(((double) sqrt(2.0)))) * ((double) (((double) (((double) (((double) (x * 0.5)) - y)) * ((double) sqrt(z)))) * ((double) (((double) cbrt(((double) sqrt(2.0)))) * ((double) cbrt(((double) sqrt(2.0)))))))))) * ((double) exp((((double) (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 sqrt-prod_binary640.5
Applied associate-*r*_binary640.5
rmApplied add-cube-cbrt_binary640.5
Applied associate-*r*_binary640.5
Final simplification0.5
herbie shell --seed 2020210
(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.0))) (pow (exp 1.0) (/ (* t t) 2.0)))
(* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))