?

Average Error: 20.2 → 20.2
Time: 18.6s
Precision: binary64
Cost: 58752

?

\[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
\[{\left(a \cdot \cos \left(\sqrt[3]{angle} \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot {\left(\sqrt[3]{angle}\right)}^{2}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
(FPCore (a b angle)
 :precision binary64
 (+
  (pow (* a (cos (* PI (/ angle 180.0)))) 2.0)
  (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))
(FPCore (a b angle)
 :precision binary64
 (+
  (pow
   (*
    a
    (cos
     (* (cbrt angle) (* (* 0.005555555555555556 PI) (pow (cbrt angle) 2.0)))))
   2.0)
  (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))
double code(double a, double b, double angle) {
	return pow((a * cos((((double) M_PI) * (angle / 180.0)))), 2.0) + pow((b * sin((((double) M_PI) * (angle / 180.0)))), 2.0);
}
double code(double a, double b, double angle) {
	return pow((a * cos((cbrt(angle) * ((0.005555555555555556 * ((double) M_PI)) * pow(cbrt(angle), 2.0))))), 2.0) + pow((b * sin((((double) M_PI) * (angle / 180.0)))), 2.0);
}
public static double code(double a, double b, double angle) {
	return Math.pow((a * Math.cos((Math.PI * (angle / 180.0)))), 2.0) + Math.pow((b * Math.sin((Math.PI * (angle / 180.0)))), 2.0);
}
public static double code(double a, double b, double angle) {
	return Math.pow((a * Math.cos((Math.cbrt(angle) * ((0.005555555555555556 * Math.PI) * Math.pow(Math.cbrt(angle), 2.0))))), 2.0) + Math.pow((b * Math.sin((Math.PI * (angle / 180.0)))), 2.0);
}
function code(a, b, angle)
	return Float64((Float64(a * cos(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0))
end
function code(a, b, angle)
	return Float64((Float64(a * cos(Float64(cbrt(angle) * Float64(Float64(0.005555555555555556 * pi) * (cbrt(angle) ^ 2.0))))) ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0))
end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(N[Power[angle, 1/3], $MachinePrecision] * N[(N[(0.005555555555555556 * Pi), $MachinePrecision] * N[Power[N[Power[angle, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
{\left(a \cdot \cos \left(\sqrt[3]{angle} \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot {\left(\sqrt[3]{angle}\right)}^{2}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 20.2

    \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  2. Applied egg-rr20.2

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

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

    [Start]20.2

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

    associate-/r/ [=>]20.2

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

    *-commutative [=>]20.2

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

    associate-/l* [=>]20.2

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

    associate-/r/ [=>]20.2

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

    metadata-eval [<=]20.2

    \[ {\left(a \cdot \cos \left(\sqrt[3]{angle} \cdot \left(\frac{\pi}{\color{blue}{\frac{-180}{-1}}} \cdot {\left(\sqrt[3]{angle}\right)}^{2}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]

    associate-/l* [<=]20.2

    \[ {\left(a \cdot \cos \left(\sqrt[3]{angle} \cdot \left(\color{blue}{\frac{\pi \cdot -1}{-180}} \cdot {\left(\sqrt[3]{angle}\right)}^{2}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]

    *-commutative [=>]20.2

    \[ {\left(a \cdot \cos \left(\sqrt[3]{angle} \cdot \left(\frac{\color{blue}{-1 \cdot \pi}}{-180} \cdot {\left(\sqrt[3]{angle}\right)}^{2}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]

    associate-/l* [=>]20.2

    \[ {\left(a \cdot \cos \left(\sqrt[3]{angle} \cdot \left(\color{blue}{\frac{-1}{\frac{-180}{\pi}}} \cdot {\left(\sqrt[3]{angle}\right)}^{2}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]

    associate-/r/ [=>]20.2

    \[ {\left(a \cdot \cos \left(\sqrt[3]{angle} \cdot \left(\color{blue}{\left(\frac{-1}{-180} \cdot \pi\right)} \cdot {\left(\sqrt[3]{angle}\right)}^{2}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]

    metadata-eval [=>]20.2

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

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

Alternatives

Alternative 1
Error20.2
Cost26240
\[{a}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2} \]
Alternative 2
Error20.2
Cost26240
\[{a}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
Alternative 3
Error20.2
Cost26240
\[{a}^{2} + {\left(b \cdot \sin \left(\frac{angle}{\frac{180}{\pi}}\right)\right)}^{2} \]
Alternative 4
Error20.3
Cost20425
\[\begin{array}{l} \mathbf{if}\;angle \leq -0.058 \lor \neg \left(angle \leq 0.000225\right):\\ \;\;\;\;{a}^{2} + \left(1 - \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right) \cdot \frac{b}{\frac{2}{b}}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + {\left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left(angle \cdot b\right)\right)}^{2}\\ \end{array} \]
Alternative 5
Error20.3
Cost20424
\[\begin{array}{l} t_0 := 1 - \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\ \mathbf{if}\;angle \leq -0.058:\\ \;\;\;\;{a}^{2} + \frac{b \cdot b}{2} \cdot t_0\\ \mathbf{elif}\;angle \leq 0.000225:\\ \;\;\;\;{a}^{2} + {\left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left(angle \cdot b\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + t_0 \cdot \frac{b}{\frac{2}{b}}\\ \end{array} \]
Alternative 6
Error20.3
Cost20424
\[\begin{array}{l} t_0 := \frac{b \cdot b}{2}\\ \mathbf{if}\;angle \leq -0.058:\\ \;\;\;\;{a}^{2} + t_0 \cdot \left(1 - \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{elif}\;angle \leq 0.000225:\\ \;\;\;\;{a}^{2} + {\left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left(angle \cdot b\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + t_0 \cdot \left(1 - \cos \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\\ \end{array} \]
Alternative 7
Error23.6
Cost20360
\[\begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{+22}:\\ \;\;\;\;{a}^{2} + {\left(angle \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot b\right)\right)}^{2}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+38}:\\ \;\;\;\;{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left({\pi}^{2} \cdot \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \left(\left(angle \cdot b\right) \cdot \left(\pi \cdot \left(angle \cdot b\right)\right)\right)\right)\\ \end{array} \]
Alternative 8
Error23.6
Cost20360
\[\begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{-86}:\\ \;\;\;\;{a}^{2} + {\left(angle \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot b\right)\right)}^{2}\\ \mathbf{elif}\;b \leq 2 \cdot 10^{+127}:\\ \;\;\;\;{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left({\pi}^{2} \cdot \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left({\pi}^{2} \cdot \left(\left(angle \cdot b\right) \cdot \left(angle \cdot b\right)\right)\right)\\ \end{array} \]
Alternative 9
Error25.9
Cost19840
\[{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(angle \cdot \left(\pi \cdot b\right)\right)}^{2} \]
Alternative 10
Error25.9
Cost19840
\[{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2} \]
Alternative 11
Error25.9
Cost19840
\[{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(b \cdot \left(angle \cdot \pi\right)\right)}^{2} \]
Alternative 12
Error25.8
Cost19840
\[{a}^{2} + {\left(angle \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot b\right)\right)}^{2} \]
Alternative 13
Error25.8
Cost19840
\[{a}^{2} + {\left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left(angle \cdot b\right)\right)}^{2} \]

Error

Reproduce?

herbie shell --seed 2023018 
(FPCore (a b angle)
  :name "ab-angle->ABCF C"
  :precision binary64
  (+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))