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



Bits error versus a



Bits error versus b



Bits error versus angle
Results
Initial program 19.8
Applied div-inv_binary6419.8
Applied associate-*l*_binary6419.8
Simplified19.8
Applied add-cbrt-cube_binary6419.8
Applied div-inv_binary6419.8
Applied associate-*l*_binary6419.8
Final simplification19.8
herbie shell --seed 2022131
(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)))