?

Average Error: 31.77% → 31.75%
Time: 18.6s
Precision: binary64
Cost: 39488

?

\[{\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(\frac{\frac{\pi}{180}}{\frac{1}{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 (/ (/ PI 180.0) (/ 1.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(((((double) M_PI) / 180.0) / (1.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.PI / 180.0) / (1.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.pi / 180.0) / (1.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(pi / 180.0) / Float64(1.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(((pi / 180.0) / (1.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[(Pi / 180.0), $MachinePrecision] / N[(1.0 / angle), $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(\frac{\frac{\pi}{180}}{\frac{1}{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 31.77

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

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

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

Alternatives

Alternative 1
Error31.77%
Cost39360
\[{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(a \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2} \]
Alternative 2
Error31.77%
Cost39360
\[\begin{array}{l} t_0 := \pi \cdot \frac{angle}{180}\\ {\left(b \cdot \sin t_0\right)}^{2} + {\left(a \cdot \cos t_0\right)}^{2} \end{array} \]
Alternative 3
Error31.76%
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
Error31.7%
Cost39040
\[{a}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)}^{2} \]
Alternative 5
Error31.73%
Cost26240
\[{a}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2} \]
Alternative 6
Error31.74%
Cost26240
\[{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {a}^{2} \]
Alternative 7
Error32.07%
Cost20425
\[\begin{array}{l} \mathbf{if}\;angle \leq -6.3 \cdot 10^{+29} \lor \neg \left(angle \leq 0.0054\right):\\ \;\;\;\;{a}^{2} + \frac{b \cdot b}{2} \cdot \left(1 - \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + {\left(angle \cdot \left(b \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\ \end{array} \]
Alternative 8
Error32.07%
Cost20425
\[\begin{array}{l} \mathbf{if}\;angle \leq -6.3 \cdot 10^{+29} \lor \neg \left(angle \leq 0.005\right):\\ \;\;\;\;{a}^{2} + \frac{\left(1 - \cos \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right) \cdot \left(b \cdot b\right)}{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + {\left(angle \cdot \left(b \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\ \end{array} \]
Alternative 9
Error34.55%
Cost20105
\[\begin{array}{l} \mathbf{if}\;angle \leq -1.25 \cdot 10^{+48} \lor \neg \left(angle \leq 4.1 \cdot 10^{+51}\right):\\ \;\;\;\;{a}^{2} + \frac{\left(b \cdot b\right) \cdot \mathsf{expm1}\left(0\right)}{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + {\left(angle \cdot \left(b \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\ \end{array} \]
Alternative 10
Error40.26%
Cost19840
\[{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(angle \cdot \left(\pi \cdot b\right)\right)}^{2} \]
Alternative 11
Error40.26%
Cost19840
\[{a}^{2} + {\left(b \cdot \left(\pi \cdot angle\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5} \]
Alternative 12
Error40.17%
Cost19840
\[{a}^{2} + {\left(angle \cdot \left(b \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2} \]

Error

Reproduce?

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