ab-angle->ABCF C

Percentage Accurate: 79.6% → 79.6%
Time: 17.4s
Alternatives: 21
Speedup: 1.9×

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 21 alternatives:

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

Initial Program: 79.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \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.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := {\left(\frac{180}{angle\_m}\right)}^{-0.5}\\
{\left(a \cdot \cos \left(\pi \cdot \left(t\_0 \cdot t\_0\right)\right)\right)}^{2} + {\left(b \cdot \sin \left({\pi}^{0.16666666666666666} \cdot \left(\left(angle\_m \cdot \left(0.005555555555555556 \cdot {\pi}^{0.6666666666666666}\right)\right) \cdot {\pi}^{0.16666666666666666}\right)\right)\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 81.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. Step-by-step derivation
    1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \color{blue}{\left({\left(\frac{180}{angle}\right)}^{-0.5} \cdot {\left(\frac{180}{angle}\right)}^{-0.5}\right)}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left(\left(angle \cdot \left(0.005555555555555556 \cdot {\pi}^{0.6666666666666666}\right)\right) \cdot {\pi}^{0.16666666666666666}\right) \cdot {\pi}^{0.16666666666666666}\right)\right)}^{2} \]
  7. Final simplification40.2%

    \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \left({\left(\frac{180}{angle}\right)}^{-0.5} \cdot {\left(\frac{180}{angle}\right)}^{-0.5}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left({\pi}^{0.16666666666666666} \cdot \left(\left(angle \cdot \left(0.005555555555555556 \cdot {\pi}^{0.6666666666666666}\right)\right) \cdot {\pi}^{0.16666666666666666}\right)\right)\right)}^{2} \]
  8. Add Preprocessing

Alternative 2: 79.6% accurate, 0.6× speedup?

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

\\
{\left(b \cdot \sin \left({\pi}^{0.16666666666666666} \cdot \left(\left(angle\_m \cdot \left(0.005555555555555556 \cdot {\pi}^{0.6666666666666666}\right)\right) \cdot {\pi}^{0.16666666666666666}\right)\right)\right)}^{2} + {\left(a \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 81.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. Step-by-step derivation
    1. *-commutativeN/A

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\left(\left(angle \cdot \left(0.005555555555555556 \cdot {\pi}^{0.6666666666666666}\right)\right) \cdot {\pi}^{0.16666666666666666}\right) \cdot {\pi}^{0.16666666666666666}\right)}\right)}^{2} \]
  5. Final simplification82.1%

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

Alternative 3: 79.6% accurate, 0.9× speedup?

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

\\
{\left(a \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left(angle\_m \cdot \sqrt{\sqrt{\pi}}\right) \cdot \left(0.005555555555555556 \cdot \sqrt{\pi \cdot \sqrt{\pi}}\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 81.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. Step-by-step derivation
    1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.6% accurate, 1.0× speedup?

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

\\
{\left(a \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{0.005555555555555556}{\frac{1}{angle\_m}}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 81.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. 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. /-lowering-/.f64N/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} \]
    4. /-lowering-/.f64N/A

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

      \[\leadsto {\left(a \cdot \cos \left(\frac{1}{\frac{180}{\color{blue}{\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} \]
    6. PI-lowering-PI.f6482.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 79.7% accurate, 1.1× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := b \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\\ \mathsf{fma}\left(t\_0, t\_0, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(0.005555555555555556 \cdot \sqrt{\pi}\right) \cdot \left(angle\_m \cdot \sqrt{\pi}\right)\right)\right)\right)\right) \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* b (sin (* PI (* angle_m 0.005555555555555556))))))
   (fma
    t_0
    t_0
    (*
     (* a a)
     (+
      0.5
      (*
       0.5
       (cos
        (*
         2.0
         (* (* 0.005555555555555556 (sqrt PI)) (* angle_m (sqrt PI)))))))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = b * sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
	return fma(t_0, t_0, ((a * a) * (0.5 + (0.5 * cos((2.0 * ((0.005555555555555556 * sqrt(((double) M_PI))) * (angle_m * sqrt(((double) M_PI))))))))));
}
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(b * sin(Float64(pi * Float64(angle_m * 0.005555555555555556))))
	return fma(t_0, t_0, Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(Float64(0.005555555555555556 * sqrt(pi)) * Float64(angle_m * sqrt(pi)))))))))
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(b * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(N[(0.005555555555555556 * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
t_0 := b \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\\
\mathsf{fma}\left(t\_0, t\_0, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(0.005555555555555556 \cdot \sqrt{\pi}\right) \cdot \left(angle\_m \cdot \sqrt{\pi}\right)\right)\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 81.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. Step-by-step derivation
    1. +-commutativeN/A

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\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. Step-by-step derivation
    1. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \left(angle \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right)\right)\right)\right)\right) \]
    17. PI-lowering-PI.f6482.0

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

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

Alternative 6: 79.7% accurate, 1.2× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\ t_1 := b \cdot \sin t\_0\\ \mathsf{fma}\left(t\_1, t\_1, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_0\right)\right)\right) \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (* angle_m 0.005555555555555556))) (t_1 (* b (sin t_0))))
   (fma t_1 t_1 (* (* a a) (+ 0.5 (* 0.5 (cos (* 2.0 t_0))))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double t_1 = b * sin(t_0);
	return fma(t_1, t_1, ((a * a) * (0.5 + (0.5 * cos((2.0 * t_0))))));
}
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	t_1 = Float64(b * sin(t_0))
	return fma(t_1, t_1, Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * t_0))))))
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$1 * t$95$1 + N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := b \cdot \sin t\_0\\
\mathsf{fma}\left(t\_1, t\_1, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_0\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 81.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. Step-by-step derivation
    1. +-commutativeN/A

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\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. Add Preprocessing

Alternative 7: 79.6% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_0 := b \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\mathsf{fma}\left(t\_0, t\_0, \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right), 0.5\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 81.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. Step-by-step derivation
    1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right), b \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right), \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)\right) \]
  7. Add Preprocessing

Alternative 8: 79.6% accurate, 1.6× speedup?

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

\\
{\left(b \cdot \sin \left(\left(angle\_m \cdot \sqrt{\sqrt{\pi}}\right) \cdot \left(0.005555555555555556 \cdot \sqrt{\pi \cdot \sqrt{\pi}}\right)\right)\right)}^{2} + a \cdot a
\end{array}
Derivation
  1. Initial program 81.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. Step-by-step derivation
    1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 79.7% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_0 := b \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\\
\mathsf{fma}\left(t\_0, t\_0, a \cdot a\right)
\end{array}
\end{array}
Derivation
  1. Initial program 81.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. Step-by-step derivation
    1. +-commutativeN/A

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\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(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \color{blue}{1}\right) \]
  6. Step-by-step derivation
    1. Simplified81.8%

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

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

    Alternative 10: 79.7% accurate, 1.9× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := b \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\ \mathsf{fma}\left(t\_0, t\_0, a \cdot a\right) \end{array} \end{array} \]
    angle_m = (fabs.f64 angle)
    (FPCore (a b angle_m)
     :precision binary64
     (let* ((t_0 (* b (sin (* angle_m (* PI 0.005555555555555556))))))
       (fma t_0 t_0 (* a a))))
    angle_m = fabs(angle);
    double code(double a, double b, double angle_m) {
    	double t_0 = b * sin((angle_m * (((double) M_PI) * 0.005555555555555556)));
    	return fma(t_0, t_0, (a * a));
    }
    
    angle_m = abs(angle)
    function code(a, b, angle_m)
    	t_0 = Float64(b * sin(Float64(angle_m * Float64(pi * 0.005555555555555556))))
    	return fma(t_0, t_0, Float64(a * a))
    end
    
    angle_m = N[Abs[angle], $MachinePrecision]
    code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(b * N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(a * a), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    \begin{array}{l}
    t_0 := b \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
    \mathsf{fma}\left(t\_0, t\_0, a \cdot a\right)
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 81.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 11: 79.6% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

      Alternative 12: 79.6% accurate, 1.9× speedup?

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

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

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

      Alternative 13: 66.9% accurate, 2.5× speedup?

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

        1. Initial program 82.4%

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\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(b \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\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. *-lowering-*.f64N/A

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

            \[\leadsto \mathsf{fma}\left(b \cdot \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\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) \]
          3. PI-lowering-PI.f6475.4

            \[\leadsto \mathsf{fma}\left(b \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right), b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\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. Simplified75.4%

          \[\leadsto \mathsf{fma}\left(b \cdot \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}, b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\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) \]
        8. 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)} \]
        9. 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. *-commutativeN/A

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

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

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

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

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

        if 2.5e-80 < b

        1. Initial program 81.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. Step-by-step derivation
          1. +-commutativeN/A

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\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(b \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\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. *-lowering-*.f64N/A

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

            \[\leadsto \mathsf{fma}\left(b \cdot \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\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) \]
          3. PI-lowering-PI.f6468.0

            \[\leadsto \mathsf{fma}\left(b \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right), b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\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. Simplified68.0%

          \[\leadsto \mathsf{fma}\left(b \cdot \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}, b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\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) \]
        8. Taylor expanded in angle around 0

          \[\leadsto \mathsf{fma}\left(b \cdot \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right), b \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, \left(a \cdot a\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) \]
        9. Step-by-step derivation
          1. *-lowering-*.f64N/A

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

            \[\leadsto \mathsf{fma}\left(b \cdot \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right), b \cdot \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right), \left(a \cdot a\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) \]
          3. PI-lowering-PI.f6478.1

            \[\leadsto \mathsf{fma}\left(b \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), b \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right), \left(a \cdot a\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) \]
        10. Simplified78.1%

          \[\leadsto \mathsf{fma}\left(b \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), b \cdot \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}, \left(a \cdot a\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) \]
      3. Recombined 2 regimes into one program.
      4. Final simplification67.7%

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

      Alternative 14: 72.5% accurate, 2.8× speedup?

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

        1. Initial program 84.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. Step-by-step derivation
          1. +-commutativeN/A

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\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(b \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\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. *-lowering-*.f64N/A

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

            \[\leadsto \mathsf{fma}\left(b \cdot \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\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) \]
          3. PI-lowering-PI.f6479.6

            \[\leadsto \mathsf{fma}\left(b \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right), b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\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. Simplified79.6%

          \[\leadsto \mathsf{fma}\left(b \cdot \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}, b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\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) \]
        8. Taylor expanded in angle around 0

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

            \[\leadsto \mathsf{fma}\left(b \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\right) \cdot \color{blue}{1}\right) \]

          if 1.9999999999999999e60 < (/.f64 angle #s(literal 180 binary64))

          1. Initial program 68.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}{{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. Simplified34.0%

            \[\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. 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) \]
            3. associate-*l*N/A

              \[\leadsto \mathsf{fma}\left(angle \cdot angle, \mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(b \cdot \left(b \cdot \frac{1}{32400}\right)\right)}\right), a \cdot a\right) \]
            4. *-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 \cdot \left(b \cdot \frac{1}{32400}\right)\right)}\right), a \cdot a\right) \]
            5. *-lowering-*.f6456.8

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

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

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

        Alternative 15: 62.9% accurate, 3.4× speedup?

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

          1. Initial program 82.4%

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\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(b \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\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. *-lowering-*.f64N/A

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

              \[\leadsto \mathsf{fma}\left(b \cdot \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\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) \]
            3. PI-lowering-PI.f6475.4

              \[\leadsto \mathsf{fma}\left(b \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right), b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\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. Simplified75.4%

            \[\leadsto \mathsf{fma}\left(b \cdot \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}, b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(a \cdot a\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) \]
          8. 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)} \]
          9. 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. *-commutativeN/A

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

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

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

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

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

          if 1.0999999999999999e-79 < b < 9.60000000000000059e154

          1. Initial program 64.6%

            \[{\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. Simplified28.0%

            \[\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. 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) \]
            3. associate-*l*N/A

              \[\leadsto \mathsf{fma}\left(angle \cdot angle, \mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(b \cdot \left(b \cdot \frac{1}{32400}\right)\right)}\right), a \cdot a\right) \]
            4. *-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 \cdot \left(b \cdot \frac{1}{32400}\right)\right)}\right), a \cdot a\right) \]
            5. *-lowering-*.f6457.1

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

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

          if 9.60000000000000059e154 < b

          1. Initial program 99.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}{{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. Simplified44.2%

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

              \[\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. Simplified55.0%

            \[\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} \]
          10. Applied egg-rr69.3%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.1 \cdot 10^{-79}:\\ \;\;\;\;\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)\\ \mathbf{elif}\;b \leq 9.6 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right), a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(angle \cdot \left(\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(b \cdot b\right)\right)\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 16: 62.9% accurate, 3.4× speedup?

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

          1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.20000000000000003e-79 < b < 9.60000000000000059e154

          1. Initial program 64.6%

            \[{\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. Simplified28.0%

            \[\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. 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) \]
            3. associate-*l*N/A

              \[\leadsto \mathsf{fma}\left(angle \cdot angle, \mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(b \cdot \left(b \cdot \frac{1}{32400}\right)\right)}\right), a \cdot a\right) \]
            4. *-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 \cdot \left(b \cdot \frac{1}{32400}\right)\right)}\right), a \cdot a\right) \]
            5. *-lowering-*.f6457.1

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

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

          if 9.60000000000000059e154 < b

          1. Initial program 99.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}{{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. Simplified44.2%

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

              \[\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. Simplified55.0%

            \[\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} \]
          10. Applied egg-rr69.3%

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

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

        Alternative 17: 63.0% accurate, 3.4× speedup?

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

          1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right), b \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right), \mathsf{fma}\left(0.5, \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right), 0.5\right) \cdot \left(a \cdot a\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. *-commutativeN/A

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

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

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

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

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

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

          if 1.25e-80 < b < 9.60000000000000059e154

          1. Initial program 64.6%

            \[{\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. Simplified28.0%

            \[\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. 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) \]
            3. associate-*l*N/A

              \[\leadsto \mathsf{fma}\left(angle \cdot angle, \mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(b \cdot \left(b \cdot \frac{1}{32400}\right)\right)}\right), a \cdot a\right) \]
            4. *-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 \cdot \left(b \cdot \frac{1}{32400}\right)\right)}\right), a \cdot a\right) \]
            5. *-lowering-*.f6457.1

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

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

          if 9.60000000000000059e154 < b

          1. Initial program 99.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}{{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. Simplified44.2%

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

              \[\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. Simplified55.0%

            \[\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} \]
          10. Applied egg-rr69.3%

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

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

        Alternative 18: 65.4% accurate, 10.4× speedup?

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

          1. Initial program 78.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. Simplified46.3%

            \[\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. 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) \]
            3. associate-*l*N/A

              \[\leadsto \mathsf{fma}\left(angle \cdot angle, \mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(b \cdot \left(b \cdot \frac{1}{32400}\right)\right)}\right), a \cdot a\right) \]
            4. *-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 \cdot \left(b \cdot \frac{1}{32400}\right)\right)}\right), a \cdot a\right) \]
            5. *-lowering-*.f6459.9

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

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

          if 1.05000000000000008e153 < a

          1. Initial program 100.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-*.f64100.0

              \[\leadsto \color{blue}{a \cdot a} \]
          5. Simplified100.0%

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

        Alternative 19: 61.4% accurate, 12.1× speedup?

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

          1. Initial program 79.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. 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.0

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

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

          if 5.80000000000000029e159 < b

          1. Initial program 99.6%

            \[{\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. Simplified48.1%

            \[\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-*.f6456.9

              \[\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. Simplified56.9%

            \[\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} \]
          10. Applied egg-rr69.5%

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

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

        Alternative 20: 60.6% accurate, 12.1× speedup?

        \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 5.8 \cdot 10^{+159}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(angle\_m \cdot angle\_m\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} \]
        angle_m = (fabs.f64 angle)
        (FPCore (a b angle_m)
         :precision binary64
         (if (<= b 5.8e+159)
           (* a a)
           (* (* angle_m angle_m) (* PI (* 3.08641975308642e-5 (* PI (* b b)))))))
        angle_m = fabs(angle);
        double code(double a, double b, double angle_m) {
        	double tmp;
        	if (b <= 5.8e+159) {
        		tmp = a * a;
        	} else {
        		tmp = (angle_m * angle_m) * (((double) M_PI) * (3.08641975308642e-5 * (((double) M_PI) * (b * b))));
        	}
        	return tmp;
        }
        
        angle_m = Math.abs(angle);
        public static double code(double a, double b, double angle_m) {
        	double tmp;
        	if (b <= 5.8e+159) {
        		tmp = a * a;
        	} else {
        		tmp = (angle_m * angle_m) * (Math.PI * (3.08641975308642e-5 * (Math.PI * (b * b))));
        	}
        	return tmp;
        }
        
        angle_m = math.fabs(angle)
        def code(a, b, angle_m):
        	tmp = 0
        	if b <= 5.8e+159:
        		tmp = a * a
        	else:
        		tmp = (angle_m * angle_m) * (math.pi * (3.08641975308642e-5 * (math.pi * (b * b))))
        	return tmp
        
        angle_m = abs(angle)
        function code(a, b, angle_m)
        	tmp = 0.0
        	if (b <= 5.8e+159)
        		tmp = Float64(a * a);
        	else
        		tmp = Float64(Float64(angle_m * angle_m) * Float64(pi * Float64(3.08641975308642e-5 * Float64(pi * Float64(b * b)))));
        	end
        	return tmp
        end
        
        angle_m = abs(angle);
        function tmp_2 = code(a, b, angle_m)
        	tmp = 0.0;
        	if (b <= 5.8e+159)
        		tmp = a * a;
        	else
        		tmp = (angle_m * angle_m) * (pi * (3.08641975308642e-5 * (pi * (b * b))));
        	end
        	tmp_2 = tmp;
        end
        
        angle_m = N[Abs[angle], $MachinePrecision]
        code[a_, b_, angle$95$m_] := If[LessEqual[b, 5.8e+159], N[(a * a), $MachinePrecision], N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(Pi * N[(3.08641975308642e-5 * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        angle_m = \left|angle\right|
        
        \\
        \begin{array}{l}
        \mathbf{if}\;b \leq 5.8 \cdot 10^{+159}:\\
        \;\;\;\;a \cdot a\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(angle\_m \cdot angle\_m\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 < 5.80000000000000029e159

          1. Initial program 79.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. 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.0

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

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

          if 5.80000000000000029e159 < b

          1. Initial program 99.6%

            \[{\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. Simplified48.1%

            \[\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-*.f6456.9

              \[\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. Simplified56.9%

            \[\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 21: 56.9% accurate, 74.7× speedup?

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

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

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

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

        Reproduce

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