ab-angle->ABCF C

Percentage Accurate: 80.7% → 80.7%
Time: 19.5s
Alternatives: 14
Speedup: 1.2×

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

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

Initial Program: 80.7% 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: 80.7% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := \sin t\_0\\
t_2 := b \cdot t\_1\\
t_3 := t\_1 \cdot t\_1\\
\mathsf{fma}\left(t\_2, t\_2, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \frac{{\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{6} + {\left(t\_1 \cdot \left(0 - t\_1\right)\right)}^{3}}{{\cos t\_0}^{4} + \left(t\_3 \cdot t\_3 + \mathsf{fma}\left(0.5, \cos \left(\left(angle \cdot \left(\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right)\right) \cdot 0.011111111111111112\right), 0.5\right) \cdot t\_3\right)}\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 81.2%

    \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. +-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.4%

    \[\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. Applied egg-rr81.4%

    \[\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 \color{blue}{\frac{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{6} + {\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}}{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{4} + \left(\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) - \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}}\right)\right) \]
  6. Step-by-step derivation
    1. 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 \frac{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    2. sqrt-unprodN/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 \frac{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\color{blue}{\sqrt{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    3. 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 \frac{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    4. 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 \frac{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\sqrt{\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}}} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    5. sqrt-unprodN/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 \frac{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\color{blue}{\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    6. *-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 \frac{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\color{blue}{\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    7. 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 \frac{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\color{blue}{\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    8. *-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 \frac{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\color{blue}{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    9. 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 \frac{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\color{blue}{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    10. 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 \frac{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    11. 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 \frac{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    12. 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 \frac{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \color{blue}{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\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 \frac{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\color{blue}{\sqrt{\mathsf{PI}\left(\right)}}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    14. PI-lowering-PI.f6481.4

      \[\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 \frac{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{6} + {\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}}{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{4} + \left(\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) - \mathsf{fma}\left(0.5, \cos \left(\left(\left(\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\color{blue}{\pi}}}\right) \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}\right)\right) \]
  7. Applied egg-rr81.4%

    \[\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 \frac{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{6} + {\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}}{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{4} + \left(\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) - \mathsf{fma}\left(0.5, \cos \left(\left(\color{blue}{\left(\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right)} \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}\right)\right) \]
  8. Taylor expanded in angle around inf

    \[\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 \frac{{\color{blue}{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
  9. Step-by-step derivation
    1. *-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 \frac{{\cos \left(\frac{1}{180} \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    2. 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 \frac{{\cos \color{blue}{\left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    3. cos-lowering-cos.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 \frac{{\color{blue}{\cos \left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    4. 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 \frac{{\cos \color{blue}{\left(\frac{1}{180} \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    5. *-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 \frac{{\cos \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    6. *-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 \frac{{\cos \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)}}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    7. 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 \frac{{\cos \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)\right)}}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    8. *-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 \frac{{\cos \left(angle \cdot \color{blue}{\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    9. *-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 \frac{{\cos \color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    10. *-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 \frac{{\cos \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)}\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\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 \frac{{\cos \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)}\right)}^{6} + {\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{3}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
    12. PI-lowering-PI.f6481.4

      \[\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 \frac{{\cos \left(angle \cdot \left(\color{blue}{\pi} \cdot 0.005555555555555556\right)\right)}^{6} + {\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}}{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{4} + \left(\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) - \mathsf{fma}\left(0.5, \cos \left(\left(\left(\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right) \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}\right)\right) \]
  10. Simplified81.4%

    \[\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 \frac{{\color{blue}{\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}}^{6} + {\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}}{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{4} + \left(\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) - \mathsf{fma}\left(0.5, \cos \left(\left(\left(\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right) \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}\right)\right) \]
  11. Final simplification81.4%

    \[\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 \frac{{\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{6} + {\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(0 - \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}^{3}}{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{4} + \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) + \mathsf{fma}\left(0.5, \cos \left(\left(angle \cdot \left(\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right)\right) \cdot 0.011111111111111112\right), 0.5\right) \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}\right)\right) \]
  12. Add Preprocessing

Alternative 2: 80.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\ t_1 := \cos t\_0\\ t_2 := \sin t\_0\\ t_3 := b \cdot t\_2\\ t_4 := t\_2 \cdot t\_2\\ \mathsf{fma}\left(t\_3, t\_3, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \frac{{t\_1}^{6} - {t\_2}^{6}}{{t\_1}^{4} + \left(t\_4 \cdot t\_4 + \mathsf{fma}\left(0.5, \cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right), 0.5\right) \cdot t\_4\right)}\right)\right) \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* PI (* angle 0.005555555555555556)))
        (t_1 (cos t_0))
        (t_2 (sin t_0))
        (t_3 (* b t_2))
        (t_4 (* t_2 t_2)))
   (fma
    t_3
    t_3
    (*
     (* a a)
     (+
      0.5
      (*
       0.5
       (/
        (- (pow t_1 6.0) (pow t_2 6.0))
        (+
         (pow t_1 4.0)
         (+
          (* t_4 t_4)
          (*
           (fma 0.5 (cos (* 0.011111111111111112 (* PI angle))) 0.5)
           t_4))))))))))
double code(double a, double b, double angle) {
	double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
	double t_1 = cos(t_0);
	double t_2 = sin(t_0);
	double t_3 = b * t_2;
	double t_4 = t_2 * t_2;
	return fma(t_3, t_3, ((a * a) * (0.5 + (0.5 * ((pow(t_1, 6.0) - pow(t_2, 6.0)) / (pow(t_1, 4.0) + ((t_4 * t_4) + (fma(0.5, cos((0.011111111111111112 * (((double) M_PI) * angle))), 0.5) * t_4))))))));
}
function code(a, b, angle)
	t_0 = Float64(pi * Float64(angle * 0.005555555555555556))
	t_1 = cos(t_0)
	t_2 = sin(t_0)
	t_3 = Float64(b * t_2)
	t_4 = Float64(t_2 * t_2)
	return fma(t_3, t_3, Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * Float64(Float64((t_1 ^ 6.0) - (t_2 ^ 6.0)) / Float64((t_1 ^ 4.0) + Float64(Float64(t_4 * t_4) + Float64(fma(0.5, cos(Float64(0.011111111111111112 * Float64(pi * angle))), 0.5) * t_4))))))))
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(b * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 * t$95$2), $MachinePrecision]}, N[(t$95$3 * t$95$3 + N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[(N[(N[Power[t$95$1, 6.0], $MachinePrecision] - N[Power[t$95$2, 6.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$1, 4.0], $MachinePrecision] + N[(N[(t$95$4 * t$95$4), $MachinePrecision] + N[(N[(0.5 * N[Cos[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
t_3 := b \cdot t\_2\\
t_4 := t\_2 \cdot t\_2\\
\mathsf{fma}\left(t\_3, t\_3, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \frac{{t\_1}^{6} - {t\_2}^{6}}{{t\_1}^{4} + \left(t\_4 \cdot t\_4 + \mathsf{fma}\left(0.5, \cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right), 0.5\right) \cdot t\_4\right)}\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 81.2%

    \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. +-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.4%

    \[\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. Applied egg-rr81.4%

    \[\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 \color{blue}{\frac{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{6} + {\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}}{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{4} + \left(\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) - \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}}\right)\right) \]
  6. Step-by-step derivation
    1. unpow3N/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 \frac{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{6} + \color{blue}{\left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}}{{\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)}^{4} + \left(\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right) - \mathsf{fma}\left(\frac{1}{2}, \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{1}{2}\right) \cdot \left(\left(\mathsf{neg}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right)}\right)\right) \]
  7. Applied egg-rr81.4%

    \[\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 \frac{\color{blue}{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{6} - {\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{6}}}{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{4} + \left(\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) - \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}\right)\right) \]
  8. Final simplification81.4%

    \[\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 \frac{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{6} - {\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{6}}{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{4} + \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) + \mathsf{fma}\left(0.5, \cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right), 0.5\right) \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}\right)\right) \]
  9. Add Preprocessing

Alternative 3: 80.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\ t_1 := \sin t\_0\\ t_2 := b \cdot t\_1\\ t_3 := \cos t\_0\\ \mathsf{fma}\left(t\_2, t\_2, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \frac{{\left(t\_1 \cdot \left(0 - t\_1\right)\right)}^{3} + {t\_3}^{6}}{\mathsf{fma}\left(t\_1, {t\_1}^{3} + t\_1 \cdot \mathsf{fma}\left(0.5, \cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right), 0.5\right), {t\_3}^{4}\right)}\right)\right) \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* PI (* angle 0.005555555555555556)))
        (t_1 (sin t_0))
        (t_2 (* b t_1))
        (t_3 (cos t_0)))
   (fma
    t_2
    t_2
    (*
     (* a a)
     (+
      0.5
      (*
       0.5
       (/
        (+ (pow (* t_1 (- 0.0 t_1)) 3.0) (pow t_3 6.0))
        (fma
         t_1
         (+
          (pow t_1 3.0)
          (* t_1 (fma 0.5 (cos (* 0.011111111111111112 (* PI angle))) 0.5)))
         (pow t_3 4.0)))))))))
double code(double a, double b, double angle) {
	double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
	double t_1 = sin(t_0);
	double t_2 = b * t_1;
	double t_3 = cos(t_0);
	return fma(t_2, t_2, ((a * a) * (0.5 + (0.5 * ((pow((t_1 * (0.0 - t_1)), 3.0) + pow(t_3, 6.0)) / fma(t_1, (pow(t_1, 3.0) + (t_1 * fma(0.5, cos((0.011111111111111112 * (((double) M_PI) * angle))), 0.5))), pow(t_3, 4.0)))))));
}
function code(a, b, angle)
	t_0 = Float64(pi * Float64(angle * 0.005555555555555556))
	t_1 = sin(t_0)
	t_2 = Float64(b * t_1)
	t_3 = cos(t_0)
	return fma(t_2, t_2, Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * Float64(Float64((Float64(t_1 * Float64(0.0 - t_1)) ^ 3.0) + (t_3 ^ 6.0)) / fma(t_1, Float64((t_1 ^ 3.0) + Float64(t_1 * fma(0.5, cos(Float64(0.011111111111111112 * Float64(pi * angle))), 0.5))), (t_3 ^ 4.0)))))))
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(b * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$0], $MachinePrecision]}, N[(t$95$2 * t$95$2 + N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[(N[(N[Power[N[(t$95$1 * N[(0.0 - t$95$1), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] + N[Power[t$95$3, 6.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * N[(N[Power[t$95$1, 3.0], $MachinePrecision] + N[(t$95$1 * N[(0.5 * N[Cos[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[t$95$3, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := \sin t\_0\\
t_2 := b \cdot t\_1\\
t_3 := \cos t\_0\\
\mathsf{fma}\left(t\_2, t\_2, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \frac{{\left(t\_1 \cdot \left(0 - t\_1\right)\right)}^{3} + {t\_3}^{6}}{\mathsf{fma}\left(t\_1, {t\_1}^{3} + t\_1 \cdot \mathsf{fma}\left(0.5, \cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right), 0.5\right), {t\_3}^{4}\right)}\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 81.2%

    \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. +-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.4%

    \[\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. Applied egg-rr81.4%

    \[\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 \color{blue}{\frac{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{6} + {\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}}{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{4} + \left(\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) - \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right) \cdot \left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}}\right)\right) \]
  6. Applied egg-rr81.4%

    \[\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 \frac{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{6} + {\left(\left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}}{\color{blue}{\mathsf{fma}\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), {\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{3} - \left(-\mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.5\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right), {\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{4}\right)}}\right)\right) \]
  7. Final simplification81.4%

    \[\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 \frac{{\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(0 - \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}^{3} + {\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{6}}{\mathsf{fma}\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), {\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{3} + \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \mathsf{fma}\left(0.5, \cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right), 0.5\right), {\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{4}\right)}\right)\right) \]
  8. Add Preprocessing

Alternative 4: 80.7% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \pi \cdot \left(angle \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(t\_0 \cdot 2\right)\right)\right) \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* PI (* angle 0.005555555555555556))) (t_1 (* b (sin t_0))))
   (fma t_1 t_1 (* (* a a) (+ 0.5 (* 0.5 (cos (* t_0 2.0))))))))
double code(double a, double b, double angle) {
	double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
	double t_1 = b * sin(t_0);
	return fma(t_1, t_1, ((a * a) * (0.5 + (0.5 * cos((t_0 * 2.0))))));
}
function code(a, b, angle)
	t_0 = Float64(pi * Float64(angle * 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(t_0 * 2.0))))))
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 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[(t$95$0 * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \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(t\_0 \cdot 2\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 81.2%

    \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. +-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.4%

    \[\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. Final simplification81.4%

    \[\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(\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right)\right) \]
  6. Add Preprocessing

Alternative 5: 80.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(a \cdot \left(0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right), a, \left(a \cdot a\right) \cdot 0.5\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (+
  (fma
   (* a (* 0.5 (cos (* 0.011111111111111112 (* PI angle)))))
   a
   (* (* a a) 0.5))
  (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))
double code(double a, double b, double angle) {
	return fma((a * (0.5 * cos((0.011111111111111112 * (((double) M_PI) * angle))))), a, ((a * a) * 0.5)) + pow((b * sin((((double) M_PI) * (angle / 180.0)))), 2.0);
}
function code(a, b, angle)
	return Float64(fma(Float64(a * Float64(0.5 * cos(Float64(0.011111111111111112 * Float64(pi * angle))))), a, Float64(Float64(a * a) * 0.5)) + (Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0))
end
code[a_, b_, angle_] := N[(N[(N[(a * N[(0.5 * N[Cos[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a + N[(N[(a * a), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(a \cdot \left(0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right), a, \left(a \cdot a\right) \cdot 0.5\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \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}{\left(angle \cdot \frac{1}{180}\right)}\right)\right)\right) + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
    12. metadata-evalN/A

      \[\leadsto \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) + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
  6. Applied egg-rr81.2%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(0.5 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right) \cdot a, a, \left(a \cdot a\right) \cdot 0.5\right)} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  7. Final simplification81.2%

    \[\leadsto \mathsf{fma}\left(a \cdot \left(0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right), a, \left(a \cdot a\right) \cdot 0.5\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  8. Add Preprocessing

Alternative 6: 80.5% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_0 := b \cdot \sin \left(\pi \cdot \left(angle \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.2%

    \[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. +-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.4%

    \[\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. Simplified80.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 simplification80.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 7: 80.5% accurate, 1.9× speedup?

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

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

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

    Alternative 8: 65.2% accurate, 2.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;angle \leq 46000000:\\ \;\;\;\;\mathsf{fma}\left(b \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}, \pi \cdot \pi, 0.005555555555555556\right)\right)\right), 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(\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right)\right), a \cdot a\right)\\ \end{array} \end{array} \]
    (FPCore (a b angle)
     :precision binary64
     (if (<= angle 46000000.0)
       (fma
        (*
         b
         (*
          angle
          (*
           PI
           (fma
            (* (* angle angle) -2.8577960676726107e-8)
            (* PI PI)
            0.005555555555555556))))
        (* b (* 0.005555555555555556 (* PI angle)))
        (*
         (* a a)
         (+ 0.5 (* 0.5 (cos (* (* PI (* angle 0.005555555555555556)) 2.0))))))
       (fma
        (* angle angle)
        (* PI (* PI (* 3.08641975308642e-5 (* b b))))
        (* a a))))
    double code(double a, double b, double angle) {
    	double tmp;
    	if (angle <= 46000000.0) {
    		tmp = fma((b * (angle * (((double) M_PI) * fma(((angle * angle) * -2.8577960676726107e-8), (((double) M_PI) * ((double) M_PI)), 0.005555555555555556)))), (b * (0.005555555555555556 * (((double) M_PI) * angle))), ((a * a) * (0.5 + (0.5 * cos(((((double) M_PI) * (angle * 0.005555555555555556)) * 2.0))))));
    	} else {
    		tmp = fma((angle * angle), (((double) M_PI) * (((double) M_PI) * (3.08641975308642e-5 * (b * b)))), (a * a));
    	}
    	return tmp;
    }
    
    function code(a, b, angle)
    	tmp = 0.0
    	if (angle <= 46000000.0)
    		tmp = fma(Float64(b * Float64(angle * Float64(pi * fma(Float64(Float64(angle * angle) * -2.8577960676726107e-8), Float64(pi * pi), 0.005555555555555556)))), Float64(b * Float64(0.005555555555555556 * Float64(pi * angle))), Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * cos(Float64(Float64(pi * Float64(angle * 0.005555555555555556)) * 2.0))))));
    	else
    		tmp = fma(Float64(angle * angle), Float64(pi * Float64(pi * Float64(3.08641975308642e-5 * Float64(b * b)))), Float64(a * a));
    	end
    	return tmp
    end
    
    code[a_, b_, angle_] := If[LessEqual[angle, 46000000.0], N[(N[(b * N[(angle * N[(Pi * N[(N[(N[(angle * angle), $MachinePrecision] * -2.8577960676726107e-8), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b * N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle * angle), $MachinePrecision] * N[(Pi * N[(Pi * N[(3.08641975308642e-5 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;angle \leq 46000000:\\
    \;\;\;\;\mathsf{fma}\left(b \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}, \pi \cdot \pi, 0.005555555555555556\right)\right)\right), 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(\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right)\right), a \cdot a\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if angle < 4.6e7

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

        \[\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(angle \cdot \left(\frac{-1}{34992000} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \frac{1}{180} \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. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) \cdot \frac{-1}{34992000}} + \frac{1}{180} \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. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\color{blue}{{angle}^{2} \cdot \left({\mathsf{PI}\left(\right)}^{3} \cdot \frac{-1}{34992000}\right)} + \frac{1}{180} \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. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left({angle}^{2} \cdot \color{blue}{\left(\frac{-1}{34992000} \cdot {\mathsf{PI}\left(\right)}^{3}\right)} + \frac{1}{180} \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) \]
        4. +-commutativeN/A

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

          \[\leadsto \mathsf{fma}\left(b \cdot \color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + {angle}^{2} \cdot \left(\frac{-1}{34992000} \cdot {\mathsf{PI}\left(\right)}^{3}\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. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \color{blue}{\left({angle}^{2} \cdot \left(\frac{-1}{34992000} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \frac{1}{180} \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) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left({angle}^{2} \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{3} \cdot \frac{-1}{34992000}\right)} + \frac{1}{180} \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) \]
        8. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) \cdot \frac{-1}{34992000}} + \frac{1}{180} \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) \]
        9. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\color{blue}{\frac{-1}{34992000} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right)} + \frac{1}{180} \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) \]
        10. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\color{blue}{\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{3}} + \frac{1}{180} \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) \]
        11. unpow3N/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right)} + \frac{1}{180} \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) \]
        12. unpow2N/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{180} \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) \]
        13. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\color{blue}{\left(\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \mathsf{PI}\left(\right)} + \frac{1}{180} \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) \]
      7. Simplified76.0%

        \[\leadsto \mathsf{fma}\left(b \cdot \color{blue}{\left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}, \pi \cdot \pi, 0.005555555555555556\right)\right)\right)}, 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(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{34992000}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\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(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{34992000}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\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(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{34992000}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\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.f6469.9

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}, \pi \cdot \pi, 0.005555555555555556\right)\right)\right), 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. Simplified69.9%

        \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}, \pi \cdot \pi, 0.005555555555555556\right)\right)\right), 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) \]

      if 4.6e7 < angle

      1. Initial program 62.9%

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

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

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

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

          \[\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) \]
        2. unpow2N/A

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

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

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

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

    Alternative 9: 70.0% accurate, 2.7× speedup?

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

      1. Initial program 85.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-rr86.1%

        \[\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(angle \cdot \left(\frac{-1}{34992000} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \frac{1}{180} \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. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) \cdot \frac{-1}{34992000}} + \frac{1}{180} \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. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\color{blue}{{angle}^{2} \cdot \left({\mathsf{PI}\left(\right)}^{3} \cdot \frac{-1}{34992000}\right)} + \frac{1}{180} \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. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left({angle}^{2} \cdot \color{blue}{\left(\frac{-1}{34992000} \cdot {\mathsf{PI}\left(\right)}^{3}\right)} + \frac{1}{180} \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) \]
        4. +-commutativeN/A

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

          \[\leadsto \mathsf{fma}\left(b \cdot \color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + {angle}^{2} \cdot \left(\frac{-1}{34992000} \cdot {\mathsf{PI}\left(\right)}^{3}\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. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \color{blue}{\left({angle}^{2} \cdot \left(\frac{-1}{34992000} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \frac{1}{180} \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) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left({angle}^{2} \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{3} \cdot \frac{-1}{34992000}\right)} + \frac{1}{180} \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) \]
        8. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) \cdot \frac{-1}{34992000}} + \frac{1}{180} \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) \]
        9. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\color{blue}{\frac{-1}{34992000} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right)} + \frac{1}{180} \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) \]
        10. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\color{blue}{\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{3}} + \frac{1}{180} \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) \]
        11. unpow3N/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right)} + \frac{1}{180} \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) \]
        12. unpow2N/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot \left(\color{blue}{{\mathsf{PI}\left(\right)}^{2}} \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{180} \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) \]
        13. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(b \cdot \left(angle \cdot \left(\color{blue}{\left(\left(\frac{-1}{34992000} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \mathsf{PI}\left(\right)} + \frac{1}{180} \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) \]
      7. Simplified75.7%

        \[\leadsto \mathsf{fma}\left(b \cdot \color{blue}{\left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}, \pi \cdot \pi, 0.005555555555555556\right)\right)\right)}, 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(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{34992000}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\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. Simplified75.3%

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

        if 140 < angle

        1. Initial program 64.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. 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. Simplified22.5%

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

            \[\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) \]
          2. unpow2N/A

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

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

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

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

      Alternative 10: 65.4% accurate, 3.4× speedup?

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

        1. Initial program 78.1%

          \[{\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-rr78.3%

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

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

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

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

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

        if 8.50000000000000003e-122 < b < 4.99999999999999967e145

        1. Initial program 80.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. Simplified53.5%

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

            \[\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) \]
          2. unpow2N/A

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

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

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

        if 4.99999999999999967e145 < b

        1. Initial program 97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 11: 65.4% accurate, 9.1× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := angle \cdot \left(b \cdot \pi\right)\\ \mathbf{if}\;b \leq 8.4 \cdot 10^{-122}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+145}:\\ \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right)\right), a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;3.08641975308642 \cdot 10^{-5} \cdot \left(t\_0 \cdot t\_0\right)\\ \end{array} \end{array} \]
      (FPCore (a b angle)
       :precision binary64
       (let* ((t_0 (* angle (* b PI))))
         (if (<= b 8.4e-122)
           (* a a)
           (if (<= b 5e+145)
             (fma
              (* angle angle)
              (* PI (* PI (* 3.08641975308642e-5 (* b b))))
              (* a a))
             (* 3.08641975308642e-5 (* t_0 t_0))))))
      double code(double a, double b, double angle) {
      	double t_0 = angle * (b * ((double) M_PI));
      	double tmp;
      	if (b <= 8.4e-122) {
      		tmp = a * a;
      	} else if (b <= 5e+145) {
      		tmp = fma((angle * angle), (((double) M_PI) * (((double) M_PI) * (3.08641975308642e-5 * (b * b)))), (a * a));
      	} else {
      		tmp = 3.08641975308642e-5 * (t_0 * t_0);
      	}
      	return tmp;
      }
      
      function code(a, b, angle)
      	t_0 = Float64(angle * Float64(b * pi))
      	tmp = 0.0
      	if (b <= 8.4e-122)
      		tmp = Float64(a * a);
      	elseif (b <= 5e+145)
      		tmp = fma(Float64(angle * angle), Float64(pi * Float64(pi * Float64(3.08641975308642e-5 * Float64(b * b)))), Float64(a * a));
      	else
      		tmp = Float64(3.08641975308642e-5 * Float64(t_0 * t_0));
      	end
      	return tmp
      end
      
      code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(b * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 8.4e-122], N[(a * a), $MachinePrecision], If[LessEqual[b, 5e+145], N[(N[(angle * angle), $MachinePrecision] * N[(Pi * N[(Pi * N[(3.08641975308642e-5 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(3.08641975308642e-5 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := angle \cdot \left(b \cdot \pi\right)\\
      \mathbf{if}\;b \leq 8.4 \cdot 10^{-122}:\\
      \;\;\;\;a \cdot a\\
      
      \mathbf{elif}\;b \leq 5 \cdot 10^{+145}:\\
      \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right)\right), a \cdot a\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;3.08641975308642 \cdot 10^{-5} \cdot \left(t\_0 \cdot t\_0\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if b < 8.39999999999999969e-122

        1. Initial program 78.1%

          \[{\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-*.f6462.7

            \[\leadsto \color{blue}{a \cdot a} \]
        5. Simplified62.7%

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

        if 8.39999999999999969e-122 < b < 4.99999999999999967e145

        1. Initial program 80.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. Simplified53.5%

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

            \[\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) \]
          2. unpow2N/A

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

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

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

        if 4.99999999999999967e145 < b

        1. Initial program 97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 12: 64.1% accurate, 12.1× speedup?

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

        1. Initial program 78.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}{{a}^{2}} \]
        4. Step-by-step derivation
          1. unpow2N/A

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

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

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

        if 1.49999999999999995e144 < b

        1. Initial program 97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 13: 62.5% accurate, 12.1× speedup?

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

        1. Initial program 78.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}{{a}^{2}} \]
        4. Step-by-step derivation
          1. unpow2N/A

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

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

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

        if 7.8000000000000001e142 < b

        1. Initial program 97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot \left(angle \cdot \left(\pi \cdot \left(\pi \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right)\right) \]
        11. Simplified70.9%

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

      Alternative 14: 57.4% accurate, 74.7× speedup?

      \[\begin{array}{l} \\ a \cdot a \end{array} \]
      (FPCore (a b angle) :precision binary64 (* a a))
      double code(double a, double b, double angle) {
      	return a * a;
      }
      
      real(8) function code(a, b, angle)
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          real(8), intent (in) :: angle
          code = a * a
      end function
      
      public static double code(double a, double b, double angle) {
      	return a * a;
      }
      
      def code(a, b, angle):
      	return a * a
      
      function code(a, b, angle)
      	return Float64(a * a)
      end
      
      function tmp = code(a, b, angle)
      	tmp = a * a;
      end
      
      code[a_, b_, angle_] := N[(a * a), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      a \cdot a
      \end{array}
      
      Derivation
      1. Initial program 81.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-*.f6459.1

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

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

      Reproduce

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