\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq -1.0003839562376489 \cdot 10^{+88}:\\
\;\;\;\;0 \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \log \left(e^{\cos \left(\frac{angle}{180} \cdot \pi\right)}\right)\\
\end{array}(FPCore (a b angle) :precision binary64 (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0)))) (cos (* PI (/ angle 180.0)))))
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) -1.0003839562376489e+88)
(* 0.0 (cos (* (/ angle 180.0) PI)))
(*
(* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) PI)))
(log (exp (cos (* (/ angle 180.0) PI)))))))double code(double a, double b, double angle) {
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(((double) M_PI) * (angle / 180.0))) * cos(((double) M_PI) * (angle / 180.0));
}
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -1.0003839562376489e+88) {
tmp = 0.0 * cos((angle / 180.0) * ((double) M_PI));
} else {
tmp = ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin((angle / 180.0) * ((double) M_PI))) * log(exp(cos((angle / 180.0) * ((double) M_PI))));
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus angle
Results
if (/.f64 angle 180) < -1.0003839562376489e88Initial program 52.0
Taylor expanded around 0 53.6
if -1.0003839562376489e88 < (/.f64 angle 180) Initial program 27.1
rmApplied add-log-exp_binary6427.1
Final simplification31.2
herbie shell --seed 2020354
(FPCore (a b angle)
:name "ab-angle->ABCF B"
:precision binary64
(* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0)))) (cos (* PI (/ angle 180.0)))))