ab-angle->ABCF A

Percentage Accurate: 79.4% → 79.4%
Time: 16.3s
Alternatives: 14
Speedup: N/A×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 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.7× speedup?

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

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

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


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

    1. Initial program 88.5%

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

      \[\leadsto {\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. Applied rewrites88.4%

        \[\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-*.f6488.4

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

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{b \cdot b} \]
      4. 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} + b \cdot b \]
      5. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

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

          \[\leadsto {\left(angle \cdot \color{blue}{\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} + b \cdot b \]
        6. 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} + b \cdot b \]
        7. associate-*l*N/A

          \[\leadsto {\left(angle \cdot \left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right) + \color{blue}{\frac{-1}{34992000} \cdot \left(\left(a \cdot {\mathsf{PI}\left(\right)}^{3}\right) \cdot {angle}^{2}\right)}\right)\right)}^{2} + b \cdot b \]
        8. 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(a \cdot \left({\mathsf{PI}\left(\right)}^{3} \cdot {angle}^{2}\right)\right)}\right)\right)}^{2} + b \cdot b \]
        9. *-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({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right)}\right)\right)\right)}^{2} + b \cdot b \]
      6. Applied rewrites83.1%

        \[\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} + b \cdot b \]

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

      1. Initial program 61.4%

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

        \[\leadsto {\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. Applied rewrites62.1%

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

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

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

      Alternative 2: 79.4% accurate, 1.9× speedup?

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

          \[\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-*.f6481.0

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

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

        Alternative 3: 79.4% accurate, 2.0× speedup?

        \[\begin{array}{l} angle_m = \left|angle\right| \\ b \cdot b + {\left(a \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right)\right)}^{2} \end{array} \]
        angle_m = (fabs.f64 angle)
        (FPCore (a b angle_m)
         :precision binary64
         (+ (* b b) (pow (* a (sin (* (* angle_m PI) 0.005555555555555556))) 2.0)))
        angle_m = fabs(angle);
        double code(double a, double b, double angle_m) {
        	return (b * b) + pow((a * sin(((angle_m * ((double) M_PI)) * 0.005555555555555556))), 2.0);
        }
        
        angle_m = Math.abs(angle);
        public static double code(double a, double b, double angle_m) {
        	return (b * b) + Math.pow((a * Math.sin(((angle_m * Math.PI) * 0.005555555555555556))), 2.0);
        }
        
        angle_m = math.fabs(angle)
        def code(a, b, angle_m):
        	return (b * b) + math.pow((a * math.sin(((angle_m * math.pi) * 0.005555555555555556))), 2.0)
        
        angle_m = abs(angle)
        function code(a, b, angle_m)
        	return Float64(Float64(b * b) + (Float64(a * sin(Float64(Float64(angle_m * pi) * 0.005555555555555556))) ^ 2.0))
        end
        
        angle_m = abs(angle);
        function tmp = code(a, b, angle_m)
        	tmp = (b * b) + ((a * sin(((angle_m * pi) * 0.005555555555555556))) ^ 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[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        angle_m = \left|angle\right|
        
        \\
        b \cdot b + {\left(a \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right)\right)}^{2}
        \end{array}
        
        Derivation
        1. Initial program 80.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. Applied rewrites81.0%

            \[\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-*.f6481.0

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

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + \color{blue}{b \cdot b} \]
          4. 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} + b \cdot b \]
            2. associate-*l/N/A

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

              \[\leadsto {\left(a \cdot \sin \left(\frac{\color{blue}{angle \cdot \mathsf{PI}\left(\right)}}{180}\right)\right)}^{2} + b \cdot b \]
            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} + b \cdot b \]
            5. lower-*.f64N/A

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

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

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

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

          Alternative 4: 79.4% accurate, 3.0× speedup?

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

            1. Initial program 88.5%

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

              \[\leadsto {\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. Applied rewrites88.4%

                \[\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-*.f6488.4

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

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

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

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

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

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

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

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

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

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

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

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

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

              1. Initial program 61.4%

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

                \[\leadsto {\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. Applied rewrites62.1%

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

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

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

              Alternative 5: 79.4% accurate, 3.0× speedup?

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

                1. Initial program 88.5%

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

                  \[\leadsto {\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. Applied rewrites88.4%

                    \[\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-*.f6488.4

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

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

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

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

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

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

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

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

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

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

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

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

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

                  1. Initial program 61.4%

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

                    \[\leadsto {\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. Applied rewrites62.1%

                      \[\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-*.f6462.1

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

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

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

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

                  Alternative 6: 66.1% accurate, 3.4× speedup?

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

                    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 8.20000000000000045e-133 < a

                    1. Initial program 83.2%

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

                      \[\leadsto {\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. Applied rewrites83.3%

                        \[\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-*.f6483.3

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 7: 66.1% accurate, 3.4× speedup?

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

                      1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 8.20000000000000045e-133 < a

                      1. Initial program 83.2%

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

                        \[\leadsto {\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. Applied rewrites83.3%

                          \[\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-*.f6483.3

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 8: 66.1% accurate, 3.4× speedup?

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

                        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-*.f6458.5

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

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

                        if 1.9000000000000001e-17 < a

                        1. Initial program 88.4%

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

                          \[\leadsto {\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. Applied rewrites88.4%

                            \[\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-*.f6488.4

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 9: 62.2% accurate, 9.1× speedup?

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

                          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-*.f6458.5

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

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

                          if 1.9000000000000001e-17 < a < 1.12e173

                          1. Initial program 76.3%

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \color{blue}{\mathsf{fma}\left({a}^{2}, \left(\mathsf{neg}\left(\frac{-1}{32400} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}, {b}^{2}\right)} \]
                            4. Applied rewrites72.6%

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

                            if 1.12e173 < a

                            1. Initial program 99.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 {\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. Applied rewrites99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \color{blue}{\left(a \cdot \left(\left(angle \cdot angle\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right)\right)\right) \cdot a} \]
                              9. Applied rewrites71.4%

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

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

                            Alternative 10: 71.7% accurate, 10.4× speedup?

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

                              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 {\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. Applied rewrites77.3%

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{\mathsf{fma}\left({a}^{2}, \left(\mathsf{neg}\left(\frac{-1}{32400} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}, {b}^{2}\right)} \]
                                4. Applied rewrites64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(a \cdot a\right) \cdot angle, angle \cdot \left(\frac{1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), b \cdot b\right)} \]
                                6. Applied rewrites71.6%

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

                                if 1.09999999999999994e132 < a

                                1. Initial program 99.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 {\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. Applied rewrites99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(a \cdot a\right) \cdot \left(angle \cdot angle\right)\right) \cdot \frac{1}{32400}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), b \cdot b\right)} \]
                                  6. Applied rewrites86.3%

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

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

                                Alternative 11: 69.9% accurate, 10.4× speedup?

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

                                  1. Initial program 78.2%

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

                                    \[\leadsto {\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. Applied rewrites78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(a \cdot a\right) \cdot angle, angle \cdot \left(\frac{1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), b \cdot b\right)} \]
                                    6. Applied rewrites72.4%

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

                                    if 5.0000000000000003e181 < a

                                    1. Initial program 99.5%

                                      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
                                    2. Add Preprocessing
                                    3. 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. Applied rewrites99.5%

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \color{blue}{\mathsf{fma}\left({a}^{2}, \left(\mathsf{neg}\left(\frac{-1}{32400} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}, {b}^{2}\right)} \]
                                      4. Applied rewrites58.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \color{blue}{\left(a \cdot \left(\left(angle \cdot angle\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right)\right)\right) \cdot a} \]
                                      9. Applied rewrites75.9%

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

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

                                    Alternative 12: 60.9% accurate, 12.1× speedup?

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

                                      1. Initial program 77.5%

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

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

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

                                          \[\leadsto \color{blue}{b \cdot b} \]
                                      5. Applied rewrites59.1%

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

                                      if 1.3e159 < a

                                      1. Initial program 99.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 {\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. Applied rewrites99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \color{blue}{\left(a \cdot \left(\left(angle \cdot angle\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right)\right)\right) \cdot a} \]
                                        9. Applied rewrites70.5%

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

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

                                      Alternative 13: 61.3% accurate, 12.1× speedup?

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

                                        1. Initial program 77.5%

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

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

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

                                            \[\leadsto \color{blue}{b \cdot b} \]
                                        5. Applied rewrites59.1%

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

                                        if 6.00000000000000029e148 < a

                                        1. Initial program 99.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 {\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. Applied rewrites99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto angle \cdot \color{blue}{\left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{32400}\right)\right)\right) \cdot \left(a \cdot a\right)\right)} \]
                                          9. Applied rewrites64.6%

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

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

                                        Alternative 14: 56.5% 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 80.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-*.f6454.1

                                            \[\leadsto \color{blue}{b \cdot b} \]
                                        5. Applied rewrites54.1%

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

                                        Reproduce

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