ab-angle->ABCF C

Percentage Accurate: 79.3% → 79.3%
Time: 19.6s
Alternatives: 13
Speedup: 0.7×

Specification

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

\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin 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.3% accurate, 1.0× speedup?

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

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

Alternative 1: 79.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\\ t_1 := b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\\ \mathsf{fma}\left(t\_1, t\_1, a \cdot \left(a \cdot \mathsf{fma}\left(0.5, \mathsf{fma}\left(t\_0, t\_0, 0 - \mathsf{fma}\left(\cos \left(\left(angle \cdot \left(\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right)\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right), 0.5\right)\right)\right) \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (cos (* PI (* angle 0.005555555555555556))))
        (t_1 (* b (sin (* (* PI angle) 0.005555555555555556)))))
   (fma
    t_1
    t_1
    (*
     a
     (*
      a
      (fma
       0.5
       (fma
        t_0
        t_0
        (-
         0.0
         (fma
          (cos
           (*
            (* angle (* (sqrt (* PI (sqrt PI))) (sqrt (sqrt PI))))
            0.011111111111111112))
          -0.5
          0.5)))
       0.5))))))
double code(double a, double b, double angle) {
	double t_0 = cos((((double) M_PI) * (angle * 0.005555555555555556)));
	double t_1 = b * sin(((((double) M_PI) * angle) * 0.005555555555555556));
	return fma(t_1, t_1, (a * (a * fma(0.5, fma(t_0, t_0, (0.0 - fma(cos(((angle * (sqrt((((double) M_PI) * sqrt(((double) M_PI)))) * sqrt(sqrt(((double) M_PI))))) * 0.011111111111111112)), -0.5, 0.5))), 0.5))));
}
function code(a, b, angle)
	t_0 = cos(Float64(pi * Float64(angle * 0.005555555555555556)))
	t_1 = Float64(b * sin(Float64(Float64(pi * angle) * 0.005555555555555556)))
	return fma(t_1, t_1, Float64(a * Float64(a * fma(0.5, fma(t_0, t_0, Float64(0.0 - fma(cos(Float64(Float64(angle * Float64(sqrt(Float64(pi * sqrt(pi))) * sqrt(sqrt(pi)))) * 0.011111111111111112)), -0.5, 0.5))), 0.5))))
end
code[a_, b_, angle_] := Block[{t$95$0 = N[Cos[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$1 * t$95$1 + N[(a * N[(a * N[(0.5 * N[(t$95$0 * t$95$0 + N[(0.0 - N[(N[Cos[N[(N[(angle * N[(N[Sqrt[N[(Pi * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Sqrt[Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\\
t_1 := b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\\
\mathsf{fma}\left(t\_1, t\_1, a \cdot \left(a \cdot \mathsf{fma}\left(0.5, \mathsf{fma}\left(t\_0, t\_0, 0 - \mathsf{fma}\left(\cos \left(\left(angle \cdot \left(\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right)\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right), 0.5\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 74.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \cos \left(e^{\log \left(\frac{180}{\color{blue}{\mathsf{PI}\left(\right) \cdot angle}}\right) \cdot -1}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
    10. PI-lowering-PI.f6441.8

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

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

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

    \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right), b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right), a \cdot \left(a \cdot \mathsf{fma}\left(0.5, \color{blue}{\mathsf{fma}\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), -\mathsf{fma}\left(\cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right)}, 0.5\right)\right)\right) \]
  7. Step-by-step derivation
    1. add-sqr-sqrtN/A

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), a \cdot \left(a \cdot \mathsf{fma}\left(\frac{1}{2}, \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right), \frac{1}{2}\right)\right)\right) \]
    2. sqrt-unprodN/A

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), a \cdot \left(a \cdot \mathsf{fma}\left(\frac{1}{2}, \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\color{blue}{\sqrt{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right), \frac{1}{2}\right)\right)\right) \]
    3. add-sqr-sqrtN/A

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), a \cdot \left(a \cdot \mathsf{fma}\left(\frac{1}{2}, \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\sqrt{\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}}} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right), \frac{1}{2}\right)\right)\right) \]
    5. add-sqr-sqrtN/A

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), a \cdot \left(a \cdot \mathsf{fma}\left(\frac{1}{2}, \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\sqrt{\left(\color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right), \frac{1}{2}\right)\right)\right) \]
    6. pow3N/A

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), a \cdot \left(a \cdot \mathsf{fma}\left(\frac{1}{2}, \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\sqrt{\color{blue}{{\left(\sqrt{\mathsf{PI}\left(\right)}\right)}^{3}} \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right), \frac{1}{2}\right)\right)\right) \]
    7. sqrt-prodN/A

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), a \cdot \left(a \cdot \mathsf{fma}\left(\frac{1}{2}, \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\color{blue}{\left(\sqrt{{\left(\sqrt{\mathsf{PI}\left(\right)}\right)}^{3}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right), \frac{1}{2}\right)\right)\right) \]
    8. pow1/2N/A

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), a \cdot \left(a \cdot \mathsf{fma}\left(\frac{1}{2}, \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\color{blue}{\left(\sqrt{{\left(\sqrt{\mathsf{PI}\left(\right)}\right)}^{3}} \cdot {\left(\sqrt{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{2}}\right)} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right), \frac{1}{2}\right)\right)\right) \]
    10. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), a \cdot \left(a \cdot \mathsf{fma}\left(\frac{1}{2}, \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\color{blue}{\sqrt{{\left(\sqrt{\mathsf{PI}\left(\right)}\right)}^{3}}} \cdot {\left(\sqrt{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{2}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right), \frac{1}{2}\right)\right)\right) \]
    11. pow3N/A

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), a \cdot \left(a \cdot \mathsf{fma}\left(\frac{1}{2}, \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\sqrt{\color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}}} \cdot {\left(\sqrt{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{2}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right), \frac{1}{2}\right)\right)\right) \]
    12. add-sqr-sqrtN/A

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), a \cdot \left(a \cdot \mathsf{fma}\left(\frac{1}{2}, \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\sqrt{\color{blue}{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot {\left(\sqrt{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{2}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right), \frac{1}{2}\right)\right)\right) \]
    13. *-lowering-*.f64N/A

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

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

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), a \cdot \left(a \cdot \mathsf{fma}\left(\frac{1}{2}, \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}} \cdot {\left(\sqrt{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{2}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right), \frac{1}{2}\right)\right)\right) \]
    17. pow1/2N/A

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), a \cdot \left(a \cdot \mathsf{fma}\left(\frac{1}{2}, \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \color{blue}{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right), \frac{1}{2}\right)\right)\right) \]
    18. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), a \cdot \left(a \cdot \mathsf{fma}\left(\frac{1}{2}, \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \color{blue}{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right), \frac{1}{2}\right)\right)\right) \]
    19. sqrt-lowering-sqrt.f64N/A

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

    \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right), b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right), a \cdot \left(a \cdot \mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), -\mathsf{fma}\left(\cos \left(\left(\color{blue}{\left(\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right)} \cdot angle\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right), 0.5\right)\right)\right) \]
  9. Final simplification74.5%

    \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right), b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right), a \cdot \left(a \cdot \mathsf{fma}\left(0.5, \mathsf{fma}\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), 0 - \mathsf{fma}\left(\cos \left(\left(angle \cdot \left(\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right)\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right), 0.5\right)\right)\right) \]
  10. Add Preprocessing

Alternative 2: 79.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\\ t_1 := b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\\ \mathsf{fma}\left(t\_1, t\_1, a \cdot \left(a \cdot \mathsf{fma}\left(0.5, \mathsf{fma}\left(t\_0, t\_0, 0 - \mathsf{fma}\left(\cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right), 0.5\right)\right)\right) \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (cos (* PI (* angle 0.005555555555555556))))
        (t_1 (* b (sin (* (* PI angle) 0.005555555555555556)))))
   (fma
    t_1
    t_1
    (*
     a
     (*
      a
      (fma
       0.5
       (fma
        t_0
        t_0
        (- 0.0 (fma (cos (* (* PI angle) 0.011111111111111112)) -0.5 0.5)))
       0.5))))))
double code(double a, double b, double angle) {
	double t_0 = cos((((double) M_PI) * (angle * 0.005555555555555556)));
	double t_1 = b * sin(((((double) M_PI) * angle) * 0.005555555555555556));
	return fma(t_1, t_1, (a * (a * fma(0.5, fma(t_0, t_0, (0.0 - fma(cos(((((double) M_PI) * angle) * 0.011111111111111112)), -0.5, 0.5))), 0.5))));
}
function code(a, b, angle)
	t_0 = cos(Float64(pi * Float64(angle * 0.005555555555555556)))
	t_1 = Float64(b * sin(Float64(Float64(pi * angle) * 0.005555555555555556)))
	return fma(t_1, t_1, Float64(a * Float64(a * fma(0.5, fma(t_0, t_0, Float64(0.0 - fma(cos(Float64(Float64(pi * angle) * 0.011111111111111112)), -0.5, 0.5))), 0.5))))
end
code[a_, b_, angle_] := Block[{t$95$0 = N[Cos[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$1 * t$95$1 + N[(a * N[(a * N[(0.5 * N[(t$95$0 * t$95$0 + N[(0.0 - N[(N[Cos[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\\
t_1 := b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\\
\mathsf{fma}\left(t\_1, t\_1, a \cdot \left(a \cdot \mathsf{fma}\left(0.5, \mathsf{fma}\left(t\_0, t\_0, 0 - \mathsf{fma}\left(\cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right), 0.5\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 74.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \cos \left(e^{\log \left(\frac{180}{\color{blue}{\mathsf{PI}\left(\right) \cdot angle}}\right) \cdot -1}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
    10. PI-lowering-PI.f6441.8

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

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

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

    \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right), b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right), a \cdot \left(a \cdot \mathsf{fma}\left(0.5, \color{blue}{\mathsf{fma}\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), -\mathsf{fma}\left(\cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right)}, 0.5\right)\right)\right) \]
  7. Final simplification74.5%

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

Alternative 3: 79.3% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\\ \mathsf{fma}\left(t\_0, t\_0, a \cdot \left(a \cdot \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right)\right)\right) \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* b (sin (* (* PI angle) 0.005555555555555556)))))
   (fma
    t_0
    t_0
    (* a (* a (fma 0.5 (cos (* (* PI angle) 0.011111111111111112)) 0.5))))))
double code(double a, double b, double angle) {
	double t_0 = b * sin(((((double) M_PI) * angle) * 0.005555555555555556));
	return fma(t_0, t_0, (a * (a * fma(0.5, cos(((((double) M_PI) * angle) * 0.011111111111111112)), 0.5))));
}
function code(a, b, angle)
	t_0 = Float64(b * sin(Float64(Float64(pi * angle) * 0.005555555555555556)))
	return fma(t_0, t_0, Float64(a * Float64(a * fma(0.5, cos(Float64(Float64(pi * angle) * 0.011111111111111112)), 0.5))))
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(a * N[(a * N[(0.5 * N[Cos[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\\
\mathsf{fma}\left(t\_0, t\_0, a \cdot \left(a \cdot \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 74.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \cos \left(e^{\log \left(\frac{180}{\color{blue}{\mathsf{PI}\left(\right) \cdot angle}}\right) \cdot -1}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
    10. PI-lowering-PI.f6441.8

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

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

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

Alternative 4: 79.3% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\\ \mathsf{fma}\left(t\_0, t\_0, a \cdot a\right) \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* b (sin (* (* PI angle) 0.005555555555555556)))))
   (fma t_0 t_0 (* a a))))
double code(double a, double b, double angle) {
	double t_0 = b * sin(((((double) M_PI) * angle) * 0.005555555555555556));
	return fma(t_0, t_0, (a * a));
}
function code(a, b, angle)
	t_0 = Float64(b * sin(Float64(Float64(pi * angle) * 0.005555555555555556)))
	return fma(t_0, t_0, Float64(a * a))
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(a * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\\
\mathsf{fma}\left(t\_0, t\_0, a \cdot a\right)
\end{array}
\end{array}
Derivation
  1. Initial program 74.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \cos \left(e^{\log \left(\frac{180}{\color{blue}{\mathsf{PI}\left(\right) \cdot angle}}\right) \cdot -1}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
    10. PI-lowering-PI.f6441.8

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

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

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

    \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right), a \cdot \left(a \cdot \color{blue}{1}\right)\right) \]
  7. Step-by-step derivation
    1. Simplified73.6%

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right), b \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right), a \cdot \left(a \cdot \color{blue}{1}\right)\right) \]
    2. Final simplification73.6%

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

    Alternative 5: 79.3% accurate, 1.9× speedup?

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

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

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

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

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

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

    Alternative 6: 64.9% accurate, 2.6× speedup?

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

      1. Initial program 79.0%

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

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

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

          \[\leadsto \color{blue}{a \cdot a} \]
      5. Simplified57.2%

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

      if 3.4999999999999999e-162 < angle < 6.6e6

      1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(a \cdot \cos \left(e^{\log \left(\frac{180}{\color{blue}{\mathsf{PI}\left(\right) \cdot angle}}\right) \cdot -1}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
        10. PI-lowering-PI.f6499.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(a, a \cdot \mathsf{fma}\left(0.5, \cos \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right), 0.5\right), \left(b \cdot b\right) \cdot \left(\left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\color{blue}{\pi} \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right) \]
      11. Simplified96.7%

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

      if 6.6e6 < angle

      1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(e^{\log \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)}, a, \left(b \cdot b\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)} \]
      5. Taylor expanded in angle around 0

        \[\leadsto \mathsf{fma}\left(\color{blue}{a}, a, \left(b \cdot b\right) \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)\right) \]
      6. Step-by-step derivation
        1. Simplified51.4%

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

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

      Alternative 7: 64.9% accurate, 2.9× speedup?

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

        1. Initial program 79.0%

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

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

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

            \[\leadsto \color{blue}{a \cdot a} \]
        5. Simplified57.2%

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

        if 1.7999999999999999e-162 < angle < 470

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        if 470 < angle

        1. Initial program 52.3%

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(e^{\log \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)}, a, \left(b \cdot b\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)} \]
        5. Taylor expanded in angle around 0

          \[\leadsto \mathsf{fma}\left(\color{blue}{a}, a, \left(b \cdot b\right) \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)\right) \]
        6. Step-by-step derivation
          1. Simplified50.6%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;angle \leq 1.8 \cdot 10^{-162}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;angle \leq 470:\\ \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, a, \left(b \cdot b\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right)\right)\\ \end{array} \]
        9. Add Preprocessing

        Alternative 8: 55.7% accurate, 3.4× speedup?

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

          1. Initial program 70.0%

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

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

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

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{32400} + \left(a \cdot a\right) \cdot \frac{-1}{32400}\right)\right)\right), angle, a \cdot a\right)} \]
          7. Applied egg-rr44.8%

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

          if 1.7e54 < a

          1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(a \cdot a\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \left(\frac{1}{90} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right), \frac{1}{2}\right) \]
            9. PI-lowering-PI.f6484.4

              \[\leadsto \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right), 0.5\right) \]
          8. Simplified84.4%

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

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

        Alternative 9: 55.7% accurate, 8.3× speedup?

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

          1. Initial program 70.0%

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

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

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

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\left(b \cdot b\right) \cdot \frac{1}{32400} + \left(a \cdot a\right) \cdot \frac{-1}{32400}\right)\right)\right), angle, a \cdot a\right)} \]
          7. Applied egg-rr44.8%

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

          if 4.79999999999999997e54 < a

          1. Initial program 87.5%

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

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

              \[\leadsto \color{blue}{a \cdot a} \]
            2. *-lowering-*.f6484.3

              \[\leadsto \color{blue}{a \cdot a} \]
          5. Simplified84.3%

            \[\leadsto \color{blue}{a \cdot a} \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 10: 61.2% accurate, 10.4× speedup?

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

          1. Initial program 72.7%

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

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

              \[\leadsto \color{blue}{a \cdot a} \]
            2. *-lowering-*.f6460.6

              \[\leadsto \color{blue}{a \cdot a} \]
          5. Simplified60.6%

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

          if 1.02e22 < b

          1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

        Alternative 11: 60.8% accurate, 12.1× speedup?

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

          1. Initial program 72.0%

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

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

              \[\leadsto \color{blue}{a \cdot a} \]
            2. *-lowering-*.f6457.8

              \[\leadsto \color{blue}{a \cdot a} \]
          5. Simplified57.8%

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

          if 4.00000000000000007e151 < b

          1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 12: 59.8% accurate, 12.1× speedup?

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

          1. Initial program 72.0%

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

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

              \[\leadsto \color{blue}{a \cdot a} \]
            2. *-lowering-*.f6457.8

              \[\leadsto \color{blue}{a \cdot a} \]
          5. Simplified57.8%

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

          if 1.01999999999999999e152 < b

          1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 13: 56.2% accurate, 74.7× speedup?

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

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

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

            \[\leadsto \color{blue}{a \cdot a} \]
          2. *-lowering-*.f6456.1

            \[\leadsto \color{blue}{a \cdot a} \]
        5. Simplified56.1%

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

        Reproduce

        ?
        herbie shell --seed 2024197 
        (FPCore (a b angle)
          :name "ab-angle->ABCF C"
          :precision binary64
          (+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))