{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := \sqrt[3]{t_0}\\
t_2 := \sqrt[3]{t_1}\\
{\left(a \cdot \sin t_0\right)}^{2} + {\left(b \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(t_1 \cdot \left(t_1 \cdot \sqrt[3]{t_1 \cdot \left(t_1 \cdot \left(t_2 \cdot \left(t_2 \cdot t_2\right)\right)\right)}\right)\right)\right)\right)\right)}^{2}
\end{array}
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (/ angle 180.0) PI))) 2.0)))
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) PI)) (t_1 (cbrt t_0)) (t_2 (cbrt t_1)))
(+
(pow (* a (sin t_0)) 2.0)
(pow
(*
b
(log1p
(expm1
(cos (* t_1 (* t_1 (cbrt (* t_1 (* t_1 (* t_2 (* t_2 t_2)))))))))))
2.0))))double code(double a, double b, double angle) {
return pow((a * sin((angle / 180.0) * ((double) M_PI))), 2.0) + pow((b * cos((angle / 180.0) * ((double) M_PI))), 2.0);
}
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
double t_1 = cbrt(t_0);
double t_2 = cbrt(t_1);
return pow((a * sin(t_0)), 2.0) + pow((b * log1p(expm1(cos(t_1 * (t_1 * cbrt(t_1 * (t_1 * (t_2 * (t_2 * t_2))))))))), 2.0);
}



Bits error versus a



Bits error versus b



Bits error versus angle
Results
Initial program 20.6
Applied add-cube-cbrt_binary6420.6
Simplified20.6
Simplified20.6
Applied add-cbrt-cube_binary6420.6
Applied add-cube-cbrt_binary6420.6
Applied log1p-expm1-u_binary6420.6
Final simplification20.6
herbie shell --seed 2021224
(FPCore (a b angle)
:name "ab-angle->ABCF A"
:precision binary64
(+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (/ angle 180.0) PI))) 2.0)))