ab-angle->ABCF A

Percentage Accurate: 79.4% → 79.4%
Time: 17.0s
Alternatives: 12
Speedup: 2.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 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.4% 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.4% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 83.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. 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. Simplified78.9%

      \[\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-rr79.4%

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

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

    1. Initial program 60.1%

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

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

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

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

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

    Alternative 2: 79.4% accurate, 1.0× speedup?

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

      \[{\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. 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{angle \cdot \mathsf{PI}\left(\right)}{180}\right)}\right)}^{2} \]
      4. lower-*.f6477.9

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

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

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

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

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

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

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

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

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

    Alternative 3: 79.4% accurate, 1.2× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := a \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\ \mathsf{fma}\left(t\_0, t\_0, \mathsf{fma}\left(0.5, \cos \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right), 0.5\right) \cdot \left(b \cdot b\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 (* PI 0.005555555555555556))))))
       (fma
        t_0
        t_0
        (* (fma 0.5 (cos (* (* angle_m PI) 0.011111111111111112)) 0.5) (* b b)))))
    angle_m = fabs(angle);
    double code(double a, double b, double angle_m) {
    	double t_0 = a * sin((angle_m * (((double) M_PI) * 0.005555555555555556)));
    	return fma(t_0, t_0, (fma(0.5, cos(((angle_m * ((double) M_PI)) * 0.011111111111111112)), 0.5) * (b * b)));
    }
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	t_0 = Float64(a * sin(Float64(angle_m * Float64(pi * 0.005555555555555556))))
    	return fma(t_0, t_0, Float64(fma(0.5, cos(Float64(Float64(angle_m * pi) * 0.011111111111111112)), 0.5) * 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[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(N[(0.5 * N[Cos[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    \begin{array}{l}
    t_0 := a \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
    \mathsf{fma}\left(t\_0, t\_0, \mathsf{fma}\left(0.5, \cos \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right), 0.5\right) \cdot \left(b \cdot b\right)\right)
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 77.9%

      \[{\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. 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{angle \cdot \mathsf{PI}\left(\right)}{180}\right)}\right)}^{2} \]
      4. lower-*.f6477.9

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right), a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right), \mathsf{fma}\left(0.5, \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right), 0.5\right) \cdot \left(b \cdot b\right)\right)} \]
    6. Add Preprocessing

    Alternative 4: 79.4% accurate, 1.9× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := a \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\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 (* PI 0.005555555555555556))))))
       (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 * (((double) M_PI) * 0.005555555555555556)));
    	return fma(t_0, t_0, (b * b));
    }
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	t_0 = Float64(a * sin(Float64(angle_m * Float64(pi * 0.005555555555555556))))
    	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[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $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(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
    \mathsf{fma}\left(t\_0, t\_0, b \cdot b\right)
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 77.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{b \cdot b} \]
        12. lower-fma.f6477.7

          \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right), a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right), b \cdot b\right)} \]
      3. Applied egg-rr77.7%

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

      Alternative 5: 79.3% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

        Alternative 6: 79.5% accurate, 2.0× speedup?

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

          1. Initial program 83.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. 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. Simplified78.9%

            \[\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-rr78.9%

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

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

          1. Initial program 60.1%

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

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

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

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

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

          Alternative 7: 79.3% accurate, 2.9× speedup?

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

            1. Initial program 83.3%

              \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. 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. 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{angle \cdot \mathsf{PI}\left(\right)}{180}\right)}\right)}^{2} \]
              4. lower-*.f6483.3

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(0.005555555555555556 \cdot \left(\pi \cdot \left(angle \cdot a\right)\right), 0.005555555555555556 \cdot \left(\pi \cdot \left(angle \cdot a\right)\right), b \cdot b\right)} \]

            if 5.00000000000000041e-6 < (/.f64 angle #s(literal 180 binary64))

            1. Initial program 61.8%

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

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

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

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

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

            Alternative 8: 67.2% accurate, 3.4× speedup?

            \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\\ \mathbf{if}\;a \leq 7 \cdot 10^{-168}:\\ \;\;\;\;\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)\\ \mathbf{else}:\\ \;\;\;\;\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 (* 0.005555555555555556 (* PI (* a angle_m)))))
               (if (<= a 7e-168)
                 (* (* b b) (fma 0.5 (cos (* PI (* angle_m 0.011111111111111112))) 0.5))
                 (fma t_0 t_0 (* b b)))))
            angle_m = fabs(angle);
            double code(double a, double b, double angle_m) {
            	double t_0 = 0.005555555555555556 * (((double) M_PI) * (a * angle_m));
            	double tmp;
            	if (a <= 7e-168) {
            		tmp = (b * b) * fma(0.5, cos((((double) M_PI) * (angle_m * 0.011111111111111112))), 0.5);
            	} else {
            		tmp = fma(t_0, t_0, (b * b));
            	}
            	return tmp;
            }
            
            angle_m = abs(angle)
            function code(a, b, angle_m)
            	t_0 = Float64(0.005555555555555556 * Float64(pi * Float64(a * angle_m)))
            	tmp = 0.0
            	if (a <= 7e-168)
            		tmp = Float64(Float64(b * b) * fma(0.5, cos(Float64(pi * Float64(angle_m * 0.011111111111111112))), 0.5));
            	else
            		tmp = fma(t_0, t_0, Float64(b * b));
            	end
            	return tmp
            end
            
            angle_m = N[Abs[angle], $MachinePrecision]
            code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(Pi * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 7e-168], 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], 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 := 0.005555555555555556 \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\\
            \mathbf{if}\;a \leq 7 \cdot 10^{-168}:\\
            \;\;\;\;\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)\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(t\_0, t\_0, b \cdot b\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < 6.99999999999999964e-168

              1. Initial program 78.7%

                \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              2. Add Preprocessing
              3. Applied egg-rr32.1%

                \[\leadsto \color{blue}{\mathsf{fma}\left(e^{\log \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\right)}, b, \left(a \cdot a\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 b around inf

                \[\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. associate-*r*N/A

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

                  \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{90} \cdot angle\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(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{90} \cdot angle\right)\right)}, \frac{1}{2}\right) \]
                10. lower-PI.f64N/A

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

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

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

                \[\leadsto \color{blue}{\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)} \]

              if 6.99999999999999964e-168 < a

              1. Initial program 76.8%

                \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              2. Add Preprocessing
              3. 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. 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{angle \cdot \mathsf{PI}\left(\right)}{180}\right)}\right)}^{2} \]
                4. lower-*.f6476.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right) \cdot angle, \left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right) \cdot angle, {b}^{2}\right)} \]
              9. Simplified71.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(0.005555555555555556 \cdot \left(\pi \cdot \left(angle \cdot a\right)\right), 0.005555555555555556 \cdot \left(\pi \cdot \left(angle \cdot a\right)\right), b \cdot b\right)} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification64.7%

              \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 7 \cdot 10^{-168}:\\ \;\;\;\;\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)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.005555555555555556 \cdot \left(\pi \cdot \left(a \cdot angle\right)\right), 0.005555555555555556 \cdot \left(\pi \cdot \left(a \cdot angle\right)\right), b \cdot b\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 9: 67.4% accurate, 9.3× speedup?

            \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\\ \mathbf{if}\;a \leq 8 \cdot 10^{-107}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\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 (* 0.005555555555555556 (* PI (* a angle_m)))))
               (if (<= a 8e-107) (* b b) (fma t_0 t_0 (* b b)))))
            angle_m = fabs(angle);
            double code(double a, double b, double angle_m) {
            	double t_0 = 0.005555555555555556 * (((double) M_PI) * (a * angle_m));
            	double tmp;
            	if (a <= 8e-107) {
            		tmp = b * b;
            	} else {
            		tmp = fma(t_0, t_0, (b * b));
            	}
            	return tmp;
            }
            
            angle_m = abs(angle)
            function code(a, b, angle_m)
            	t_0 = Float64(0.005555555555555556 * Float64(pi * Float64(a * angle_m)))
            	tmp = 0.0
            	if (a <= 8e-107)
            		tmp = Float64(b * b);
            	else
            		tmp = fma(t_0, t_0, Float64(b * b));
            	end
            	return tmp
            end
            
            angle_m = N[Abs[angle], $MachinePrecision]
            code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(Pi * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 8e-107], N[(b * b), $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 := 0.005555555555555556 \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\\
            \mathbf{if}\;a \leq 8 \cdot 10^{-107}:\\
            \;\;\;\;b \cdot b\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(t\_0, t\_0, b \cdot b\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < 8e-107

              1. Initial program 77.1%

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

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

                  \[\leadsto \color{blue}{b \cdot b} \]
                2. lower-*.f6459.5

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

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

              if 8e-107 < a

              1. Initial program 79.1%

                \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. 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. 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{angle \cdot \mathsf{PI}\left(\right)}{180}\right)}\right)}^{2} \]
                4. lower-*.f6479.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 10: 61.5% accurate, 12.1× speedup?

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

              1. Initial program 76.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. 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.0

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

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

              if 4.1000000000000001e83 < a

              1. Initial program 83.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. 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{angle \cdot \mathsf{PI}\left(\right)}{180}\right)}\right)}^{2} \]
                4. lower-*.f6483.0

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

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

                \[\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)} \]
              8. 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)} \]
              9. Step-by-step derivation
                1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 11: 61.0% accurate, 12.1× speedup?

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

              1. Initial program 76.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. 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.0

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

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

              if 4.1000000000000001e83 < a

              1. Initial program 83.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. 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{angle \cdot \mathsf{PI}\left(\right)}{180}\right)}\right)}^{2} \]
                4. lower-*.f6483.0

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

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

                \[\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)} \]
              8. 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)} \]
              9. Step-by-step derivation
                1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto a \cdot \color{blue}{\left(\left(a \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right) \cdot \left(angle \cdot angle\right)\right)} \]
              12. Applied egg-rr61.8%

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

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

            Alternative 12: 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 77.9%

              \[{\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-*.f6452.7

                \[\leadsto \color{blue}{b \cdot b} \]
            5. Simplified52.7%

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

            Reproduce

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