Average Error: 19.8 → 19.8
Time: 16.2s
Precision: binary64
\[{\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} \]
(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}

Error

Bits error versus a

Bits error versus b

Bits error versus angle

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 19.8

    \[{\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} \]
  2. Applied div-inv_binary6419.8

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \pi\right)\right)}^{2} \]
  3. Applied associate-*l*_binary6419.8

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \pi\right)\right)}\right)}^{2} \]
  4. Simplified19.8

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \color{blue}{\left(0.005555555555555556 \cdot \pi\right)}\right)\right)}^{2} \]
  5. Applied add-cbrt-cube_binary6419.8

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sqrt[3]{\left(\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right) \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}}\right)}^{2} \]
  6. Applied div-inv_binary6419.8

    \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sqrt[3]{\left(\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right) \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}\right)}^{2} \]
  7. Applied associate-*l*_binary6419.8

    \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \pi\right)\right)}\right)}^{2} + {\left(b \cdot \sqrt[3]{\left(\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right) \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}\right)}^{2} \]
  8. Final simplification19.8

    \[\leadsto {\left(a \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)}^{2} + {\left(b \cdot \sqrt[3]{\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)}\right)}^{2} \]

Reproduce

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)))