?

Average Accuracy: 67.6% → 67.6%
Time: 19.5s
Precision: binary64
Cost: 45760

?

\[{\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(angle \cdot \left(\pi \cdot \sqrt[3]{1.7146776406035666 \cdot 10^{-7}}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\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 (* angle (* PI (cbrt 1.7146776406035666e-7))))) 2.0)
  (pow (* b (sin (* PI (* angle 0.005555555555555556)))) 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((angle * (((double) M_PI) * cbrt(1.7146776406035666e-7))))), 2.0) + pow((b * sin((((double) M_PI) * (angle * 0.005555555555555556)))), 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((angle * (Math.PI * Math.cbrt(1.7146776406035666e-7))))), 2.0) + Math.pow((b * Math.sin((Math.PI * (angle * 0.005555555555555556)))), 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(angle * Float64(pi * cbrt(1.7146776406035666e-7))))) ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(angle * 0.005555555555555556)))) ^ 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[(angle * N[(Pi * N[Power[1.7146776406035666e-7, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $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(angle \cdot \left(\pi \cdot \sqrt[3]{1.7146776406035666 \cdot 10^{-7}}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 67.6%

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

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

    [Start]67.6

    \[ {\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} \]

    add-cbrt-cube [=>]59.7

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

    pow3 [=>]59.7

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

    div-inv [=>]59.7

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

    metadata-eval [=>]59.7

    \[ {\left(a \cdot \cos \left(\sqrt[3]{{\left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right)}^{3}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  3. Taylor expanded in angle around 0 67.6%

    \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\sqrt[3]{1.7146776406035666 \cdot 10^{-7}} \cdot \left(angle \cdot \pi\right)\right)}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  4. Simplified67.6%

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

    [Start]67.6

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

    *-commutative [=>]67.6

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

    *-commutative [=>]67.6

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

    *-commutative [<=]67.6

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

    associate-*l* [=>]67.6

    \[ {\left(a \cdot \cos \color{blue}{\left(angle \cdot \left(\pi \cdot \sqrt[3]{1.7146776406035666 \cdot 10^{-7}}\right)\right)}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  5. Taylor expanded in angle around inf 67.6%

    \[\leadsto {\left(a \cdot \cos \left(angle \cdot \left(\pi \cdot \sqrt[3]{1.7146776406035666 \cdot 10^{-7}}\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)}^{2} \]
  6. Simplified67.6%

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

    [Start]67.6

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

    associate-*r* [=>]67.6

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

    *-commutative [<=]67.6

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

    *-commutative [<=]67.6

    \[ {\left(a \cdot \cos \left(angle \cdot \left(\pi \cdot \sqrt[3]{1.7146776406035666 \cdot 10^{-7}}\right)\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}^{2} \]
  7. Final simplification67.6%

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

Alternatives

Alternative 1
Accuracy67.6%
Cost39360
\[{\left(a \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
Alternative 2
Accuracy67.7%
Cost26240
\[{a}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2} \]
Alternative 3
Accuracy67.6%
Cost26240
\[{\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2} + {a}^{2} \]
Alternative 4
Accuracy67.2%
Cost20681
\[\begin{array}{l} t_0 := \pi \cdot \left(angle \cdot b\right)\\ \mathbf{if}\;\frac{angle}{180} \leq -10000000000 \lor \neg \left(\frac{angle}{180} \leq 5 \cdot 10^{-7}\right):\\ \;\;\;\;{a}^{2} + \left(b \cdot b\right) \cdot \left(0.5 - \frac{\cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)}{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t_0, t_0 \cdot 3.08641975308642 \cdot 10^{-5}, a \cdot a\right)\\ \end{array} \]
Alternative 5
Accuracy67.3%
Cost20680
\[\begin{array}{l} t_0 := \pi \cdot \left(angle \cdot b\right)\\ \mathbf{if}\;\frac{angle}{180} \leq -10000000000:\\ \;\;\;\;{a}^{2} + \left(\left(b \cdot b\right) \cdot 0.5 + \left(b \cdot b\right) \cdot \left(\cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot -0.5\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(t_0, t_0 \cdot 3.08641975308642 \cdot 10^{-5}, a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + \left(b \cdot b\right) \cdot \left(0.5 - \frac{\cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)}{2}\right)\\ \end{array} \]
Alternative 6
Accuracy64.8%
Cost20553
\[\begin{array}{l} t_0 := \pi \cdot \left(angle \cdot b\right)\\ \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{+26} \lor \neg \left(\frac{angle}{180} \leq 5 \cdot 10^{-7}\right):\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t_0, t_0 \cdot 3.08641975308642 \cdot 10^{-5}, a \cdot a\right)\\ \end{array} \]
Alternative 7
Accuracy64.9%
Cost20361
\[\begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{+26} \lor \neg \left(\frac{angle}{180} \leq 5 \cdot 10^{-7}\right):\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + {\left(angle \cdot \left(b \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\ \end{array} \]
Alternative 8
Accuracy64.7%
Cost20297
\[\begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{+26} \lor \neg \left(\frac{angle}{180} \leq 5 \cdot 10^{-7}\right):\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, {\left(b \cdot \left(angle \cdot \pi\right)\right)}^{2}, a \cdot a\right)\\ \end{array} \]
Alternative 9
Accuracy64.8%
Cost20233
\[\begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{+26} \lor \neg \left(\frac{angle}{180} \leq 5 \cdot 10^{-7}\right):\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(a, \pi \cdot \left(angle \cdot \left(b \cdot 0.005555555555555556\right)\right)\right)\right)}^{2}\\ \end{array} \]
Alternative 10
Accuracy54.4%
Cost14289
\[\begin{array}{l} \mathbf{if}\;angle \leq -6.2 \cdot 10^{+24}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;angle \leq -1.95 \cdot 10^{-97} \lor \neg \left(angle \leq 1.06 \cdot 10^{-102}\right) \land angle \leq 85000000:\\ \;\;\;\;a \cdot a + 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot {\pi}^{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot a\\ \end{array} \]
Alternative 11
Accuracy49.8%
Cost192
\[a \cdot a \]

Error

Reproduce?

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