ab-angle->ABCF A

Percentage Accurate: 79.6% → 79.6%
Time: 19.6s
Alternatives: 13
Speedup: 2.0×

Specification

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

\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos 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 13 alternatives:

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

Initial Program: 79.6% accurate, 1.0× speedup?

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

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

Alternative 1: 79.6% accurate, 2.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5, a \cdot \left(\cos \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right) \cdot -0.5\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5\right)\right)}}\\


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

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(angle \cdot \left(a \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} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    6. Applied egg-rr81.9%

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

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

    1. Initial program 56.1%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. flip-+N/A

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} - {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} - {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}}} \]
    4. Applied egg-rr56.3%

      \[\leadsto \color{blue}{\frac{1}{\frac{1}{\mathsf{fma}\left(a, a \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\right)}}} \]
    5. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)}, \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}} \]
      2. distribute-lft-inN/A

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2}, a \cdot \left(\mathsf{neg}\left(\color{blue}{\cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \frac{1}{2}}\right)\right)\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}} \]
      6. distribute-rgt-neg-inN/A

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

        \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2}, a \cdot \color{blue}{\left(\cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)}\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}} \]
    6. Applied egg-rr56.3%

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

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

        \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5, a \cdot \left(\cos \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right) \cdot -0.5\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \color{blue}{1}\right)\right)}} \]
    9. Recombined 2 regimes into one program.
    10. Final simplification75.2%

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

    Alternative 2: 79.5% accurate, 0.9× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \sin \left(\left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \sqrt{\pi \cdot \sqrt{\pi}}\right) \cdot \sqrt{\sqrt{\pi}}\right)\right)}^{2} + {\left(b \cdot \cos \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
        (sin
         (*
          (* (* angle_m 0.005555555555555556) (sqrt (* PI (sqrt PI))))
          (sqrt (sqrt PI)))))
       2.0)
      (pow (* b (cos (* PI (/ angle_m 180.0)))) 2.0)))
    angle_m = fabs(angle);
    double code(double a, double b, double angle_m) {
    	return pow((a * sin((((angle_m * 0.005555555555555556) * sqrt((((double) M_PI) * sqrt(((double) M_PI))))) * sqrt(sqrt(((double) M_PI)))))), 2.0) + pow((b * cos((((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.sin((((angle_m * 0.005555555555555556) * Math.sqrt((Math.PI * Math.sqrt(Math.PI)))) * Math.sqrt(Math.sqrt(Math.PI))))), 2.0) + Math.pow((b * Math.cos((Math.PI * (angle_m / 180.0)))), 2.0);
    }
    
    angle_m = math.fabs(angle)
    def code(a, b, angle_m):
    	return math.pow((a * math.sin((((angle_m * 0.005555555555555556) * math.sqrt((math.pi * math.sqrt(math.pi)))) * math.sqrt(math.sqrt(math.pi))))), 2.0) + math.pow((b * math.cos((math.pi * (angle_m / 180.0)))), 2.0)
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	return Float64((Float64(a * sin(Float64(Float64(Float64(angle_m * 0.005555555555555556) * sqrt(Float64(pi * sqrt(pi)))) * sqrt(sqrt(pi))))) ^ 2.0) + (Float64(b * cos(Float64(pi * Float64(angle_m / 180.0)))) ^ 2.0))
    end
    
    angle_m = abs(angle);
    function tmp = code(a, b, angle_m)
    	tmp = ((a * sin((((angle_m * 0.005555555555555556) * sqrt((pi * sqrt(pi)))) * sqrt(sqrt(pi))))) ^ 2.0) + ((b * cos((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[Sin[N[(N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[Sqrt[N[(Pi * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[Sqrt[Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[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 \sin \left(\left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \sqrt{\pi \cdot \sqrt{\pi}}\right) \cdot \sqrt{\sqrt{\pi}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2}
    \end{array}
    
    Derivation
    1. Initial program 79.3%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrtN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\left(\left(angle \cdot \left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
    6. Applied egg-rr79.4%

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

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

    Alternative 3: 79.6% accurate, 1.0× speedup?

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

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

    Alternative 4: 79.6% accurate, 1.0× speedup?

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

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 79.6% accurate, 1.0× speedup?

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

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/N/A

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

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

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

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

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

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

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

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

    Alternative 6: 79.4% accurate, 1.2× speedup?

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

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrtN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\left(\left(angle \cdot \left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
    6. Applied egg-rr79.4%

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\left(angle \cdot \frac{1}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)\right)}^{2} + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
    8. Step-by-step derivation
      1. Simplified79.1%

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

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

      Alternative 7: 79.5% accurate, 1.4× speedup?

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

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

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
      4. Step-by-step derivation
        1. Simplified79.0%

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

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

        Alternative 8: 78.3% accurate, 2.2× speedup?

        \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 100000000000:\\ \;\;\;\;\frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(angle\_m, angle\_m \cdot \left(a \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right), 0\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5, a \cdot \left(\cos \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right) \cdot -0.5\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5\right)\right)}}\\ \end{array} \end{array} \]
        angle_m = (fabs.f64 angle)
        (FPCore (a b angle_m)
         :precision binary64
         (if (<= (/ angle_m 180.0) 100000000000.0)
           (/
            1.0
            (/
             1.0
             (fma
              a
              (fma angle_m (* angle_m (* a (* (* PI PI) 3.08641975308642e-5))) 0.0)
              (*
               (* b b)
               (+
                0.5
                (* 0.5 (cos (* 2.0 (* (* angle_m 0.005555555555555556) PI)))))))))
           (/
            1.0
            (/
             1.0
             (fma
              a
              (fma a 0.5 (* a (* (cos (* PI (* angle_m 0.011111111111111112))) -0.5)))
              (* (* b b) (+ 0.5 0.5)))))))
        angle_m = fabs(angle);
        double code(double a, double b, double angle_m) {
        	double tmp;
        	if ((angle_m / 180.0) <= 100000000000.0) {
        		tmp = 1.0 / (1.0 / fma(a, fma(angle_m, (angle_m * (a * ((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5))), 0.0), ((b * b) * (0.5 + (0.5 * cos((2.0 * ((angle_m * 0.005555555555555556) * ((double) M_PI)))))))));
        	} else {
        		tmp = 1.0 / (1.0 / fma(a, fma(a, 0.5, (a * (cos((((double) M_PI) * (angle_m * 0.011111111111111112))) * -0.5))), ((b * b) * (0.5 + 0.5))));
        	}
        	return tmp;
        }
        
        angle_m = abs(angle)
        function code(a, b, angle_m)
        	tmp = 0.0
        	if (Float64(angle_m / 180.0) <= 100000000000.0)
        		tmp = Float64(1.0 / Float64(1.0 / fma(a, fma(angle_m, Float64(angle_m * Float64(a * Float64(Float64(pi * pi) * 3.08641975308642e-5))), 0.0), Float64(Float64(b * b) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(Float64(angle_m * 0.005555555555555556) * pi)))))))));
        	else
        		tmp = Float64(1.0 / Float64(1.0 / fma(a, fma(a, 0.5, Float64(a * Float64(cos(Float64(pi * Float64(angle_m * 0.011111111111111112))) * -0.5))), Float64(Float64(b * b) * Float64(0.5 + 0.5)))));
        	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], 100000000000.0], N[(1.0 / N[(1.0 / N[(a * N[(angle$95$m * N[(angle$95$m * N[(a * N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 0.0), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / N[(a * N[(a * 0.5 + N[(a * N[(N[Cos[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(0.5 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        angle_m = \left|angle\right|
        
        \\
        \begin{array}{l}
        \mathbf{if}\;\frac{angle\_m}{180} \leq 100000000000:\\
        \;\;\;\;\frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(angle\_m, angle\_m \cdot \left(a \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right), 0\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\right)}}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5, a \cdot \left(\cos \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right) \cdot -0.5\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5\right)\right)}}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 angle #s(literal 180 binary64)) < 1e11

          1. Initial program 87.5%

            \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. flip-+N/A

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

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

              \[\leadsto \color{blue}{\frac{1}{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} - {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} - {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}}} \]
          4. Applied egg-rr71.8%

            \[\leadsto \color{blue}{\frac{1}{\frac{1}{\mathsf{fma}\left(a, a \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\right)}}} \]
          5. Step-by-step derivation
            1. sub-negN/A

              \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)}, \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}} \]
            2. distribute-lft-inN/A

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

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

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

              \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2}, a \cdot \left(\mathsf{neg}\left(\color{blue}{\cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \frac{1}{2}}\right)\right)\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}} \]
            6. distribute-rgt-neg-inN/A

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

              \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2}, a \cdot \color{blue}{\left(\cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)}\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}} \]
          6. Applied egg-rr71.8%

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, \color{blue}{angle \cdot \left(angle \cdot \left(\frac{1}{32400} \cdot \left(a \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)} + \left(\frac{1}{2} \cdot a + \frac{-1}{2} \cdot a\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}} \]
            9. distribute-rgt-outN/A

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

              \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, angle \cdot \left(angle \cdot \left(\frac{1}{32400} \cdot \left(a \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right) + a \cdot \color{blue}{0}, \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}} \]
            11. mul0-rgtN/A

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

              \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(angle, angle \cdot \left(\frac{1}{32400} \cdot \left(a \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right), 0\right)}, \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}} \]
          9. Simplified80.5%

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

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

          1. Initial program 56.1%

            \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. flip-+N/A

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

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

              \[\leadsto \color{blue}{\frac{1}{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} - {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} - {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}}} \]
          4. Applied egg-rr56.3%

            \[\leadsto \color{blue}{\frac{1}{\frac{1}{\mathsf{fma}\left(a, a \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\right)}}} \]
          5. Step-by-step derivation
            1. sub-negN/A

              \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)}, \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}} \]
            2. distribute-lft-inN/A

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

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

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

              \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2}, a \cdot \left(\mathsf{neg}\left(\color{blue}{\cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \frac{1}{2}}\right)\right)\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}} \]
            6. distribute-rgt-neg-inN/A

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

              \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2}, a \cdot \color{blue}{\left(\cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)}\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}} \]
          6. Applied egg-rr56.3%

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

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

              \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5, a \cdot \left(\cos \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right) \cdot -0.5\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \color{blue}{1}\right)\right)}} \]
          9. Recombined 2 regimes into one program.
          10. Final simplification74.2%

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

          Alternative 9: 57.3% accurate, 2.6× speedup?

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

            1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(\left(\frac{1}{32400} \cdot {a}^{2}\right) \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \left(\frac{-1}{32400} \cdot {b}^{2}\right) \cdot \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}\right) + {b}^{2} \]
              9. distribute-rgt-outN/A

                \[\leadsto \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \left(\frac{1}{32400} \cdot {a}^{2} + \frac{-1}{32400} \cdot {b}^{2}\right)} + {b}^{2} \]
            5. Simplified45.2%

              \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right), \mathsf{fma}\left(b \cdot b, -3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right), b \cdot b\right)} \]
            6. Step-by-step derivation
              1. *-commutativeN/A

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

                \[\leadsto \color{blue}{\left(\left(\left(b \cdot b\right) \cdot \frac{-1}{32400} + \left(a \cdot a\right) \cdot \frac{1}{32400}\right) \cdot angle\right) \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)} + b \cdot b \]
              3. accelerator-lowering-fma.f64N/A

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

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

            if 2.05e21 < b

            1. Initial program 89.5%

              \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. flip-+N/A

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

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

                \[\leadsto \color{blue}{\frac{1}{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} - {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} - {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}}} \]
            4. Applied egg-rr86.5%

              \[\leadsto \color{blue}{\frac{1}{\frac{1}{\mathsf{fma}\left(a, a \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\right)}}} \]
            5. Step-by-step derivation
              1. sub-negN/A

                \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)}, \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}} \]
              2. distribute-lft-inN/A

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

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

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

                \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2}, a \cdot \left(\mathsf{neg}\left(\color{blue}{\cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \frac{1}{2}}\right)\right)\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}} \]
              6. distribute-rgt-neg-inN/A

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

                \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2}, a \cdot \color{blue}{\left(\cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)}\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}} \]
            6. Applied egg-rr86.5%

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

              \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2}, a \cdot \left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{90} \cdot angle\right)\right) \cdot \frac{-1}{2}\right)\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \color{blue}{1}\right)\right)}} \]
            8. Step-by-step derivation
              1. Simplified86.6%

                \[\leadsto \frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5, a \cdot \left(\cos \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right) \cdot -0.5\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \color{blue}{1}\right)\right)}} \]
            9. Recombined 2 regimes into one program.
            10. Final simplification60.6%

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

            Alternative 10: 56.3% accurate, 8.3× speedup?

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

              1. Initial program 75.7%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\left(\frac{1}{32400} \cdot {a}^{2}\right) \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \left(\frac{-1}{32400} \cdot {b}^{2}\right) \cdot \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}\right) + {b}^{2} \]
                9. distribute-rgt-outN/A

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right), \mathsf{fma}\left(b \cdot b, -3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right), b \cdot b\right)} \]
              6. Step-by-step derivation
                1. *-commutativeN/A

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

                  \[\leadsto \color{blue}{\left(\left(\left(b \cdot b\right) \cdot \frac{-1}{32400} + \left(a \cdot a\right) \cdot \frac{1}{32400}\right) \cdot angle\right) \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)} + b \cdot b \]
                3. accelerator-lowering-fma.f64N/A

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

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

              if 2.70000000000000004e131 < b

              1. Initial program 100.0%

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

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

                  \[\leadsto \color{blue}{b \cdot b} \]
                2. *-lowering-*.f64100.0

                  \[\leadsto \color{blue}{b \cdot b} \]
              5. Simplified100.0%

                \[\leadsto \color{blue}{b \cdot b} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification59.3%

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

            Alternative 11: 62.5% accurate, 10.4× speedup?

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

              1. Initial program 76.1%

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

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

                  \[\leadsto \color{blue}{b \cdot b} \]
                2. *-lowering-*.f6459.4

                  \[\leadsto \color{blue}{b \cdot b} \]
              5. Simplified59.4%

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

              if 1.2999999999999999e-55 < a

              1. Initial program 85.2%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\left(\frac{1}{32400} \cdot {a}^{2}\right) \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \left(\frac{-1}{32400} \cdot {b}^{2}\right) \cdot \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}\right) + {b}^{2} \]
                9. distribute-rgt-outN/A

                  \[\leadsto \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \left(\frac{1}{32400} \cdot {a}^{2} + \frac{-1}{32400} \cdot {b}^{2}\right)} + {b}^{2} \]
              5. Simplified35.4%

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

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

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

                  \[\leadsto \mathsf{fma}\left(angle \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{{a}^{2} \cdot \frac{1}{32400}}, b \cdot b\right) \]
                3. unpow2N/A

                  \[\leadsto \mathsf{fma}\left(angle \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{\left(a \cdot a\right)} \cdot \frac{1}{32400}, b \cdot b\right) \]
                4. *-lowering-*.f6463.6

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

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

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

            Alternative 12: 60.4% accurate, 12.1× speedup?

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

              1. Initial program 75.8%

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

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

                  \[\leadsto \color{blue}{b \cdot b} \]
                2. *-lowering-*.f6460.4

                  \[\leadsto \color{blue}{b \cdot b} \]
              5. Simplified60.4%

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

              if 3.6999999999999998e104 < a

              1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\left(\frac{1}{32400} \cdot {a}^{2}\right) \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \left(\frac{-1}{32400} \cdot {b}^{2}\right) \cdot \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}\right) + {b}^{2} \]
                9. distribute-rgt-outN/A

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

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

                \[\leadsto \color{blue}{\frac{1}{32400} \cdot \left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
              7. Step-by-step derivation
                1. associate-*r*N/A

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

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

                  \[\leadsto \color{blue}{\left({a}^{2} \cdot \frac{1}{32400}\right)} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \]
                4. *-lowering-*.f64N/A

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

                  \[\leadsto \left(\color{blue}{\left(a \cdot a\right)} \cdot \frac{1}{32400}\right) \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \]
                6. *-lowering-*.f64N/A

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

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

                  \[\leadsto \left(\left(a \cdot a\right) \cdot \frac{1}{32400}\right) \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)}\right) \]
                9. unswap-sqrN/A

                  \[\leadsto \left(\left(a \cdot a\right) \cdot \frac{1}{32400}\right) \cdot \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
                10. *-lowering-*.f64N/A

                  \[\leadsto \left(\left(a \cdot a\right) \cdot \frac{1}{32400}\right) \cdot \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
                11. *-lowering-*.f64N/A

                  \[\leadsto \left(\left(a \cdot a\right) \cdot \frac{1}{32400}\right) \cdot \left(\color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \]
                12. PI-lowering-PI.f64N/A

                  \[\leadsto \left(\left(a \cdot a\right) \cdot \frac{1}{32400}\right) \cdot \left(\left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \]
                13. *-lowering-*.f64N/A

                  \[\leadsto \left(\left(a \cdot a\right) \cdot \frac{1}{32400}\right) \cdot \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right) \]
                14. PI-lowering-PI.f6460.0

                  \[\leadsto \left(\left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\left(angle \cdot \pi\right) \cdot \left(angle \cdot \color{blue}{\pi}\right)\right) \]
              8. Simplified60.0%

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

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

            Alternative 13: 57.4% accurate, 74.7× speedup?

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

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

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

                \[\leadsto \color{blue}{b \cdot b} \]
              2. *-lowering-*.f6454.9

                \[\leadsto \color{blue}{b \cdot b} \]
            5. Simplified54.9%

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

            Reproduce

            ?
            herbie shell --seed 2024199 
            (FPCore (a b angle)
              :name "ab-angle->ABCF A"
              :precision binary64
              (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (/ angle 180.0) PI))) 2.0)))