ab-angle->ABCF A

Percentage Accurate: 79.6% → 78.9%
Time: 16.1s
Alternatives: 13
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 13 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: 78.9% accurate, 2.5× speedup?

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

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

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


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

    1. Initial program 85.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), b \cdot b\right)} \]
      4. Taylor expanded in angle around 0

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(angle \cdot \left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right) + \frac{-1}{34992000} \cdot \left(a \cdot \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right)}\right)\right), a \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right), b \cdot b\right) \]
      6. Simplified75.5%

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

      if 5.00000000000000036e-18 < (/.f64 angle #s(literal 180 binary64))

      1. Initial program 69.6%

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

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

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

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

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

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

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

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

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

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

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

      Alternative 2: 12.3% accurate, 1.0× speedup?

      \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \pi \cdot \frac{angle\_m}{180}\\ \mathbf{if}\;{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \leq 5 \cdot 10^{-236}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;b\\ \end{array} \end{array} \]
      angle_m = (fabs.f64 angle)
      (FPCore (a b angle_m)
       :precision binary64
       (let* ((t_0 (* PI (/ angle_m 180.0))))
         (if (<= (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0)) 5e-236)
           0.0
           b)))
      angle_m = fabs(angle);
      double code(double a, double b, double angle_m) {
      	double t_0 = ((double) M_PI) * (angle_m / 180.0);
      	double tmp;
      	if ((pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0)) <= 5e-236) {
      		tmp = 0.0;
      	} else {
      		tmp = b;
      	}
      	return tmp;
      }
      
      angle_m = Math.abs(angle);
      public static double code(double a, double b, double angle_m) {
      	double t_0 = Math.PI * (angle_m / 180.0);
      	double tmp;
      	if ((Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0)) <= 5e-236) {
      		tmp = 0.0;
      	} else {
      		tmp = b;
      	}
      	return tmp;
      }
      
      angle_m = math.fabs(angle)
      def code(a, b, angle_m):
      	t_0 = math.pi * (angle_m / 180.0)
      	tmp = 0
      	if (math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)) <= 5e-236:
      		tmp = 0.0
      	else:
      		tmp = b
      	return tmp
      
      angle_m = abs(angle)
      function code(a, b, angle_m)
      	t_0 = Float64(pi * Float64(angle_m / 180.0))
      	tmp = 0.0
      	if (Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) <= 5e-236)
      		tmp = 0.0;
      	else
      		tmp = b;
      	end
      	return tmp
      end
      
      angle_m = abs(angle);
      function tmp_2 = code(a, b, angle_m)
      	t_0 = pi * (angle_m / 180.0);
      	tmp = 0.0;
      	if ((((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0)) <= 5e-236)
      		tmp = 0.0;
      	else
      		tmp = b;
      	end
      	tmp_2 = tmp;
      end
      
      angle_m = N[Abs[angle], $MachinePrecision]
      code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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], 5e-236], 0.0, b]]
      
      \begin{array}{l}
      angle_m = \left|angle\right|
      
      \\
      \begin{array}{l}
      t_0 := \pi \cdot \frac{angle\_m}{180}\\
      \mathbf{if}\;{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \leq 5 \cdot 10^{-236}:\\
      \;\;\;\;0\\
      
      \mathbf{else}:\\
      \;\;\;\;b\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) < 4.9999999999999998e-236

        1. Initial program 90.5%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(b \cdot b, \frac{1}{2}, \color{blue}{b \cdot \left(b \cdot \frac{1}{2}\right)}\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fma}\left(b \cdot b, \frac{1}{2}, \color{blue}{b \cdot \left(b \cdot \frac{1}{2}\right)}\right) \]
          5. *-lowering-*.f6483.5

            \[\leadsto \mathsf{fma}\left(b \cdot b, 0.5, b \cdot \color{blue}{\left(b \cdot 0.5\right)}\right) \]
        8. Simplified83.5%

          \[\leadsto \mathsf{fma}\left(b \cdot b, 0.5, \color{blue}{b \cdot \left(b \cdot 0.5\right)}\right) \]
        9. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \left(b \cdot b\right) \cdot \frac{1}{2} + \color{blue}{\left(b \cdot b\right) \cdot \frac{1}{2}} \]
          2. flip-+N/A

            \[\leadsto \color{blue}{\frac{\left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) - \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right)}{\left(b \cdot b\right) \cdot \frac{1}{2} - \left(b \cdot b\right) \cdot \frac{1}{2}}} \]
          3. +-inversesN/A

            \[\leadsto \frac{\left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) - \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right)}{\color{blue}{0}} \]
          4. +-inversesN/A

            \[\leadsto \frac{\color{blue}{0}}{0} \]
          5. metadata-evalN/A

            \[\leadsto \frac{\color{blue}{0 + 0}}{0} \]
          6. metadata-evalN/A

            \[\leadsto \frac{\color{blue}{{0}^{3}} + 0}{0} \]
          7. metadata-evalN/A

            \[\leadsto \frac{{0}^{3} + \color{blue}{{0}^{3}}}{0} \]
          8. metadata-evalN/A

            \[\leadsto \frac{{0}^{3} + {0}^{3}}{\color{blue}{0 + 0}} \]
          9. metadata-evalN/A

            \[\leadsto \frac{{0}^{3} + {0}^{3}}{\color{blue}{0 \cdot 0} + 0} \]
          10. metadata-evalN/A

            \[\leadsto \frac{{0}^{3} + {0}^{3}}{0 \cdot 0 + \color{blue}{\left(0 - 0\right)}} \]
          11. metadata-evalN/A

            \[\leadsto \frac{{0}^{3} + {0}^{3}}{0 \cdot 0 + \left(\color{blue}{0 \cdot 0} - 0\right)} \]
          12. metadata-evalN/A

            \[\leadsto \frac{{0}^{3} + {0}^{3}}{0 \cdot 0 + \left(0 \cdot 0 - \color{blue}{0 \cdot 0}\right)} \]
          13. flip3-+N/A

            \[\leadsto \color{blue}{0 + 0} \]
          14. metadata-eval73.7

            \[\leadsto \color{blue}{0} \]
        10. Applied egg-rr73.7%

          \[\leadsto \color{blue}{0} \]

        if 4.9999999999999998e-236 < (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)))

        1. Initial program 81.1%

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right), \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right), {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
        4. Applied egg-rr75.0%

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(b \cdot b, \frac{1}{2}, \color{blue}{b \cdot \left(b \cdot \frac{1}{2}\right)}\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fma}\left(b \cdot b, \frac{1}{2}, \color{blue}{b \cdot \left(b \cdot \frac{1}{2}\right)}\right) \]
          5. *-lowering-*.f6453.4

            \[\leadsto \mathsf{fma}\left(b \cdot b, 0.5, b \cdot \color{blue}{\left(b \cdot 0.5\right)}\right) \]
        8. Simplified53.4%

          \[\leadsto \mathsf{fma}\left(b \cdot b, 0.5, \color{blue}{b \cdot \left(b \cdot 0.5\right)}\right) \]
        9. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \left(b \cdot b\right) \cdot \frac{1}{2} + \color{blue}{\left(b \cdot b\right) \cdot \frac{1}{2}} \]
          2. flip-+N/A

            \[\leadsto \color{blue}{\frac{\left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) - \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right)}{\left(b \cdot b\right) \cdot \frac{1}{2} - \left(b \cdot b\right) \cdot \frac{1}{2}}} \]
          3. +-inversesN/A

            \[\leadsto \frac{\left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) - \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right)}{\color{blue}{0}} \]
          4. +-inversesN/A

            \[\leadsto \frac{\color{blue}{0}}{0} \]
          5. metadata-evalN/A

            \[\leadsto \frac{\color{blue}{0 + 0}}{0} \]
          6. metadata-evalN/A

            \[\leadsto \frac{\color{blue}{{0}^{3}} + 0}{0} \]
          7. metadata-evalN/A

            \[\leadsto \frac{{0}^{3} + \color{blue}{{0}^{3}}}{0} \]
          8. metadata-evalN/A

            \[\leadsto \frac{{0}^{3} + {0}^{3}}{\color{blue}{0 + 0}} \]
          9. metadata-evalN/A

            \[\leadsto \frac{{0}^{3} + {0}^{3}}{\color{blue}{0 \cdot 0} + 0} \]
          10. metadata-evalN/A

            \[\leadsto \frac{{0}^{3} + {0}^{3}}{0 \cdot 0 + \color{blue}{\left(0 - 0\right)}} \]
          11. metadata-evalN/A

            \[\leadsto \frac{{0}^{3} + {0}^{3}}{0 \cdot 0 + \left(\color{blue}{0 \cdot 0} - 0\right)} \]
          12. metadata-evalN/A

            \[\leadsto \frac{{0}^{3} + {0}^{3}}{0 \cdot 0 + \left(0 \cdot 0 - \color{blue}{0 \cdot 0}\right)} \]
          13. flip3-+N/A

            \[\leadsto \color{blue}{0 + 0} \]
          14. metadata-eval2.3

            \[\leadsto \color{blue}{0} \]
          15. metadata-evalN/A

            \[\leadsto \color{blue}{{0}^{\frac{1}{2}}} \]
        10. Applied egg-rr3.4%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(a \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \leq 5 \cdot 10^{-236}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;b\\ \end{array} \]
      5. Add Preprocessing

      Alternative 3: 79.5% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 4: 79.5% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto {\left(a \cdot \sin \color{blue}{\left(angle \cdot \frac{\mathsf{PI}\left(\right)}{180}\right)}\right)}^{2} + b \cdot b \]
            3. div-invN/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 \]
            4. metadata-evalN/A

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

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

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

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

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

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

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

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

          Alternative 5: 78.9% accurate, 2.9× speedup?

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

            1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 5.00000000000000036e-18 < (/.f64 angle #s(literal 180 binary64))

              1. Initial program 69.6%

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

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

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

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

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

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

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

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

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

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

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

              Alternative 6: 66.9% accurate, 3.4× speedup?

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

                1. Initial program 81.3%

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

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

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

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

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

                if 9.1999999999999992e-90 < a

                1. Initial program 84.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. Simplified84.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 7: 66.6% accurate, 10.4× speedup?

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

                  1. Initial program 81.3%

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

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

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

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

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

                  if 7.80000000000000009e-90 < a

                  1. Initial program 84.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. Simplified84.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 8: 66.5% accurate, 10.4× speedup?

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

                    1. Initial program 81.3%

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

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

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

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

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

                    if 1.0199999999999999e-89 < a

                    1. Initial program 84.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. Simplified84.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 9: 65.4% accurate, 10.4× speedup?

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

                      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. Simplified80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 4.39999999999999997e111 < b

                        1. Initial program 92.8%

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

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

                            \[\leadsto \color{blue}{b \cdot b} \]
                          2. *-lowering-*.f6492.7

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

                          \[\leadsto \color{blue}{b \cdot b} \]
                      5. Recombined 2 regimes into one program.
                      6. Final simplification72.6%

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

                      Alternative 10: 65.4% accurate, 10.4× speedup?

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

                        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. Simplified80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if 6.8999999999999999e112 < b

                          1. Initial program 92.8%

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

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

                              \[\leadsto \color{blue}{b \cdot b} \]
                            2. *-lowering-*.f6492.7

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

                            \[\leadsto \color{blue}{b \cdot b} \]
                        5. Recombined 2 regimes into one program.
                        6. Add Preprocessing

                        Alternative 11: 61.1% accurate, 12.1× speedup?

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

                          1. Initial program 78.9%

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

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

                              \[\leadsto \color{blue}{b \cdot b} \]
                            2. *-lowering-*.f6461.8

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

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

                          if 3.3e143 < a

                          1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 12: 57.3% accurate, 74.7× speedup?

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

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

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

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

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

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

                          Alternative 13: 11.5% accurate, 448.0× speedup?

                          \[\begin{array}{l} angle_m = \left|angle\right| \\ 0 \end{array} \]
                          angle_m = (fabs.f64 angle)
                          (FPCore (a b angle_m) :precision binary64 0.0)
                          angle_m = fabs(angle);
                          double code(double a, double b, double angle_m) {
                          	return 0.0;
                          }
                          
                          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 = 0.0d0
                          end function
                          
                          angle_m = Math.abs(angle);
                          public static double code(double a, double b, double angle_m) {
                          	return 0.0;
                          }
                          
                          angle_m = math.fabs(angle)
                          def code(a, b, angle_m):
                          	return 0.0
                          
                          angle_m = abs(angle)
                          function code(a, b, angle_m)
                          	return 0.0
                          end
                          
                          angle_m = abs(angle);
                          function tmp = code(a, b, angle_m)
                          	tmp = 0.0;
                          end
                          
                          angle_m = N[Abs[angle], $MachinePrecision]
                          code[a_, b_, angle$95$m_] := 0.0
                          
                          \begin{array}{l}
                          angle_m = \left|angle\right|
                          
                          \\
                          0
                          \end{array}
                          
                          Derivation
                          1. Initial program 82.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. Step-by-step derivation
                            1. unpow2N/A

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

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

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

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot \left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right), \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right), {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
                          4. Applied egg-rr76.8%

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(b \cdot b, \frac{1}{2}, \color{blue}{b \cdot \left(b \cdot \frac{1}{2}\right)}\right) \]
                            4. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{fma}\left(b \cdot b, \frac{1}{2}, \color{blue}{b \cdot \left(b \cdot \frac{1}{2}\right)}\right) \]
                            5. *-lowering-*.f6457.0

                              \[\leadsto \mathsf{fma}\left(b \cdot b, 0.5, b \cdot \color{blue}{\left(b \cdot 0.5\right)}\right) \]
                          8. Simplified57.0%

                            \[\leadsto \mathsf{fma}\left(b \cdot b, 0.5, \color{blue}{b \cdot \left(b \cdot 0.5\right)}\right) \]
                          9. Step-by-step derivation
                            1. associate-*r*N/A

                              \[\leadsto \left(b \cdot b\right) \cdot \frac{1}{2} + \color{blue}{\left(b \cdot b\right) \cdot \frac{1}{2}} \]
                            2. flip-+N/A

                              \[\leadsto \color{blue}{\frac{\left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) - \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right)}{\left(b \cdot b\right) \cdot \frac{1}{2} - \left(b \cdot b\right) \cdot \frac{1}{2}}} \]
                            3. +-inversesN/A

                              \[\leadsto \frac{\left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) - \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{2}\right)}{\color{blue}{0}} \]
                            4. +-inversesN/A

                              \[\leadsto \frac{\color{blue}{0}}{0} \]
                            5. metadata-evalN/A

                              \[\leadsto \frac{\color{blue}{0 + 0}}{0} \]
                            6. metadata-evalN/A

                              \[\leadsto \frac{\color{blue}{{0}^{3}} + 0}{0} \]
                            7. metadata-evalN/A

                              \[\leadsto \frac{{0}^{3} + \color{blue}{{0}^{3}}}{0} \]
                            8. metadata-evalN/A

                              \[\leadsto \frac{{0}^{3} + {0}^{3}}{\color{blue}{0 + 0}} \]
                            9. metadata-evalN/A

                              \[\leadsto \frac{{0}^{3} + {0}^{3}}{\color{blue}{0 \cdot 0} + 0} \]
                            10. metadata-evalN/A

                              \[\leadsto \frac{{0}^{3} + {0}^{3}}{0 \cdot 0 + \color{blue}{\left(0 - 0\right)}} \]
                            11. metadata-evalN/A

                              \[\leadsto \frac{{0}^{3} + {0}^{3}}{0 \cdot 0 + \left(\color{blue}{0 \cdot 0} - 0\right)} \]
                            12. metadata-evalN/A

                              \[\leadsto \frac{{0}^{3} + {0}^{3}}{0 \cdot 0 + \left(0 \cdot 0 - \color{blue}{0 \cdot 0}\right)} \]
                            13. flip3-+N/A

                              \[\leadsto \color{blue}{0 + 0} \]
                            14. metadata-eval10.7

                              \[\leadsto \color{blue}{0} \]
                          10. Applied egg-rr10.7%

                            \[\leadsto \color{blue}{0} \]
                          11. Add Preprocessing

                          Reproduce

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