ab-angle->ABCF A

Percentage Accurate: 79.8% → 79.7%
Time: 17.7s
Alternatives: 15
Speedup: N/A×

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 15 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.8% 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.7% accurate, 2.0× speedup?

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

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

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


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

    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}{\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. lower-*.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. Simplified89.7%

      \[\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-rr89.8%

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

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

    1. Initial program 52.6%

      \[{\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. Applied egg-rr53.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-PI.f64N/A

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\color{blue}{\frac{1}{180}} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. associate-/r/N/A

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}\right)}, a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\frac{1}{\color{blue}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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) \]
      8. lift-/.f6447.8

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)}, a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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. Applied egg-rr47.8%

      \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)}, a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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) \]
    6. Applied egg-rr52.5%

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

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

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

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

    Alternative 2: 79.7% accurate, 0.5× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := a \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\\ t_1 := {\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3}\\ \mathsf{fma}\left(t\_0, t\_0, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{t\_1 \cdot t\_1}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle\_m}}\right)\right)\right)\right) \end{array} \end{array} \]
    angle_m = (fabs.f64 angle)
    (FPCore (a b angle_m)
     :precision binary64
     (let* ((t_0 (* a (sin (* (* angle_m 0.005555555555555556) PI))))
            (t_1 (pow (cbrt (sqrt PI)) 3.0)))
       (fma
        t_0
        t_0
        (*
         (* b b)
         (+
          0.5
          (*
           0.5
           (cos
            (*
             2.0
             (* (/ (sqrt (* t_1 t_1)) 180.0) (/ (sqrt PI) (/ 1.0 angle_m)))))))))))
    angle_m = fabs(angle);
    double code(double a, double b, double angle_m) {
    	double t_0 = a * sin(((angle_m * 0.005555555555555556) * ((double) M_PI)));
    	double t_1 = pow(cbrt(sqrt(((double) M_PI))), 3.0);
    	return fma(t_0, t_0, ((b * b) * (0.5 + (0.5 * cos((2.0 * ((sqrt((t_1 * t_1)) / 180.0) * (sqrt(((double) M_PI)) / (1.0 / angle_m)))))))));
    }
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	t_0 = Float64(a * sin(Float64(Float64(angle_m * 0.005555555555555556) * pi)))
    	t_1 = cbrt(sqrt(pi)) ^ 3.0
    	return fma(t_0, t_0, Float64(Float64(b * b) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(Float64(sqrt(Float64(t_1 * t_1)) / 180.0) * Float64(sqrt(pi) / Float64(1.0 / angle_m)))))))))
    end
    
    angle_m = N[Abs[angle], $MachinePrecision]
    code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(a * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Power[N[Sqrt[Pi], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(N[(b * b), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(N[(N[Sqrt[N[(t$95$1 * t$95$1), $MachinePrecision]], $MachinePrecision] / 180.0), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    \begin{array}{l}
    t_0 := a \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\\
    t_1 := {\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3}\\
    \mathsf{fma}\left(t\_0, t\_0, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{t\_1 \cdot t\_1}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle\_m}}\right)\right)\right)\right)
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 83.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. Applied egg-rr83.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
    4. Step-by-step derivation
      1. lift-PI.f64N/A

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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 \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right)\right) \]
      2. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\mathsf{PI}\left(\right)}}{180} \cdot \color{blue}{\frac{\sqrt{\mathsf{PI}\left(\right)}}{\frac{1}{angle}}}\right)\right)\right)\right) \]
      15. lower-/.f6483.7

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \frac{\sqrt{\pi}}{\color{blue}{\frac{1}{angle}}}\right)\right)\right)\right) \]
    5. Applied egg-rr83.7%

      \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \color{blue}{\left(\frac{\sqrt{\pi}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle}}\right)}\right)\right)\right) \]
    6. Step-by-step derivation
      1. add-cube-cbrtN/A

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}}}}{180} \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{\frac{1}{angle}}\right)\right)\right)\right) \]
      2. pow3N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{\sqrt{{\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3} \cdot \color{blue}{{\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3}}}}{180} \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{\frac{1}{angle}}\right)\right)\right)\right) \]
      13. lower-cbrt.f6483.7

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{{\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3} \cdot {\color{blue}{\left(\sqrt[3]{\sqrt{\pi}}\right)}}^{3}}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle}}\right)\right)\right)\right) \]
    7. Applied egg-rr83.7%

      \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\color{blue}{{\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3} \cdot {\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3}}}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle}}\right)\right)\right)\right) \]
    8. Add Preprocessing

    Alternative 3: 79.8% accurate, 1.1× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := a \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\\ \mathsf{fma}\left(t\_0, t\_0, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \frac{1}{\frac{1}{angle\_m \cdot \sqrt{\pi}}}\right)\right)\right)\right) \end{array} \end{array} \]
    angle_m = (fabs.f64 angle)
    (FPCore (a b angle_m)
     :precision binary64
     (let* ((t_0 (* a (sin (* (* angle_m 0.005555555555555556) PI)))))
       (fma
        t_0
        t_0
        (*
         (* b b)
         (+
          0.5
          (*
           0.5
           (cos
            (*
             2.0
             (* (/ (sqrt PI) 180.0) (/ 1.0 (/ 1.0 (* angle_m (sqrt PI)))))))))))))
    angle_m = fabs(angle);
    double code(double a, double b, double angle_m) {
    	double t_0 = a * sin(((angle_m * 0.005555555555555556) * ((double) M_PI)));
    	return fma(t_0, t_0, ((b * b) * (0.5 + (0.5 * cos((2.0 * ((sqrt(((double) M_PI)) / 180.0) * (1.0 / (1.0 / (angle_m * sqrt(((double) M_PI))))))))))));
    }
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	t_0 = Float64(a * sin(Float64(Float64(angle_m * 0.005555555555555556) * pi)))
    	return fma(t_0, t_0, Float64(Float64(b * b) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(Float64(sqrt(pi) / 180.0) * Float64(1.0 / Float64(1.0 / Float64(angle_m * sqrt(pi)))))))))))
    end
    
    angle_m = N[Abs[angle], $MachinePrecision]
    code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(a * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(N[(b * b), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(N[(N[Sqrt[Pi], $MachinePrecision] / 180.0), $MachinePrecision] * N[(1.0 / N[(1.0 / N[(angle$95$m * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    \begin{array}{l}
    t_0 := a \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\\
    \mathsf{fma}\left(t\_0, t\_0, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \frac{1}{\frac{1}{angle\_m \cdot \sqrt{\pi}}}\right)\right)\right)\right)
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 83.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. Applied egg-rr83.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
    4. Step-by-step derivation
      1. lift-PI.f64N/A

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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 \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right)\right) \]
      2. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\mathsf{PI}\left(\right)}}{180} \cdot \color{blue}{\frac{\sqrt{\mathsf{PI}\left(\right)}}{\frac{1}{angle}}}\right)\right)\right)\right) \]
      15. lower-/.f6483.7

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \frac{\sqrt{\pi}}{\color{blue}{\frac{1}{angle}}}\right)\right)\right)\right) \]
    5. Applied egg-rr83.7%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \frac{1}{\color{blue}{\frac{1}{\frac{\sqrt{\pi}}{\frac{1}{angle}}}}}\right)\right)\right)\right) \]
      9. lift-/.f64N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \frac{1}{\frac{1}{\color{blue}{\sqrt{\pi} \cdot angle}}}\right)\right)\right)\right) \]
    7. Applied egg-rr83.7%

      \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \color{blue}{\frac{1}{\frac{1}{\sqrt{\pi} \cdot angle}}}\right)\right)\right)\right) \]
    8. Final simplification83.7%

      \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \frac{1}{\frac{1}{angle \cdot \sqrt{\pi}}}\right)\right)\right)\right) \]
    9. Add Preprocessing

    Alternative 4: 79.8% accurate, 1.1× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := a \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\\ \mathsf{fma}\left(t\_0, t\_0, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \left(angle\_m \cdot \sqrt{\pi}\right)\right)\right)\right)\right) \end{array} \end{array} \]
    angle_m = (fabs.f64 angle)
    (FPCore (a b angle_m)
     :precision binary64
     (let* ((t_0 (* a (sin (* (* angle_m 0.005555555555555556) PI)))))
       (fma
        t_0
        t_0
        (*
         (* b b)
         (+
          0.5
          (* 0.5 (cos (* 2.0 (* (/ (sqrt PI) 180.0) (* angle_m (sqrt PI)))))))))))
    angle_m = fabs(angle);
    double code(double a, double b, double angle_m) {
    	double t_0 = a * sin(((angle_m * 0.005555555555555556) * ((double) M_PI)));
    	return fma(t_0, t_0, ((b * b) * (0.5 + (0.5 * cos((2.0 * ((sqrt(((double) M_PI)) / 180.0) * (angle_m * sqrt(((double) M_PI))))))))));
    }
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	t_0 = Float64(a * sin(Float64(Float64(angle_m * 0.005555555555555556) * pi)))
    	return fma(t_0, t_0, Float64(Float64(b * b) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(Float64(sqrt(pi) / 180.0) * Float64(angle_m * sqrt(pi)))))))))
    end
    
    angle_m = N[Abs[angle], $MachinePrecision]
    code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(a * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(N[(b * b), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(N[(N[Sqrt[Pi], $MachinePrecision] / 180.0), $MachinePrecision] * N[(angle$95$m * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    \begin{array}{l}
    t_0 := a \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\\
    \mathsf{fma}\left(t\_0, t\_0, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \left(angle\_m \cdot \sqrt{\pi}\right)\right)\right)\right)\right)
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 83.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. Applied egg-rr83.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
    4. Step-by-step derivation
      1. lift-PI.f64N/A

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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 \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right)\right) \]
      2. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\mathsf{PI}\left(\right)}}{180} \cdot \color{blue}{\frac{\sqrt{\mathsf{PI}\left(\right)}}{\frac{1}{angle}}}\right)\right)\right)\right) \]
      15. lower-/.f6483.7

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \frac{\sqrt{\pi}}{\color{blue}{\frac{1}{angle}}}\right)\right)\right)\right) \]
    5. Applied egg-rr83.7%

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

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\mathsf{PI}\left(\right)}}{180} \cdot \color{blue}{\left(\frac{\sqrt{\mathsf{PI}\left(\right)}}{1} \cdot angle\right)}\right)\right)\right)\right) \]
      4. /-rgt-identityN/A

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

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \color{blue}{\left(\sqrt{\pi} \cdot angle\right)}\right)\right)\right)\right) \]
    7. Applied egg-rr83.7%

      \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \color{blue}{\left(\sqrt{\pi} \cdot angle\right)}\right)\right)\right)\right) \]
    8. Final simplification83.7%

      \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \left(angle \cdot \sqrt{\pi}\right)\right)\right)\right)\right) \]
    9. Add Preprocessing

    Alternative 5: 79.6% accurate, 1.9× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := a \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\\ \mathsf{fma}\left(t\_0, t\_0, b \cdot b\right) \end{array} \end{array} \]
    angle_m = (fabs.f64 angle)
    (FPCore (a b angle_m)
     :precision binary64
     (let* ((t_0 (* a (sin (* (* angle_m 0.005555555555555556) PI)))))
       (fma t_0 t_0 (* b b))))
    angle_m = fabs(angle);
    double code(double a, double b, double angle_m) {
    	double t_0 = a * sin(((angle_m * 0.005555555555555556) * ((double) M_PI)));
    	return fma(t_0, t_0, (b * b));
    }
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	t_0 = Float64(a * sin(Float64(Float64(angle_m * 0.005555555555555556) * pi)))
    	return fma(t_0, t_0, Float64(b * b))
    end
    
    angle_m = N[Abs[angle], $MachinePrecision]
    code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(a * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(b * b), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    \begin{array}{l}
    t_0 := a \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\\
    \mathsf{fma}\left(t\_0, t\_0, b \cdot b\right)
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 83.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. Applied egg-rr83.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
    4. Taylor expanded in angle around 0

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

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), \left(b \cdot b\right) \cdot \color{blue}{1}\right) \]
      2. Final simplification83.6%

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), b \cdot b\right) \]
      3. Add Preprocessing

      Alternative 6: 78.6% accurate, 2.6× speedup?

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

        1. Initial program 91.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. Applied egg-rr91.0%

          \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-PI.f64N/A

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. associate-*r*N/A

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. metadata-evalN/A

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\color{blue}{\frac{1}{180}} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-*.f64N/A

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. associate-/r/N/A

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}\right)}, a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-/.f64N/A

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\frac{1}{\color{blue}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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) \]
          8. lift-/.f6490.1

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)}, a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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. Applied egg-rr90.1%

          \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)}, a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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) \]
        6. Applied egg-rr71.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right), b \cdot b, a \cdot \left(angle \cdot \left(angle \cdot \left(a \cdot \left(\frac{1}{32400} \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right) \]
          17. lower-PI.f6488.7

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right), b \cdot b, a \cdot \left(angle \cdot \left(angle \cdot \left(a \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right)\right)\right)\right) \]
        9. Simplified88.7%

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

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

        1. Initial program 53.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. Applied egg-rr53.7%

          \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-PI.f64N/A

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. associate-*r*N/A

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. metadata-evalN/A

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\color{blue}{\frac{1}{180}} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-*.f64N/A

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. associate-/r/N/A

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}\right)}, a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-/.f64N/A

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\frac{1}{\color{blue}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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) \]
          8. lift-/.f6448.4

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)}, a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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. Applied egg-rr48.4%

          \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)}, a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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) \]
        6. Applied egg-rr53.2%

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

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

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

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

        Alternative 7: 75.8% accurate, 2.6× speedup?

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

          1. Initial program 91.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. Step-by-step derivation
            1. lift-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{angle}{180} \cdot \color{blue}{\mathsf{PI}\left(\right)}\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(\frac{angle \cdot \mathsf{PI}\left(\right)}{180}\right)}\right)}^{2} \]
            3. clear-numN/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{1}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}\right)}\right)}^{2} \]
            4. lower-/.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{1}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}\right)}\right)}^{2} \]
            5. lower-/.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{1}{\color{blue}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}}\right)\right)}^{2} \]
            6. lower-*.f6491.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(a \cdot a\right) \cdot \left(\left(\left(\left(angle \cdot angle\right) \cdot \pi\right) \cdot \color{blue}{\pi}\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) + {\left(b \cdot \cos \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)\right)}^{2} \]
          7. Simplified71.4%

            \[\leadsto \color{blue}{\left(a \cdot a\right) \cdot \left(\left(\left(\left(angle \cdot angle\right) \cdot \pi\right) \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} + {\left(b \cdot \cos \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)\right)}^{2} \]
          8. Applied egg-rr82.6%

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

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

          1. Initial program 53.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. Applied egg-rr53.7%

            \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-PI.f64N/A

              \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. associate-*r*N/A

              \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. metadata-evalN/A

              \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\color{blue}{\frac{1}{180}} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-*.f64N/A

              \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. associate-/r/N/A

              \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}\right)}, a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-/.f64N/A

              \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\frac{1}{\color{blue}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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) \]
            8. lift-/.f6448.4

              \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)}, a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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. Applied egg-rr48.4%

            \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)}, a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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) \]
          6. Applied egg-rr53.2%

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

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

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

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

          Alternative 8: 60.5% accurate, 3.1× speedup?

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

            1. Initial program 82.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. Applied egg-rr82.7%

              \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
            4. 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}} \]
            5. Step-by-step derivation
              1. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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), {b}^{2}\right)} \]
            6. Simplified47.5%

              \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \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)} \]
            7. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

            if 7.0000000000000004e23 < b

            1. Initial program 87.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. Applied egg-rr87.2%

              \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-PI.f64N/A

                \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. associate-*r*N/A

                \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. metadata-evalN/A

                \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\color{blue}{\frac{1}{180}} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. associate-/r/N/A

                \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}\right)}, a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-/.f64N/A

                \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\frac{1}{\color{blue}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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) \]
              8. lift-/.f6485.3

                \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)}, a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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. Applied egg-rr85.3%

              \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)}, a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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) \]
            6. Applied egg-rr83.9%

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

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

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

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

            Alternative 9: 59.2% accurate, 3.4× speedup?

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

              1. Initial program 82.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. Applied egg-rr82.7%

                \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
              4. 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}} \]
              5. Step-by-step derivation
                1. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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), {b}^{2}\right)} \]
              6. Simplified47.5%

                \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \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)} \]
              7. Step-by-step derivation
                1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

              if 1.35e29 < b

              1. Initial program 87.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. Applied egg-rr87.2%

                \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-PI.f64N/A

                  \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. associate-*r*N/A

                  \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. metadata-evalN/A

                  \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\color{blue}{\frac{1}{180}} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-*.f64N/A

                  \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. associate-/r/N/A

                  \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}\right)}, a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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. lift-/.f64N/A

                  \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\frac{1}{\color{blue}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}}\right), a \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\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) \]
                8. lift-/.f6485.3

                  \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)}, a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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. Applied egg-rr85.3%

                \[\leadsto \mathsf{fma}\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)}, a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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) \]
              6. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\color{blue}{\pi} \cdot 0.011111111111111112\right)\right), 0.5\right) \]
              8. Simplified80.0%

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

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

            Alternative 10: 59.2% accurate, 3.4× speedup?

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

              1. Initial program 82.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. Applied egg-rr82.7%

                \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
              4. 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}} \]
              5. Step-by-step derivation
                1. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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), {b}^{2}\right)} \]
              6. Simplified47.5%

                \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \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)} \]
              7. Step-by-step derivation
                1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

              if 1.35e29 < b

              1. Initial program 87.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. Applied egg-rr87.2%

                \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
              4. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

                  \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \left(\frac{1}{90} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right), \frac{1}{2}\right) \]
                9. lower-PI.f6480.0

                  \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right), 0.5\right) \]
              6. Simplified80.0%

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

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

            Alternative 11: 59.2% accurate, 8.3× speedup?

            \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 1.35 \cdot 10^{+29}:\\ \;\;\;\;\mathsf{fma}\left(\left(angle\_m \cdot \pi\right) \cdot \left(\pi \cdot \mathsf{fma}\left(b, b \cdot -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right)\right), angle\_m, 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 1.35e+29)
               (fma
                (*
                 (* angle_m PI)
                 (* PI (fma b (* b -3.08641975308642e-5) (* 3.08641975308642e-5 (* a a)))))
                angle_m
                (* b b))
               (* b b)))
            angle_m = fabs(angle);
            double code(double a, double b, double angle_m) {
            	double tmp;
            	if (b <= 1.35e+29) {
            		tmp = fma(((angle_m * ((double) M_PI)) * (((double) M_PI) * fma(b, (b * -3.08641975308642e-5), (3.08641975308642e-5 * (a * a))))), angle_m, (b * b));
            	} else {
            		tmp = b * b;
            	}
            	return tmp;
            }
            
            angle_m = abs(angle)
            function code(a, b, angle_m)
            	tmp = 0.0
            	if (b <= 1.35e+29)
            		tmp = fma(Float64(Float64(angle_m * pi) * Float64(pi * fma(b, Float64(b * -3.08641975308642e-5), Float64(3.08641975308642e-5 * Float64(a * a))))), angle_m, 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, 1.35e+29], N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(Pi * N[(b * N[(b * -3.08641975308642e-5), $MachinePrecision] + N[(3.08641975308642e-5 * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle$95$m + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(b * b), $MachinePrecision]]
            
            \begin{array}{l}
            angle_m = \left|angle\right|
            
            \\
            \begin{array}{l}
            \mathbf{if}\;b \leq 1.35 \cdot 10^{+29}:\\
            \;\;\;\;\mathsf{fma}\left(\left(angle\_m \cdot \pi\right) \cdot \left(\pi \cdot \mathsf{fma}\left(b, b \cdot -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right)\right), angle\_m, b \cdot b\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;b \cdot b\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if b < 1.35e29

              1. Initial program 82.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. Applied egg-rr82.7%

                \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
              4. 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}} \]
              5. Step-by-step derivation
                1. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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), {b}^{2}\right)} \]
              6. Simplified47.5%

                \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \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)} \]
              7. Step-by-step derivation
                1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

              if 1.35e29 < b

              1. Initial program 87.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}{{b}^{2}} \]
              4. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto \color{blue}{b \cdot b} \]
                2. lower-*.f6478.3

                  \[\leadsto \color{blue}{b \cdot b} \]
              5. Simplified78.3%

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

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

            Alternative 12: 63.4% accurate, 9.1× speedup?

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

              1. Initial program 83.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}{{b}^{2}} \]
              4. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto \color{blue}{b \cdot b} \]
                2. lower-*.f6465.6

                  \[\leadsto \color{blue}{b \cdot b} \]
              5. Simplified65.6%

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

              if 9.4000000000000004e-123 < a < 1.4e154

              1. Initial program 77.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. Applied egg-rr77.2%

                \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
              4. 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}} \]
              5. Step-by-step derivation
                1. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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), {b}^{2}\right)} \]
              6. Simplified45.9%

                \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \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)} \]
              7. Taylor expanded in b around 0

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

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

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

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

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

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

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

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

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

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

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

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

              if 1.4e154 < a

              1. Initial program 99.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. Applied egg-rr99.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
              4. 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}} \]
              5. Step-by-step derivation
                1. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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), {b}^{2}\right)} \]
              6. Simplified17.9%

                \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \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)} \]
              7. 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)} \]
              8. 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. lower-*.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. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\frac{1}{32400} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                13. lower-PI.f6437.9

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

                \[\leadsto \color{blue}{\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right)\right)} \]
              10. Step-by-step derivation
                1. associate-*r*N/A

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\frac{1}{32400} \cdot a\right)} \cdot \left(a \cdot \left(angle \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
                10. lower-*.f6461.3

                  \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot \color{blue}{\left(a \cdot \left(angle \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right)\right)\right)} \]
                11. lift-*.f64N/A

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

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

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

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

                  \[\leadsto \left(\frac{1}{32400} \cdot a\right) \cdot \left(a \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right)\right)\right) \]
                16. lower-*.f6461.3

                  \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot \left(a \cdot \left(angle \cdot \color{blue}{\left(\pi \cdot \left(\pi \cdot angle\right)\right)}\right)\right) \]
              11. Applied egg-rr61.3%

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

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

            Alternative 13: 61.5% accurate, 10.4× speedup?

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

              1. Initial program 82.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}{{b}^{2}} \]
              4. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto \color{blue}{b \cdot b} \]
                2. lower-*.f6465.6

                  \[\leadsto \color{blue}{b \cdot b} \]
              5. Simplified65.6%

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

              if 3.6999999999999999e117 < a < 3.00000000000000025e201

              1. Initial program 79.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. Applied egg-rr79.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
              4. 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}} \]
              5. Step-by-step derivation
                1. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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), {b}^{2}\right)} \]
              6. Simplified27.8%

                \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \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)} \]
              7. 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)} \]
              8. 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. lower-*.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. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\frac{1}{32400} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                13. lower-PI.f6434.3

                  \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right) \]
              9. Simplified34.3%

                \[\leadsto \color{blue}{\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right)\right)} \]
              10. Step-by-step derivation
                1. lift-*.f64N/A

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\left(\frac{1}{32400} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot angle} \]
                10. lower-*.f6453.0

                  \[\leadsto \color{blue}{\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right)\right)} \cdot angle \]
                11. lift-*.f64N/A

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

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

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

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

                  \[\leadsto \left(\left(\frac{1}{32400} \cdot \left(a \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right)\right) \cdot angle \]
                16. lower-*.f6453.0

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

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

              if 3.00000000000000025e201 < a

              1. Initial program 99.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. Applied egg-rr99.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
              4. 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}} \]
              5. Step-by-step derivation
                1. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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), {b}^{2}\right)} \]
              6. Simplified18.7%

                \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \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)} \]
              7. 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)} \]
              8. 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. lower-*.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. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\frac{1}{32400} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                13. lower-PI.f6440.9

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

                \[\leadsto \color{blue}{\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right)\right)} \]
              10. Step-by-step derivation
                1. associate-*r*N/A

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\frac{1}{32400} \cdot a\right)} \cdot \left(a \cdot \left(angle \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
                10. lower-*.f6462.7

                  \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot \color{blue}{\left(a \cdot \left(angle \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right)\right)\right)} \]
                11. lift-*.f64N/A

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

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

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

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

                  \[\leadsto \left(\frac{1}{32400} \cdot a\right) \cdot \left(a \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right)\right)\right) \]
                16. lower-*.f6462.7

                  \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot \left(a \cdot \left(angle \cdot \color{blue}{\left(\pi \cdot \left(\pi \cdot angle\right)\right)}\right)\right) \]
              11. Applied egg-rr62.7%

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

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

            Alternative 14: 61.5% accurate, 12.1× speedup?

            \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;a \leq 1.66 \cdot 10^{+118}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\\ \end{array} \end{array} \]
            angle_m = (fabs.f64 angle)
            (FPCore (a b angle_m)
             :precision binary64
             (if (<= a 1.66e+118)
               (* b b)
               (* (* a 3.08641975308642e-5) (* a (* angle_m (* PI (* angle_m PI)))))))
            angle_m = fabs(angle);
            double code(double a, double b, double angle_m) {
            	double tmp;
            	if (a <= 1.66e+118) {
            		tmp = b * b;
            	} else {
            		tmp = (a * 3.08641975308642e-5) * (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 <= 1.66e+118) {
            		tmp = b * b;
            	} else {
            		tmp = (a * 3.08641975308642e-5) * (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 <= 1.66e+118:
            		tmp = b * b
            	else:
            		tmp = (a * 3.08641975308642e-5) * (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 <= 1.66e+118)
            		tmp = Float64(b * b);
            	else
            		tmp = Float64(Float64(a * 3.08641975308642e-5) * Float64(a * Float64(angle_m * Float64(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 <= 1.66e+118)
            		tmp = b * b;
            	else
            		tmp = (a * 3.08641975308642e-5) * (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, 1.66e+118], N[(b * b), $MachinePrecision], N[(N[(a * 3.08641975308642e-5), $MachinePrecision] * N[(a * N[(angle$95$m * N[(Pi * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            angle_m = \left|angle\right|
            
            \\
            \begin{array}{l}
            \mathbf{if}\;a \leq 1.66 \cdot 10^{+118}:\\
            \;\;\;\;b \cdot b\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(a \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < 1.66e118

              1. Initial program 82.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}{{b}^{2}} \]
              4. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto \color{blue}{b \cdot b} \]
                2. lower-*.f6465.6

                  \[\leadsto \color{blue}{b \cdot b} \]
              5. Simplified65.6%

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

              if 1.66e118 < a

              1. Initial program 90.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. Applied egg-rr90.2%

                \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\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)} \]
              4. 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}} \]
              5. Step-by-step derivation
                1. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \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), {b}^{2}\right)} \]
              6. Simplified23.0%

                \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \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)} \]
              7. 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)} \]
              8. 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. lower-*.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. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\frac{1}{32400} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
                13. lower-PI.f6437.8

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

                \[\leadsto \color{blue}{\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right)\right)} \]
              10. Step-by-step derivation
                1. associate-*r*N/A

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\frac{1}{32400} \cdot a\right)} \cdot \left(a \cdot \left(angle \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
                10. lower-*.f6454.9

                  \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot \color{blue}{\left(a \cdot \left(angle \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right)\right)\right)} \]
                11. lift-*.f64N/A

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

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

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

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

                  \[\leadsto \left(\frac{1}{32400} \cdot a\right) \cdot \left(a \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right)\right)\right) \]
                16. lower-*.f6454.9

                  \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot \left(a \cdot \left(angle \cdot \color{blue}{\left(\pi \cdot \left(\pi \cdot angle\right)\right)}\right)\right) \]
              11. Applied egg-rr54.9%

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

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

            Alternative 15: 57.3% 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 83.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}{{b}^{2}} \]
            4. Step-by-step derivation
              1. unpow2N/A

                \[\leadsto \color{blue}{b \cdot b} \]
              2. lower-*.f6461.4

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

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

            Reproduce

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