\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|
\begin{array}{l}
t_1 := \frac{eh \cdot \tan t}{ew}\\
\left|\left(ew \cdot \cos t\right) \cdot \frac{1}{\sqrt{1 + t_1 \cdot t_1}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|
\end{array}
(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
(let* ((t_1 (/ (* eh (tan t)) ew)))
(fabs
(-
(* (* ew (cos t)) (/ 1.0 (sqrt (+ 1.0 (* t_1 t_1)))))
(* (* 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((-eh * tan(t)) / ew))));
}
double code(double eh, double ew, double t) {
double t_1 = (eh * tan(t)) / ew;
return fabs(((ew * cos(t)) * (1.0 / sqrt(1.0 + (t_1 * t_1)))) - ((eh * sin(t)) * sin(atan((-eh * tan(t)) / ew))));
}



Bits error versus eh



Bits error versus ew



Bits error versus t
Results
Initial program 0.1
Applied cos-atan_binary640.1
Final simplification0.1
herbie shell --seed 2022081
(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)))))))