(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 (cbrt (* PI (/ angle 180.0))))
(t_1 (cos (* t_0 (* t_0 t_0))))
(t_2 (cbrt t_0)))
(+
(pow (* a (sin (* 0.005555555555555556 (* angle PI)))) 2.0)
(pow
(* b (cbrt (* (* t_1 t_1) (cos (* t_0 (* t_0 (* 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 = cbrt((((double) M_PI) * (angle / 180.0)));
double t_1 = cos((t_0 * (t_0 * t_0)));
double t_2 = cbrt(t_0);
return pow((a * sin((0.005555555555555556 * (angle * ((double) M_PI))))), 2.0) + pow((b * cbrt(((t_1 * t_1) * cos((t_0 * (t_0 * (t_2 * (t_2 * t_2)))))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(((angle / 180.0) * Math.PI))), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.cbrt((Math.PI * (angle / 180.0)));
double t_1 = Math.cos((t_0 * (t_0 * t_0)));
double t_2 = Math.cbrt(t_0);
return Math.pow((a * Math.sin((0.005555555555555556 * (angle * Math.PI)))), 2.0) + Math.pow((b * Math.cbrt(((t_1 * t_1) * Math.cos((t_0 * (t_0 * (t_2 * (t_2 * t_2)))))))), 2.0);
}
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(Float64(angle / 180.0) * pi))) ^ 2.0)) end
function code(a, b, angle) t_0 = cbrt(Float64(pi * Float64(angle / 180.0))) t_1 = cos(Float64(t_0 * Float64(t_0 * t_0))) t_2 = cbrt(t_0) return Float64((Float64(a * sin(Float64(0.005555555555555556 * Float64(angle * pi)))) ^ 2.0) + (Float64(b * cbrt(Float64(Float64(t_1 * t_1) * cos(Float64(t_0 * Float64(t_0 * Float64(t_2 * Float64(t_2 * t_2)))))))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
code[a_, b_, angle_] := Block[{t$95$0 = N[Power[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[t$95$0, 1/3], $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Power[N[(N[(t$95$1 * t$95$1), $MachinePrecision] * N[Cos[N[(t$95$0 * N[(t$95$0 * N[(t$95$2 * N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]]]
{\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 := \sqrt[3]{\pi \cdot \frac{angle}{180}}\\
t_1 := \cos \left(t_0 \cdot \left(t_0 \cdot t_0\right)\right)\\
t_2 := \sqrt[3]{t_0}\\
{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2} + {\left(b \cdot \sqrt[3]{\left(t_1 \cdot t_1\right) \cdot \cos \left(t_0 \cdot \left(t_0 \cdot \left(t_2 \cdot \left(t_2 \cdot t_2\right)\right)\right)\right)}\right)}^{2}
\end{array}



Bits error versus a



Bits error versus b



Bits error versus angle
Results
Initial program 20.8
Applied add-cube-cbrt_binary6420.8
Applied add-cbrt-cube_binary6420.8
Applied add-cube-cbrt_binary6420.8
Simplified20.8
Simplified20.8
Taylor expanded in angle around inf 20.8
Final simplification20.8
herbie shell --seed 2022137
(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)))