?

Average Error: 20.4 → 20.4
Time: 18.8s
Precision: binary64
Cost: 58624

?

\[{\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(\left(\sqrt{\pi} \cdot \frac{\sqrt{\pi}}{180}\right) \cdot angle\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 (* (* (sqrt PI) (/ (sqrt PI) 180.0)) angle))) 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(((sqrt(((double) M_PI)) * (sqrt(((double) M_PI)) / 180.0)) * angle))), 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.sqrt(Math.PI) * (Math.sqrt(Math.PI) / 180.0)) * angle))), 2.0) + Math.pow((b * Math.sin((Math.PI * (angle / 180.0)))), 2.0);
}
def code(a, b, 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)
def code(a, b, angle):
	return math.pow((a * math.cos(((math.sqrt(math.pi) * (math.sqrt(math.pi) / 180.0)) * angle))), 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(Float64(sqrt(pi) * Float64(sqrt(pi) / 180.0)) * angle))) ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0))
end
function tmp = code(a, b, angle)
	tmp = ((a * cos((pi * (angle / 180.0)))) ^ 2.0) + ((b * sin((pi * (angle / 180.0)))) ^ 2.0);
end
function tmp = code(a, b, angle)
	tmp = ((a * cos(((sqrt(pi) * (sqrt(pi) / 180.0)) * angle))) ^ 2.0) + ((b * sin((pi * (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[(N[Sqrt[Pi], $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] / 180.0), $MachinePrecision]), $MachinePrecision] * angle), $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(\left(\sqrt{\pi} \cdot \frac{\sqrt{\pi}}{180}\right) \cdot angle\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.4

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

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

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

    [Start]20.4

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

    associate-/l/ [=>]20.4

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

    associate-/r/ [=>]20.4

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

    associate-*r* [=>]20.4

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

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

Alternatives

Alternative 1
Error20.4
Cost58624
\[{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(a \cdot \cos \left(\sqrt{\pi} \cdot \left(\frac{\sqrt{\pi}}{180} \cdot angle\right)\right)\right)}^{2} \]
Alternative 2
Error20.4
Cost52288
\[{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(a \cdot \cos \left(\sqrt[3]{3.08641975308642 \cdot 10^{-5}} \cdot \frac{angle}{\frac{\sqrt[3]{-180}}{\pi}}\right)\right)}^{2} \]
Alternative 3
Error20.4
Cost39360
\[{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(a \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} \]
Alternative 4
Error20.4
Cost26368
\[{a}^{2} + {\left(b \cdot \sin \left(\frac{\frac{\pi}{180}}{\frac{1}{angle}}\right)\right)}^{2} \]
Alternative 5
Error20.4
Cost26240
\[{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {a}^{2} \]
Alternative 6
Error20.8
Cost20489
\[\begin{array}{l} t_0 := b \cdot \left(angle \cdot 0.005555555555555556\right)\\ \mathbf{if}\;angle \leq -3.3 \cdot 10^{+14} \lor \neg \left(angle \leq 4 \cdot 10^{-20}\right):\\ \;\;\;\;{a}^{2} + \frac{b \cdot b}{2} \cdot \left(1 - \cos \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + \left(t_0 \cdot t_0\right) \cdot {\pi}^{2}\\ \end{array} \]
Alternative 7
Error20.9
Cost20425
\[\begin{array}{l} \mathbf{if}\;angle \leq -3.3 \cdot 10^{+14} \lor \neg \left(angle \leq 4 \cdot 10^{-20}\right):\\ \;\;\;\;{a}^{2} + \left(1 - \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right) \cdot \left(b \cdot \left(b \cdot 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(b \cdot \left(\pi \cdot angle\right)\right)}^{2}\\ \end{array} \]
Alternative 8
Error20.9
Cost20425
\[\begin{array}{l} \mathbf{if}\;angle \leq -3.3 \cdot 10^{+14} \lor \neg \left(angle \leq 4 \cdot 10^{-20}\right):\\ \;\;\;\;{a}^{2} + \frac{b \cdot b}{2} \cdot \left(1 - \cos \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(b \cdot \left(\pi \cdot angle\right)\right)}^{2}\\ \end{array} \]
Alternative 9
Error26.0
Cost19840
\[{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(angle \cdot \left(\pi \cdot b\right)\right)}^{2} \]
Alternative 10
Error26.1
Cost19840
\[{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(b \cdot \left(\pi \cdot angle\right)\right)}^{2} \]

Error

Reproduce?

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