?

Average Accuracy: 68.3% → 68.1%
Time: 18.4s
Precision: binary64
Cost: 20424

?

\[{\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} \]
\[\begin{array}{l} \mathbf{if}\;angle \leq -0.0048:\\ \;\;\;\;{a}^{2} + \frac{\left(1 - \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right) \cdot \left(b \cdot b\right)}{2}\\ \mathbf{elif}\;angle \leq 0.0045:\\ \;\;\;\;{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \left(\left(b \cdot angle\right) \cdot \left(\pi \cdot \left(b \cdot angle\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + \frac{b}{\frac{2}{b}} \cdot \left(1 - \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\ \end{array} \]
(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
 (if (<= angle -0.0048)
   (+
    (pow a 2.0)
    (/ (* (- 1.0 (cos (* (* angle PI) 0.011111111111111112))) (* b b)) 2.0))
   (if (<= angle 0.0045)
     (+
      (pow a 2.0)
      (* 3.08641975308642e-5 (* PI (* (* b angle) (* PI (* b angle))))))
     (+
      (pow a 2.0)
      (*
       (/ b (/ 2.0 b))
       (- 1.0 (cos (* angle (* PI 0.011111111111111112)))))))))
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) {
	double tmp;
	if (angle <= -0.0048) {
		tmp = pow(a, 2.0) + (((1.0 - cos(((angle * ((double) M_PI)) * 0.011111111111111112))) * (b * b)) / 2.0);
	} else if (angle <= 0.0045) {
		tmp = pow(a, 2.0) + (3.08641975308642e-5 * (((double) M_PI) * ((b * angle) * (((double) M_PI) * (b * angle)))));
	} else {
		tmp = pow(a, 2.0) + ((b / (2.0 / b)) * (1.0 - cos((angle * (((double) M_PI) * 0.011111111111111112)))));
	}
	return tmp;
}
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) {
	double tmp;
	if (angle <= -0.0048) {
		tmp = Math.pow(a, 2.0) + (((1.0 - Math.cos(((angle * Math.PI) * 0.011111111111111112))) * (b * b)) / 2.0);
	} else if (angle <= 0.0045) {
		tmp = Math.pow(a, 2.0) + (3.08641975308642e-5 * (Math.PI * ((b * angle) * (Math.PI * (b * angle)))));
	} else {
		tmp = Math.pow(a, 2.0) + ((b / (2.0 / b)) * (1.0 - Math.cos((angle * (Math.PI * 0.011111111111111112)))));
	}
	return tmp;
}
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):
	tmp = 0
	if angle <= -0.0048:
		tmp = math.pow(a, 2.0) + (((1.0 - math.cos(((angle * math.pi) * 0.011111111111111112))) * (b * b)) / 2.0)
	elif angle <= 0.0045:
		tmp = math.pow(a, 2.0) + (3.08641975308642e-5 * (math.pi * ((b * angle) * (math.pi * (b * angle)))))
	else:
		tmp = math.pow(a, 2.0) + ((b / (2.0 / b)) * (1.0 - math.cos((angle * (math.pi * 0.011111111111111112)))))
	return tmp
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)
	tmp = 0.0
	if (angle <= -0.0048)
		tmp = Float64((a ^ 2.0) + Float64(Float64(Float64(1.0 - cos(Float64(Float64(angle * pi) * 0.011111111111111112))) * Float64(b * b)) / 2.0));
	elseif (angle <= 0.0045)
		tmp = Float64((a ^ 2.0) + Float64(3.08641975308642e-5 * Float64(pi * Float64(Float64(b * angle) * Float64(pi * Float64(b * angle))))));
	else
		tmp = Float64((a ^ 2.0) + Float64(Float64(b / Float64(2.0 / b)) * Float64(1.0 - cos(Float64(angle * Float64(pi * 0.011111111111111112))))));
	end
	return tmp
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_2 = code(a, b, angle)
	tmp = 0.0;
	if (angle <= -0.0048)
		tmp = (a ^ 2.0) + (((1.0 - cos(((angle * pi) * 0.011111111111111112))) * (b * b)) / 2.0);
	elseif (angle <= 0.0045)
		tmp = (a ^ 2.0) + (3.08641975308642e-5 * (pi * ((b * angle) * (pi * (b * angle)))));
	else
		tmp = (a ^ 2.0) + ((b / (2.0 / b)) * (1.0 - cos((angle * (pi * 0.011111111111111112)))));
	end
	tmp_2 = tmp;
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_] := If[LessEqual[angle, -0.0048], N[(N[Power[a, 2.0], $MachinePrecision] + N[(N[(N[(1.0 - N[Cos[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 0.0045], N[(N[Power[a, 2.0], $MachinePrecision] + N[(3.08641975308642e-5 * N[(Pi * N[(N[(b * angle), $MachinePrecision] * N[(Pi * N[(b * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(N[(b / N[(2.0 / b), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[Cos[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $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}
\begin{array}{l}
\mathbf{if}\;angle \leq -0.0048:\\
\;\;\;\;{a}^{2} + \frac{\left(1 - \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right) \cdot \left(b \cdot b\right)}{2}\\

\mathbf{elif}\;angle \leq 0.0045:\\
\;\;\;\;{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \left(\left(b \cdot angle\right) \cdot \left(\pi \cdot \left(b \cdot angle\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;{a}^{2} + \frac{b}{\frac{2}{b}} \cdot \left(1 - \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 3 regimes
  2. if angle < -0.00479999999999999958

    1. Initial program 28.8%

      \[{\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. Taylor expanded in angle around 0 28.7%

      \[\leadsto {\left(a \cdot \color{blue}{1}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    3. Applied egg-rr28.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{\left(\cos \left(\left(\pi \cdot angle\right) \cdot 0\right) - \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right) \cdot \left(b \cdot b\right)}{2}} \]
      Proof

      [Start]28.7

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

      unpow2 [=>]28.7

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

      *-commutative [=>]28.7

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

      *-commutative [=>]28.7

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

      swap-sqr [=>]28.7

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

      sin-mult [=>]28.6

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

      associate-*l/ [=>]28.6

      \[ {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{\left(\cos \left(\pi \cdot \frac{angle}{180} - \pi \cdot \frac{angle}{180}\right) - \cos \left(\pi \cdot \frac{angle}{180} + \pi \cdot \frac{angle}{180}\right)\right) \cdot \left(b \cdot b\right)}{2}} \]
    4. Taylor expanded in angle around inf 28.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \frac{\color{blue}{\left(1 - \cos \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)} \cdot \left(b \cdot b\right)}{2} \]

    if -0.00479999999999999958 < angle < 0.00449999999999999966

    1. Initial program 99.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. Taylor expanded in angle around 0 99.5%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)}}^{2} \]
    4. Taylor expanded in angle around 0 78.1%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right)} \]
    5. Simplified99.3%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot {\left(angle \cdot \left(b \cdot \pi\right)\right)}^{2}} \]
      Proof

      [Start]78.1

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \]

      unpow2 [=>]78.1

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \left({b}^{2} \cdot {\pi}^{2}\right)\right) \]

      associate-*r* [=>]78.0

      \[ {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \left({b}^{2} \cdot {\pi}^{2}\right)} \]

      unpow2 [=>]78.0

      \[ {\left(a \cdot 1\right)}^{2} + \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \left(\color{blue}{\left(b \cdot b\right)} \cdot {\pi}^{2}\right) \]

      unpow2 [=>]78.0

      \[ {\left(a \cdot 1\right)}^{2} + \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \left(\left(b \cdot b\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)}\right) \]

      swap-sqr [<=]78.0

      \[ {\left(a \cdot 1\right)}^{2} + \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \color{blue}{\left(\left(b \cdot \pi\right) \cdot \left(b \cdot \pi\right)\right)} \]

      unpow2 [<=]78.0

      \[ {\left(a \cdot 1\right)}^{2} + \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \color{blue}{{\left(b \cdot \pi\right)}^{2}} \]

      associate-*l* [=>]78.1

      \[ {\left(a \cdot 1\right)}^{2} + \color{blue}{3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot {\left(b \cdot \pi\right)}^{2}\right)} \]

      *-commutative [=>]78.1

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left({\left(b \cdot \pi\right)}^{2} \cdot \left(angle \cdot angle\right)\right)} \]

      unpow2 [=>]78.1

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\color{blue}{\left(\left(b \cdot \pi\right) \cdot \left(b \cdot \pi\right)\right)} \cdot \left(angle \cdot angle\right)\right) \]

      swap-sqr [<=]99.3

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(\left(b \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b \cdot \pi\right) \cdot angle\right)\right)} \]

      associate-*r* [<=]99.4

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\color{blue}{\left(b \cdot \left(\pi \cdot angle\right)\right)} \cdot \left(\left(b \cdot \pi\right) \cdot angle\right)\right) \]

      *-commutative [<=]99.4

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(b \cdot \color{blue}{\left(angle \cdot \pi\right)}\right) \cdot \left(\left(b \cdot \pi\right) \cdot angle\right)\right) \]

      associate-*r* [<=]99.4

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \color{blue}{\left(b \cdot \left(\pi \cdot angle\right)\right)}\right) \]

      *-commutative [<=]99.4

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b \cdot \color{blue}{\left(angle \cdot \pi\right)}\right)\right) \]

      unpow2 [<=]99.4

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{{\left(b \cdot \left(angle \cdot \pi\right)\right)}^{2}} \]
    6. Applied egg-rr99.4%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(\left(\pi \cdot \left(angle \cdot b\right)\right) \cdot \left(angle \cdot b\right)\right) \cdot \pi\right)} \]
      Proof

      [Start]99.3

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(angle \cdot \left(b \cdot \pi\right)\right)}^{2} \]

      unpow2 [=>]99.3

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(angle \cdot \left(b \cdot \pi\right)\right) \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)} \]

      associate-*r* [=>]99.4

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot \left(b \cdot \pi\right)\right) \cdot \color{blue}{\left(\left(angle \cdot b\right) \cdot \pi\right)}\right) \]

      associate-*r* [=>]99.4

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \color{blue}{\left(\left(\left(angle \cdot \left(b \cdot \pi\right)\right) \cdot \left(angle \cdot b\right)\right) \cdot \pi\right)} \]

      associate-*r* [=>]99.4

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(\color{blue}{\left(\left(angle \cdot b\right) \cdot \pi\right)} \cdot \left(angle \cdot b\right)\right) \cdot \pi\right) \]

      *-commutative [=>]99.4

      \[ {\left(a \cdot 1\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(\color{blue}{\left(\pi \cdot \left(angle \cdot b\right)\right)} \cdot \left(angle \cdot b\right)\right) \cdot \pi\right) \]

    if 0.00449999999999999966 < angle

    1. Initial program 29.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. Taylor expanded in angle around 0 29.3%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\color{blue}{\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}}^{2} \]
    4. Applied egg-rr29.2%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{\left(b \cdot b\right) \cdot \left(\cos 0 - \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)}{2}} \]
      Proof

      [Start]29.3

      \[ {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2} \]

      unpow2 [=>]29.3

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

      swap-sqr [=>]29.3

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

      sin-mult [=>]29.2

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

      associate-*r/ [=>]29.2

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

      +-inverses [=>]29.2

      \[ {\left(a \cdot 1\right)}^{2} + \frac{\left(b \cdot b\right) \cdot \left(\cos \color{blue}{0} - \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right) + 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}{2} \]

      distribute-rgt-out [=>]29.2

      \[ {\left(a \cdot 1\right)}^{2} + \frac{\left(b \cdot b\right) \cdot \left(\cos 0 - \cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(0.005555555555555556 + 0.005555555555555556\right)\right)}\right)}{2} \]

      metadata-eval [=>]29.2

      \[ {\left(a \cdot 1\right)}^{2} + \frac{\left(b \cdot b\right) \cdot \left(\cos 0 - \cos \left(\left(angle \cdot \pi\right) \cdot \color{blue}{0.011111111111111112}\right)\right)}{2} \]
    5. Simplified29.3%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{b}{\frac{2}{b}} \cdot \left(1 - \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)} \]
      Proof

      [Start]29.2

      \[ {\left(a \cdot 1\right)}^{2} + \frac{\left(b \cdot b\right) \cdot \left(\cos 0 - \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)}{2} \]

      unpow2 [<=]29.2

      \[ {\left(a \cdot 1\right)}^{2} + \frac{\color{blue}{{b}^{2}} \cdot \left(\cos 0 - \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)}{2} \]

      associate-*l/ [<=]29.2

      \[ {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{{b}^{2}}{2} \cdot \left(\cos 0 - \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)} \]

      unpow2 [=>]29.2

      \[ {\left(a \cdot 1\right)}^{2} + \frac{\color{blue}{b \cdot b}}{2} \cdot \left(\cos 0 - \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right) \]

      associate-/l* [=>]29.2

      \[ {\left(a \cdot 1\right)}^{2} + \color{blue}{\frac{b}{\frac{2}{b}}} \cdot \left(\cos 0 - \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right) \]

      cos-0 [=>]29.2

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

      associate-*l* [=>]29.3

      \[ {\left(a \cdot 1\right)}^{2} + \frac{b}{\frac{2}{b}} \cdot \left(1 - \cos \color{blue}{\left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification68.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;angle \leq -0.0048:\\ \;\;\;\;{a}^{2} + \frac{\left(1 - \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right) \cdot \left(b \cdot b\right)}{2}\\ \mathbf{elif}\;angle \leq 0.0045:\\ \;\;\;\;{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \left(\left(b \cdot angle\right) \cdot \left(\pi \cdot \left(b \cdot angle\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + \frac{b}{\frac{2}{b}} \cdot \left(1 - \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy68.2%
Cost39040
\[{a}^{2} + {\left(b \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\right)}^{2} \]
Alternative 2
Accuracy68.2%
Cost26240
\[{a}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2} \]
Alternative 3
Accuracy68.1%
Cost20425
\[\begin{array}{l} \mathbf{if}\;angle \leq -0.005 \lor \neg \left(angle \leq 0.0045\right):\\ \;\;\;\;{a}^{2} + \frac{b}{\frac{2}{b}} \cdot \left(1 - \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \left(\left(b \cdot angle\right) \cdot \left(\pi \cdot \left(b \cdot angle\right)\right)\right)\right)\\ \end{array} \]
Alternative 4
Accuracy65.4%
Cost20361
\[\begin{array}{l} \mathbf{if}\;angle \leq -2.8 \cdot 10^{+30} \lor \neg \left(angle \leq 2500000000000\right):\\ \;\;\;\;{a}^{2} + \frac{{\left(b \cdot \sqrt{0}\right)}^{2}}{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \left(\left(b \cdot angle\right) \cdot \left(\pi \cdot \left(b \cdot angle\right)\right)\right)\right)\\ \end{array} \]
Alternative 5
Accuracy65.4%
Cost20105
\[\begin{array}{l} \mathbf{if}\;angle \leq -3.75 \cdot 10^{+30} \lor \neg \left(angle \leq 2.16 \cdot 10^{+15}\right):\\ \;\;\;\;{a}^{2} + \frac{{\left(b \cdot \sqrt{0}\right)}^{2}}{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + {\left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left(b \cdot angle\right)\right)}^{2}\\ \end{array} \]
Alternative 6
Accuracy59.6%
Cost19840
\[{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(angle \cdot \left(b \cdot \pi\right)\right)}^{2} \]
Alternative 7
Accuracy59.6%
Cost19840
\[{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(b \cdot angle\right)\right)}^{2} \]
Alternative 8
Accuracy59.7%
Cost19840
\[{a}^{2} + {\left(0.005555555555555556 \cdot \left(\pi \cdot \left(b \cdot angle\right)\right)\right)}^{2} \]
Alternative 9
Accuracy59.7%
Cost19840
\[{a}^{2} + {\left(b \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2} \]
Alternative 10
Accuracy59.7%
Cost19840
\[{a}^{2} + {\left(b \cdot \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} \]
Alternative 11
Accuracy59.7%
Cost19840
\[{a}^{2} + {\left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left(b \cdot angle\right)\right)}^{2} \]

Error

Reproduce?

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