ab-angle->ABCF A

Percentage Accurate: 79.4% → 79.2%
Time: 16.2s
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.2% accurate, 1.8× speedup?

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

\\
{\left(a \cdot \sin \left(\frac{1}{\frac{1}{angle}} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2} + b \cdot b
\end{array}
Derivation
  1. Initial program 75.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. Simplified75.6%

      \[\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. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 2: 79.2% accurate, 1.9× speedup?

    \[\begin{array}{l} \\ b \cdot b + {\left(a \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \end{array} \]
    (FPCore (a b angle)
     :precision binary64
     (+ (* b b) (pow (* a (sin (* PI (/ angle 180.0)))) 2.0)))
    double code(double a, double b, double angle) {
    	return (b * b) + pow((a * sin((((double) M_PI) * (angle / 180.0)))), 2.0);
    }
    
    public static double code(double a, double b, double angle) {
    	return (b * b) + Math.pow((a * Math.sin((Math.PI * (angle / 180.0)))), 2.0);
    }
    
    def code(a, b, angle):
    	return (b * b) + math.pow((a * math.sin((math.pi * (angle / 180.0)))), 2.0)
    
    function code(a, b, angle)
    	return Float64(Float64(b * b) + (Float64(a * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0))
    end
    
    function tmp = code(a, b, angle)
    	tmp = (b * b) + ((a * sin((pi * (angle / 180.0)))) ^ 2.0);
    end
    
    code[a_, b_, angle_] := N[(N[(b * b), $MachinePrecision] + N[Power[N[(a * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    b \cdot b + {\left(a \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
    \end{array}
    
    Derivation
    1. Initial program 75.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. Simplified75.6%

        \[\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. *-lowering-*.f6475.6

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

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

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

      Alternative 3: 76.7% accurate, 3.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;angle \leq 0.003:\\ \;\;\;\;b \cdot b + {\left(a \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, a \cdot \left(\left(1 - \cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot 0.5\right), b \cdot b\right)\\ \end{array} \end{array} \]
      (FPCore (a b angle)
       :precision binary64
       (if (<= angle 0.003)
         (+ (* b b) (pow (* a (* angle (* PI 0.005555555555555556))) 2.0))
         (fma
          a
          (* a (* (- 1.0 (cos (* 0.011111111111111112 (* PI angle)))) 0.5))
          (* b b))))
      double code(double a, double b, double angle) {
      	double tmp;
      	if (angle <= 0.003) {
      		tmp = (b * b) + pow((a * (angle * (((double) M_PI) * 0.005555555555555556))), 2.0);
      	} else {
      		tmp = fma(a, (a * ((1.0 - cos((0.011111111111111112 * (((double) M_PI) * angle)))) * 0.5)), (b * b));
      	}
      	return tmp;
      }
      
      function code(a, b, angle)
      	tmp = 0.0
      	if (angle <= 0.003)
      		tmp = Float64(Float64(b * b) + (Float64(a * Float64(angle * Float64(pi * 0.005555555555555556))) ^ 2.0));
      	else
      		tmp = fma(a, Float64(a * Float64(Float64(1.0 - cos(Float64(0.011111111111111112 * Float64(pi * angle)))) * 0.5)), Float64(b * b));
      	end
      	return tmp
      end
      
      code[a_, b_, angle_] := If[LessEqual[angle, 0.003], N[(N[(b * b), $MachinePrecision] + N[Power[N[(a * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(a * N[(a * N[(N[(1.0 - N[Cos[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;angle \leq 0.003:\\
      \;\;\;\;b \cdot b + {\left(a \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(a, a \cdot \left(\left(1 - \cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot 0.5\right), b \cdot b\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if angle < 0.0030000000000000001

        1. Initial program 83.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. Simplified83.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. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto {\left(a \cdot \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)}\right)}^{2} + b \cdot b \]
            2. 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 \]
            3. *-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 \]
            4. *-lowering-*.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 \]
            5. *-lowering-*.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 \]
            6. PI-lowering-PI.f6480.6

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

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

          if 0.0030000000000000001 < angle

          1. Initial program 54.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. Simplified55.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. unpow1N/A

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

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

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

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

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

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

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

              \[\leadsto {\left(a \cdot \color{blue}{\frac{\sqrt{1 - \cos \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)}}{\sqrt{2}}}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
            4. Step-by-step derivation
              1. unpow-prod-downN/A

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

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

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

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(a, a \cdot {\left(\frac{\sqrt{1 - \cos \left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{90} \cdot angle\right)\right)}}{\sqrt{2}}\right)}^{2}, b \cdot b\right)} \]
            5. Applied egg-rr55.4%

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

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

          Alternative 4: 76.7% accurate, 3.2× speedup?

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

            1. Initial program 83.3%

              \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
            2. Add Preprocessing
            3. 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. Simplified83.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. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto {\left(a \cdot \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)}\right)}^{2} + b \cdot b \]
                2. 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 \]
                3. *-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 \]
                4. *-lowering-*.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 \]
                5. *-lowering-*.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 \]
                6. PI-lowering-PI.f6480.7

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

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

              if 4.40000000000000016e-4 < angle

              1. Initial program 54.8%

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

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

                  \[\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. pow-prod-downN/A

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

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

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

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

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

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

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

                  \[\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 b\right)} \]
              5. Recombined 2 regimes into one program.
              6. Final simplification73.6%

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

              Alternative 5: 76.7% accurate, 3.2× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;angle \leq 0.003:\\ \;\;\;\;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} \end{array} \]
              (FPCore (a b angle)
               :precision binary64
               (if (<= angle 0.003)
                 (+ (* b b) (pow (* a (* angle (* PI 0.005555555555555556))) 2.0))
                 (fma
                  (* a (fma (cos (* PI (* angle 0.011111111111111112))) -0.5 0.5))
                  a
                  (* b b))))
              double code(double a, double b, double angle) {
              	double tmp;
              	if (angle <= 0.003) {
              		tmp = (b * b) + pow((a * (angle * (((double) M_PI) * 0.005555555555555556))), 2.0);
              	} else {
              		tmp = fma((a * fma(cos((((double) M_PI) * (angle * 0.011111111111111112))), -0.5, 0.5)), a, (b * b));
              	}
              	return tmp;
              }
              
              function code(a, b, angle)
              	tmp = 0.0
              	if (angle <= 0.003)
              		tmp = Float64(Float64(b * b) + (Float64(a * Float64(angle * Float64(pi * 0.005555555555555556))) ^ 2.0));
              	else
              		tmp = fma(Float64(a * fma(cos(Float64(pi * Float64(angle * 0.011111111111111112))), -0.5, 0.5)), a, Float64(b * b));
              	end
              	return tmp
              end
              
              code[a_, b_, angle_] := If[LessEqual[angle, 0.003], N[(N[(b * b), $MachinePrecision] + N[Power[N[(a * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(N[Cos[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision]), $MachinePrecision] * a + N[(b * b), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;angle \leq 0.003:\\
              \;\;\;\;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}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if angle < 0.0030000000000000001

                1. Initial program 83.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. Simplified83.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. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto {\left(a \cdot \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)}\right)}^{2} + b \cdot b \]
                    2. 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 \]
                    3. *-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 \]
                    4. *-lowering-*.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 \]
                    5. *-lowering-*.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 \]
                    6. PI-lowering-PI.f6480.6

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

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

                  if 0.0030000000000000001 < angle

                  1. Initial program 54.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. Simplified55.4%

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

                      \[\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) \cdot a, a, b \cdot b\right)} \]
                  5. Recombined 2 regimes into one program.
                  6. Final simplification73.6%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;angle \leq 0.003:\\ \;\;\;\;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 6: 66.5% accurate, 3.4× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 1.32 \cdot 10^{+20}:\\ \;\;\;\;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} \end{array} \]
                  (FPCore (a b angle)
                   :precision binary64
                   (if (<= a 1.32e+20)
                     (* b b)
                     (+ (* b b) (pow (* a (* angle (* PI 0.005555555555555556))) 2.0))))
                  double code(double a, double b, double angle) {
                  	double tmp;
                  	if (a <= 1.32e+20) {
                  		tmp = b * b;
                  	} else {
                  		tmp = (b * b) + pow((a * (angle * (((double) M_PI) * 0.005555555555555556))), 2.0);
                  	}
                  	return tmp;
                  }
                  
                  public static double code(double a, double b, double angle) {
                  	double tmp;
                  	if (a <= 1.32e+20) {
                  		tmp = b * b;
                  	} else {
                  		tmp = (b * b) + Math.pow((a * (angle * (Math.PI * 0.005555555555555556))), 2.0);
                  	}
                  	return tmp;
                  }
                  
                  def code(a, b, angle):
                  	tmp = 0
                  	if a <= 1.32e+20:
                  		tmp = b * b
                  	else:
                  		tmp = (b * b) + math.pow((a * (angle * (math.pi * 0.005555555555555556))), 2.0)
                  	return tmp
                  
                  function code(a, b, angle)
                  	tmp = 0.0
                  	if (a <= 1.32e+20)
                  		tmp = Float64(b * b);
                  	else
                  		tmp = Float64(Float64(b * b) + (Float64(a * Float64(angle * Float64(pi * 0.005555555555555556))) ^ 2.0));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(a, b, angle)
                  	tmp = 0.0;
                  	if (a <= 1.32e+20)
                  		tmp = b * b;
                  	else
                  		tmp = (b * b) + ((a * (angle * (pi * 0.005555555555555556))) ^ 2.0);
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[a_, b_, angle_] := If[LessEqual[a, 1.32e+20], N[(b * b), $MachinePrecision], N[(N[(b * b), $MachinePrecision] + N[Power[N[(a * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;a \leq 1.32 \cdot 10^{+20}:\\
                  \;\;\;\;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}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if a < 1.32e20

                    1. Initial program 70.8%

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

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

                        \[\leadsto \color{blue}{b \cdot b} \]
                      2. *-lowering-*.f6457.6

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

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

                    if 1.32e20 < a

                    1. Initial program 86.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. Simplified86.9%

                        \[\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. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto {\left(a \cdot \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)}\right)}^{2} + b \cdot b \]
                        2. 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 \]
                        3. *-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 \]
                        4. *-lowering-*.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 \]
                        5. *-lowering-*.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 \]
                        6. PI-lowering-PI.f6484.1

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

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.32 \cdot 10^{+20}:\\ \;\;\;\;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 7: 66.3% accurate, 10.4× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 8 \cdot 10^{+18}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(a \cdot angle\right) \cdot \left(\left(angle \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\pi \cdot \pi\right)\right), a, b \cdot b\right)\\ \end{array} \end{array} \]
                    (FPCore (a b angle)
                     :precision binary64
                     (if (<= a 8e+18)
                       (* b b)
                       (fma
                        (* (* a angle) (* (* angle 3.08641975308642e-5) (* PI PI)))
                        a
                        (* b b))))
                    double code(double a, double b, double angle) {
                    	double tmp;
                    	if (a <= 8e+18) {
                    		tmp = b * b;
                    	} else {
                    		tmp = fma(((a * angle) * ((angle * 3.08641975308642e-5) * (((double) M_PI) * ((double) M_PI)))), a, (b * b));
                    	}
                    	return tmp;
                    }
                    
                    function code(a, b, angle)
                    	tmp = 0.0
                    	if (a <= 8e+18)
                    		tmp = Float64(b * b);
                    	else
                    		tmp = fma(Float64(Float64(a * angle) * Float64(Float64(angle * 3.08641975308642e-5) * Float64(pi * pi))), a, Float64(b * b));
                    	end
                    	return tmp
                    end
                    
                    code[a_, b_, angle_] := If[LessEqual[a, 8e+18], N[(b * b), $MachinePrecision], N[(N[(N[(a * angle), $MachinePrecision] * N[(N[(angle * 3.08641975308642e-5), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a + N[(b * b), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;a \leq 8 \cdot 10^{+18}:\\
                    \;\;\;\;b \cdot b\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\mathsf{fma}\left(\left(a \cdot angle\right) \cdot \left(\left(angle \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\pi \cdot \pi\right)\right), a, b \cdot b\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if a < 8e18

                      1. Initial program 70.8%

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

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

                          \[\leadsto \color{blue}{b \cdot b} \]
                        2. *-lowering-*.f6457.6

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

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

                      if 8e18 < a

                      1. Initial program 86.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. Simplified86.9%

                          \[\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. accelerator-lowering-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. Simplified57.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. Step-by-step derivation
                          1. associate-*l*N/A

                            \[\leadsto \color{blue}{a \cdot \left(a \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)\right)} + b \cdot b \]
                          2. *-commutativeN/A

                            \[\leadsto \color{blue}{\left(a \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)\right) \cdot a} + b \cdot b \]
                          3. accelerator-lowering-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(a \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), a, b \cdot b\right)} \]
                          4. associate-*l*N/A

                            \[\leadsto \mathsf{fma}\left(a \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)}, a, b \cdot b\right) \]
                          5. associate-*r*N/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(a \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)}, a, b \cdot b\right) \]
                          6. *-lowering-*.f64N/A

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

                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(a \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), a, b \cdot b\right) \]
                          8. associate-*r*N/A

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

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

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

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

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

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

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

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

                      Alternative 8: 64.8% accurate, 10.4× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 1.02 \cdot 10^{+19}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right), a \cdot \left(a \cdot \left(angle \cdot angle\right)\right), b \cdot b\right)\\ \end{array} \end{array} \]
                      (FPCore (a b angle)
                       :precision binary64
                       (if (<= a 1.02e+19)
                         (* b b)
                         (fma
                          (* PI (* PI 3.08641975308642e-5))
                          (* a (* a (* angle angle)))
                          (* b b))))
                      double code(double a, double b, double angle) {
                      	double tmp;
                      	if (a <= 1.02e+19) {
                      		tmp = b * b;
                      	} else {
                      		tmp = fma((((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5)), (a * (a * (angle * angle))), (b * b));
                      	}
                      	return tmp;
                      }
                      
                      function code(a, b, angle)
                      	tmp = 0.0
                      	if (a <= 1.02e+19)
                      		tmp = Float64(b * b);
                      	else
                      		tmp = fma(Float64(pi * Float64(pi * 3.08641975308642e-5)), Float64(a * Float64(a * Float64(angle * angle))), Float64(b * b));
                      	end
                      	return tmp
                      end
                      
                      code[a_, b_, angle_] := If[LessEqual[a, 1.02e+19], N[(b * b), $MachinePrecision], N[(N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision] * N[(a * N[(a * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;a \leq 1.02 \cdot 10^{+19}:\\
                      \;\;\;\;b \cdot b\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\mathsf{fma}\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right), a \cdot \left(a \cdot \left(angle \cdot angle\right)\right), b \cdot b\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if a < 1.02e19

                        1. Initial program 70.8%

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

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

                            \[\leadsto \color{blue}{b \cdot b} \]
                          2. *-lowering-*.f6457.6

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

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

                        if 1.02e19 < a

                        1. Initial program 86.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. Simplified86.9%

                            \[\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. accelerator-lowering-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. Simplified57.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. Step-by-step derivation
                            1. 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 \]
                            2. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 9: 70.2% accurate, 10.4× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 1.8 \cdot 10^{+174}:\\ \;\;\;\;\mathsf{fma}\left(angle, \left(a \cdot a\right) \cdot \left(\left(angle \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\pi \cdot \pi\right)\right), b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(\left(a \cdot angle\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\ \end{array} \end{array} \]
                        (FPCore (a b angle)
                         :precision binary64
                         (if (<= a 1.8e+174)
                           (fma angle (* (* a a) (* (* angle 3.08641975308642e-5) (* PI PI))) (* b b))
                           (* a (* (* a angle) (* 3.08641975308642e-5 (* angle (* PI PI)))))))
                        double code(double a, double b, double angle) {
                        	double tmp;
                        	if (a <= 1.8e+174) {
                        		tmp = fma(angle, ((a * a) * ((angle * 3.08641975308642e-5) * (((double) M_PI) * ((double) M_PI)))), (b * b));
                        	} else {
                        		tmp = a * ((a * angle) * (3.08641975308642e-5 * (angle * (((double) M_PI) * ((double) M_PI)))));
                        	}
                        	return tmp;
                        }
                        
                        function code(a, b, angle)
                        	tmp = 0.0
                        	if (a <= 1.8e+174)
                        		tmp = fma(angle, Float64(Float64(a * a) * Float64(Float64(angle * 3.08641975308642e-5) * Float64(pi * pi))), Float64(b * b));
                        	else
                        		tmp = Float64(a * Float64(Float64(a * angle) * Float64(3.08641975308642e-5 * Float64(angle * Float64(pi * pi)))));
                        	end
                        	return tmp
                        end
                        
                        code[a_, b_, angle_] := If[LessEqual[a, 1.8e+174], N[(angle * N[(N[(a * a), $MachinePrecision] * N[(N[(angle * 3.08641975308642e-5), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(a * angle), $MachinePrecision] * N[(3.08641975308642e-5 * N[(angle * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;a \leq 1.8 \cdot 10^{+174}:\\
                        \;\;\;\;\mathsf{fma}\left(angle, \left(a \cdot a\right) \cdot \left(\left(angle \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\pi \cdot \pi\right)\right), b \cdot b\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;a \cdot \left(\left(a \cdot angle\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if a < 1.8000000000000001e174

                          1. Initial program 71.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. Simplified71.9%

                              \[\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. accelerator-lowering-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. Simplified56.5%

                              \[\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. *-commutativeN/A

                                \[\leadsto \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) \cdot \left(a \cdot a\right)} + b \cdot b \]
                              2. associate-*l*N/A

                                \[\leadsto \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)} \cdot \left(a \cdot a\right) + b \cdot b \]
                              3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

                            if 1.8000000000000001e174 < 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. Simplified99.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. accelerator-lowering-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. Simplified51.0%

                                \[\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 \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                                2. associate-*r*N/A

                                  \[\leadsto \color{blue}{{a}^{2} \cdot \left(\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)} \]
                                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)} \]
                                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) \]
                                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)} \]
                                6. *-lowering-*.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. *-lowering-*.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. 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) \]
                                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 {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)} \]
                                12. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

                                  \[\leadsto \color{blue}{a \cdot \left(a \cdot \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)\right)} \]
                                2. *-commutativeN/A

                                  \[\leadsto \color{blue}{\left(a \cdot \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)\right) \cdot a} \]
                                3. *-lowering-*.f64N/A

                                  \[\leadsto \color{blue}{\left(a \cdot \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)\right) \cdot a} \]
                                4. associate-*r*N/A

                                  \[\leadsto \color{blue}{\left(\left(a \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)\right)} \cdot a \]
                                5. *-lowering-*.f64N/A

                                  \[\leadsto \color{blue}{\left(\left(a \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)\right)} \cdot a \]
                                6. *-lowering-*.f64N/A

                                  \[\leadsto \left(\color{blue}{\left(a \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)\right) \cdot a \]
                                7. *-commutativeN/A

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

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

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

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

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

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

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

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

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

                            Alternative 10: 61.9% accurate, 12.1× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 1.5 \cdot 10^{+181}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(\left(a \cdot angle\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\ \end{array} \end{array} \]
                            (FPCore (a b angle)
                             :precision binary64
                             (if (<= a 1.5e+181)
                               (* b b)
                               (* a (* (* a angle) (* 3.08641975308642e-5 (* angle (* PI PI)))))))
                            double code(double a, double b, double angle) {
                            	double tmp;
                            	if (a <= 1.5e+181) {
                            		tmp = b * b;
                            	} else {
                            		tmp = a * ((a * angle) * (3.08641975308642e-5 * (angle * (((double) M_PI) * ((double) M_PI)))));
                            	}
                            	return tmp;
                            }
                            
                            public static double code(double a, double b, double angle) {
                            	double tmp;
                            	if (a <= 1.5e+181) {
                            		tmp = b * b;
                            	} else {
                            		tmp = a * ((a * angle) * (3.08641975308642e-5 * (angle * (Math.PI * Math.PI))));
                            	}
                            	return tmp;
                            }
                            
                            def code(a, b, angle):
                            	tmp = 0
                            	if a <= 1.5e+181:
                            		tmp = b * b
                            	else:
                            		tmp = a * ((a * angle) * (3.08641975308642e-5 * (angle * (math.pi * math.pi))))
                            	return tmp
                            
                            function code(a, b, angle)
                            	tmp = 0.0
                            	if (a <= 1.5e+181)
                            		tmp = Float64(b * b);
                            	else
                            		tmp = Float64(a * Float64(Float64(a * angle) * Float64(3.08641975308642e-5 * Float64(angle * Float64(pi * pi)))));
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(a, b, angle)
                            	tmp = 0.0;
                            	if (a <= 1.5e+181)
                            		tmp = b * b;
                            	else
                            		tmp = a * ((a * angle) * (3.08641975308642e-5 * (angle * (pi * pi))));
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[a_, b_, angle_] := If[LessEqual[a, 1.5e+181], N[(b * b), $MachinePrecision], N[(a * N[(N[(a * angle), $MachinePrecision] * N[(3.08641975308642e-5 * N[(angle * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;a \leq 1.5 \cdot 10^{+181}:\\
                            \;\;\;\;b \cdot b\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;a \cdot \left(\left(a \cdot angle\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if a < 1.50000000000000006e181

                              1. Initial program 71.7%

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

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

                                  \[\leadsto \color{blue}{b \cdot b} \]
                                2. *-lowering-*.f6456.3

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

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

                              if 1.50000000000000006e181 < 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. Simplified99.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. accelerator-lowering-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. Simplified52.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 \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                                  2. associate-*r*N/A

                                    \[\leadsto \color{blue}{{a}^{2} \cdot \left(\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)} \]
                                  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)} \]
                                  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) \]
                                  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)} \]
                                  6. *-lowering-*.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. *-lowering-*.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. 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) \]
                                  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 {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)} \]
                                  12. *-lowering-*.f64N/A

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

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

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

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

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

                                    \[\leadsto \left(a \cdot a\right) \cdot \left(angle \cdot \left(angle \cdot \left(\frac{1}{32400} \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
                                  18. PI-lowering-PI.f6452.6

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

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

                                    \[\leadsto \color{blue}{a \cdot \left(a \cdot \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)\right)} \]
                                  2. *-commutativeN/A

                                    \[\leadsto \color{blue}{\left(a \cdot \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)\right) \cdot a} \]
                                  3. *-lowering-*.f64N/A

                                    \[\leadsto \color{blue}{\left(a \cdot \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)\right) \cdot a} \]
                                  4. associate-*r*N/A

                                    \[\leadsto \color{blue}{\left(\left(a \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)\right)} \cdot a \]
                                  5. *-lowering-*.f64N/A

                                    \[\leadsto \color{blue}{\left(\left(a \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)\right)} \cdot a \]
                                  6. *-lowering-*.f64N/A

                                    \[\leadsto \left(\color{blue}{\left(a \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)\right) \cdot a \]
                                  7. *-commutativeN/A

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

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

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

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

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

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

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

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

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

                              Alternative 11: 60.8% accurate, 12.1× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 1.5 \cdot 10^{+181}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot \left(a \cdot \left(angle \cdot angle\right)\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\\ \end{array} \end{array} \]
                              (FPCore (a b angle)
                               :precision binary64
                               (if (<= a 1.5e+181)
                                 (* b b)
                                 (* (* a (* a (* angle angle))) (* 3.08641975308642e-5 (* PI PI)))))
                              double code(double a, double b, double angle) {
                              	double tmp;
                              	if (a <= 1.5e+181) {
                              		tmp = b * b;
                              	} else {
                              		tmp = (a * (a * (angle * angle))) * (3.08641975308642e-5 * (((double) M_PI) * ((double) M_PI)));
                              	}
                              	return tmp;
                              }
                              
                              public static double code(double a, double b, double angle) {
                              	double tmp;
                              	if (a <= 1.5e+181) {
                              		tmp = b * b;
                              	} else {
                              		tmp = (a * (a * (angle * angle))) * (3.08641975308642e-5 * (Math.PI * Math.PI));
                              	}
                              	return tmp;
                              }
                              
                              def code(a, b, angle):
                              	tmp = 0
                              	if a <= 1.5e+181:
                              		tmp = b * b
                              	else:
                              		tmp = (a * (a * (angle * angle))) * (3.08641975308642e-5 * (math.pi * math.pi))
                              	return tmp
                              
                              function code(a, b, angle)
                              	tmp = 0.0
                              	if (a <= 1.5e+181)
                              		tmp = Float64(b * b);
                              	else
                              		tmp = Float64(Float64(a * Float64(a * Float64(angle * angle))) * Float64(3.08641975308642e-5 * Float64(pi * pi)));
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(a, b, angle)
                              	tmp = 0.0;
                              	if (a <= 1.5e+181)
                              		tmp = b * b;
                              	else
                              		tmp = (a * (a * (angle * angle))) * (3.08641975308642e-5 * (pi * pi));
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[a_, b_, angle_] := If[LessEqual[a, 1.5e+181], N[(b * b), $MachinePrecision], N[(N[(a * N[(a * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(3.08641975308642e-5 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;a \leq 1.5 \cdot 10^{+181}:\\
                              \;\;\;\;b \cdot b\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\left(a \cdot \left(a \cdot \left(angle \cdot angle\right)\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if a < 1.50000000000000006e181

                                1. Initial program 71.7%

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

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

                                    \[\leadsto \color{blue}{b \cdot b} \]
                                  2. *-lowering-*.f6456.3

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

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

                                if 1.50000000000000006e181 < 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. Simplified99.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. accelerator-lowering-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. Simplified52.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 \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                                    2. associate-*r*N/A

                                      \[\leadsto \color{blue}{{a}^{2} \cdot \left(\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)} \]
                                    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)} \]
                                    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) \]
                                    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)} \]
                                    6. *-lowering-*.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. *-lowering-*.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. 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) \]
                                    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 {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)} \]
                                    12. *-lowering-*.f64N/A

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

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

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

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

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

                                      \[\leadsto \left(a \cdot a\right) \cdot \left(angle \cdot \left(angle \cdot \left(\frac{1}{32400} \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
                                    18. PI-lowering-PI.f6452.6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                Alternative 12: 60.4% accurate, 12.1× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 1.25 \cdot 10^{+115}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot a\right) \cdot \left(angle \cdot \left(\left(angle \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\pi \cdot \pi\right)\right)\right)\\ \end{array} \end{array} \]
                                (FPCore (a b angle)
                                 :precision binary64
                                 (if (<= a 1.25e+115)
                                   (* b b)
                                   (* (* a a) (* angle (* (* angle 3.08641975308642e-5) (* PI PI))))))
                                double code(double a, double b, double angle) {
                                	double tmp;
                                	if (a <= 1.25e+115) {
                                		tmp = b * b;
                                	} else {
                                		tmp = (a * a) * (angle * ((angle * 3.08641975308642e-5) * (((double) M_PI) * ((double) M_PI))));
                                	}
                                	return tmp;
                                }
                                
                                public static double code(double a, double b, double angle) {
                                	double tmp;
                                	if (a <= 1.25e+115) {
                                		tmp = b * b;
                                	} else {
                                		tmp = (a * a) * (angle * ((angle * 3.08641975308642e-5) * (Math.PI * Math.PI)));
                                	}
                                	return tmp;
                                }
                                
                                def code(a, b, angle):
                                	tmp = 0
                                	if a <= 1.25e+115:
                                		tmp = b * b
                                	else:
                                		tmp = (a * a) * (angle * ((angle * 3.08641975308642e-5) * (math.pi * math.pi)))
                                	return tmp
                                
                                function code(a, b, angle)
                                	tmp = 0.0
                                	if (a <= 1.25e+115)
                                		tmp = Float64(b * b);
                                	else
                                		tmp = Float64(Float64(a * a) * Float64(angle * Float64(Float64(angle * 3.08641975308642e-5) * Float64(pi * pi))));
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(a, b, angle)
                                	tmp = 0.0;
                                	if (a <= 1.25e+115)
                                		tmp = b * b;
                                	else
                                		tmp = (a * a) * (angle * ((angle * 3.08641975308642e-5) * (pi * pi)));
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[a_, b_, angle_] := If[LessEqual[a, 1.25e+115], N[(b * b), $MachinePrecision], N[(N[(a * a), $MachinePrecision] * N[(angle * N[(N[(angle * 3.08641975308642e-5), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;a \leq 1.25 \cdot 10^{+115}:\\
                                \;\;\;\;b \cdot b\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\left(a \cdot a\right) \cdot \left(angle \cdot \left(\left(angle \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\pi \cdot \pi\right)\right)\right)\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if a < 1.25000000000000002e115

                                  1. Initial program 70.8%

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

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

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

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

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

                                  if 1.25000000000000002e115 < a

                                  1. Initial program 94.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. Simplified94.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. accelerator-lowering-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. Simplified55.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 \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                                      2. associate-*r*N/A

                                        \[\leadsto \color{blue}{{a}^{2} \cdot \left(\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)} \]
                                      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)} \]
                                      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) \]
                                      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)} \]
                                      6. *-lowering-*.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. *-lowering-*.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. 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) \]
                                      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 {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)} \]
                                      12. *-lowering-*.f64N/A

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

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

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

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

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

                                        \[\leadsto \left(a \cdot a\right) \cdot \left(angle \cdot \left(angle \cdot \left(\frac{1}{32400} \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
                                      18. PI-lowering-PI.f6453.3

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

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

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

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

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

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

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

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

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

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

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

                                  Alternative 13: 60.4% accurate, 12.1× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 1.22 \cdot 10^{+117}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot a\right) \cdot \left(angle \cdot \left(angle \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\ \end{array} \end{array} \]
                                  (FPCore (a b angle)
                                   :precision binary64
                                   (if (<= a 1.22e+117)
                                     (* b b)
                                     (* (* a a) (* angle (* angle (* 3.08641975308642e-5 (* PI PI)))))))
                                  double code(double a, double b, double angle) {
                                  	double tmp;
                                  	if (a <= 1.22e+117) {
                                  		tmp = b * b;
                                  	} else {
                                  		tmp = (a * a) * (angle * (angle * (3.08641975308642e-5 * (((double) M_PI) * ((double) M_PI)))));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  public static double code(double a, double b, double angle) {
                                  	double tmp;
                                  	if (a <= 1.22e+117) {
                                  		tmp = b * b;
                                  	} else {
                                  		tmp = (a * a) * (angle * (angle * (3.08641975308642e-5 * (Math.PI * Math.PI))));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(a, b, angle):
                                  	tmp = 0
                                  	if a <= 1.22e+117:
                                  		tmp = b * b
                                  	else:
                                  		tmp = (a * a) * (angle * (angle * (3.08641975308642e-5 * (math.pi * math.pi))))
                                  	return tmp
                                  
                                  function code(a, b, angle)
                                  	tmp = 0.0
                                  	if (a <= 1.22e+117)
                                  		tmp = Float64(b * b);
                                  	else
                                  		tmp = Float64(Float64(a * a) * Float64(angle * Float64(angle * Float64(3.08641975308642e-5 * Float64(pi * pi)))));
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(a, b, angle)
                                  	tmp = 0.0;
                                  	if (a <= 1.22e+117)
                                  		tmp = b * b;
                                  	else
                                  		tmp = (a * a) * (angle * (angle * (3.08641975308642e-5 * (pi * pi))));
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[a_, b_, angle_] := If[LessEqual[a, 1.22e+117], N[(b * b), $MachinePrecision], N[(N[(a * a), $MachinePrecision] * N[(angle * N[(angle * N[(3.08641975308642e-5 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;a \leq 1.22 \cdot 10^{+117}:\\
                                  \;\;\;\;b \cdot b\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\left(a \cdot a\right) \cdot \left(angle \cdot \left(angle \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if a < 1.22000000000000004e117

                                    1. Initial program 70.8%

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

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

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

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

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

                                    if 1.22000000000000004e117 < a

                                    1. Initial program 94.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. Simplified94.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. accelerator-lowering-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. Simplified55.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 \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                                        2. associate-*r*N/A

                                          \[\leadsto \color{blue}{{a}^{2} \cdot \left(\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)} \]
                                        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)} \]
                                        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) \]
                                        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)} \]
                                        6. *-lowering-*.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. *-lowering-*.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. 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) \]
                                        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 {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)} \]
                                        12. *-lowering-*.f64N/A

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

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

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

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

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

                                          \[\leadsto \left(a \cdot a\right) \cdot \left(angle \cdot \left(angle \cdot \left(\frac{1}{32400} \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
                                        18. PI-lowering-PI.f6453.3

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

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

                                    Alternative 14: 57.5% accurate, 74.7× speedup?

                                    \[\begin{array}{l} \\ b \cdot b \end{array} \]
                                    (FPCore (a b angle) :precision binary64 (* b b))
                                    double code(double a, double b, double angle) {
                                    	return b * b;
                                    }
                                    
                                    real(8) function code(a, b, angle)
                                        real(8), intent (in) :: a
                                        real(8), intent (in) :: b
                                        real(8), intent (in) :: angle
                                        code = b * b
                                    end function
                                    
                                    public static double code(double a, double b, double angle) {
                                    	return b * b;
                                    }
                                    
                                    def code(a, b, angle):
                                    	return b * b
                                    
                                    function code(a, b, angle)
                                    	return Float64(b * b)
                                    end
                                    
                                    function tmp = code(a, b, angle)
                                    	tmp = b * b;
                                    end
                                    
                                    code[a_, b_, angle_] := N[(b * b), $MachinePrecision]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    b \cdot b
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 75.3%

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

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

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

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

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

                                    Reproduce

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