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



Bits error versus eh



Bits error versus ew



Bits error versus t
Results
Initial program 0.1
rmApplied distribute-lft-neg-out_binary640.1
Applied distribute-frac-neg_binary640.1
Applied atan-neg_binary640.1
Applied cos-neg_binary640.1
Final simplification0.1
herbie shell --seed 2021118
(FPCore (eh ew t)
:name "Example 2 from Robby"
:precision binary64
(fabs (- (* (* ew (cos t)) (cos (atan (/ (* (- eh) (tan t)) ew)))) (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))