Average Error: 20.5 → 20.5
Time: 31.1s
Precision: binary64
Cost: 110592
\[{\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 := {\cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}^{2}\\ {\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sqrt[3]{\sqrt[3]{t_0} \cdot \left(t_0 \cdot \sqrt[3]{\cos \left({\left(\sqrt[3]{\pi \cdot \left(0.005555555555555556 \cdot angle\right)}\right)}^{3}\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 (pow (cos (* (* angle PI) 0.005555555555555556)) 2.0)))
   (+
    (pow (* a (sin (* (* angle 0.005555555555555556) PI))) 2.0)
    (pow
     (*
      b
      (cbrt
       (*
        (cbrt t_0)
        (*
         t_0
         (cbrt
          (cos (pow (cbrt (* PI (* 0.005555555555555556 angle))) 3.0)))))))
     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 = pow(cos(((angle * ((double) M_PI)) * 0.005555555555555556)), 2.0);
	return pow((a * sin(((angle * 0.005555555555555556) * ((double) M_PI)))), 2.0) + pow((b * cbrt((cbrt(t_0) * (t_0 * cbrt(cos(pow(cbrt((((double) M_PI) * (0.005555555555555556 * angle))), 3.0))))))), 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.pow(Math.cos(((angle * Math.PI) * 0.005555555555555556)), 2.0);
	return Math.pow((a * Math.sin(((angle * 0.005555555555555556) * Math.PI))), 2.0) + Math.pow((b * Math.cbrt((Math.cbrt(t_0) * (t_0 * Math.cbrt(Math.cos(Math.pow(Math.cbrt((Math.PI * (0.005555555555555556 * angle))), 3.0))))))), 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 = cos(Float64(Float64(angle * pi) * 0.005555555555555556)) ^ 2.0
	return Float64((Float64(a * sin(Float64(Float64(angle * 0.005555555555555556) * pi))) ^ 2.0) + (Float64(b * cbrt(Float64(cbrt(t_0) * Float64(t_0 * cbrt(cos((cbrt(Float64(pi * Float64(0.005555555555555556 * angle))) ^ 3.0))))))) ^ 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[Cos[N[(N[(angle * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[N[(N[(angle * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Power[N[(N[Power[t$95$0, 1/3], $MachinePrecision] * N[(t$95$0 * N[Power[N[Cos[N[Power[N[Power[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision], 1/3], $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 := {\cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}^{2}\\
{\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sqrt[3]{\sqrt[3]{t_0} \cdot \left(t_0 \cdot \sqrt[3]{\cos \left({\left(\sqrt[3]{\pi \cdot \left(0.005555555555555556 \cdot angle\right)}\right)}^{3}\right)}\right)}\right)}^{2}
\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 20.5

    \[{\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. Simplified20.4

    \[\leadsto \color{blue}{{\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)}^{2}} \]
    Proof
  3. Applied egg-rr20.5

    \[\leadsto {\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\sqrt[3]{\pi} \cdot \left(\sqrt[3]{0.005555555555555556} \cdot \left(\sqrt[3]{\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}} \cdot angle\right)\right)\right)}\right)}^{2} \]
  4. Applied egg-rr20.5

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

    \[\leadsto {\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sqrt[3]{\sqrt[3]{{\cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}^{2}} \cdot \left({\cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}^{2} \cdot \sqrt[3]{\cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}\right)}}\right)}^{2} \]
    Proof
  6. Applied egg-rr20.5

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

Alternatives

Alternative 1
Error20.4
Cost39360
\[\begin{array}{l} t_0 := \left(0.005555555555555556 \cdot \pi\right) \cdot angle\\ {\left(a \cdot \sin t_0\right)}^{2} + {\left(b \cdot \cos t_0\right)}^{2} \end{array} \]
Alternative 2
Error20.4
Cost39360
\[{\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot \pi\right) \cdot angle\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)}^{2} \]
Alternative 3
Error31.7
Cost26888
\[\begin{array}{l} t_0 := {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}\\ t_1 := {\left(a \cdot 0\right)}^{2} + t_0\\ \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{+50}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+38}:\\ \;\;\;\;\left(a \cdot angle\right) \cdot \left(a \cdot angle\right) + t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error20.4
Cost26368
\[{\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot \pi\right) \cdot angle\right)\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
Alternative 5
Error33.0
Cost20424
\[\begin{array}{l} t_0 := \left(a \cdot angle\right) \cdot \left(a \cdot angle\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}\\ \mathbf{if}\;a \leq -7.2 \cdot 10^{-167}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{-165}:\\ \;\;\;\;\left(\left(a \cdot a\right) \cdot angle\right) \cdot angle + b \cdot b\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error33.0
Cost20424
\[\begin{array}{l} t_0 := {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}\\ t_1 := \left(a \cdot angle\right) \cdot \left(a \cdot angle\right) + t_0\\ \mathbf{if}\;a \leq -8 \cdot 10^{-162}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{-165}:\\ \;\;\;\;\left(\left(a \cdot a\right) \cdot angle\right) \cdot angle + t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error33.1
Cost968
\[\begin{array}{l} \mathbf{if}\;a \leq -7.8 \cdot 10^{-162}:\\ \;\;\;\;\left(angle \cdot \left(a \cdot angle\right)\right) \cdot a + b \cdot b\\ \mathbf{elif}\;a \leq 10^{+115}:\\ \;\;\;\;\left(\left(a \cdot a\right) \cdot angle\right) \cdot angle + b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot angle\right) \cdot \left(a \cdot angle\right) + b \cdot b\\ \end{array} \]
Alternative 8
Error37.7
Cost704
\[\left(a \cdot a\right) \cdot \left(angle \cdot angle\right) + b \cdot b \]
Alternative 9
Error35.4
Cost704
\[\left(a \cdot angle\right) \cdot \left(a \cdot angle\right) + b \cdot b \]

Error

Reproduce

herbie shell --seed 2023010 
(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)))