ab-angle->ABCF C

Percentage Accurate: 80.0% → 80.0%
Time: 14.7s
Alternatives: 18
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 18 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: 80.0% 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: 80.0% accurate, 2.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := angle\_m \cdot \left(b \cdot \left(\pi \cdot \mathsf{fma}\left(angle\_m \cdot angle\_m, -2.8577960676726107 \cdot 10^{-8} \cdot \left(\pi \cdot \pi\right), 0.005555555555555556\right)\right)\right)\\ t_1 := 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\\ \mathbf{if}\;\frac{angle\_m}{180} \leq 0.02:\\ \;\;\;\;\mathsf{fma}\left(0.5 + t\_1, a \cdot a, t\_0 \cdot t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b \cdot \left(0.5 - t\_1\right), b, a \cdot \left(a \cdot 1\right)\right)\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0
         (*
          angle_m
          (*
           b
           (*
            PI
            (fma
             (* angle_m angle_m)
             (* -2.8577960676726107e-8 (* PI PI))
             0.005555555555555556)))))
        (t_1 (* 0.5 (cos (* 2.0 (* PI (* angle_m 0.005555555555555556)))))))
   (if (<= (/ angle_m 180.0) 0.02)
     (fma (+ 0.5 t_1) (* a a) (* t_0 t_0))
     (fma (* b (- 0.5 t_1)) b (* a (* a 1.0))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = angle_m * (b * (((double) M_PI) * fma((angle_m * angle_m), (-2.8577960676726107e-8 * (((double) M_PI) * ((double) M_PI))), 0.005555555555555556)));
	double t_1 = 0.5 * cos((2.0 * (((double) M_PI) * (angle_m * 0.005555555555555556))));
	double tmp;
	if ((angle_m / 180.0) <= 0.02) {
		tmp = fma((0.5 + t_1), (a * a), (t_0 * t_0));
	} else {
		tmp = fma((b * (0.5 - t_1)), b, (a * (a * 1.0)));
	}
	return tmp;
}
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(angle_m * Float64(b * Float64(pi * fma(Float64(angle_m * angle_m), Float64(-2.8577960676726107e-8 * Float64(pi * pi)), 0.005555555555555556))))
	t_1 = Float64(0.5 * cos(Float64(2.0 * Float64(pi * Float64(angle_m * 0.005555555555555556)))))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 0.02)
		tmp = fma(Float64(0.5 + t_1), Float64(a * a), Float64(t_0 * t_0));
	else
		tmp = fma(Float64(b * Float64(0.5 - t_1)), b, Float64(a * Float64(a * 1.0)));
	end
	return tmp
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(b * N[(Pi * N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(-2.8577960676726107e-8 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision] + 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[Cos[N[(2.0 * N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 0.02], N[(N[(0.5 + t$95$1), $MachinePrecision] * N[(a * a), $MachinePrecision] + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(0.5 - t$95$1), $MachinePrecision]), $MachinePrecision] * b + N[(a * N[(a * 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(b \cdot \left(\pi \cdot \mathsf{fma}\left(angle\_m \cdot angle\_m, -2.8577960676726107 \cdot 10^{-8} \cdot \left(\pi \cdot \pi\right), 0.005555555555555556\right)\right)\right)\\
t_1 := 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\\
\mathbf{if}\;\frac{angle\_m}{180} \leq 0.02:\\
\;\;\;\;\mathsf{fma}\left(0.5 + t\_1, a \cdot a, t\_0 \cdot t\_0\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot \left(0.5 - t\_1\right), b, a \cdot \left(a \cdot 1\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 0.0200000000000000004

    1. Initial program 89.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. Add Preprocessing
    3. Taylor expanded in angle around 0

      \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(angle \cdot \left(\frac{-1}{34992000} \cdot \left({angle}^{2} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right) + \frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\frac{-1}{34992000} \cdot \color{blue}{\left(\left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right) \cdot {angle}^{2}\right)} + \frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right)}^{2} \]
      2. associate-*r*N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\color{blue}{\left(\frac{-1}{34992000} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right) \cdot {angle}^{2}} + \frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right)}^{2} \]
      3. +-commutativeN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right) + \left(\frac{-1}{34992000} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right) \cdot {angle}^{2}\right)}\right)}^{2} \]
      4. lower-*.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right) + \left(\frac{-1}{34992000} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right) \cdot {angle}^{2}\right)\right)}}^{2} \]
      5. associate-*r*N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right) + \color{blue}{\frac{-1}{34992000} \cdot \left(\left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right) \cdot {angle}^{2}\right)}\right)\right)}^{2} \]
      6. *-commutativeN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right) + \frac{-1}{34992000} \cdot \color{blue}{\left({angle}^{2} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)}\right)\right)}^{2} \]
      7. *-commutativeN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\frac{1}{180} \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot b\right)} + \frac{-1}{34992000} \cdot \left({angle}^{2} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)}^{2} \]
      8. associate-*r*N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\color{blue}{\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b} + \frac{-1}{34992000} \cdot \left({angle}^{2} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)}^{2} \]
      9. associate-*r*N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b + \color{blue}{\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)}\right)\right)}^{2} \]
      10. *-commutativeN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b + \left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{3} \cdot b\right)}\right)\right)}^{2} \]
      11. associate-*r*N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b + \color{blue}{\left(\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{3}\right) \cdot b}\right)\right)}^{2} \]
    5. Applied rewrites86.5%

      \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(angle \cdot \left(b \cdot \left(\pi \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}, \pi \cdot \pi, 0.005555555555555556\right)\right)\right)\right)}}^{2} \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{34992000}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\right)\right)\right)\right)}^{2}} \]
      2. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}} + {\left(angle \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{34992000}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\right)\right)\right)\right)}^{2} \]
      3. lift-*.f64N/A

        \[\leadsto {\color{blue}{\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}}^{2} + {\left(angle \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{34992000}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\right)\right)\right)\right)}^{2} \]
      4. unpow-prod-downN/A

        \[\leadsto \color{blue}{{a}^{2} \cdot {\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}^{2}} + {\left(angle \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{34992000}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\right)\right)\right)\right)}^{2} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{{\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}^{2} \cdot {a}^{2}} + {\left(angle \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{34992000}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\right)\right)\right)\right)}^{2} \]
      6. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left({\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}^{2}, {a}^{2}, {\left(angle \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{34992000}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\right)\right)\right)\right)}^{2}\right)} \]
    7. Applied rewrites86.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right), a \cdot a, \left(angle \cdot \left(b \cdot \left(\pi \cdot \mathsf{fma}\left(angle \cdot angle, -2.8577960676726107 \cdot 10^{-8} \cdot \left(\pi \cdot \pi\right), 0.005555555555555556\right)\right)\right)\right) \cdot \left(angle \cdot \left(b \cdot \left(\pi \cdot \mathsf{fma}\left(angle \cdot angle, -2.8577960676726107 \cdot 10^{-8} \cdot \left(\pi \cdot \pi\right), 0.005555555555555556\right)\right)\right)\right)\right)} \]

    if 0.0200000000000000004 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 72.7%

      \[{\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. Add Preprocessing
    3. Applied rewrites72.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right), b, a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)} \]
    4. Taylor expanded in angle around 0

      \[\leadsto \mathsf{fma}\left(b \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right), b, a \cdot \left(a \cdot \color{blue}{1}\right)\right) \]
    5. Step-by-step derivation
      1. Applied rewrites73.1%

        \[\leadsto \mathsf{fma}\left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right), b, a \cdot \left(a \cdot \color{blue}{1}\right)\right) \]
    6. Recombined 2 regimes into one program.
    7. Add Preprocessing

    Alternative 2: 80.0% accurate, 0.9× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \sqrt{angle\_m \cdot 0.005555555555555556}\\ {\left(a \cdot \cos \left(\pi \cdot \left(t\_0 \cdot t\_0\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)}^{2} \end{array} \end{array} \]
    angle_m = (fabs.f64 angle)
    (FPCore (a b angle_m)
     :precision binary64
     (let* ((t_0 (sqrt (* angle_m 0.005555555555555556))))
       (+
        (pow (* a (cos (* PI (* t_0 t_0)))) 2.0)
        (pow (* b (sin (/ PI (/ 180.0 angle_m)))) 2.0))))
    angle_m = fabs(angle);
    double code(double a, double b, double angle_m) {
    	double t_0 = sqrt((angle_m * 0.005555555555555556));
    	return pow((a * cos((((double) M_PI) * (t_0 * t_0)))), 2.0) + pow((b * sin((((double) M_PI) / (180.0 / angle_m)))), 2.0);
    }
    
    angle_m = Math.abs(angle);
    public static double code(double a, double b, double angle_m) {
    	double t_0 = Math.sqrt((angle_m * 0.005555555555555556));
    	return Math.pow((a * Math.cos((Math.PI * (t_0 * t_0)))), 2.0) + Math.pow((b * Math.sin((Math.PI / (180.0 / angle_m)))), 2.0);
    }
    
    angle_m = math.fabs(angle)
    def code(a, b, angle_m):
    	t_0 = math.sqrt((angle_m * 0.005555555555555556))
    	return math.pow((a * math.cos((math.pi * (t_0 * t_0)))), 2.0) + math.pow((b * math.sin((math.pi / (180.0 / angle_m)))), 2.0)
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	t_0 = sqrt(Float64(angle_m * 0.005555555555555556))
    	return Float64((Float64(a * cos(Float64(pi * Float64(t_0 * t_0)))) ^ 2.0) + (Float64(b * sin(Float64(pi / Float64(180.0 / angle_m)))) ^ 2.0))
    end
    
    angle_m = abs(angle);
    function tmp = code(a, b, angle_m)
    	t_0 = sqrt((angle_m * 0.005555555555555556));
    	tmp = ((a * cos((pi * (t_0 * t_0)))) ^ 2.0) + ((b * sin((pi / (180.0 / angle_m)))) ^ 2.0);
    end
    
    angle_m = N[Abs[angle], $MachinePrecision]
    code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sqrt[N[(angle$95$m * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[N[(Pi * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    \begin{array}{l}
    t_0 := \sqrt{angle\_m \cdot 0.005555555555555556}\\
    {\left(a \cdot \cos \left(\pi \cdot \left(t\_0 \cdot t\_0\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)}^{2}
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 85.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
      2. lift-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} \]
      3. clear-numN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{1}{\frac{180}{angle}}}\right)\right)}^{2} \]
      4. un-div-invN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)}\right)}^{2} \]
      5. lower-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)}\right)}^{2} \]
      6. lower-/.f6485.8

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

      \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{\pi}{\frac{180}{angle}}\right)}\right)}^{2} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      2. clear-numN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{1}{\frac{180}{angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      3. lift-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{1}{\color{blue}{\frac{180}{angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      4. inv-powN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{{\left(\frac{180}{angle}\right)}^{-1}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      5. pow-to-expN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{e^{\log \left(\frac{180}{angle}\right) \cdot -1}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      6. lower-exp.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{e^{\log \left(\frac{180}{angle}\right) \cdot -1}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      7. lower-*.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot e^{\color{blue}{\log \left(\frac{180}{angle}\right) \cdot -1}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      8. lower-log.f6449.4

        \[\leadsto {\left(a \cdot \cos \left(\pi \cdot e^{\color{blue}{\log \left(\frac{180}{angle}\right)} \cdot -1}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} \]
    6. Applied rewrites49.4%

      \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \color{blue}{e^{\log \left(\frac{180}{angle}\right) \cdot -1}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} \]
    7. Step-by-step derivation
      1. lift-exp.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{e^{\log \left(\frac{180}{angle}\right) \cdot -1}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      2. lift-*.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot e^{\color{blue}{\log \left(\frac{180}{angle}\right) \cdot -1}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      3. lift-log.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot e^{\color{blue}{\log \left(\frac{180}{angle}\right)} \cdot -1}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      4. exp-to-powN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{{\left(\frac{180}{angle}\right)}^{-1}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      5. inv-powN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{1}{\frac{180}{angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      6. lift-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{1}{\color{blue}{\frac{180}{angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      7. associate-/r/N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\frac{1}{180} \cdot angle\right)}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      8. metadata-evalN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \left(\color{blue}{\frac{1}{180}} \cdot angle\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      9. *-commutativeN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      10. lift-*.f6485.8

        \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \color{blue}{\left(angle \cdot 0.005555555555555556\right)}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} \]
      11. rem-square-sqrtN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\sqrt{angle \cdot \frac{1}{180}} \cdot \sqrt{angle \cdot \frac{1}{180}}\right)}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      12. unpow1/2N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \left(\color{blue}{{\left(angle \cdot \frac{1}{180}\right)}^{\frac{1}{2}}} \cdot \sqrt{angle \cdot \frac{1}{180}}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      13. unpow1/2N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \left({\left(angle \cdot \frac{1}{180}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(angle \cdot \frac{1}{180}\right)}^{\frac{1}{2}}}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      14. lower-*.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left({\left(angle \cdot \frac{1}{180}\right)}^{\frac{1}{2}} \cdot {\left(angle \cdot \frac{1}{180}\right)}^{\frac{1}{2}}\right)}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      15. unpow1/2N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \left(\color{blue}{\sqrt{angle \cdot \frac{1}{180}}} \cdot {\left(angle \cdot \frac{1}{180}\right)}^{\frac{1}{2}}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      16. lower-sqrt.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \left(\color{blue}{\sqrt{angle \cdot \frac{1}{180}}} \cdot {\left(angle \cdot \frac{1}{180}\right)}^{\frac{1}{2}}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      17. unpow1/2N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \left(\sqrt{angle \cdot \frac{1}{180}} \cdot \color{blue}{\sqrt{angle \cdot \frac{1}{180}}}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} \]
      18. lower-sqrt.f6449.4

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

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

    Alternative 3: 80.0% accurate, 1.0× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2} \end{array} \]
    angle_m = (fabs.f64 angle)
    (FPCore (a b angle_m)
     :precision binary64
     (+
      (pow (* a (cos (/ 1.0 (/ 180.0 (* PI angle_m))))) 2.0)
      (pow (* b (sin (* PI (/ angle_m 180.0)))) 2.0)))
    angle_m = fabs(angle);
    double code(double a, double b, double angle_m) {
    	return pow((a * cos((1.0 / (180.0 / (((double) M_PI) * angle_m))))), 2.0) + pow((b * sin((((double) M_PI) * (angle_m / 180.0)))), 2.0);
    }
    
    angle_m = Math.abs(angle);
    public static double code(double a, double b, double angle_m) {
    	return Math.pow((a * Math.cos((1.0 / (180.0 / (Math.PI * angle_m))))), 2.0) + Math.pow((b * Math.sin((Math.PI * (angle_m / 180.0)))), 2.0);
    }
    
    angle_m = math.fabs(angle)
    def code(a, b, angle_m):
    	return math.pow((a * math.cos((1.0 / (180.0 / (math.pi * angle_m))))), 2.0) + math.pow((b * math.sin((math.pi * (angle_m / 180.0)))), 2.0)
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	return Float64((Float64(a * cos(Float64(1.0 / Float64(180.0 / Float64(pi * angle_m))))) ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(angle_m / 180.0)))) ^ 2.0))
    end
    
    angle_m = abs(angle);
    function tmp = code(a, b, angle_m)
    	tmp = ((a * cos((1.0 / (180.0 / (pi * angle_m))))) ^ 2.0) + ((b * sin((pi * (angle_m / 180.0)))) ^ 2.0);
    end
    
    angle_m = N[Abs[angle], $MachinePrecision]
    code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Cos[N[(1.0 / N[(180.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2}
    \end{array}
    
    Derivation
    1. Initial program 85.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
      2. lift-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
      3. associate-*r/N/A

        \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
      4. clear-numN/A

        \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
      5. lower-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
      6. lower-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
      7. lower-*.f6485.9

        \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\color{blue}{\pi \cdot angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    4. Applied rewrites85.9%

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

    Alternative 4: 80.0% accurate, 1.0× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right)\right)}^{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 (cos (/ 1.0 (/ 180.0 (* PI angle_m))))) 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 * cos((1.0 / (180.0 / (((double) M_PI) * angle_m))))), 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 * Math.cos((1.0 / (180.0 / (Math.PI * angle_m))))), 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 * math.cos((1.0 / (180.0 / (math.pi * angle_m))))), 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((Float64(a * cos(Float64(1.0 / Float64(180.0 / Float64(pi * angle_m))))) ^ 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 * cos((1.0 / (180.0 / (pi * angle_m))))) ^ 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[N[(a * N[Cos[N[(1.0 / N[(180.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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|
    
    \\
    {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right)\right)}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{2}
    \end{array}
    
    Derivation
    1. Initial program 85.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
      2. lift-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
      3. associate-*r/N/A

        \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
      4. clear-numN/A

        \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
      5. lower-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
      6. lower-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
      7. lower-*.f6485.9

        \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\color{blue}{\pi \cdot angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    4. Applied rewrites85.9%

      \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
      2. lift-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} \]
      3. associate-*r/N/A

        \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} \]
      4. lift-*.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\color{blue}{\mathsf{PI}\left(\right) \cdot angle}}{180}\right)\right)}^{2} \]
      5. div-invN/A

        \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)}\right)}^{2} \]
      6. metadata-evalN/A

        \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \color{blue}{\frac{1}{180}}\right)\right)}^{2} \]
      7. lower-*.f6485.9

        \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right)}^{2} \]
    6. Applied rewrites85.9%

      \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right)}^{2} \]
    7. Final simplification85.9%

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

    Alternative 5: 80.0% accurate, 1.0× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2} \end{array} \]
    angle_m = (fabs.f64 angle)
    (FPCore (a b angle_m)
     :precision binary64
     (+
      (pow (* a (cos (* PI (/ angle_m 180.0)))) 2.0)
      (pow (* b (sin (* angle_m (* PI 0.005555555555555556)))) 2.0)))
    angle_m = fabs(angle);
    double code(double a, double b, double angle_m) {
    	return pow((a * cos((((double) M_PI) * (angle_m / 180.0)))), 2.0) + pow((b * sin((angle_m * (((double) M_PI) * 0.005555555555555556)))), 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 * (angle_m / 180.0)))), 2.0) + Math.pow((b * Math.sin((angle_m * (Math.PI * 0.005555555555555556)))), 2.0);
    }
    
    angle_m = math.fabs(angle)
    def code(a, b, angle_m):
    	return math.pow((a * math.cos((math.pi * (angle_m / 180.0)))), 2.0) + math.pow((b * math.sin((angle_m * (math.pi * 0.005555555555555556)))), 2.0)
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	return Float64((Float64(a * cos(Float64(pi * Float64(angle_m / 180.0)))) ^ 2.0) + (Float64(b * sin(Float64(angle_m * Float64(pi * 0.005555555555555556)))) ^ 2.0))
    end
    
    angle_m = abs(angle);
    function tmp = code(a, b, angle_m)
    	tmp = ((a * cos((pi * (angle_m / 180.0)))) ^ 2.0) + ((b * sin((angle_m * (pi * 0.005555555555555556)))) ^ 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[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    {\left(a \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}
    \end{array}
    
    Derivation
    1. Initial program 85.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
      2. *-commutativeN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
      3. lift-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\frac{angle}{180}} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
      4. div-invN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
      5. associate-*l*N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} \]
      6. *-commutativeN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}\right)}^{2} \]
      7. lower-*.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}\right)}^{2} \]
      8. *-commutativeN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)} \cdot angle\right)\right)}^{2} \]
      9. lower-*.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)} \cdot angle\right)\right)}^{2} \]
      10. metadata-eval85.8

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

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

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

    Alternative 6: 79.9% accurate, 1.9× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ a \cdot a + {\left(b \cdot \sin \left(\frac{0.005555555555555556}{\frac{1}{\pi \cdot angle\_m}}\right)\right)}^{2} \end{array} \]
    angle_m = (fabs.f64 angle)
    (FPCore (a b angle_m)
     :precision binary64
     (+
      (* a a)
      (pow (* b (sin (/ 0.005555555555555556 (/ 1.0 (* PI angle_m))))) 2.0)))
    angle_m = fabs(angle);
    double code(double a, double b, double angle_m) {
    	return (a * a) + pow((b * sin((0.005555555555555556 / (1.0 / (((double) M_PI) * angle_m))))), 2.0);
    }
    
    angle_m = Math.abs(angle);
    public static double code(double a, double b, double angle_m) {
    	return (a * a) + Math.pow((b * Math.sin((0.005555555555555556 / (1.0 / (Math.PI * angle_m))))), 2.0);
    }
    
    angle_m = math.fabs(angle)
    def code(a, b, angle_m):
    	return (a * a) + math.pow((b * math.sin((0.005555555555555556 / (1.0 / (math.pi * angle_m))))), 2.0)
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	return Float64(Float64(a * a) + (Float64(b * sin(Float64(0.005555555555555556 / Float64(1.0 / Float64(pi * angle_m))))) ^ 2.0))
    end
    
    angle_m = abs(angle);
    function tmp = code(a, b, angle_m)
    	tmp = (a * a) + ((b * sin((0.005555555555555556 / (1.0 / (pi * angle_m))))) ^ 2.0);
    end
    
    angle_m = N[Abs[angle], $MachinePrecision]
    code[a_, b_, angle$95$m_] := N[(N[(a * a), $MachinePrecision] + N[Power[N[(b * N[Sin[N[(0.005555555555555556 / N[(1.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    a \cdot a + {\left(b \cdot \sin \left(\frac{0.005555555555555556}{\frac{1}{\pi \cdot angle\_m}}\right)\right)}^{2}
    \end{array}
    
    Derivation
    1. Initial program 85.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
      2. lift-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} \]
      3. associate-*r/N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} \]
      4. clear-numN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
      5. lower-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
      6. lower-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} \]
      7. lower-*.f6485.8

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

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

      \[\leadsto \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} \]
      2. lower-*.f6485.7

        \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)\right)}^{2} \]
    7. Applied rewrites85.7%

      \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)\right)}^{2} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
      2. lift-/.f64N/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} \]
      3. div-invN/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \left(\frac{1}{\color{blue}{180 \cdot \frac{1}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} \]
      4. associate-/r*N/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \color{blue}{\left(\frac{\frac{1}{180}}{\frac{1}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
      5. metadata-evalN/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \left(\frac{\color{blue}{\frac{1}{180}}}{\frac{1}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} \]
      6. lower-/.f64N/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \color{blue}{\left(\frac{\frac{1}{180}}{\frac{1}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
      7. lower-/.f6485.8

        \[\leadsto a \cdot a + {\left(b \cdot \sin \left(\frac{0.005555555555555556}{\color{blue}{\frac{1}{\pi \cdot angle}}}\right)\right)}^{2} \]
      8. lift-*.f64N/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \left(\frac{\frac{1}{180}}{\frac{1}{\color{blue}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} \]
      9. *-commutativeN/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \left(\frac{\frac{1}{180}}{\frac{1}{\color{blue}{angle \cdot \mathsf{PI}\left(\right)}}}\right)\right)}^{2} \]
      10. lower-*.f6485.8

        \[\leadsto a \cdot a + {\left(b \cdot \sin \left(\frac{0.005555555555555556}{\frac{1}{\color{blue}{angle \cdot \pi}}}\right)\right)}^{2} \]
    9. Applied rewrites85.8%

      \[\leadsto a \cdot a + {\left(b \cdot \sin \color{blue}{\left(\frac{0.005555555555555556}{\frac{1}{angle \cdot \pi}}\right)}\right)}^{2} \]
    10. Final simplification85.8%

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

    Alternative 7: 79.9% accurate, 2.0× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ a \cdot a + {\left(b \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2} \end{array} \]
    angle_m = (fabs.f64 angle)
    (FPCore (a b angle_m)
     :precision binary64
     (+ (* a a) (pow (* b (sin (* PI (* angle_m 0.005555555555555556)))) 2.0)))
    angle_m = fabs(angle);
    double code(double a, double b, double angle_m) {
    	return (a * a) + pow((b * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))), 2.0);
    }
    
    angle_m = Math.abs(angle);
    public static double code(double a, double b, double angle_m) {
    	return (a * a) + Math.pow((b * Math.sin((Math.PI * (angle_m * 0.005555555555555556)))), 2.0);
    }
    
    angle_m = math.fabs(angle)
    def code(a, b, angle_m):
    	return (a * a) + math.pow((b * math.sin((math.pi * (angle_m * 0.005555555555555556)))), 2.0)
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	return Float64(Float64(a * a) + (Float64(b * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))) ^ 2.0))
    end
    
    angle_m = abs(angle);
    function tmp = code(a, b, angle_m)
    	tmp = (a * a) + ((b * sin((pi * (angle_m * 0.005555555555555556)))) ^ 2.0);
    end
    
    angle_m = N[Abs[angle], $MachinePrecision]
    code[a_, b_, angle$95$m_] := N[(N[(a * a), $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    a \cdot a + {\left(b \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2}
    \end{array}
    
    Derivation
    1. Initial program 85.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
      2. lift-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} \]
      3. associate-*r/N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} \]
      4. clear-numN/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
      5. lower-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
      6. lower-/.f64N/A

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} \]
      7. lower-*.f6485.8

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

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

      \[\leadsto \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} \]
      2. lower-*.f6485.7

        \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)\right)}^{2} \]
    7. Applied rewrites85.7%

      \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)\right)}^{2} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
      2. lift-/.f64N/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} \]
      3. clear-numN/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} \]
      4. lift-*.f64N/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \left(\frac{\color{blue}{\mathsf{PI}\left(\right) \cdot angle}}{180}\right)\right)}^{2} \]
      5. *-commutativeN/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \left(\frac{\color{blue}{angle \cdot \mathsf{PI}\left(\right)}}{180}\right)\right)}^{2} \]
      6. associate-*l/N/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
      7. div-invN/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
      8. metadata-evalN/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \left(\left(angle \cdot \color{blue}{\frac{1}{180}}\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
      9. lift-*.f64N/A

        \[\leadsto a \cdot a + {\left(b \cdot \sin \left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
      10. lower-*.f6485.7

        \[\leadsto a \cdot a + {\left(b \cdot \sin \color{blue}{\left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)}\right)}^{2} \]
    9. Applied rewrites85.7%

      \[\leadsto a \cdot a + {\left(b \cdot \sin \color{blue}{\left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)}\right)}^{2} \]
    10. Final simplification85.7%

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

    Alternative 8: 79.7% accurate, 2.7× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-10}:\\ \;\;\;\;a \cdot a + {\left(angle\_m \cdot \left(b \cdot \left(\pi \cdot \mathsf{fma}\left(\left(angle\_m \cdot angle\_m\right) \cdot -2.8577960676726107 \cdot 10^{-8}, \pi \cdot \pi, 0.005555555555555556\right)\right)\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right), b, a \cdot \left(a \cdot 1\right)\right)\\ \end{array} \end{array} \]
    angle_m = (fabs.f64 angle)
    (FPCore (a b angle_m)
     :precision binary64
     (if (<= (/ angle_m 180.0) 1e-10)
       (+
        (* a a)
        (pow
         (*
          angle_m
          (*
           b
           (*
            PI
            (fma
             (* (* angle_m angle_m) -2.8577960676726107e-8)
             (* PI PI)
             0.005555555555555556))))
         2.0))
       (fma
        (* b (- 0.5 (* 0.5 (cos (* 2.0 (* PI (* angle_m 0.005555555555555556)))))))
        b
        (* a (* a 1.0)))))
    angle_m = fabs(angle);
    double code(double a, double b, double angle_m) {
    	double tmp;
    	if ((angle_m / 180.0) <= 1e-10) {
    		tmp = (a * a) + pow((angle_m * (b * (((double) M_PI) * fma(((angle_m * angle_m) * -2.8577960676726107e-8), (((double) M_PI) * ((double) M_PI)), 0.005555555555555556)))), 2.0);
    	} else {
    		tmp = fma((b * (0.5 - (0.5 * cos((2.0 * (((double) M_PI) * (angle_m * 0.005555555555555556))))))), b, (a * (a * 1.0)));
    	}
    	return tmp;
    }
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	tmp = 0.0
    	if (Float64(angle_m / 180.0) <= 1e-10)
    		tmp = Float64(Float64(a * a) + (Float64(angle_m * Float64(b * Float64(pi * fma(Float64(Float64(angle_m * angle_m) * -2.8577960676726107e-8), Float64(pi * pi), 0.005555555555555556)))) ^ 2.0));
    	else
    		tmp = fma(Float64(b * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(pi * Float64(angle_m * 0.005555555555555556))))))), b, Float64(a * Float64(a * 1.0)));
    	end
    	return tmp
    end
    
    angle_m = N[Abs[angle], $MachinePrecision]
    code[a_, b_, angle$95$m_] := If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-10], N[(N[(a * a), $MachinePrecision] + N[Power[N[(angle$95$m * N[(b * N[(Pi * N[(N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * -2.8577960676726107e-8), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * b + N[(a * N[(a * 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-10}:\\
    \;\;\;\;a \cdot a + {\left(angle\_m \cdot \left(b \cdot \left(\pi \cdot \mathsf{fma}\left(\left(angle\_m \cdot angle\_m\right) \cdot -2.8577960676726107 \cdot 10^{-8}, \pi \cdot \pi, 0.005555555555555556\right)\right)\right)\right)}^{2}\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right), b, a \cdot \left(a \cdot 1\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e-10

      1. Initial program 89.3%

        \[{\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. Add Preprocessing
      3. Taylor expanded in angle around 0

        \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(angle \cdot \left(\frac{-1}{34992000} \cdot \left({angle}^{2} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right) + \frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\frac{-1}{34992000} \cdot \color{blue}{\left(\left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right) \cdot {angle}^{2}\right)} + \frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right)}^{2} \]
        2. associate-*r*N/A

          \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\color{blue}{\left(\frac{-1}{34992000} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right) \cdot {angle}^{2}} + \frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right)\right)}^{2} \]
        3. +-commutativeN/A

          \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right) + \left(\frac{-1}{34992000} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right) \cdot {angle}^{2}\right)}\right)}^{2} \]
        4. lower-*.f64N/A

          \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right) + \left(\frac{-1}{34992000} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right) \cdot {angle}^{2}\right)\right)}}^{2} \]
        5. associate-*r*N/A

          \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right) + \color{blue}{\frac{-1}{34992000} \cdot \left(\left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right) \cdot {angle}^{2}\right)}\right)\right)}^{2} \]
        6. *-commutativeN/A

          \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\frac{1}{180} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right) + \frac{-1}{34992000} \cdot \color{blue}{\left({angle}^{2} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)}\right)\right)}^{2} \]
        7. *-commutativeN/A

          \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\frac{1}{180} \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot b\right)} + \frac{-1}{34992000} \cdot \left({angle}^{2} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)}^{2} \]
        8. associate-*r*N/A

          \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\color{blue}{\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b} + \frac{-1}{34992000} \cdot \left({angle}^{2} \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)}^{2} \]
        9. associate-*r*N/A

          \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b + \color{blue}{\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot \left(b \cdot {\mathsf{PI}\left(\right)}^{3}\right)}\right)\right)}^{2} \]
        10. *-commutativeN/A

          \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b + \left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{3} \cdot b\right)}\right)\right)}^{2} \]
        11. associate-*r*N/A

          \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(angle \cdot \left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b + \color{blue}{\left(\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{3}\right) \cdot b}\right)\right)}^{2} \]
      5. Applied rewrites86.2%

        \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\color{blue}{\left(angle \cdot \left(b \cdot \left(\pi \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}, \pi \cdot \pi, 0.005555555555555556\right)\right)\right)\right)}}^{2} \]
      6. Taylor expanded in angle around 0

        \[\leadsto \color{blue}{{a}^{2}} + {\left(angle \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{34992000}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\right)\right)\right)\right)}^{2} \]
      7. Step-by-step derivation
        1. unpow2N/A

          \[\leadsto \color{blue}{a \cdot a} + {\left(angle \cdot \left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{34992000}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\right)\right)\right)\right)}^{2} \]
        2. lower-*.f6486.2

          \[\leadsto \color{blue}{a \cdot a} + {\left(angle \cdot \left(b \cdot \left(\pi \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}, \pi \cdot \pi, 0.005555555555555556\right)\right)\right)\right)}^{2} \]
      8. Applied rewrites86.2%

        \[\leadsto \color{blue}{a \cdot a} + {\left(angle \cdot \left(b \cdot \left(\pi \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}, \pi \cdot \pi, 0.005555555555555556\right)\right)\right)\right)}^{2} \]

      if 1.00000000000000004e-10 < (/.f64 angle #s(literal 180 binary64))

      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. Add Preprocessing
      3. Applied rewrites74.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right), b, a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)} \]
      4. Taylor expanded in angle around 0

        \[\leadsto \mathsf{fma}\left(b \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right), b, a \cdot \left(a \cdot \color{blue}{1}\right)\right) \]
      5. Step-by-step derivation
        1. Applied rewrites73.3%

          \[\leadsto \mathsf{fma}\left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right), b, a \cdot \left(a \cdot \color{blue}{1}\right)\right) \]
      6. Recombined 2 regimes into one program.
      7. Add Preprocessing

      Alternative 9: 79.7% accurate, 2.8× speedup?

      \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-10}:\\ \;\;\;\;a \cdot a + {\left(b \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right), b, a \cdot \left(a \cdot 1\right)\right)\\ \end{array} \end{array} \]
      angle_m = (fabs.f64 angle)
      (FPCore (a b angle_m)
       :precision binary64
       (if (<= (/ angle_m 180.0) 1e-10)
         (+ (* a a) (pow (* b (* 0.005555555555555556 (* PI angle_m))) 2.0))
         (fma
          (* b (- 0.5 (* 0.5 (cos (* 2.0 (* PI (* angle_m 0.005555555555555556)))))))
          b
          (* a (* a 1.0)))))
      angle_m = fabs(angle);
      double code(double a, double b, double angle_m) {
      	double tmp;
      	if ((angle_m / 180.0) <= 1e-10) {
      		tmp = (a * a) + pow((b * (0.005555555555555556 * (((double) M_PI) * angle_m))), 2.0);
      	} else {
      		tmp = fma((b * (0.5 - (0.5 * cos((2.0 * (((double) M_PI) * (angle_m * 0.005555555555555556))))))), b, (a * (a * 1.0)));
      	}
      	return tmp;
      }
      
      angle_m = abs(angle)
      function code(a, b, angle_m)
      	tmp = 0.0
      	if (Float64(angle_m / 180.0) <= 1e-10)
      		tmp = Float64(Float64(a * a) + (Float64(b * Float64(0.005555555555555556 * Float64(pi * angle_m))) ^ 2.0));
      	else
      		tmp = fma(Float64(b * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(pi * Float64(angle_m * 0.005555555555555556))))))), b, Float64(a * Float64(a * 1.0)));
      	end
      	return tmp
      end
      
      angle_m = N[Abs[angle], $MachinePrecision]
      code[a_, b_, angle$95$m_] := If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-10], N[(N[(a * a), $MachinePrecision] + N[Power[N[(b * N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * b + N[(a * N[(a * 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      angle_m = \left|angle\right|
      
      \\
      \begin{array}{l}
      \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-10}:\\
      \;\;\;\;a \cdot a + {\left(b \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{2}\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right), b, a \cdot \left(a \cdot 1\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e-10

        1. Initial program 89.3%

          \[{\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. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
          2. lift-/.f64N/A

            \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} \]
          3. associate-*r/N/A

            \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} \]
          4. clear-numN/A

            \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
          5. lower-/.f64N/A

            \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
          6. lower-/.f64N/A

            \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} \]
          7. lower-*.f6489.3

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

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

          \[\leadsto \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} \]
        6. Step-by-step derivation
          1. unpow2N/A

            \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} \]
          2. lower-*.f6489.7

            \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)\right)}^{2} \]
        7. Applied rewrites89.7%

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

          \[\leadsto a \cdot a + {\left(b \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} \]
        9. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto a \cdot a + {\left(b \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} \]
          2. lower-*.f64N/A

            \[\leadsto a \cdot a + {\left(b \cdot \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)\right)}^{2} \]
          3. lower-PI.f6487.1

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

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

        if 1.00000000000000004e-10 < (/.f64 angle #s(literal 180 binary64))

        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. Add Preprocessing
        3. Applied rewrites74.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right), b, a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)} \]
        4. Taylor expanded in angle around 0

          \[\leadsto \mathsf{fma}\left(b \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right), b, a \cdot \left(a \cdot \color{blue}{1}\right)\right) \]
        5. Step-by-step derivation
          1. Applied rewrites73.3%

            \[\leadsto \mathsf{fma}\left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right), b, a \cdot \left(a \cdot \color{blue}{1}\right)\right) \]
        6. Recombined 2 regimes into one program.
        7. Final simplification83.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{-10}:\\ \;\;\;\;a \cdot a + {\left(b \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right), b, a \cdot \left(a \cdot 1\right)\right)\\ \end{array} \]
        8. Add Preprocessing

        Alternative 10: 79.7% accurate, 2.9× speedup?

        \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-10}:\\ \;\;\;\;a \cdot a + {\left(b \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, b \cdot \left(0.5 + -0.5 \cdot \cos \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right)\right), a \cdot a\right)\\ \end{array} \end{array} \]
        angle_m = (fabs.f64 angle)
        (FPCore (a b angle_m)
         :precision binary64
         (if (<= (/ angle_m 180.0) 1e-10)
           (+ (* a a) (pow (* b (* 0.005555555555555556 (* PI angle_m))) 2.0))
           (fma
            b
            (* b (+ 0.5 (* -0.5 (cos (* (* PI angle_m) 0.011111111111111112)))))
            (* a a))))
        angle_m = fabs(angle);
        double code(double a, double b, double angle_m) {
        	double tmp;
        	if ((angle_m / 180.0) <= 1e-10) {
        		tmp = (a * a) + pow((b * (0.005555555555555556 * (((double) M_PI) * angle_m))), 2.0);
        	} else {
        		tmp = fma(b, (b * (0.5 + (-0.5 * cos(((((double) M_PI) * angle_m) * 0.011111111111111112))))), (a * a));
        	}
        	return tmp;
        }
        
        angle_m = abs(angle)
        function code(a, b, angle_m)
        	tmp = 0.0
        	if (Float64(angle_m / 180.0) <= 1e-10)
        		tmp = Float64(Float64(a * a) + (Float64(b * Float64(0.005555555555555556 * Float64(pi * angle_m))) ^ 2.0));
        	else
        		tmp = fma(b, Float64(b * Float64(0.5 + Float64(-0.5 * cos(Float64(Float64(pi * angle_m) * 0.011111111111111112))))), Float64(a * a));
        	end
        	return tmp
        end
        
        angle_m = N[Abs[angle], $MachinePrecision]
        code[a_, b_, angle$95$m_] := If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-10], N[(N[(a * a), $MachinePrecision] + N[Power[N[(b * N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(b * N[(b * N[(0.5 + N[(-0.5 * N[Cos[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        angle_m = \left|angle\right|
        
        \\
        \begin{array}{l}
        \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-10}:\\
        \;\;\;\;a \cdot a + {\left(b \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{2}\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(b, b \cdot \left(0.5 + -0.5 \cdot \cos \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right)\right), a \cdot a\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e-10

          1. Initial program 89.3%

            \[{\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. Add Preprocessing
          3. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
            2. lift-/.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} \]
            3. associate-*r/N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} \]
            4. clear-numN/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
            5. lower-/.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
            6. lower-/.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} \]
            7. lower-*.f6489.3

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

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

            \[\leadsto \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} \]
          6. Step-by-step derivation
            1. unpow2N/A

              \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} \]
            2. lower-*.f6489.7

              \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)\right)}^{2} \]
          7. Applied rewrites89.7%

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

            \[\leadsto a \cdot a + {\left(b \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} \]
          9. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto a \cdot a + {\left(b \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} \]
            2. lower-*.f64N/A

              \[\leadsto a \cdot a + {\left(b \cdot \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)\right)}^{2} \]
            3. lower-PI.f6487.1

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

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

          if 1.00000000000000004e-10 < (/.f64 angle #s(literal 180 binary64))

          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. Add Preprocessing
          3. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
            2. lift-/.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} \]
            3. associate-*r/N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} \]
            4. clear-numN/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
            5. lower-/.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
            6. lower-/.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} \]
            7. lower-*.f6474.8

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

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

            \[\leadsto \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} \]
          6. Step-by-step derivation
            1. unpow2N/A

              \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} \]
            2. lower-*.f6473.3

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

            \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)\right)}^{2} \]
          8. Applied rewrites73.2%

            \[\leadsto \color{blue}{\mathsf{fma}\left(b, b \cdot \left(0.5 + -0.5 \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right), a \cdot a\right)} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification83.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{-10}:\\ \;\;\;\;a \cdot a + {\left(b \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, b \cdot \left(0.5 + -0.5 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right), a \cdot a\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 11: 66.7% accurate, 3.4× speedup?

        \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 1.7 \cdot 10^{-39}:\\ \;\;\;\;\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle\_m \cdot \left(\pi \cdot 0.011111111111111112\right)\right), 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot a + {\left(b \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{2}\\ \end{array} \end{array} \]
        angle_m = (fabs.f64 angle)
        (FPCore (a b angle_m)
         :precision binary64
         (if (<= b 1.7e-39)
           (* (* a a) (fma 0.5 (cos (* angle_m (* PI 0.011111111111111112))) 0.5))
           (+ (* a a) (pow (* b (* 0.005555555555555556 (* PI angle_m))) 2.0))))
        angle_m = fabs(angle);
        double code(double a, double b, double angle_m) {
        	double tmp;
        	if (b <= 1.7e-39) {
        		tmp = (a * a) * fma(0.5, cos((angle_m * (((double) M_PI) * 0.011111111111111112))), 0.5);
        	} else {
        		tmp = (a * a) + pow((b * (0.005555555555555556 * (((double) M_PI) * angle_m))), 2.0);
        	}
        	return tmp;
        }
        
        angle_m = abs(angle)
        function code(a, b, angle_m)
        	tmp = 0.0
        	if (b <= 1.7e-39)
        		tmp = Float64(Float64(a * a) * fma(0.5, cos(Float64(angle_m * Float64(pi * 0.011111111111111112))), 0.5));
        	else
        		tmp = Float64(Float64(a * a) + (Float64(b * Float64(0.005555555555555556 * Float64(pi * angle_m))) ^ 2.0));
        	end
        	return tmp
        end
        
        angle_m = N[Abs[angle], $MachinePrecision]
        code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.7e-39], N[(N[(a * a), $MachinePrecision] * N[(0.5 * N[Cos[N[(angle$95$m * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[Power[N[(b * N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        angle_m = \left|angle\right|
        
        \\
        \begin{array}{l}
        \mathbf{if}\;b \leq 1.7 \cdot 10^{-39}:\\
        \;\;\;\;\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle\_m \cdot \left(\pi \cdot 0.011111111111111112\right)\right), 0.5\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;a \cdot a + {\left(b \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{2}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if b < 1.7e-39

          1. Initial program 85.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. Add Preprocessing
          3. Applied rewrites76.8%

            \[\leadsto \color{blue}{\mathsf{fma}\left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right), b, a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)} \]
          4. Taylor expanded in b around 0

            \[\leadsto \color{blue}{{a}^{2} \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
          5. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \color{blue}{{a}^{2} \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
            2. unpow2N/A

              \[\leadsto \color{blue}{\left(a \cdot a\right)} \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
            3. lower-*.f64N/A

              \[\leadsto \color{blue}{\left(a \cdot a\right)} \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
            4. +-commutativeN/A

              \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) + \frac{1}{2}\right)} \]
            5. lower-fma.f64N/A

              \[\leadsto \left(a \cdot a\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2}, \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right), \frac{1}{2}\right)} \]
            6. lower-cos.f64N/A

              \[\leadsto \left(a \cdot a\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{\cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, \frac{1}{2}\right) \]
            7. *-commutativeN/A

              \[\leadsto \left(a \cdot a\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{90}\right)}, \frac{1}{2}\right) \]
            8. associate-*l*N/A

              \[\leadsto \left(a \cdot a\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{90}\right)\right)}, \frac{1}{2}\right) \]
            9. lower-*.f64N/A

              \[\leadsto \left(a \cdot a\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{90}\right)\right)}, \frac{1}{2}\right) \]
            10. lower-*.f64N/A

              \[\leadsto \left(a \cdot a\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{90}\right)}\right), \frac{1}{2}\right) \]
            11. lower-PI.f6469.1

              \[\leadsto \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\color{blue}{\pi} \cdot 0.011111111111111112\right)\right), 0.5\right) \]
          6. Applied rewrites69.1%

            \[\leadsto \color{blue}{\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right), 0.5\right)} \]

          if 1.7e-39 < b

          1. Initial program 86.7%

            \[{\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. Add Preprocessing
          3. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
            2. lift-/.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} \]
            3. associate-*r/N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} \]
            4. clear-numN/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
            5. lower-/.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
            6. lower-/.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} \]
            7. lower-*.f6486.7

              \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\color{blue}{\pi \cdot angle}}}\right)\right)}^{2} \]
          4. Applied rewrites86.7%

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

            \[\leadsto \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} \]
          6. Step-by-step derivation
            1. unpow2N/A

              \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} \]
            2. lower-*.f6486.8

              \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)\right)}^{2} \]
          7. Applied rewrites86.8%

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

            \[\leadsto a \cdot a + {\left(b \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} \]
          9. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto a \cdot a + {\left(b \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} \]
            2. lower-*.f64N/A

              \[\leadsto a \cdot a + {\left(b \cdot \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)\right)}^{2} \]
            3. lower-PI.f6484.9

              \[\leadsto a \cdot a + {\left(b \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right)\right)}^{2} \]
          10. Applied rewrites84.9%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.7 \cdot 10^{-39}:\\ \;\;\;\;\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right), 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot a + {\left(b \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2}\\ \end{array} \]
        5. Add Preprocessing

        Alternative 12: 66.7% accurate, 3.4× speedup?

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

          1. Initial program 85.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. Add Preprocessing
          3. Taylor expanded in angle around 0

            \[\leadsto \color{blue}{{a}^{2}} \]
          4. Step-by-step derivation
            1. unpow2N/A

              \[\leadsto \color{blue}{a \cdot a} \]
            2. lower-*.f6468.9

              \[\leadsto \color{blue}{a \cdot a} \]
          5. Applied rewrites68.9%

            \[\leadsto \color{blue}{a \cdot a} \]

          if 1.64999999999999992e-39 < b

          1. Initial program 86.7%

            \[{\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. Add Preprocessing
          3. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
            2. lift-/.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} \]
            3. associate-*r/N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} \]
            4. clear-numN/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
            5. lower-/.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} \]
            6. lower-/.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} \]
            7. lower-*.f6486.7

              \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\color{blue}{\pi \cdot angle}}}\right)\right)}^{2} \]
          4. Applied rewrites86.7%

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

            \[\leadsto \color{blue}{{a}^{2}} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} \]
          6. Step-by-step derivation
            1. unpow2N/A

              \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)\right)}^{2} \]
            2. lower-*.f6486.8

              \[\leadsto \color{blue}{a \cdot a} + {\left(b \cdot \sin \left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)\right)}^{2} \]
          7. Applied rewrites86.8%

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

            \[\leadsto a \cdot a + {\left(b \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} \]
          9. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto a \cdot a + {\left(b \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} \]
            2. lower-*.f64N/A

              \[\leadsto a \cdot a + {\left(b \cdot \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)\right)}^{2} \]
            3. lower-PI.f6484.9

              \[\leadsto a \cdot a + {\left(b \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right)\right)}^{2} \]
          10. Applied rewrites84.9%

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

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

        Alternative 13: 56.7% accurate, 8.3× speedup?

        \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;a \leq 5.9 \cdot 10^{+118}:\\ \;\;\;\;\mathsf{fma}\left(a, a, angle\_m \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(\pi \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, b \cdot b, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot a\\ \end{array} \end{array} \]
        angle_m = (fabs.f64 angle)
        (FPCore (a b angle_m)
         :precision binary64
         (if (<= a 5.9e+118)
           (fma
            a
            a
            (*
             angle_m
             (*
              (* PI angle_m)
              (*
               PI
               (fma 3.08641975308642e-5 (* b b) (* (* a a) -3.08641975308642e-5))))))
           (* a a)))
        angle_m = fabs(angle);
        double code(double a, double b, double angle_m) {
        	double tmp;
        	if (a <= 5.9e+118) {
        		tmp = fma(a, a, (angle_m * ((((double) M_PI) * angle_m) * (((double) M_PI) * fma(3.08641975308642e-5, (b * b), ((a * a) * -3.08641975308642e-5))))));
        	} else {
        		tmp = a * a;
        	}
        	return tmp;
        }
        
        angle_m = abs(angle)
        function code(a, b, angle_m)
        	tmp = 0.0
        	if (a <= 5.9e+118)
        		tmp = fma(a, a, Float64(angle_m * Float64(Float64(pi * angle_m) * Float64(pi * fma(3.08641975308642e-5, Float64(b * b), Float64(Float64(a * a) * -3.08641975308642e-5))))));
        	else
        		tmp = Float64(a * a);
        	end
        	return tmp
        end
        
        angle_m = N[Abs[angle], $MachinePrecision]
        code[a_, b_, angle$95$m_] := If[LessEqual[a, 5.9e+118], N[(a * a + N[(angle$95$m * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(Pi * N[(3.08641975308642e-5 * N[(b * b), $MachinePrecision] + N[(N[(a * a), $MachinePrecision] * -3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * a), $MachinePrecision]]
        
        \begin{array}{l}
        angle_m = \left|angle\right|
        
        \\
        \begin{array}{l}
        \mathbf{if}\;a \leq 5.9 \cdot 10^{+118}:\\
        \;\;\;\;\mathsf{fma}\left(a, a, angle\_m \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(\pi \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, b \cdot b, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;a \cdot a\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if a < 5.8999999999999997e118

          1. Initial program 84.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. Add Preprocessing
          3. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
            2. lift-/.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
            3. associate-*r/N/A

              \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
            4. clear-numN/A

              \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
            5. lower-/.f64N/A

              \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
            6. lower-/.f64N/A

              \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
            7. lower-*.f6485.0

              \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\color{blue}{\pi \cdot angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
          4. Applied rewrites85.0%

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

            \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2}} \]
          6. Step-by-step derivation
            1. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {a}^{2}\right)} \]
          7. Applied rewrites55.8%

            \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)} \]
          8. Step-by-step derivation
            1. Applied rewrites59.4%

              \[\leadsto \mathsf{fma}\left(a, \color{blue}{a}, angle \cdot \left(\left(angle \cdot \pi\right) \cdot \left(\pi \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, b \cdot b, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right) \]

            if 5.8999999999999997e118 < a

            1. Initial program 89.7%

              \[{\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. Add Preprocessing
            3. Taylor expanded in angle around 0

              \[\leadsto \color{blue}{{a}^{2}} \]
            4. Step-by-step derivation
              1. unpow2N/A

                \[\leadsto \color{blue}{a \cdot a} \]
              2. lower-*.f6488.3

                \[\leadsto \color{blue}{a \cdot a} \]
            5. Applied rewrites88.3%

              \[\leadsto \color{blue}{a \cdot a} \]
          9. Recombined 2 regimes into one program.
          10. Final simplification64.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 5.9 \cdot 10^{+118}:\\ \;\;\;\;\mathsf{fma}\left(a, a, angle \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\pi \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, b \cdot b, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot a\\ \end{array} \]
          11. Add Preprocessing

          Alternative 14: 64.4% accurate, 9.1× speedup?

          \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 1.65 \cdot 10^{-39}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{+152}:\\ \;\;\;\;\mathsf{fma}\left(angle\_m \cdot angle\_m, b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot \left(\pi \cdot \pi\right)\right)\right), a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle\_m \cdot b\right) \cdot \left(angle\_m \cdot \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\ \end{array} \end{array} \]
          angle_m = (fabs.f64 angle)
          (FPCore (a b angle_m)
           :precision binary64
           (if (<= b 1.65e-39)
             (* a a)
             (if (<= b 8.5e+152)
               (fma
                (* angle_m angle_m)
                (* b (* 3.08641975308642e-5 (* b (* PI PI))))
                (* a a))
               (* (* angle_m b) (* angle_m (* b (* (* PI PI) 3.08641975308642e-5)))))))
          angle_m = fabs(angle);
          double code(double a, double b, double angle_m) {
          	double tmp;
          	if (b <= 1.65e-39) {
          		tmp = a * a;
          	} else if (b <= 8.5e+152) {
          		tmp = fma((angle_m * angle_m), (b * (3.08641975308642e-5 * (b * (((double) M_PI) * ((double) M_PI))))), (a * a));
          	} else {
          		tmp = (angle_m * b) * (angle_m * (b * ((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5)));
          	}
          	return tmp;
          }
          
          angle_m = abs(angle)
          function code(a, b, angle_m)
          	tmp = 0.0
          	if (b <= 1.65e-39)
          		tmp = Float64(a * a);
          	elseif (b <= 8.5e+152)
          		tmp = fma(Float64(angle_m * angle_m), Float64(b * Float64(3.08641975308642e-5 * Float64(b * Float64(pi * pi)))), Float64(a * a));
          	else
          		tmp = Float64(Float64(angle_m * b) * Float64(angle_m * Float64(b * Float64(Float64(pi * pi) * 3.08641975308642e-5))));
          	end
          	return tmp
          end
          
          angle_m = N[Abs[angle], $MachinePrecision]
          code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.65e-39], N[(a * a), $MachinePrecision], If[LessEqual[b, 8.5e+152], N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(b * N[(3.08641975308642e-5 * N[(b * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * b), $MachinePrecision] * N[(angle$95$m * N[(b * N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          angle_m = \left|angle\right|
          
          \\
          \begin{array}{l}
          \mathbf{if}\;b \leq 1.65 \cdot 10^{-39}:\\
          \;\;\;\;a \cdot a\\
          
          \mathbf{elif}\;b \leq 8.5 \cdot 10^{+152}:\\
          \;\;\;\;\mathsf{fma}\left(angle\_m \cdot angle\_m, b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot \left(\pi \cdot \pi\right)\right)\right), a \cdot a\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(angle\_m \cdot b\right) \cdot \left(angle\_m \cdot \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if b < 1.64999999999999992e-39

            1. Initial program 85.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. Add Preprocessing
            3. Taylor expanded in angle around 0

              \[\leadsto \color{blue}{{a}^{2}} \]
            4. Step-by-step derivation
              1. unpow2N/A

                \[\leadsto \color{blue}{a \cdot a} \]
              2. lower-*.f6468.9

                \[\leadsto \color{blue}{a \cdot a} \]
            5. Applied rewrites68.9%

              \[\leadsto \color{blue}{a \cdot a} \]

            if 1.64999999999999992e-39 < b < 8.4999999999999993e152

            1. Initial program 75.3%

              \[{\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. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
              2. lift-/.f64N/A

                \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
              3. associate-*r/N/A

                \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
              4. clear-numN/A

                \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
              5. lower-/.f64N/A

                \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
              6. lower-/.f64N/A

                \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
              7. lower-*.f6475.5

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

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

              \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2}} \]
            6. Step-by-step derivation
              1. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {a}^{2}\right)} \]
            7. Applied rewrites47.9%

              \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)} \]
            8. Taylor expanded in b around inf

              \[\leadsto \mathsf{fma}\left(angle \cdot angle, \frac{1}{32400} \cdot \color{blue}{\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}, a \cdot a\right) \]
            9. Step-by-step derivation
              1. Applied rewrites69.4%

                \[\leadsto \mathsf{fma}\left(angle \cdot angle, b \cdot \color{blue}{\left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot \left(\pi \cdot \pi\right)\right)\right)}, a \cdot a\right) \]

              if 8.4999999999999993e152 < b

              1. Initial program 99.7%

                \[{\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. Add Preprocessing
              3. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                2. lift-/.f64N/A

                  \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                3. associate-*r/N/A

                  \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                4. clear-numN/A

                  \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                5. lower-/.f64N/A

                  \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                6. lower-/.f64N/A

                  \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                7. lower-*.f6499.7

                  \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\color{blue}{\pi \cdot angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
              4. Applied rewrites99.7%

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

                \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2}} \]
              6. Step-by-step derivation
                1. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {a}^{2}\right)} \]
              7. Applied rewrites53.3%

                \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)} \]
              8. Taylor expanded in b around inf

                \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
              9. Step-by-step derivation
                1. Applied rewrites75.2%

                  \[\leadsto angle \cdot \color{blue}{\left(angle \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)} \]
                2. Step-by-step derivation
                  1. Applied rewrites87.3%

                    \[\leadsto \left(angle \cdot b\right) \cdot \left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right) \cdot b\right) \cdot \color{blue}{angle}\right) \]
                3. Recombined 3 regimes into one program.
                4. Final simplification71.7%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.65 \cdot 10^{-39}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{+152}:\\ \;\;\;\;\mathsf{fma}\left(angle \cdot angle, b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot \left(\pi \cdot \pi\right)\right)\right), a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\ \end{array} \]
                5. Add Preprocessing

                Alternative 15: 62.7% accurate, 12.1× speedup?

                \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 5.8 \cdot 10^{+119}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(angle\_m \cdot b\right) \cdot \left(angle\_m \cdot \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\ \end{array} \end{array} \]
                angle_m = (fabs.f64 angle)
                (FPCore (a b angle_m)
                 :precision binary64
                 (if (<= b 5.8e+119)
                   (* a a)
                   (* (* angle_m b) (* angle_m (* b (* (* PI PI) 3.08641975308642e-5))))))
                angle_m = fabs(angle);
                double code(double a, double b, double angle_m) {
                	double tmp;
                	if (b <= 5.8e+119) {
                		tmp = a * a;
                	} else {
                		tmp = (angle_m * b) * (angle_m * (b * ((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5)));
                	}
                	return tmp;
                }
                
                angle_m = Math.abs(angle);
                public static double code(double a, double b, double angle_m) {
                	double tmp;
                	if (b <= 5.8e+119) {
                		tmp = a * a;
                	} else {
                		tmp = (angle_m * b) * (angle_m * (b * ((Math.PI * Math.PI) * 3.08641975308642e-5)));
                	}
                	return tmp;
                }
                
                angle_m = math.fabs(angle)
                def code(a, b, angle_m):
                	tmp = 0
                	if b <= 5.8e+119:
                		tmp = a * a
                	else:
                		tmp = (angle_m * b) * (angle_m * (b * ((math.pi * math.pi) * 3.08641975308642e-5)))
                	return tmp
                
                angle_m = abs(angle)
                function code(a, b, angle_m)
                	tmp = 0.0
                	if (b <= 5.8e+119)
                		tmp = Float64(a * a);
                	else
                		tmp = Float64(Float64(angle_m * b) * Float64(angle_m * Float64(b * Float64(Float64(pi * pi) * 3.08641975308642e-5))));
                	end
                	return tmp
                end
                
                angle_m = abs(angle);
                function tmp_2 = code(a, b, angle_m)
                	tmp = 0.0;
                	if (b <= 5.8e+119)
                		tmp = a * a;
                	else
                		tmp = (angle_m * b) * (angle_m * (b * ((pi * pi) * 3.08641975308642e-5)));
                	end
                	tmp_2 = tmp;
                end
                
                angle_m = N[Abs[angle], $MachinePrecision]
                code[a_, b_, angle$95$m_] := If[LessEqual[b, 5.8e+119], N[(a * a), $MachinePrecision], N[(N[(angle$95$m * b), $MachinePrecision] * N[(angle$95$m * N[(b * N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                angle_m = \left|angle\right|
                
                \\
                \begin{array}{l}
                \mathbf{if}\;b \leq 5.8 \cdot 10^{+119}:\\
                \;\;\;\;a \cdot a\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(angle\_m \cdot b\right) \cdot \left(angle\_m \cdot \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if b < 5.80000000000000014e119

                  1. Initial program 84.1%

                    \[{\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. Add Preprocessing
                  3. Taylor expanded in angle around 0

                    \[\leadsto \color{blue}{{a}^{2}} \]
                  4. Step-by-step derivation
                    1. unpow2N/A

                      \[\leadsto \color{blue}{a \cdot a} \]
                    2. lower-*.f6468.3

                      \[\leadsto \color{blue}{a \cdot a} \]
                  5. Applied rewrites68.3%

                    \[\leadsto \color{blue}{a \cdot a} \]

                  if 5.80000000000000014e119 < b

                  1. Initial program 93.0%

                    \[{\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. Add Preprocessing
                  3. Step-by-step derivation
                    1. lift-*.f64N/A

                      \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                    2. lift-/.f64N/A

                      \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                    3. associate-*r/N/A

                      \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                    4. clear-numN/A

                      \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                    5. lower-/.f64N/A

                      \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                    6. lower-/.f64N/A

                      \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                    7. lower-*.f6493.1

                      \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\color{blue}{\pi \cdot angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
                  4. Applied rewrites93.1%

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

                    \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2}} \]
                  6. Step-by-step derivation
                    1. lower-fma.f64N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {a}^{2}\right)} \]
                  7. Applied rewrites51.0%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)} \]
                  8. Taylor expanded in b around inf

                    \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                  9. Step-by-step derivation
                    1. Applied rewrites71.0%

                      \[\leadsto angle \cdot \color{blue}{\left(angle \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)} \]
                    2. Step-by-step derivation
                      1. Applied rewrites80.5%

                        \[\leadsto \left(angle \cdot b\right) \cdot \left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right) \cdot b\right) \cdot \color{blue}{angle}\right) \]
                    3. Recombined 2 regimes into one program.
                    4. Final simplification70.6%

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

                    Alternative 16: 62.1% accurate, 12.1× speedup?

                    \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 5.8 \cdot 10^{+119}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;angle\_m \cdot \left(\left(b \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\pi \cdot b\right)\right)\right)\right)\\ \end{array} \end{array} \]
                    angle_m = (fabs.f64 angle)
                    (FPCore (a b angle_m)
                     :precision binary64
                     (if (<= b 5.8e+119)
                       (* a a)
                       (* angle_m (* (* b 3.08641975308642e-5) (* angle_m (* PI (* PI b)))))))
                    angle_m = fabs(angle);
                    double code(double a, double b, double angle_m) {
                    	double tmp;
                    	if (b <= 5.8e+119) {
                    		tmp = a * a;
                    	} else {
                    		tmp = angle_m * ((b * 3.08641975308642e-5) * (angle_m * (((double) M_PI) * (((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 <= 5.8e+119) {
                    		tmp = a * a;
                    	} else {
                    		tmp = angle_m * ((b * 3.08641975308642e-5) * (angle_m * (Math.PI * (Math.PI * b))));
                    	}
                    	return tmp;
                    }
                    
                    angle_m = math.fabs(angle)
                    def code(a, b, angle_m):
                    	tmp = 0
                    	if b <= 5.8e+119:
                    		tmp = a * a
                    	else:
                    		tmp = angle_m * ((b * 3.08641975308642e-5) * (angle_m * (math.pi * (math.pi * b))))
                    	return tmp
                    
                    angle_m = abs(angle)
                    function code(a, b, angle_m)
                    	tmp = 0.0
                    	if (b <= 5.8e+119)
                    		tmp = Float64(a * a);
                    	else
                    		tmp = Float64(angle_m * Float64(Float64(b * 3.08641975308642e-5) * Float64(angle_m * Float64(pi * Float64(pi * b)))));
                    	end
                    	return tmp
                    end
                    
                    angle_m = abs(angle);
                    function tmp_2 = code(a, b, angle_m)
                    	tmp = 0.0;
                    	if (b <= 5.8e+119)
                    		tmp = a * a;
                    	else
                    		tmp = angle_m * ((b * 3.08641975308642e-5) * (angle_m * (pi * (pi * b))));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    angle_m = N[Abs[angle], $MachinePrecision]
                    code[a_, b_, angle$95$m_] := If[LessEqual[b, 5.8e+119], N[(a * a), $MachinePrecision], N[(angle$95$m * N[(N[(b * 3.08641975308642e-5), $MachinePrecision] * N[(angle$95$m * N[(Pi * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    angle_m = \left|angle\right|
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;b \leq 5.8 \cdot 10^{+119}:\\
                    \;\;\;\;a \cdot a\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;angle\_m \cdot \left(\left(b \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\pi \cdot b\right)\right)\right)\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if b < 5.80000000000000014e119

                      1. Initial program 84.1%

                        \[{\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. Add Preprocessing
                      3. Taylor expanded in angle around 0

                        \[\leadsto \color{blue}{{a}^{2}} \]
                      4. Step-by-step derivation
                        1. unpow2N/A

                          \[\leadsto \color{blue}{a \cdot a} \]
                        2. lower-*.f6468.3

                          \[\leadsto \color{blue}{a \cdot a} \]
                      5. Applied rewrites68.3%

                        \[\leadsto \color{blue}{a \cdot a} \]

                      if 5.80000000000000014e119 < b

                      1. Initial program 93.0%

                        \[{\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. Add Preprocessing
                      3. Step-by-step derivation
                        1. lift-*.f64N/A

                          \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                        2. lift-/.f64N/A

                          \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                        3. associate-*r/N/A

                          \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                        4. clear-numN/A

                          \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                        5. lower-/.f64N/A

                          \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                        6. lower-/.f64N/A

                          \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                        7. lower-*.f6493.1

                          \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\color{blue}{\pi \cdot angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
                      4. Applied rewrites93.1%

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

                        \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2}} \]
                      6. Step-by-step derivation
                        1. lower-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {a}^{2}\right)} \]
                      7. Applied rewrites51.0%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)} \]
                      8. Taylor expanded in b around inf

                        \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                      9. Step-by-step derivation
                        1. Applied rewrites71.0%

                          \[\leadsto angle \cdot \color{blue}{\left(angle \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)} \]
                        2. Step-by-step derivation
                          1. Applied rewrites76.8%

                            \[\leadsto angle \cdot \left(\left(b \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\left(\pi \cdot \left(\pi \cdot b\right)\right) \cdot \color{blue}{angle}\right)\right) \]
                        3. Recombined 2 regimes into one program.
                        4. Final simplification69.9%

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

                        Alternative 17: 61.4% accurate, 12.1× speedup?

                        \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 5.8 \cdot 10^{+119}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;angle\_m \cdot \left(angle\_m \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
                        angle_m = (fabs.f64 angle)
                        (FPCore (a b angle_m)
                         :precision binary64
                         (if (<= b 5.8e+119)
                           (* a a)
                           (* angle_m (* angle_m (* b (* 3.08641975308642e-5 (* b (* PI PI))))))))
                        angle_m = fabs(angle);
                        double code(double a, double b, double angle_m) {
                        	double tmp;
                        	if (b <= 5.8e+119) {
                        		tmp = a * a;
                        	} else {
                        		tmp = angle_m * (angle_m * (b * (3.08641975308642e-5 * (b * (((double) M_PI) * ((double) M_PI))))));
                        	}
                        	return tmp;
                        }
                        
                        angle_m = Math.abs(angle);
                        public static double code(double a, double b, double angle_m) {
                        	double tmp;
                        	if (b <= 5.8e+119) {
                        		tmp = a * a;
                        	} else {
                        		tmp = angle_m * (angle_m * (b * (3.08641975308642e-5 * (b * (Math.PI * Math.PI)))));
                        	}
                        	return tmp;
                        }
                        
                        angle_m = math.fabs(angle)
                        def code(a, b, angle_m):
                        	tmp = 0
                        	if b <= 5.8e+119:
                        		tmp = a * a
                        	else:
                        		tmp = angle_m * (angle_m * (b * (3.08641975308642e-5 * (b * (math.pi * math.pi)))))
                        	return tmp
                        
                        angle_m = abs(angle)
                        function code(a, b, angle_m)
                        	tmp = 0.0
                        	if (b <= 5.8e+119)
                        		tmp = Float64(a * a);
                        	else
                        		tmp = Float64(angle_m * Float64(angle_m * Float64(b * Float64(3.08641975308642e-5 * Float64(b * Float64(pi * pi))))));
                        	end
                        	return tmp
                        end
                        
                        angle_m = abs(angle);
                        function tmp_2 = code(a, b, angle_m)
                        	tmp = 0.0;
                        	if (b <= 5.8e+119)
                        		tmp = a * a;
                        	else
                        		tmp = angle_m * (angle_m * (b * (3.08641975308642e-5 * (b * (pi * pi)))));
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        angle_m = N[Abs[angle], $MachinePrecision]
                        code[a_, b_, angle$95$m_] := If[LessEqual[b, 5.8e+119], N[(a * a), $MachinePrecision], N[(angle$95$m * N[(angle$95$m * N[(b * N[(3.08641975308642e-5 * N[(b * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        angle_m = \left|angle\right|
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;b \leq 5.8 \cdot 10^{+119}:\\
                        \;\;\;\;a \cdot a\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;angle\_m \cdot \left(angle\_m \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if b < 5.80000000000000014e119

                          1. Initial program 84.1%

                            \[{\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. Add Preprocessing
                          3. Taylor expanded in angle around 0

                            \[\leadsto \color{blue}{{a}^{2}} \]
                          4. Step-by-step derivation
                            1. unpow2N/A

                              \[\leadsto \color{blue}{a \cdot a} \]
                            2. lower-*.f6468.3

                              \[\leadsto \color{blue}{a \cdot a} \]
                          5. Applied rewrites68.3%

                            \[\leadsto \color{blue}{a \cdot a} \]

                          if 5.80000000000000014e119 < b

                          1. Initial program 93.0%

                            \[{\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. Add Preprocessing
                          3. Step-by-step derivation
                            1. lift-*.f64N/A

                              \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                            2. lift-/.f64N/A

                              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                            3. associate-*r/N/A

                              \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                            4. clear-numN/A

                              \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                            5. lower-/.f64N/A

                              \[\leadsto {\left(a \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                            6. lower-/.f64N/A

                              \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\color{blue}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                            7. lower-*.f6493.1

                              \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\color{blue}{\pi \cdot angle}}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
                          4. Applied rewrites93.1%

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

                            \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2}} \]
                          6. Step-by-step derivation
                            1. lower-fma.f64N/A

                              \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {a}^{2}\right)} \]
                          7. Applied rewrites51.0%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)} \]
                          8. Taylor expanded in b around inf

                            \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                          9. Step-by-step derivation
                            1. Applied rewrites71.0%

                              \[\leadsto angle \cdot \color{blue}{\left(angle \cdot \left(b \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)} \]
                          10. Recombined 2 regimes into one program.
                          11. Add Preprocessing

                          Alternative 18: 56.5% accurate, 74.7× speedup?

                          \[\begin{array}{l} angle_m = \left|angle\right| \\ a \cdot a \end{array} \]
                          angle_m = (fabs.f64 angle)
                          (FPCore (a b angle_m) :precision binary64 (* a a))
                          angle_m = fabs(angle);
                          double code(double a, double b, double angle_m) {
                          	return a * a;
                          }
                          
                          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 * a
                          end function
                          
                          angle_m = Math.abs(angle);
                          public static double code(double a, double b, double angle_m) {
                          	return a * a;
                          }
                          
                          angle_m = math.fabs(angle)
                          def code(a, b, angle_m):
                          	return a * a
                          
                          angle_m = abs(angle)
                          function code(a, b, angle_m)
                          	return Float64(a * a)
                          end
                          
                          angle_m = abs(angle);
                          function tmp = code(a, b, angle_m)
                          	tmp = a * a;
                          end
                          
                          angle_m = N[Abs[angle], $MachinePrecision]
                          code[a_, b_, angle$95$m_] := N[(a * a), $MachinePrecision]
                          
                          \begin{array}{l}
                          angle_m = \left|angle\right|
                          
                          \\
                          a \cdot a
                          \end{array}
                          
                          Derivation
                          1. Initial program 85.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. Add Preprocessing
                          3. Taylor expanded in angle around 0

                            \[\leadsto \color{blue}{{a}^{2}} \]
                          4. Step-by-step derivation
                            1. unpow2N/A

                              \[\leadsto \color{blue}{a \cdot a} \]
                            2. lower-*.f6460.8

                              \[\leadsto \color{blue}{a \cdot a} \]
                          5. Applied rewrites60.8%

                            \[\leadsto \color{blue}{a \cdot a} \]
                          6. Add Preprocessing

                          Reproduce

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