ab-angle->ABCF A

Percentage Accurate: 79.6% → 79.1%
Time: 14.0s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 79.6% accurate, 1.0× speedup?

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

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

Alternative 1: 79.1% accurate, 3.0× speedup?

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

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

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


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

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 64.0%

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

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

          \[\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 {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{{b}^{2}} \]
        3. Step-by-step derivation
          1. unpow2N/A

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

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

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

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

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

      Alternative 2: 79.5% accurate, 1.8× speedup?

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

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

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

          \[\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 {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{{b}^{2}} \]
        3. Step-by-step derivation
          1. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 3: 79.6% accurate, 2.0× speedup?

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

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

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

            \[\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 {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{{b}^{2}} \]
          3. Step-by-step derivation
            1. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 4: 66.8% accurate, 3.4× speedup?

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

            1. Initial program 79.4%

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

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

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

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

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

            if 4.20000000000000006e-65 < a

            1. Initial program 81.2%

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

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
            4. Step-by-step derivation
              1. Applied rewrites81.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 {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{{b}^{2}} \]
              3. Step-by-step derivation
                1. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

            Alternative 5: 66.8% accurate, 3.4× speedup?

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

              1. Initial program 79.4%

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

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

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

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

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

              if 4.20000000000000006e-65 < a

              1. Initial program 81.2%

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

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
              4. Step-by-step derivation
                1. Applied rewrites81.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 {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{{b}^{2}} \]
                3. Step-by-step derivation
                  1. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 6: 64.2% accurate, 9.1× speedup?

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

                1. Initial program 79.4%

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

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

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

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

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

                if 4.20000000000000006e-65 < a < 9.5000000000000002e139

                1. Initial program 68.9%

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

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

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

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

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

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

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

                  if 9.5000000000000002e139 < a

                  1. Initial program 95.6%

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

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

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

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

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

                    \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                  7. Step-by-step derivation
                    1. Applied rewrites78.5%

                      \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\left(angle \cdot angle\right) \cdot a\right)\right)\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)} \]
                    2. Step-by-step derivation
                      1. Applied rewrites92.9%

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

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

                    Alternative 7: 62.8% accurate, 12.1× speedup?

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

                      1. Initial program 77.1%

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

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

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

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

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

                      if 9.2e139 < a

                      1. Initial program 95.6%

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

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

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

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

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

                        \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                      7. Step-by-step derivation
                        1. Applied rewrites78.5%

                          \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\left(angle \cdot angle\right) \cdot a\right)\right)\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)} \]
                        2. Step-by-step derivation
                          1. Applied rewrites92.9%

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

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

                        Alternative 8: 62.4% accurate, 12.1× speedup?

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

                          1. Initial program 77.1%

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

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

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

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

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

                          if 9.5000000000000002e139 < a

                          1. Initial program 95.6%

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

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

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

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

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

                            \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                          7. Step-by-step derivation
                            1. Applied rewrites78.5%

                              \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\left(angle \cdot angle\right) \cdot a\right)\right)\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)} \]
                            2. Step-by-step derivation
                              1. Applied rewrites88.2%

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

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

                            Alternative 9: 61.0% accurate, 12.1× speedup?

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

                              1. Initial program 77.1%

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

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

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

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

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

                              if 9.5000000000000002e139 < a

                              1. Initial program 95.6%

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

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

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

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

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

                                \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                              7. Step-by-step derivation
                                1. Applied rewrites78.5%

                                  \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\left(angle \cdot angle\right) \cdot a\right)\right)\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)} \]
                                2. Step-by-step derivation
                                  1. Applied rewrites78.6%

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

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

                                Alternative 10: 61.5% accurate, 12.1× speedup?

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

                                  1. Initial program 77.1%

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

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

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

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

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

                                  if 9.2e139 < a

                                  1. Initial program 95.6%

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

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

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

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

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

                                    \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites78.5%

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

                                      \[\leadsto \left(\frac{1}{32400} \cdot \left({a}^{2} \cdot {angle}^{2}\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites72.1%

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

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

                                    Alternative 11: 56.8% accurate, 74.7× speedup?

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

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

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

                                        \[\leadsto \color{blue}{b \cdot b} \]
                                      2. lower-*.f6456.7

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

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

                                    Reproduce

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