\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(eh \cdot \frac{\frac{1}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|(FPCore (eh ew t) :precision binary64 (fabs (+ (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (* ew (sin t)) (cos (atan (* eh (/ (/ 1.0 ew) (tan t)))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * sin(t)) * cos(atan((eh / ew) / tan(t)))) + ((eh * cos(t)) * sin(atan((eh / ew) / tan(t)))));
}
double code(double eh, double ew, double t) {
return fabs(((ew * sin(t)) * cos(atan(eh * ((1.0 / ew) / tan(t))))) + ((eh * cos(t)) * sin(atan((eh / ew) / tan(t)))));
}



Bits error versus eh



Bits error versus ew



Bits error versus t
Results
Initial program 0.1
rmApplied *-un-lft-identity_binary64_11010.1
Applied div-inv_binary64_10980.1
Applied times-frac_binary64_11070.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020342
(FPCore (eh ew t)
:name "Example from Robby"
:precision binary64
(fabs (+ (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))