ab-angle->ABCF C

Percentage Accurate: 79.9% → 79.8%
Time: 18.1s
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: 79.9% accurate, 1.0× speedup?

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

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

Alternative 1: 79.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\ t_1 := \cos t\_0\\ t_2 := b \cdot \sin t\_0\\ \mathsf{fma}\left(t\_2, t\_2, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \mathsf{fma}\left(t\_1, t\_1, -\mathsf{fma}\left(\cos \left(\left(angle \cdot \left(\left(\sqrt{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\sqrt{\pi}}\right)\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\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 (* b (sin t_0))))
   (fma
    t_2
    t_2
    (*
     (* a a)
     (+
      0.5
      (*
       0.5
       (fma
        t_1
        t_1
        (-
         (fma
          (cos
           (*
            (* angle (* (* (sqrt PI) (cbrt PI)) (cbrt (sqrt PI))))
            0.011111111111111112))
          -0.5
          0.5)))))))))
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 = b * sin(t_0);
	return fma(t_2, t_2, ((a * a) * (0.5 + (0.5 * fma(t_1, t_1, -fma(cos(((angle * ((sqrt(((double) M_PI)) * cbrt(((double) M_PI))) * cbrt(sqrt(((double) M_PI))))) * 0.011111111111111112)), -0.5, 0.5))))));
}
function code(a, b, angle)
	t_0 = Float64(pi * Float64(angle * 0.005555555555555556))
	t_1 = cos(t_0)
	t_2 = Float64(b * sin(t_0))
	return fma(t_2, t_2, Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * fma(t_1, t_1, Float64(-fma(cos(Float64(Float64(angle * Float64(Float64(sqrt(pi) * cbrt(pi)) * cbrt(sqrt(pi)))) * 0.011111111111111112)), -0.5, 0.5)))))))
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[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$2 * t$95$2 + N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[(t$95$1 * t$95$1 + (-N[(N[Cos[N[(N[(angle * N[(N[(N[Sqrt[Pi], $MachinePrecision] * N[Power[Pi, 1/3], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $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 := b \cdot \sin t\_0\\
\mathsf{fma}\left(t\_2, t\_2, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \mathsf{fma}\left(t\_1, t\_1, -\mathsf{fma}\left(\cos \left(\left(angle \cdot \left(\left(\sqrt{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\sqrt{\pi}}\right)\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 82.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-rr82.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. Step-by-step derivation
    1. metadata-evalN/A

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)\right)\right) \]
    3. cos-2N/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 \color{blue}{\left(\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) - \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}\right)\right) \]
    4. sqr-cos-aN/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 \left(\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)} - \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right) \]
    5. div-invN/A

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \left(\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) - \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right) \]
    7. sqr-sin-aN/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 \left(\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) - \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)}\right)\right)\right) \]
    8. div-invN/A

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \left(\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) - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \color{blue}{\frac{1}{180}}\right)\right)\right)\right)\right)\right)\right) \]
  6. Applied egg-rr82.2%

    \[\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}{\mathsf{fma}\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), -\mathsf{fma}\left(\cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right)}\right)\right) \]
  7. Step-by-step derivation
    1. add-cbrt-cubeN/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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\color{blue}{\sqrt[3]{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)}} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    2. pow1/3N/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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\color{blue}{{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right)}^{\frac{1}{3}}} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left({\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{\frac{1}{3}} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left({\color{blue}{\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}}^{\frac{1}{3}} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    5. unpow-prod-downN/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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\color{blue}{\left({\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{3}} \cdot {\left(\sqrt{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{3}}\right)} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    6. pow1/3N/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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left({\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{3}} \cdot \color{blue}{\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    7. *-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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\color{blue}{\left({\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)} \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    8. pow-lowering-pow.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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\color{blue}{{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{3}}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left({\color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}}^{\frac{1}{3}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    10. *-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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left({\left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left({\left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    12. 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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left({\left(\left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left({\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    14. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left({\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    15. cbrt-lowering-cbrt.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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left({\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{3}} \cdot \color{blue}{\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    16. sqrt-lowering-sqrt.f64N/A

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

      \[\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 \mathsf{fma}\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), -\mathsf{fma}\left(\cos \left(\left(\left({\left(\left(\pi \cdot \pi\right) \cdot \sqrt{\pi}\right)}^{0.3333333333333333} \cdot \sqrt[3]{\sqrt{\color{blue}{\pi}}}\right) \cdot angle\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right)\right)\right) \]
  8. Applied egg-rr82.2%

    \[\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 \mathsf{fma}\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), -\mathsf{fma}\left(\cos \left(\left(\color{blue}{\left({\left(\left(\pi \cdot \pi\right) \cdot \sqrt{\pi}\right)}^{0.3333333333333333} \cdot \sqrt[3]{\sqrt{\pi}}\right)} \cdot angle\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right)\right)\right) \]
  9. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left({\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}}^{\frac{1}{3}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    2. *-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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left({\color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \mathsf{PI}\left(\right)\right)}}^{\frac{1}{3}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    3. unpow-prod-downN/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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\color{blue}{\left({\left(\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{3}} \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{3}}\right)} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    4. pow1/3N/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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}}} \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    5. 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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\left(\sqrt[3]{\color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    6. pow3N/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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\left(\sqrt[3]{\color{blue}{{\left(\sqrt{\mathsf{PI}\left(\right)}\right)}^{3}}} \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    7. rem-cbrt-cubeN/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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\left(\color{blue}{\sqrt{\mathsf{PI}\left(\right)}} \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    8. pow1/3N/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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\left(\color{blue}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\left(\sqrt{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    12. cbrt-lowering-cbrt.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 \mathsf{fma}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \cos \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \mathsf{neg}\left(\mathsf{fma}\left(\cos \left(\left(\left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot angle\right) \cdot \frac{1}{90}\right), \frac{-1}{2}, \frac{1}{2}\right)\right)\right)\right)\right) \]
    13. PI-lowering-PI.f6482.2

      \[\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 \mathsf{fma}\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), -\mathsf{fma}\left(\cos \left(\left(\left(\left(\sqrt{\pi} \cdot \sqrt[3]{\color{blue}{\pi}}\right) \cdot \sqrt[3]{\sqrt{\pi}}\right) \cdot angle\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right)\right)\right) \]
  10. Applied egg-rr82.2%

    \[\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 \mathsf{fma}\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), -\mathsf{fma}\left(\cos \left(\left(\left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt[3]{\pi}\right)} \cdot \sqrt[3]{\sqrt{\pi}}\right) \cdot angle\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right)\right)\right) \]
  11. Final simplification82.2%

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

Alternative 2: 79.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\ t_1 := \cos t\_0\\ t_2 := b \cdot \sin t\_0\\ \mathsf{fma}\left(t\_2, t\_2, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \mathsf{fma}\left(t\_1, t\_1, -\mathsf{fma}\left(\cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right), -0.5, 0.5\right)\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 (* b (sin t_0))))
   (fma
    t_2
    t_2
    (*
     (* a a)
     (+
      0.5
      (*
       0.5
       (fma
        t_1
        t_1
        (- (fma (cos (* 0.011111111111111112 (* PI angle))) -0.5 0.5)))))))))
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 = b * sin(t_0);
	return fma(t_2, t_2, ((a * a) * (0.5 + (0.5 * fma(t_1, t_1, -fma(cos((0.011111111111111112 * (((double) M_PI) * angle))), -0.5, 0.5))))));
}
function code(a, b, angle)
	t_0 = Float64(pi * Float64(angle * 0.005555555555555556))
	t_1 = cos(t_0)
	t_2 = Float64(b * sin(t_0))
	return fma(t_2, t_2, Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * fma(t_1, t_1, Float64(-fma(cos(Float64(0.011111111111111112 * Float64(pi * angle))), -0.5, 0.5)))))))
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[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$2 * t$95$2 + N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[(t$95$1 * t$95$1 + (-N[(N[Cos[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $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 := b \cdot \sin t\_0\\
\mathsf{fma}\left(t\_2, t\_2, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \mathsf{fma}\left(t\_1, t\_1, -\mathsf{fma}\left(\cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right), -0.5, 0.5\right)\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 82.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-rr82.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. Step-by-step derivation
    1. metadata-evalN/A

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)\right)\right) \]
    3. cos-2N/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 \color{blue}{\left(\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) - \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}\right)\right) \]
    4. sqr-cos-aN/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 \left(\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)} - \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right) \]
    5. div-invN/A

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \left(\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) - \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right) \]
    7. sqr-sin-aN/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 \left(\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) - \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)}\right)\right)\right) \]
    8. div-invN/A

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \left(\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) - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \color{blue}{\frac{1}{180}}\right)\right)\right)\right)\right)\right)\right) \]
  6. Applied egg-rr82.2%

    \[\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}{\mathsf{fma}\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), -\mathsf{fma}\left(\cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right)}\right)\right) \]
  7. Final simplification82.2%

    \[\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 \mathsf{fma}\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), -\mathsf{fma}\left(\cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right), -0.5, 0.5\right)\right)\right)\right) \]
  8. Add Preprocessing

Alternative 3: 79.8% accurate, 0.9× speedup?

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

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

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)\right)\right) \]
    3. cos-2N/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 \color{blue}{\left(\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) - \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}\right)\right) \]
    4. sqr-cos-aN/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 \left(\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)} - \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right) \]
    5. div-invN/A

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \left(\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) - \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right) \]
    7. sqr-sin-aN/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 \left(\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) - \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)}\right)\right)\right) \]
    8. div-invN/A

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \left(\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) - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \color{blue}{\frac{1}{180}}\right)\right)\right)\right)\right)\right)\right) \]
  6. Applied egg-rr82.2%

    \[\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}{\mathsf{fma}\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), -\mathsf{fma}\left(\cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right)}\right)\right) \]
  7. Step-by-step derivation
    1. distribute-rgt-inN/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} + \color{blue}{\left(\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) \cdot \frac{1}{2} + \left(\mathsf{neg}\left(\left(\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{90}\right) \cdot \frac{-1}{2} + \frac{1}{2}\right)\right)\right) \cdot \frac{1}{2}\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 \color{blue}{\left(\left(\frac{1}{2} + \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) \cdot \frac{1}{2}\right) + \left(\mathsf{neg}\left(\left(\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{90}\right) \cdot \frac{-1}{2} + \frac{1}{2}\right)\right)\right) \cdot \frac{1}{2}\right)}\right) \]
    3. +-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 \color{blue}{\left(\left(\frac{1}{2} + \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) \cdot \frac{1}{2}\right) + \left(\mathsf{neg}\left(\left(\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{90}\right) \cdot \frac{-1}{2} + \frac{1}{2}\right)\right)\right) \cdot \frac{1}{2}\right)}\right) \]
  8. Applied egg-rr82.1%

    \[\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}{\left(\left(0.5 + \left(0.25 + \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) \cdot 0.25\right)\right) + \mathsf{fma}\left(\cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), 0.25, -0.25\right)\right)}\right) \]
  9. Final simplification82.1%

    \[\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(\left(0.5 + \left(0.25 + \cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot 0.25\right)\right) + \mathsf{fma}\left(\cos \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right), 0.25, -0.25\right)\right)\right) \]
  10. Add Preprocessing

Alternative 4: 79.9% 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 82.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-rr82.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. Final simplification82.1%

    \[\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: 79.8% 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 82.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-rr82.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. Step-by-step derivation
    1. metadata-evalN/A

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right)\right)\right) \]
    3. cos-2N/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 \color{blue}{\left(\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) - \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}\right)\right) \]
    4. sqr-cos-aN/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 \left(\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)} - \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right) \]
    5. div-invN/A

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \left(\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) - \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right) \]
    7. sqr-sin-aN/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 \left(\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) - \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)}\right)\right)\right) \]
    8. div-invN/A

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

      \[\leadsto \mathsf{fma}\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(a \cdot a\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \left(\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) - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \color{blue}{\frac{1}{180}}\right)\right)\right)\right)\right)\right)\right) \]
  6. Applied egg-rr82.2%

    \[\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}{\mathsf{fma}\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), -\mathsf{fma}\left(\cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right)\right)}\right)\right) \]
  7. 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), \color{blue}{{a}^{2}}\right) \]
  8. Step-by-step derivation
    1. unpow2N/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), \color{blue}{a \cdot a}\right) \]
    2. *-lowering-*.f6482.1

      \[\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), \color{blue}{a \cdot a}\right) \]
  9. Simplified82.1%

    \[\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), \color{blue}{a \cdot a}\right) \]
  10. Add Preprocessing

Alternative 6: 79.8% 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 82.0%

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

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

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

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

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

Alternative 7: 65.5% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-172}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-13}:\\ \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, a, \left(b \cdot b\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (if (<= (/ angle 180.0) 2e-172)
   (* a a)
   (if (<= (/ angle 180.0) 2e-13)
     (fma
      (* angle angle)
      (* (* PI PI) (* 3.08641975308642e-5 (* b b)))
      (* a a))
     (fma
      a
      a
      (*
       (* b b)
       (- 0.5 (* 0.5 (cos (* (* PI (* angle 0.005555555555555556)) 2.0)))))))))
double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= 2e-172) {
		tmp = a * a;
	} else if ((angle / 180.0) <= 2e-13) {
		tmp = fma((angle * angle), ((((double) M_PI) * ((double) M_PI)) * (3.08641975308642e-5 * (b * b))), (a * a));
	} else {
		tmp = fma(a, a, ((b * b) * (0.5 - (0.5 * cos(((((double) M_PI) * (angle * 0.005555555555555556)) * 2.0))))));
	}
	return tmp;
}
function code(a, b, angle)
	tmp = 0.0
	if (Float64(angle / 180.0) <= 2e-172)
		tmp = Float64(a * a);
	elseif (Float64(angle / 180.0) <= 2e-13)
		tmp = fma(Float64(angle * angle), Float64(Float64(pi * pi) * Float64(3.08641975308642e-5 * Float64(b * b))), Float64(a * a));
	else
		tmp = fma(a, a, Float64(Float64(b * b) * Float64(0.5 - Float64(0.5 * cos(Float64(Float64(pi * Float64(angle * 0.005555555555555556)) * 2.0))))));
	end
	return tmp
end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-172], N[(a * a), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-13], N[(N[(angle * angle), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * N[(3.08641975308642e-5 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(a * a + N[(N[(b * b), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-172}:\\
\;\;\;\;a \cdot a\\

\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), a \cdot a\right)\\

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


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

    1. Initial program 85.7%

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

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

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

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

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

    if 2.0000000000000001e-172 < (/.f64 angle #s(literal 180 binary64)) < 2.0000000000000001e-13

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-13 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 61.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. Step-by-step derivation
      1. rem-exp-logN/A

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 8: 65.5% accurate, 2.6× speedup?

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

      1. Initial program 85.7%

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

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

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

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

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

      if 2.0000000000000001e-172 < (/.f64 angle #s(literal 180 binary64)) < 2.0000000000000001e-13

      1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 2.0000000000000001e-13 < (/.f64 angle #s(literal 180 binary64))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot {\left(e^{-1}\right)}^{\left(\mathsf{neg}\left(\log \color{blue}{\left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right)}\right)\right)}\right)\right) \cdot \left(b \cdot b\right) \]
      6. Applied egg-rr61.7%

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left({b}^{2}, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot e^{\log angle + \log \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)}\right), {a}^{2}\right)} \]
      9. Simplified62.2%

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

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

    Alternative 9: 56.0% accurate, 8.3× speedup?

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

      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}{{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.2%

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

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

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

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

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

      if 1.05e62 < a

      1. Initial program 85.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-*.f6484.1

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

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

    Alternative 10: 63.1% accurate, 9.1× speedup?

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

      1. Initial program 81.3%

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

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

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

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

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

      if 8.4999999999999998e-106 < b < 3.29999999999999992e136

      1. Initial program 74.3%

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left({angle}^{2}, \frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {a}^{2}\right)} \]
      5. Simplified46.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 \mathsf{fma}\left(angle \cdot angle, \color{blue}{\frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}, a \cdot a\right) \]
      7. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

      if 3.29999999999999992e136 < b

      1. Initial program 95.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}{{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. Simplified36.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 \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. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 11: 61.7% accurate, 12.1× speedup?

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

      1. Initial program 80.3%

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

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

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

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

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

      if 2.2000000000000001e87 < b

      1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 12: 60.3% accurate, 12.1× speedup?

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

      1. Initial program 80.3%

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

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

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

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

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

      if 2.59999999999999998e87 < b

      1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 13: 60.3% accurate, 12.1× speedup?

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

      1. Initial program 80.3%

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

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

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

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

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

      if 2.59999999999999998e87 < b

      1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 14: 57.1% 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 82.0%

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

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

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

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

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

    Reproduce

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