ab-angle->ABCF C

Percentage Accurate: 79.2% → 79.2%
Time: 42.0s
Alternatives: 8
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \pi \cdot \frac{angle}{180}\\ {\left(a \cdot \cos t_0\right)}^{2} + {\left(b \cdot \sin t_0\right)}^{2} \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* PI (/ angle 180.0))))
   (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
	double t_0 = ((double) M_PI) * (angle / 180.0);
	return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
	double t_0 = Math.PI * (angle / 180.0);
	return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle):
	t_0 = math.pi * (angle / 180.0)
	return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle)
	t_0 = Float64(pi * Float64(angle / 180.0))
	return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0))
end
function tmp = code(a, b, angle)
	t_0 = pi * (angle / 180.0);
	tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0);
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t_0\right)}^{2} + {\left(b \cdot \sin t_0\right)}^{2}
\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 79.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \pi \cdot \frac{angle}{180}\\ {\left(a \cdot \cos t_0\right)}^{2} + {\left(b \cdot \sin t_0\right)}^{2} \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* PI (/ angle 180.0))))
   (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
	double t_0 = ((double) M_PI) * (angle / 180.0);
	return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
	double t_0 = Math.PI * (angle / 180.0);
	return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle):
	t_0 = math.pi * (angle / 180.0)
	return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle)
	t_0 = Float64(pi * Float64(angle / 180.0))
	return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0))
end
function tmp = code(a, b, angle)
	t_0 = pi * (angle / 180.0);
	tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0);
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t_0\right)}^{2} + {\left(b \cdot \sin t_0\right)}^{2}
\end{array}
\end{array}

Alternative 1: 79.2% accurate, 0.7× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \cos \left(\frac{\pi}{\frac{-180}{angle_m}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\sqrt{angle_m} \cdot \left(\left(\pi \cdot -0.005555555555555556\right) \cdot \sqrt{angle_m}\right)\right)\right)}^{2} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (+
  (pow (* a (cos (/ PI (/ -180.0 angle_m)))) 2.0)
  (pow
   (*
    b
    (sin (* (sqrt angle_m) (* (* PI -0.005555555555555556) (sqrt angle_m)))))
   2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	return pow((a * cos((((double) M_PI) / (-180.0 / angle_m)))), 2.0) + pow((b * sin((sqrt(angle_m) * ((((double) M_PI) * -0.005555555555555556) * sqrt(angle_m))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	return Math.pow((a * Math.cos((Math.PI / (-180.0 / angle_m)))), 2.0) + Math.pow((b * Math.sin((Math.sqrt(angle_m) * ((Math.PI * -0.005555555555555556) * Math.sqrt(angle_m))))), 2.0);
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	return math.pow((a * math.cos((math.pi / (-180.0 / angle_m)))), 2.0) + math.pow((b * math.sin((math.sqrt(angle_m) * ((math.pi * -0.005555555555555556) * math.sqrt(angle_m))))), 2.0)
angle_m = abs(angle)
function code(a, b, angle_m)
	return Float64((Float64(a * cos(Float64(pi / Float64(-180.0 / angle_m)))) ^ 2.0) + (Float64(b * sin(Float64(sqrt(angle_m) * Float64(Float64(pi * -0.005555555555555556) * sqrt(angle_m))))) ^ 2.0))
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	tmp = ((a * cos((pi / (-180.0 / angle_m)))) ^ 2.0) + ((b * sin((sqrt(angle_m) * ((pi * -0.005555555555555556) * sqrt(angle_m))))) ^ 2.0);
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Cos[N[(Pi / N[(-180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[Sqrt[angle$95$m], $MachinePrecision] * N[(N[(Pi * -0.005555555555555556), $MachinePrecision] * N[Sqrt[angle$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|

\\
{\left(a \cdot \cos \left(\frac{\pi}{\frac{-180}{angle_m}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\sqrt{angle_m} \cdot \left(\left(\pi \cdot -0.005555555555555556\right) \cdot \sqrt{angle_m}\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.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. Simplified77.5%

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\frac{\pi}{\frac{-180}{angle}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi}{\frac{-180}{angle}}\right)\right)}^{2}} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. associate-/r/77.5%

      \[\leadsto {\left(a \cdot \cos \left(\frac{\pi}{\frac{-180}{angle}}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{\pi}{-180} \cdot angle\right)}\right)}^{2} \]
    2. add-sqr-sqrt36.8%

      \[\leadsto {\left(a \cdot \cos \left(\frac{\pi}{\frac{-180}{angle}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi}{-180} \cdot \color{blue}{\left(\sqrt{angle} \cdot \sqrt{angle}\right)}\right)\right)}^{2} \]
    3. associate-*r*36.8%

      \[\leadsto {\left(a \cdot \cos \left(\frac{\pi}{\frac{-180}{angle}}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\left(\frac{\pi}{-180} \cdot \sqrt{angle}\right) \cdot \sqrt{angle}\right)}\right)}^{2} \]
    4. div-inv36.8%

      \[\leadsto {\left(a \cdot \cos \left(\frac{\pi}{\frac{-180}{angle}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left(\color{blue}{\left(\pi \cdot \frac{1}{-180}\right)} \cdot \sqrt{angle}\right) \cdot \sqrt{angle}\right)\right)}^{2} \]
    5. metadata-eval36.8%

      \[\leadsto {\left(a \cdot \cos \left(\frac{\pi}{\frac{-180}{angle}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left(\left(\pi \cdot \color{blue}{-0.005555555555555556}\right) \cdot \sqrt{angle}\right) \cdot \sqrt{angle}\right)\right)}^{2} \]
  5. Applied egg-rr36.8%

    \[\leadsto {\left(a \cdot \cos \left(\frac{\pi}{\frac{-180}{angle}}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\left(\left(\pi \cdot -0.005555555555555556\right) \cdot \sqrt{angle}\right) \cdot \sqrt{angle}\right)}\right)}^{2} \]
  6. Final simplification36.8%

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

Alternative 2: 79.3% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := angle_m \cdot \frac{\pi}{-180}\\ {\left(a \cdot \cos t_0\right)}^{2} + {\left(b \cdot \sin t_0\right)}^{2} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* angle_m (/ PI -180.0))))
   (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = angle_m * (((double) M_PI) / -180.0);
	return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double t_0 = angle_m * (Math.PI / -180.0);
	return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	t_0 = angle_m * (math.pi / -180.0)
	return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(angle_m * Float64(pi / -180.0))
	return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0))
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	t_0 = angle_m * (pi / -180.0);
	tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0);
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
t_0 := angle_m \cdot \frac{\pi}{-180}\\
{\left(a \cdot \cos t_0\right)}^{2} + {\left(b \cdot \sin t_0\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 77.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. Simplified77.5%

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2}} \]
  3. Add Preprocessing
  4. Final simplification77.5%

    \[\leadsto {\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} \]
  5. Add Preprocessing

Alternative 3: 79.1% accurate, 1.3× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ {a}^{2} + {\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)\right)}^{2} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (+
  (pow a 2.0)
  (pow (* b (sin (* -0.005555555555555556 (* PI angle_m)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	return pow(a, 2.0) + pow((b * sin((-0.005555555555555556 * (((double) M_PI) * angle_m)))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	return Math.pow(a, 2.0) + Math.pow((b * Math.sin((-0.005555555555555556 * (Math.PI * angle_m)))), 2.0);
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	return math.pow(a, 2.0) + math.pow((b * math.sin((-0.005555555555555556 * (math.pi * angle_m)))), 2.0)
angle_m = abs(angle)
function code(a, b, angle_m)
	return Float64((a ^ 2.0) + (Float64(b * sin(Float64(-0.005555555555555556 * Float64(pi * angle_m)))) ^ 2.0))
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	tmp = (a ^ 2.0) + ((b * sin((-0.005555555555555556 * (pi * angle_m)))) ^ 2.0);
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|

\\
{a}^{2} + {\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.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. Simplified77.5%

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2}} \]
  3. Add Preprocessing
  4. Taylor expanded in angle around 0 76.6%

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

    \[\leadsto {\left(a \cdot 1\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)}^{2} \]
  6. Final simplification76.6%

    \[\leadsto {a}^{2} + {\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2} \]
  7. Add Preprocessing

Alternative 4: 79.2% accurate, 1.3× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(b \cdot \sin \left(angle_m \cdot \frac{\pi}{-180}\right)\right)}^{2} + {a}^{2} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (+ (pow (* b (sin (* angle_m (/ PI -180.0)))) 2.0) (pow a 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	return pow((b * sin((angle_m * (((double) M_PI) / -180.0)))), 2.0) + pow(a, 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	return Math.pow((b * Math.sin((angle_m * (Math.PI / -180.0)))), 2.0) + Math.pow(a, 2.0);
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	return math.pow((b * math.sin((angle_m * (math.pi / -180.0)))), 2.0) + math.pow(a, 2.0)
angle_m = abs(angle)
function code(a, b, angle_m)
	return Float64((Float64(b * sin(Float64(angle_m * Float64(pi / -180.0)))) ^ 2.0) + (a ^ 2.0))
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	tmp = ((b * sin((angle_m * (pi / -180.0)))) ^ 2.0) + (a ^ 2.0);
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := N[(N[Power[N[(b * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|

\\
{\left(b \cdot \sin \left(angle_m \cdot \frac{\pi}{-180}\right)\right)}^{2} + {a}^{2}
\end{array}
Derivation
  1. Initial program 77.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. Simplified77.5%

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2}} \]
  3. Add Preprocessing
  4. Taylor expanded in angle around 0 76.6%

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

    \[\leadsto {\left(b \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + {a}^{2} \]
  6. Add Preprocessing

Alternative 5: 65.8% accurate, 3.4× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 2.7 \cdot 10^{-80}:\\ \;\;\;\;{a}^{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + b \cdot \left(\left(\pi \cdot angle_m\right) \cdot \left(angle_m \cdot \left(-0.005555555555555556 \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (if (<= b 2.7e-80)
   (pow a 2.0)
   (+
    (pow a 2.0)
    (*
     b
     (*
      (* PI angle_m)
      (*
       angle_m
       (* -0.005555555555555556 (* -0.005555555555555556 (* PI b)))))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double tmp;
	if (b <= 2.7e-80) {
		tmp = pow(a, 2.0);
	} else {
		tmp = pow(a, 2.0) + (b * ((((double) M_PI) * angle_m) * (angle_m * (-0.005555555555555556 * (-0.005555555555555556 * (((double) M_PI) * b))))));
	}
	return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double tmp;
	if (b <= 2.7e-80) {
		tmp = Math.pow(a, 2.0);
	} else {
		tmp = Math.pow(a, 2.0) + (b * ((Math.PI * angle_m) * (angle_m * (-0.005555555555555556 * (-0.005555555555555556 * (Math.PI * b))))));
	}
	return tmp;
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	tmp = 0
	if b <= 2.7e-80:
		tmp = math.pow(a, 2.0)
	else:
		tmp = math.pow(a, 2.0) + (b * ((math.pi * angle_m) * (angle_m * (-0.005555555555555556 * (-0.005555555555555556 * (math.pi * b))))))
	return tmp
angle_m = abs(angle)
function code(a, b, angle_m)
	tmp = 0.0
	if (b <= 2.7e-80)
		tmp = a ^ 2.0;
	else
		tmp = Float64((a ^ 2.0) + Float64(b * Float64(Float64(pi * angle_m) * Float64(angle_m * Float64(-0.005555555555555556 * Float64(-0.005555555555555556 * Float64(pi * b)))))));
	end
	return tmp
end
angle_m = abs(angle);
function tmp_2 = code(a, b, angle_m)
	tmp = 0.0;
	if (b <= 2.7e-80)
		tmp = a ^ 2.0;
	else
		tmp = (a ^ 2.0) + (b * ((pi * angle_m) * (angle_m * (-0.005555555555555556 * (-0.005555555555555556 * (pi * b))))));
	end
	tmp_2 = tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := If[LessEqual[b, 2.7e-80], N[Power[a, 2.0], $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(b * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(angle$95$m * N[(-0.005555555555555556 * N[(-0.005555555555555556 * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.7 \cdot 10^{-80}:\\
\;\;\;\;{a}^{2}\\

\mathbf{else}:\\
\;\;\;\;{a}^{2} + b \cdot \left(\left(\pi \cdot angle_m\right) \cdot \left(angle_m \cdot \left(-0.005555555555555556 \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 2.7000000000000002e-80

    1. Initial program 74.9%

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

      \[\leadsto \color{blue}{{\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2}} \]
    3. Add Preprocessing
    4. Taylor expanded in angle around 0 74.3%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)}}^{2} \]
    6. Step-by-step derivation
      1. unpow265.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)} \]
      2. associate-*l*65.0%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{-0.005555555555555556 \cdot \left(\left(angle \cdot \left(b \cdot \pi\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right)} \]
      3. *-commutative65.0%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\color{blue}{\left(\left(b \cdot \pi\right) \cdot angle\right)} \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
      4. associate-*l*65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\color{blue}{\left(b \cdot \left(\pi \cdot angle\right)\right)} \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
      5. *-commutative65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \color{blue}{\left(angle \cdot \pi\right)}\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
      6. associate-*r*65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \color{blue}{\left(\left(-0.005555555555555556 \cdot angle\right) \cdot \left(b \cdot \pi\right)\right)}\right) \]
      7. *-commutative65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\color{blue}{\left(angle \cdot -0.005555555555555556\right)} \cdot \left(b \cdot \pi\right)\right)\right) \]
      8. associate-*l*65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \color{blue}{\left(angle \cdot \left(-0.005555555555555556 \cdot \left(b \cdot \pi\right)\right)\right)}\right) \]
      9. *-commutative65.1%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{-0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)} \]
    8. Step-by-step derivation
      1. *-commutative65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(b \cdot \left(angle \cdot \pi\right)\right)\right)} \]
      2. associate-*r*64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \color{blue}{\left(\left(\left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot b\right) \cdot \left(angle \cdot \pi\right)\right)} \]
      3. *-commutative64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\color{blue}{\left(b \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)} \cdot \left(angle \cdot \pi\right)\right) \]
      4. *-commutative64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)\right)} \]
      5. rem-square-sqrt36.8%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \color{blue}{\left(\sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)} \cdot \sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)}\right)}\right)\right) \]
      6. fabs-sqr36.8%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \color{blue}{\left|\sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)} \cdot \sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)}\right|}\right)\right) \]
      7. rem-square-sqrt50.7%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left|\color{blue}{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)}\right|\right)\right) \]
      8. fabs-mul50.7%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \color{blue}{\left(\left|angle\right| \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)}\right)\right) \]
      9. unpow150.7%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\left|\color{blue}{{angle}^{1}}\right| \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
      10. sqr-pow30.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\left|\color{blue}{{angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}}\right| \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
      11. fabs-sqr30.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\color{blue}{\left({angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}\right)} \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
      12. sqr-pow64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\color{blue}{{angle}^{1}} \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
      13. unpow164.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\color{blue}{angle} \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
      14. associate-*r*64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left|\color{blue}{\left(-0.005555555555555556 \cdot \pi\right) \cdot b}\right|\right)\right)\right) \]
      15. *-commutative64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left|\color{blue}{\left(\pi \cdot -0.005555555555555556\right)} \cdot b\right|\right)\right)\right) \]
      16. *-commutative64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left|\color{blue}{b \cdot \left(\pi \cdot -0.005555555555555556\right)}\right|\right)\right)\right) \]
      17. fabs-mul64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \color{blue}{\left(\left|b\right| \cdot \left|\pi \cdot -0.005555555555555556\right|\right)}\right)\right)\right) \]
    9. Simplified41.2%

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

      \[\leadsto \color{blue}{{a}^{2}} \]

    if 2.7000000000000002e-80 < b

    1. Initial program 83.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. Simplified83.8%

      \[\leadsto \color{blue}{{\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2}} \]
    3. Add Preprocessing
    4. Taylor expanded in angle around 0 82.7%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)}}^{2} \]
    6. Step-by-step derivation
      1. unpow280.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)} \]
      2. associate-*l*80.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{-0.005555555555555556 \cdot \left(\left(angle \cdot \left(b \cdot \pi\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right)} \]
      3. *-commutative80.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\color{blue}{\left(\left(b \cdot \pi\right) \cdot angle\right)} \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
      4. associate-*l*80.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\color{blue}{\left(b \cdot \left(\pi \cdot angle\right)\right)} \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
      5. *-commutative80.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \color{blue}{\left(angle \cdot \pi\right)}\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
      6. associate-*r*80.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \color{blue}{\left(\left(-0.005555555555555556 \cdot angle\right) \cdot \left(b \cdot \pi\right)\right)}\right) \]
      7. *-commutative80.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\color{blue}{\left(angle \cdot -0.005555555555555556\right)} \cdot \left(b \cdot \pi\right)\right)\right) \]
      8. associate-*l*80.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \color{blue}{\left(angle \cdot \left(-0.005555555555555556 \cdot \left(b \cdot \pi\right)\right)\right)}\right) \]
      9. *-commutative80.4%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{-0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*80.4%

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot -0.005555555555555556\right)} \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \]
      3. associate-*r*80.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)} \]
      4. associate-*l*80.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{b \cdot \left(\left(angle \cdot \pi\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)\right)} \]
      5. *-commutative80.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + b \cdot \left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(\left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot -0.005555555555555556\right)}\right) \]
      6. associate-*l*80.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + b \cdot \left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(angle \cdot \left(\left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right) \cdot -0.005555555555555556\right)\right)}\right) \]
      7. *-commutative80.4%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{b \cdot \left(\left(angle \cdot \pi\right) \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.7 \cdot 10^{-80}:\\ \;\;\;\;{a}^{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + b \cdot \left(\left(\pi \cdot angle\right) \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 66.2% accurate, 3.4× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := angle_m \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\\ \mathbf{if}\;b \leq 4 \cdot 10^{-80}:\\ \;\;\;\;{a}^{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + t_0 \cdot t_0\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* angle_m (* -0.005555555555555556 (* PI b)))))
   (if (<= b 4e-80) (pow a 2.0) (+ (pow a 2.0) (* t_0 t_0)))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = angle_m * (-0.005555555555555556 * (((double) M_PI) * b));
	double tmp;
	if (b <= 4e-80) {
		tmp = pow(a, 2.0);
	} else {
		tmp = pow(a, 2.0) + (t_0 * t_0);
	}
	return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double t_0 = angle_m * (-0.005555555555555556 * (Math.PI * b));
	double tmp;
	if (b <= 4e-80) {
		tmp = Math.pow(a, 2.0);
	} else {
		tmp = Math.pow(a, 2.0) + (t_0 * t_0);
	}
	return tmp;
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	t_0 = angle_m * (-0.005555555555555556 * (math.pi * b))
	tmp = 0
	if b <= 4e-80:
		tmp = math.pow(a, 2.0)
	else:
		tmp = math.pow(a, 2.0) + (t_0 * t_0)
	return tmp
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(angle_m * Float64(-0.005555555555555556 * Float64(pi * b)))
	tmp = 0.0
	if (b <= 4e-80)
		tmp = a ^ 2.0;
	else
		tmp = Float64((a ^ 2.0) + Float64(t_0 * t_0));
	end
	return tmp
end
angle_m = abs(angle);
function tmp_2 = code(a, b, angle_m)
	t_0 = angle_m * (-0.005555555555555556 * (pi * b));
	tmp = 0.0;
	if (b <= 4e-80)
		tmp = a ^ 2.0;
	else
		tmp = (a ^ 2.0) + (t_0 * t_0);
	end
	tmp_2 = tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(-0.005555555555555556 * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 4e-80], N[Power[a, 2.0], $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
t_0 := angle_m \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\\
\mathbf{if}\;b \leq 4 \cdot 10^{-80}:\\
\;\;\;\;{a}^{2}\\

\mathbf{else}:\\
\;\;\;\;{a}^{2} + t_0 \cdot t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 3.99999999999999985e-80

    1. Initial program 74.9%

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

      \[\leadsto \color{blue}{{\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2}} \]
    3. Add Preprocessing
    4. Taylor expanded in angle around 0 74.3%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)}}^{2} \]
    6. Step-by-step derivation
      1. unpow265.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)} \]
      2. associate-*l*65.0%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{-0.005555555555555556 \cdot \left(\left(angle \cdot \left(b \cdot \pi\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right)} \]
      3. *-commutative65.0%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\color{blue}{\left(\left(b \cdot \pi\right) \cdot angle\right)} \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
      4. associate-*l*65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\color{blue}{\left(b \cdot \left(\pi \cdot angle\right)\right)} \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
      5. *-commutative65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \color{blue}{\left(angle \cdot \pi\right)}\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
      6. associate-*r*65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \color{blue}{\left(\left(-0.005555555555555556 \cdot angle\right) \cdot \left(b \cdot \pi\right)\right)}\right) \]
      7. *-commutative65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\color{blue}{\left(angle \cdot -0.005555555555555556\right)} \cdot \left(b \cdot \pi\right)\right)\right) \]
      8. associate-*l*65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \color{blue}{\left(angle \cdot \left(-0.005555555555555556 \cdot \left(b \cdot \pi\right)\right)\right)}\right) \]
      9. *-commutative65.1%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{-0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)} \]
    8. Step-by-step derivation
      1. *-commutative65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(b \cdot \left(angle \cdot \pi\right)\right)\right)} \]
      2. associate-*r*64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \color{blue}{\left(\left(\left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot b\right) \cdot \left(angle \cdot \pi\right)\right)} \]
      3. *-commutative64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\color{blue}{\left(b \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)} \cdot \left(angle \cdot \pi\right)\right) \]
      4. *-commutative64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)\right)} \]
      5. rem-square-sqrt36.8%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \color{blue}{\left(\sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)} \cdot \sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)}\right)}\right)\right) \]
      6. fabs-sqr36.8%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \color{blue}{\left|\sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)} \cdot \sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)}\right|}\right)\right) \]
      7. rem-square-sqrt50.7%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left|\color{blue}{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)}\right|\right)\right) \]
      8. fabs-mul50.7%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \color{blue}{\left(\left|angle\right| \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)}\right)\right) \]
      9. unpow150.7%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\left|\color{blue}{{angle}^{1}}\right| \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
      10. sqr-pow30.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\left|\color{blue}{{angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}}\right| \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
      11. fabs-sqr30.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\color{blue}{\left({angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}\right)} \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
      12. sqr-pow64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\color{blue}{{angle}^{1}} \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
      13. unpow164.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\color{blue}{angle} \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
      14. associate-*r*64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left|\color{blue}{\left(-0.005555555555555556 \cdot \pi\right) \cdot b}\right|\right)\right)\right) \]
      15. *-commutative64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left|\color{blue}{\left(\pi \cdot -0.005555555555555556\right)} \cdot b\right|\right)\right)\right) \]
      16. *-commutative64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left|\color{blue}{b \cdot \left(\pi \cdot -0.005555555555555556\right)}\right|\right)\right)\right) \]
      17. fabs-mul64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \color{blue}{\left(\left|b\right| \cdot \left|\pi \cdot -0.005555555555555556\right|\right)}\right)\right)\right) \]
    9. Simplified41.2%

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

      \[\leadsto \color{blue}{{a}^{2}} \]

    if 3.99999999999999985e-80 < b

    1. Initial program 83.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. Simplified83.8%

      \[\leadsto \color{blue}{{\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2}} \]
    3. Add Preprocessing
    4. Taylor expanded in angle around 0 82.7%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)}}^{2} \]
    6. Step-by-step derivation
      1. unpow280.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)} \]
      2. associate-*r*80.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(-0.005555555555555556 \cdot angle\right) \cdot \left(b \cdot \pi\right)\right)} \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      3. *-commutative80.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\color{blue}{\left(angle \cdot -0.005555555555555556\right)} \cdot \left(b \cdot \pi\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      4. associate-*l*80.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(-0.005555555555555556 \cdot \left(b \cdot \pi\right)\right)\right)} \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      5. *-commutative80.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(-0.005555555555555556 \cdot \color{blue}{\left(\pi \cdot b\right)}\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
      6. associate-*r*80.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \color{blue}{\left(\left(-0.005555555555555556 \cdot angle\right) \cdot \left(b \cdot \pi\right)\right)} \]
      7. *-commutative80.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot -0.005555555555555556\right)} \cdot \left(b \cdot \pi\right)\right) \]
      8. associate-*l*80.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \color{blue}{\left(angle \cdot \left(-0.005555555555555556 \cdot \left(b \cdot \pi\right)\right)\right)} \]
      9. *-commutative80.3%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 4 \cdot 10^{-80}:\\ \;\;\;\;{a}^{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 66.2% accurate, 3.4× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 1.65 \cdot 10^{-79}:\\ \;\;\;\;{a}^{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + -0.005555555555555556 \cdot \left(\left(angle_m \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(b \cdot \left(\pi \cdot angle_m\right)\right)\right)\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (if (<= b 1.65e-79)
   (pow a 2.0)
   (+
    (pow a 2.0)
    (*
     -0.005555555555555556
     (*
      (* angle_m (* -0.005555555555555556 (* PI b)))
      (* b (* PI angle_m)))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double tmp;
	if (b <= 1.65e-79) {
		tmp = pow(a, 2.0);
	} else {
		tmp = pow(a, 2.0) + (-0.005555555555555556 * ((angle_m * (-0.005555555555555556 * (((double) M_PI) * b))) * (b * (((double) M_PI) * angle_m))));
	}
	return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double tmp;
	if (b <= 1.65e-79) {
		tmp = Math.pow(a, 2.0);
	} else {
		tmp = Math.pow(a, 2.0) + (-0.005555555555555556 * ((angle_m * (-0.005555555555555556 * (Math.PI * b))) * (b * (Math.PI * angle_m))));
	}
	return tmp;
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	tmp = 0
	if b <= 1.65e-79:
		tmp = math.pow(a, 2.0)
	else:
		tmp = math.pow(a, 2.0) + (-0.005555555555555556 * ((angle_m * (-0.005555555555555556 * (math.pi * b))) * (b * (math.pi * angle_m))))
	return tmp
angle_m = abs(angle)
function code(a, b, angle_m)
	tmp = 0.0
	if (b <= 1.65e-79)
		tmp = a ^ 2.0;
	else
		tmp = Float64((a ^ 2.0) + Float64(-0.005555555555555556 * Float64(Float64(angle_m * Float64(-0.005555555555555556 * Float64(pi * b))) * Float64(b * Float64(pi * angle_m)))));
	end
	return tmp
end
angle_m = abs(angle);
function tmp_2 = code(a, b, angle_m)
	tmp = 0.0;
	if (b <= 1.65e-79)
		tmp = a ^ 2.0;
	else
		tmp = (a ^ 2.0) + (-0.005555555555555556 * ((angle_m * (-0.005555555555555556 * (pi * b))) * (b * (pi * angle_m))));
	end
	tmp_2 = tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.65e-79], N[Power[a, 2.0], $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(-0.005555555555555556 * N[(N[(angle$95$m * N[(-0.005555555555555556 * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.65 \cdot 10^{-79}:\\
\;\;\;\;{a}^{2}\\

\mathbf{else}:\\
\;\;\;\;{a}^{2} + -0.005555555555555556 \cdot \left(\left(angle_m \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(b \cdot \left(\pi \cdot angle_m\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.6499999999999999e-79

    1. Initial program 74.9%

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

      \[\leadsto \color{blue}{{\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2}} \]
    3. Add Preprocessing
    4. Taylor expanded in angle around 0 74.3%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)}}^{2} \]
    6. Step-by-step derivation
      1. unpow265.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)} \]
      2. associate-*l*65.0%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{-0.005555555555555556 \cdot \left(\left(angle \cdot \left(b \cdot \pi\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right)} \]
      3. *-commutative65.0%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\color{blue}{\left(\left(b \cdot \pi\right) \cdot angle\right)} \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
      4. associate-*l*65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\color{blue}{\left(b \cdot \left(\pi \cdot angle\right)\right)} \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
      5. *-commutative65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \color{blue}{\left(angle \cdot \pi\right)}\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
      6. associate-*r*65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \color{blue}{\left(\left(-0.005555555555555556 \cdot angle\right) \cdot \left(b \cdot \pi\right)\right)}\right) \]
      7. *-commutative65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\color{blue}{\left(angle \cdot -0.005555555555555556\right)} \cdot \left(b \cdot \pi\right)\right)\right) \]
      8. associate-*l*65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \color{blue}{\left(angle \cdot \left(-0.005555555555555556 \cdot \left(b \cdot \pi\right)\right)\right)}\right) \]
      9. *-commutative65.1%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{-0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)} \]
    8. Step-by-step derivation
      1. *-commutative65.1%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(b \cdot \left(angle \cdot \pi\right)\right)\right)} \]
      2. associate-*r*64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \color{blue}{\left(\left(\left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot b\right) \cdot \left(angle \cdot \pi\right)\right)} \]
      3. *-commutative64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\color{blue}{\left(b \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)} \cdot \left(angle \cdot \pi\right)\right) \]
      4. *-commutative64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)\right)} \]
      5. rem-square-sqrt36.8%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \color{blue}{\left(\sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)} \cdot \sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)}\right)}\right)\right) \]
      6. fabs-sqr36.8%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \color{blue}{\left|\sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)} \cdot \sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)}\right|}\right)\right) \]
      7. rem-square-sqrt50.7%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left|\color{blue}{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)}\right|\right)\right) \]
      8. fabs-mul50.7%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \color{blue}{\left(\left|angle\right| \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)}\right)\right) \]
      9. unpow150.7%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\left|\color{blue}{{angle}^{1}}\right| \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
      10. sqr-pow30.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\left|\color{blue}{{angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}}\right| \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
      11. fabs-sqr30.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\color{blue}{\left({angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}\right)} \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
      12. sqr-pow64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\color{blue}{{angle}^{1}} \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
      13. unpow164.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\color{blue}{angle} \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
      14. associate-*r*64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left|\color{blue}{\left(-0.005555555555555556 \cdot \pi\right) \cdot b}\right|\right)\right)\right) \]
      15. *-commutative64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left|\color{blue}{\left(\pi \cdot -0.005555555555555556\right)} \cdot b\right|\right)\right)\right) \]
      16. *-commutative64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left|\color{blue}{b \cdot \left(\pi \cdot -0.005555555555555556\right)}\right|\right)\right)\right) \]
      17. fabs-mul64.6%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \color{blue}{\left(\left|b\right| \cdot \left|\pi \cdot -0.005555555555555556\right|\right)}\right)\right)\right) \]
    9. Simplified41.2%

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

      \[\leadsto \color{blue}{{a}^{2}} \]

    if 1.6499999999999999e-79 < b

    1. Initial program 83.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. Simplified83.8%

      \[\leadsto \color{blue}{{\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2}} \]
    3. Add Preprocessing
    4. Taylor expanded in angle around 0 82.7%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + {\color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)}}^{2} \]
    6. Step-by-step derivation
      1. unpow280.4%

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \cdot \color{blue}{\left(\left(angle \cdot \left(b \cdot \pi\right)\right) \cdot -0.005555555555555556\right)} \]
      3. associate-*r*80.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \cdot -0.005555555555555556} \]
      4. associate-*r*80.3%

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

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\left(\color{blue}{\left(angle \cdot -0.005555555555555556\right)} \cdot \left(b \cdot \pi\right)\right) \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \cdot -0.005555555555555556 \]
      6. associate-*l*80.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\color{blue}{\left(angle \cdot \left(-0.005555555555555556 \cdot \left(b \cdot \pi\right)\right)\right)} \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \cdot -0.005555555555555556 \]
      7. *-commutative80.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\left(angle \cdot \left(-0.005555555555555556 \cdot \color{blue}{\left(\pi \cdot b\right)}\right)\right) \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \cdot -0.005555555555555556 \]
      8. *-commutative80.3%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \color{blue}{\left(\left(b \cdot \pi\right) \cdot angle\right)}\right) \cdot -0.005555555555555556 \]
      9. associate-*l*80.4%

        \[\leadsto {\left(a \cdot 1\right)}^{2} + \left(\left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \color{blue}{\left(b \cdot \left(\pi \cdot angle\right)\right)}\right) \cdot -0.005555555555555556 \]
      10. *-commutative80.4%

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

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(\left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(b \cdot \left(angle \cdot \pi\right)\right)\right) \cdot -0.005555555555555556} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.65 \cdot 10^{-79}:\\ \;\;\;\;{a}^{2}\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(b \cdot \left(\pi \cdot angle\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 56.8% accurate, 4.1× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ {a}^{2} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m) :precision binary64 (pow a 2.0))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	return pow(a, 2.0);
}
angle_m = abs(angle)
real(8) function code(a, b, angle_m)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle_m
    code = a ** 2.0d0
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	return Math.pow(a, 2.0);
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	return math.pow(a, 2.0)
angle_m = abs(angle)
function code(a, b, angle_m)
	return a ^ 2.0
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	tmp = a ^ 2.0;
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := N[Power[a, 2.0], $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|

\\
{a}^{2}
\end{array}
Derivation
  1. Initial program 77.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. Simplified77.5%

    \[\leadsto \color{blue}{{\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2}} \]
  3. Add Preprocessing
  4. Taylor expanded in angle around 0 76.6%

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

    \[\leadsto {\left(a \cdot 1\right)}^{2} + {\color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)}}^{2} \]
  6. Step-by-step derivation
    1. unpow269.4%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)} \]
    2. associate-*l*69.4%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{-0.005555555555555556 \cdot \left(\left(angle \cdot \left(b \cdot \pi\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right)} \]
    3. *-commutative69.4%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\color{blue}{\left(\left(b \cdot \pi\right) \cdot angle\right)} \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
    4. associate-*l*69.4%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\color{blue}{\left(b \cdot \left(\pi \cdot angle\right)\right)} \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
    5. *-commutative69.4%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \color{blue}{\left(angle \cdot \pi\right)}\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\right) \]
    6. associate-*r*69.4%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \color{blue}{\left(\left(-0.005555555555555556 \cdot angle\right) \cdot \left(b \cdot \pi\right)\right)}\right) \]
    7. *-commutative69.4%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\color{blue}{\left(angle \cdot -0.005555555555555556\right)} \cdot \left(b \cdot \pi\right)\right)\right) \]
    8. associate-*l*69.4%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \color{blue}{\left(angle \cdot \left(-0.005555555555555556 \cdot \left(b \cdot \pi\right)\right)\right)}\right) \]
    9. *-commutative69.4%

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

    \[\leadsto {\left(a \cdot 1\right)}^{2} + \color{blue}{-0.005555555555555556 \cdot \left(\left(b \cdot \left(angle \cdot \pi\right)\right) \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)} \]
  8. Step-by-step derivation
    1. *-commutative69.4%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(b \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    2. associate-*r*67.6%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \color{blue}{\left(\left(\left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right) \cdot b\right) \cdot \left(angle \cdot \pi\right)\right)} \]
    3. *-commutative67.6%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\color{blue}{\left(b \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)} \cdot \left(angle \cdot \pi\right)\right) \]
    4. *-commutative67.6%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)\right)} \]
    5. rem-square-sqrt36.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \color{blue}{\left(\sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)} \cdot \sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)}\right)}\right)\right) \]
    6. fabs-sqr36.5%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \color{blue}{\left|\sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)} \cdot \sqrt{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)}\right|}\right)\right) \]
    7. rem-square-sqrt50.9%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left|\color{blue}{angle \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)}\right|\right)\right) \]
    8. fabs-mul50.9%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \color{blue}{\left(\left|angle\right| \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)}\right)\right) \]
    9. unpow150.9%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\left|\color{blue}{{angle}^{1}}\right| \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
    10. sqr-pow26.2%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\left|\color{blue}{{angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}}\right| \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
    11. fabs-sqr26.2%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\color{blue}{\left({angle}^{\left(\frac{1}{2}\right)} \cdot {angle}^{\left(\frac{1}{2}\right)}\right)} \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
    12. sqr-pow54.8%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\color{blue}{{angle}^{1}} \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
    13. unpow154.8%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(\color{blue}{angle} \cdot \left|-0.005555555555555556 \cdot \left(\pi \cdot b\right)\right|\right)\right)\right) \]
    14. associate-*r*54.8%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left|\color{blue}{\left(-0.005555555555555556 \cdot \pi\right) \cdot b}\right|\right)\right)\right) \]
    15. *-commutative54.8%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left|\color{blue}{\left(\pi \cdot -0.005555555555555556\right)} \cdot b\right|\right)\right)\right) \]
    16. *-commutative54.8%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \left|\color{blue}{b \cdot \left(\pi \cdot -0.005555555555555556\right)}\right|\right)\right)\right) \]
    17. fabs-mul54.8%

      \[\leadsto {\left(a \cdot 1\right)}^{2} + -0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot \color{blue}{\left(\left|b\right| \cdot \left|\pi \cdot -0.005555555555555556\right|\right)}\right)\right)\right) \]
  9. Simplified38.0%

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

    \[\leadsto \color{blue}{{a}^{2}} \]
  11. Final simplification52.7%

    \[\leadsto {a}^{2} \]
  12. Add Preprocessing

Reproduce

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