\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\log \left(1 + \mathsf{expm1}\left(\frac{1}{\cos \left(\frac{x}{y \cdot 2}\right)}\right)\right)double f(double x, double y) {
double r1080691 = x;
double r1080692 = y;
double r1080693 = 2.0;
double r1080694 = r1080692 * r1080693;
double r1080695 = r1080691 / r1080694;
double r1080696 = tan(r1080695);
double r1080697 = sin(r1080695);
double r1080698 = r1080696 / r1080697;
return r1080698;
}
double f(double x, double y) {
double r1080699 = 1.0;
double r1080700 = x;
double r1080701 = y;
double r1080702 = 2.0;
double r1080703 = r1080701 * r1080702;
double r1080704 = r1080700 / r1080703;
double r1080705 = cos(r1080704);
double r1080706 = r1080699 / r1080705;
double r1080707 = expm1(r1080706);
double r1080708 = r1080699 + r1080707;
double r1080709 = log(r1080708);
return r1080709;
}




Bits error versus x




Bits error versus y
Results
| Original | 36.1 |
|---|---|
| Target | 29.3 |
| Herbie | 28.9 |
Initial program 36.1
rmApplied tan-quot36.1
Applied associate-/l/36.1
rmApplied log1p-expm1-u36.1
Simplified28.9
rmApplied log1p-udef28.9
Final simplification28.9
herbie shell --seed 2019303 +o rules:numerics
(FPCore (x y)
:name "Diagrams.TwoD.Layout.CirclePacking:approxRadius from diagrams-contrib-1.3.0.5"
:precision binary64
:herbie-target
(if (< y -1.23036909113069936e114) 1 (if (< y -9.1028524068119138e-222) (/ (sin (/ x (* y 2))) (* (sin (/ x (* y 2))) (log (exp (cos (/ x (* y 2))))))) 1))
(/ (tan (/ x (* y 2))) (sin (/ x (* y 2)))))