double code(double x, double c, double s) {
return ((double) (((double) cos(((double) (2.0 * x)))) / ((double) (((double) pow(c, 2.0)) * ((double) (((double) (x * ((double) pow(s, 2.0)))) * x))))));
}
double code(double x, double c, double s) {
return ((double) (((double) (1.0 / ((double) (x * ((double) pow(((double) (c * s)), ((double) (2.0 * 0.5)))))))) * ((double) (((double) cos(((double) (x * 2.0)))) / ((double) (x * ((double) pow(((double) (c * s)), ((double) (2.0 * 0.5))))))))));
}



Bits error versus x



Bits error versus c



Bits error versus s
Results
Initial program 27.9
Simplified28.0
rmApplied pow-prod-down13.3
rmApplied sqr-pow13.3
Applied associate-*r*6.1
Simplified6.1
rmApplied associate-/r*6.0
Simplified6.0
rmApplied *-un-lft-identity6.0
Applied *-un-lft-identity6.0
Applied times-frac6.0
Applied times-frac2.6
Simplified2.6
Simplified2.6
Final simplification2.6
herbie shell --seed 2020180
(FPCore (x c s)
:name "mixedcos"
:precision binary64
(/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))