ab-angle->ABCF A

Percentage Accurate: 79.8% → 79.7%
Time: 20.3s
Alternatives: 28
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 28 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.8% accurate, 1.0× speedup?

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

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

Alternative 1: 79.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{\sqrt{\pi}}\\
{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(\frac{t\_0}{\frac{1}{angle}} \cdot \frac{t\_0}{\frac{1}{\sqrt{\pi}}}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \left({\left(\sqrt{\pi} \cdot \left(\pi \cdot \pi\right)\right)}^{0.3333333333333333} \cdot \sqrt[3]{\sqrt{\pi}}\right)\right)\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\frac{1}{180} \cdot \left(\frac{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{1}{angle}} \cdot \frac{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot {\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}}\right)\right)}^{2} \]
    8. unpow-prod-downN/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{1}{180} \cdot \left(\frac{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{1}{angle}} \cdot \frac{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \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)}\right)\right)}^{2} \]
    9. pow1/3N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{1}{180} \cdot \left(\frac{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{1}{angle}} \cdot \frac{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \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)\right)\right)}^{2} \]
    10. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{1}{180} \cdot \left(\frac{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{1}{angle}} \cdot \frac{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \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)}\right)\right)}^{2} \]
    11. lower-pow.f64N/A

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\frac{1}{180} \cdot \left(\frac{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{1}{angle}} \cdot \frac{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \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)\right)\right)}^{2} \]
    15. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{1}{180} \cdot \left(\frac{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{1}{angle}} \cdot \frac{\sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{1}{\sqrt{\mathsf{PI}\left(\right)}}}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \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)\right)\right)}^{2} \]
    16. lower-cbrt.f6481.4

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

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

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

Alternative 2: 79.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{\sqrt{\pi}}\\
{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(\frac{t\_0}{\frac{1}{angle}} \cdot \frac{t\_0}{\frac{1}{\sqrt{\pi}}}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 79.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 79.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 79.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 79.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{\sqrt{\pi}}\\
{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(\frac{t\_0}{\frac{1}{angle}} \cdot \frac{t\_0}{\frac{1}{\sqrt{\pi}}}\right)\right)\right)}^{2} + {b}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 8: 79.8% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 9: 79.7% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 10: 79.8% accurate, 1.4× speedup?

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

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

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

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

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

          Alternative 11: 77.4% accurate, 1.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\\ t_1 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\ \mathbf{if}\;\frac{angle}{180} \leq 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(t\_1 \cdot t\_1, \pi \cdot \pi, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right)\right)\right), a \cdot a, t\_0\right)\\ \end{array} \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (let* ((t_0
                   (*
                    (* b b)
                    (+ 0.5 (* 0.5 (cos (* 2.0 (* angle (* 0.005555555555555556 PI))))))))
                  (t_1 (* angle (* a 0.005555555555555556))))
             (if (<= (/ angle 180.0) 1e-6)
               (fma (* t_1 t_1) (* PI PI) t_0)
               (fma
                (-
                 0.5
                 (*
                  0.5
                  (cos
                   (* 2.0 (* angle (* 0.005555555555555556 (* (sqrt PI) (sqrt PI))))))))
                (* a a)
                t_0))))
          double code(double a, double b, double angle) {
          	double t_0 = (b * b) * (0.5 + (0.5 * cos((2.0 * (angle * (0.005555555555555556 * ((double) M_PI)))))));
          	double t_1 = angle * (a * 0.005555555555555556);
          	double tmp;
          	if ((angle / 180.0) <= 1e-6) {
          		tmp = fma((t_1 * t_1), (((double) M_PI) * ((double) M_PI)), t_0);
          	} else {
          		tmp = fma((0.5 - (0.5 * cos((2.0 * (angle * (0.005555555555555556 * (sqrt(((double) M_PI)) * sqrt(((double) M_PI))))))))), (a * a), t_0);
          	}
          	return tmp;
          }
          
          function code(a, b, angle)
          	t_0 = Float64(Float64(b * b) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(angle * Float64(0.005555555555555556 * pi)))))))
          	t_1 = Float64(angle * Float64(a * 0.005555555555555556))
          	tmp = 0.0
          	if (Float64(angle / 180.0) <= 1e-6)
          		tmp = fma(Float64(t_1 * t_1), Float64(pi * pi), t_0);
          	else
          		tmp = fma(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(angle * Float64(0.005555555555555556 * Float64(sqrt(pi) * sqrt(pi)))))))), Float64(a * a), t_0);
          	end
          	return tmp
          end
          
          code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(b * b), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(angle * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e-6], N[(N[(t$95$1 * t$95$1), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(angle * N[(0.005555555555555556 * N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a * a), $MachinePrecision] + t$95$0), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\\
          t_1 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\
          \mathbf{if}\;\frac{angle}{180} \leq 10^{-6}:\\
          \;\;\;\;\mathsf{fma}\left(t\_1 \cdot t\_1, \pi \cdot \pi, t\_0\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right)\right)\right), a \cdot a, t\_0\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999955e-7

            1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(angle \cdot \left(\pi \cdot \color{blue}{\left(0.005555555555555556 \cdot a\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
            5. Simplified84.3%

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

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

            if 9.99999999999999955e-7 < (/.f64 angle #s(literal 180 binary64))

            1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(a \cdot \sin \left(\left(angle \cdot \left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              14. lower-sqrt.f6464.7

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right), a \cdot a, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\right)} \]
            6. Step-by-step derivation
              1. lift-PI.f6464.5

                \[\leadsto \mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \color{blue}{\pi}\right)\right)\right), a \cdot a, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\right) \]
              2. rem-square-sqrtN/A

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

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

                \[\leadsto \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(angle \cdot \left(\frac{1}{180} \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right)\right)\right)\right), a \cdot a, \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right) \]
              5. lower-*.f6464.7

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

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

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

          Alternative 12: 77.4% accurate, 1.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\\ t_1 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\ \mathbf{if}\;\frac{angle}{180} \leq 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(t\_1 \cdot t\_1, \pi \cdot \pi, \left(b \cdot b\right) \cdot \left(0.5 + t\_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.5 - t\_0, a \cdot a, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot \left(angle \cdot 2\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (let* ((t_0 (* 0.5 (cos (* 2.0 (* angle (* 0.005555555555555556 PI))))))
                  (t_1 (* angle (* a 0.005555555555555556))))
             (if (<= (/ angle 180.0) 1e-6)
               (fma (* t_1 t_1) (* PI PI) (* (* b b) (+ 0.5 t_0)))
               (fma
                (- 0.5 t_0)
                (* a a)
                (*
                 (* b b)
                 (+ 0.5 (* 0.5 (cos (* 0.005555555555555556 (* PI (* angle 2.0)))))))))))
          double code(double a, double b, double angle) {
          	double t_0 = 0.5 * cos((2.0 * (angle * (0.005555555555555556 * ((double) M_PI)))));
          	double t_1 = angle * (a * 0.005555555555555556);
          	double tmp;
          	if ((angle / 180.0) <= 1e-6) {
          		tmp = fma((t_1 * t_1), (((double) M_PI) * ((double) M_PI)), ((b * b) * (0.5 + t_0)));
          	} else {
          		tmp = fma((0.5 - t_0), (a * a), ((b * b) * (0.5 + (0.5 * cos((0.005555555555555556 * (((double) M_PI) * (angle * 2.0))))))));
          	}
          	return tmp;
          }
          
          function code(a, b, angle)
          	t_0 = Float64(0.5 * cos(Float64(2.0 * Float64(angle * Float64(0.005555555555555556 * pi)))))
          	t_1 = Float64(angle * Float64(a * 0.005555555555555556))
          	tmp = 0.0
          	if (Float64(angle / 180.0) <= 1e-6)
          		tmp = fma(Float64(t_1 * t_1), Float64(pi * pi), Float64(Float64(b * b) * Float64(0.5 + t_0)));
          	else
          		tmp = fma(Float64(0.5 - t_0), Float64(a * a), Float64(Float64(b * b) * Float64(0.5 + Float64(0.5 * cos(Float64(0.005555555555555556 * Float64(pi * Float64(angle * 2.0))))))));
          	end
          	return tmp
          end
          
          code[a_, b_, angle_] := Block[{t$95$0 = N[(0.5 * N[Cos[N[(2.0 * N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(angle * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e-6], N[(N[(t$95$1 * t$95$1), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(0.5 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 - t$95$0), $MachinePrecision] * N[(a * a), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(0.005555555555555556 * N[(Pi * N[(angle * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\\
          t_1 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\
          \mathbf{if}\;\frac{angle}{180} \leq 10^{-6}:\\
          \;\;\;\;\mathsf{fma}\left(t\_1 \cdot t\_1, \pi \cdot \pi, \left(b \cdot b\right) \cdot \left(0.5 + t\_0\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(0.5 - t\_0, a \cdot a, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot \left(angle \cdot 2\right)\right)\right)\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999955e-7

            1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(angle \cdot \left(\pi \cdot \color{blue}{\left(0.005555555555555556 \cdot a\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
            5. Simplified84.3%

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

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

            if 9.99999999999999955e-7 < (/.f64 angle #s(literal 180 binary64))

            1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(a \cdot \sin \left(\left(angle \cdot \left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              14. lower-sqrt.f6464.7

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right), a \cdot a, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\right)} \]
            6. Step-by-step derivation
              1. lift-PI.f64N/A

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)\right), a \cdot a, \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\left(\color{blue}{\left(angle \cdot 2\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right)\right) \]
              10. lower-*.f6464.6

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

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

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

          Alternative 13: 77.4% accurate, 1.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\\ t_1 := \left(b \cdot b\right) \cdot \left(0.5 + t\_0\right)\\ t_2 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\ \mathbf{if}\;\frac{angle}{180} \leq 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(t\_2 \cdot t\_2, \pi \cdot \pi, t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.5 - t\_0, a \cdot a, t\_1\right)\\ \end{array} \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (let* ((t_0 (* 0.5 (cos (* 2.0 (* angle (* 0.005555555555555556 PI))))))
                  (t_1 (* (* b b) (+ 0.5 t_0)))
                  (t_2 (* angle (* a 0.005555555555555556))))
             (if (<= (/ angle 180.0) 1e-6)
               (fma (* t_2 t_2) (* PI PI) t_1)
               (fma (- 0.5 t_0) (* a a) t_1))))
          double code(double a, double b, double angle) {
          	double t_0 = 0.5 * cos((2.0 * (angle * (0.005555555555555556 * ((double) M_PI)))));
          	double t_1 = (b * b) * (0.5 + t_0);
          	double t_2 = angle * (a * 0.005555555555555556);
          	double tmp;
          	if ((angle / 180.0) <= 1e-6) {
          		tmp = fma((t_2 * t_2), (((double) M_PI) * ((double) M_PI)), t_1);
          	} else {
          		tmp = fma((0.5 - t_0), (a * a), t_1);
          	}
          	return tmp;
          }
          
          function code(a, b, angle)
          	t_0 = Float64(0.5 * cos(Float64(2.0 * Float64(angle * Float64(0.005555555555555556 * pi)))))
          	t_1 = Float64(Float64(b * b) * Float64(0.5 + t_0))
          	t_2 = Float64(angle * Float64(a * 0.005555555555555556))
          	tmp = 0.0
          	if (Float64(angle / 180.0) <= 1e-6)
          		tmp = fma(Float64(t_2 * t_2), Float64(pi * pi), t_1);
          	else
          		tmp = fma(Float64(0.5 - t_0), Float64(a * a), t_1);
          	end
          	return tmp
          end
          
          code[a_, b_, angle_] := Block[{t$95$0 = N[(0.5 * N[Cos[N[(2.0 * N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b * b), $MachinePrecision] * N[(0.5 + t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(angle * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e-6], N[(N[(t$95$2 * t$95$2), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(0.5 - t$95$0), $MachinePrecision] * N[(a * a), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\\
          t_1 := \left(b \cdot b\right) \cdot \left(0.5 + t\_0\right)\\
          t_2 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\
          \mathbf{if}\;\frac{angle}{180} \leq 10^{-6}:\\
          \;\;\;\;\mathsf{fma}\left(t\_2 \cdot t\_2, \pi \cdot \pi, t\_1\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(0.5 - t\_0, a \cdot a, t\_1\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999955e-7

            1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(angle \cdot \left(\pi \cdot \color{blue}{\left(0.005555555555555556 \cdot a\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
            5. Simplified84.3%

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

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

            if 9.99999999999999955e-7 < (/.f64 angle #s(literal 180 binary64))

            1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(a \cdot \sin \left(\left(angle \cdot \left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              14. lower-sqrt.f6464.7

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

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

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

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

          Alternative 14: 77.4% accurate, 1.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\ t_1 := \cos \left(\pi \cdot \left(2 \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\\ \mathbf{if}\;\frac{angle}{180} \leq 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(t\_0 \cdot t\_0, \pi \cdot \pi, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(t\_1, -0.5, 0.5\right), a, \left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, t\_1, 0.5\right)\right)\\ \end{array} \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (let* ((t_0 (* angle (* a 0.005555555555555556)))
                  (t_1 (cos (* PI (* 2.0 (* 0.005555555555555556 angle))))))
             (if (<= (/ angle 180.0) 1e-6)
               (fma
                (* t_0 t_0)
                (* PI PI)
                (*
                 (* b b)
                 (+ 0.5 (* 0.5 (cos (* 2.0 (* angle (* 0.005555555555555556 PI))))))))
               (fma (* a (fma t_1 -0.5 0.5)) a (* (* b b) (fma 0.5 t_1 0.5))))))
          double code(double a, double b, double angle) {
          	double t_0 = angle * (a * 0.005555555555555556);
          	double t_1 = cos((((double) M_PI) * (2.0 * (0.005555555555555556 * angle))));
          	double tmp;
          	if ((angle / 180.0) <= 1e-6) {
          		tmp = fma((t_0 * t_0), (((double) M_PI) * ((double) M_PI)), ((b * b) * (0.5 + (0.5 * cos((2.0 * (angle * (0.005555555555555556 * ((double) M_PI)))))))));
          	} else {
          		tmp = fma((a * fma(t_1, -0.5, 0.5)), a, ((b * b) * fma(0.5, t_1, 0.5)));
          	}
          	return tmp;
          }
          
          function code(a, b, angle)
          	t_0 = Float64(angle * Float64(a * 0.005555555555555556))
          	t_1 = cos(Float64(pi * Float64(2.0 * Float64(0.005555555555555556 * angle))))
          	tmp = 0.0
          	if (Float64(angle / 180.0) <= 1e-6)
          		tmp = fma(Float64(t_0 * t_0), Float64(pi * pi), Float64(Float64(b * b) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(angle * Float64(0.005555555555555556 * pi))))))));
          	else
          		tmp = fma(Float64(a * fma(t_1, -0.5, 0.5)), a, Float64(Float64(b * b) * fma(0.5, t_1, 0.5)));
          	end
          	return tmp
          end
          
          code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(Pi * N[(2.0 * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e-6], N[(N[(t$95$0 * t$95$0), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(t$95$1 * -0.5 + 0.5), $MachinePrecision]), $MachinePrecision] * a + N[(N[(b * b), $MachinePrecision] * N[(0.5 * t$95$1 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\
          t_1 := \cos \left(\pi \cdot \left(2 \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\\
          \mathbf{if}\;\frac{angle}{180} \leq 10^{-6}:\\
          \;\;\;\;\mathsf{fma}\left(t\_0 \cdot t\_0, \pi \cdot \pi, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(t\_1, -0.5, 0.5\right), a, \left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, t\_1, 0.5\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999955e-7

            1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(angle \cdot \left(\pi \cdot \color{blue}{\left(0.005555555555555556 \cdot a\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
            5. Simplified84.3%

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

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

            if 9.99999999999999955e-7 < (/.f64 angle #s(literal 180 binary64))

            1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 15: 77.4% accurate, 1.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\ t_1 := \cos \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \mathbf{if}\;\frac{angle}{180} \leq 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(t\_0 \cdot t\_0, \pi \cdot \pi, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b \cdot \mathsf{fma}\left(0.5, t\_1, 0.5\right), b, \left(a \cdot a\right) \cdot \left(0.5 + -0.5 \cdot t\_1\right)\right)\\ \end{array} \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (let* ((t_0 (* angle (* a 0.005555555555555556)))
                  (t_1 (cos (* PI (* angle 0.011111111111111112)))))
             (if (<= (/ angle 180.0) 1e-6)
               (fma
                (* t_0 t_0)
                (* PI PI)
                (*
                 (* b b)
                 (+ 0.5 (* 0.5 (cos (* 2.0 (* angle (* 0.005555555555555556 PI))))))))
               (fma (* b (fma 0.5 t_1 0.5)) b (* (* a a) (+ 0.5 (* -0.5 t_1)))))))
          double code(double a, double b, double angle) {
          	double t_0 = angle * (a * 0.005555555555555556);
          	double t_1 = cos((((double) M_PI) * (angle * 0.011111111111111112)));
          	double tmp;
          	if ((angle / 180.0) <= 1e-6) {
          		tmp = fma((t_0 * t_0), (((double) M_PI) * ((double) M_PI)), ((b * b) * (0.5 + (0.5 * cos((2.0 * (angle * (0.005555555555555556 * ((double) M_PI)))))))));
          	} else {
          		tmp = fma((b * fma(0.5, t_1, 0.5)), b, ((a * a) * (0.5 + (-0.5 * t_1))));
          	}
          	return tmp;
          }
          
          function code(a, b, angle)
          	t_0 = Float64(angle * Float64(a * 0.005555555555555556))
          	t_1 = cos(Float64(pi * Float64(angle * 0.011111111111111112)))
          	tmp = 0.0
          	if (Float64(angle / 180.0) <= 1e-6)
          		tmp = fma(Float64(t_0 * t_0), Float64(pi * pi), Float64(Float64(b * b) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(angle * Float64(0.005555555555555556 * pi))))))));
          	else
          		tmp = fma(Float64(b * fma(0.5, t_1, 0.5)), b, Float64(Float64(a * a) * Float64(0.5 + Float64(-0.5 * t_1))));
          	end
          	return tmp
          end
          
          code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e-6], N[(N[(t$95$0 * t$95$0), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(0.5 * t$95$1 + 0.5), $MachinePrecision]), $MachinePrecision] * b + N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(-0.5 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\
          t_1 := \cos \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\
          \mathbf{if}\;\frac{angle}{180} \leq 10^{-6}:\\
          \;\;\;\;\mathsf{fma}\left(t\_0 \cdot t\_0, \pi \cdot \pi, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(b \cdot \mathsf{fma}\left(0.5, t\_1, 0.5\right), b, \left(a \cdot a\right) \cdot \left(0.5 + -0.5 \cdot t\_1\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999955e-7

            1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(angle \cdot \left(\pi \cdot \color{blue}{\left(0.005555555555555556 \cdot a\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
            5. Simplified84.3%

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

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

            if 9.99999999999999955e-7 < (/.f64 angle #s(literal 180 binary64))

            1. Initial program 64.4%

              \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
            2. Add Preprocessing
            3. Applied egg-rr43.4%

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

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

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

          Alternative 16: 67.6% accurate, 2.5× speedup?

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

            1. Initial program 80.7%

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

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

                \[\leadsto \color{blue}{b \cdot b} \]
              2. lower-*.f6466.3

                \[\leadsto \color{blue}{b \cdot b} \]
            5. Simplified66.3%

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

            if 3.14999999999999983e-80 < a

            1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{1}{180} \cdot a\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              10. lower-*.f6479.5

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

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

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

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

          Alternative 17: 67.6% accurate, 2.6× speedup?

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

            1. Initial program 80.7%

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

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

                \[\leadsto \color{blue}{b \cdot b} \]
              2. lower-*.f6466.3

                \[\leadsto \color{blue}{b \cdot b} \]
            5. Simplified66.3%

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

            if 3.14999999999999983e-80 < a

            1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{1}{180} \cdot a\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              10. lower-*.f6479.5

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

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

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

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

          Alternative 18: 67.6% accurate, 2.6× speedup?

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

            1. Initial program 80.7%

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

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

                \[\leadsto \color{blue}{b \cdot b} \]
              2. lower-*.f6466.3

                \[\leadsto \color{blue}{b \cdot b} \]
            5. Simplified66.3%

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

            if 3.14999999999999983e-80 < a

            1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{1}{180} \cdot a\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              10. lower-*.f6479.5

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

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

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

          Alternative 19: 67.5% accurate, 3.2× speedup?

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

            1. Initial program 80.7%

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

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

                \[\leadsto \color{blue}{b \cdot b} \]
              2. lower-*.f6466.3

                \[\leadsto \color{blue}{b \cdot b} \]
            5. Simplified66.3%

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

            if 3.14999999999999983e-80 < a

            1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{1}{180} \cdot a\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              10. lower-*.f6479.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 20: 51.7% accurate, 3.2× speedup?

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

              1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto {\left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{1}{180} \cdot a\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                10. lower-*.f6473.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \frac{1}{32400}\right) \]
                19. lower-*.f6436.6

                  \[\leadsto \left(\pi \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
              8. Simplified36.6%

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(angle \cdot angle\right)} \]
              10. Applied egg-rr41.6%

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

              if 1.24999999999999993e-107 < b < 5.50000000000000025e30

              1. Initial program 66.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 5.50000000000000025e30 < b

              1. Initial program 91.6%

                \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              2. Add Preprocessing
              3. Applied egg-rr52.3%

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \left(\color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{90}\right), \frac{1}{2}\right) \]
                10. lower-PI.f6483.1

                  \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(angle \cdot \color{blue}{\pi}\right) \cdot 0.011111111111111112\right), 0.5\right) \]
              6. Simplified83.1%

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

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

            Alternative 21: 51.7% accurate, 3.2× speedup?

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

              1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto {\left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{1}{180} \cdot a\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                10. lower-*.f6473.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \frac{1}{32400}\right) \]
                19. lower-*.f6436.6

                  \[\leadsto \left(\pi \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
              8. Simplified36.6%

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(angle \cdot angle\right)} \]
              10. Applied egg-rr41.6%

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

              if 1.24999999999999993e-107 < b < 5.50000000000000025e30

              1. Initial program 66.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 5.50000000000000025e30 < b

              1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{90}\right)}\right), \frac{1}{2}\right) \]
                11. lower-PI.f6483.1

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

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

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

            Alternative 22: 51.8% accurate, 7.5× speedup?

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

              1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \frac{1}{32400}\right) \]
                19. lower-*.f6436.7

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(angle \cdot angle\right)} \]
              10. Applied egg-rr41.8%

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

              if 1.62e-108 < b < 2.6999999999999999e125

              1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 2.6999999999999999e125 < b

              1. Initial program 93.9%

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

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

                  \[\leadsto \color{blue}{b \cdot b} \]
                2. lower-*.f6493.7

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

                \[\leadsto \color{blue}{b \cdot b} \]
            3. Recombined 3 regimes into one program.
            4. Final simplification53.4%

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

            Alternative 23: 51.8% accurate, 7.5× speedup?

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

              1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \frac{1}{32400}\right) \]
                19. lower-*.f6436.7

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(angle \cdot angle\right)} \]
              10. Applied egg-rr41.8%

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

              if 1.62e-108 < b < 2.6999999999999999e125

              1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto {\left(a \cdot \sin \left(\left(angle \cdot \left(\frac{1}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                14. lower-sqrt.f6473.4

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

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

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

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

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

              if 2.6999999999999999e125 < b

              1. Initial program 93.9%

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

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

                  \[\leadsto \color{blue}{b \cdot b} \]
                2. lower-*.f6493.7

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

                \[\leadsto \color{blue}{b \cdot b} \]
            3. Recombined 3 regimes into one program.
            4. Final simplification53.4%

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

            Alternative 24: 63.2% accurate, 10.7× speedup?

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

              1. Initial program 78.1%

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

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

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

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

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

              if 5.60000000000000002e137 < a

              1. Initial program 97.6%

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

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

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

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

                  \[\leadsto {\color{blue}{\left(\left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right) \cdot angle\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                4. *-commutativeN/A

                  \[\leadsto {\color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                5. lower-*.f64N/A

                  \[\leadsto {\color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                6. associate-*r*N/A

                  \[\leadsto {\left(angle \cdot \color{blue}{\left(\left(\frac{1}{180} \cdot a\right) \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                7. *-commutativeN/A

                  \[\leadsto {\left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{180} \cdot a\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                8. lower-*.f64N/A

                  \[\leadsto {\left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{180} \cdot a\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                9. lower-PI.f64N/A

                  \[\leadsto {\left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{1}{180} \cdot a\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                10. lower-*.f6497.6

                  \[\leadsto {\left(angle \cdot \left(\pi \cdot \color{blue}{\left(0.005555555555555556 \cdot a\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              5. Simplified97.6%

                \[\leadsto {\color{blue}{\left(angle \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot a\right)\right)\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              6. Taylor expanded in angle around inf

                \[\leadsto \color{blue}{\frac{1}{32400} \cdot \left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
              7. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \frac{1}{32400} \cdot \left({a}^{2} \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot {angle}^{2}\right)}\right) \]
                2. associate-*r*N/A

                  \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left(\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot {angle}^{2}\right)} \]
                3. associate-*l*N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} \]
                4. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)} \cdot {angle}^{2} \]
                5. associate-*l*N/A

                  \[\leadsto \color{blue}{\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right)} \]
                6. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right)} \]
                7. *-commutativeN/A

                  \[\leadsto \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot {a}^{2}\right)} \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                8. unpow2N/A

                  \[\leadsto \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot {a}^{2}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                9. associate-*l*N/A

                  \[\leadsto \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)\right)} \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                10. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)\right)} \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                11. lower-PI.f64N/A

                  \[\leadsto \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                12. lower-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                13. lower-PI.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot {a}^{2}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                14. unpow2N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                15. lower-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                16. *-commutativeN/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \color{blue}{\left({angle}^{2} \cdot \frac{1}{32400}\right)} \]
                17. lower-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \color{blue}{\left({angle}^{2} \cdot \frac{1}{32400}\right)} \]
                18. unpow2N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \frac{1}{32400}\right) \]
                19. lower-*.f6471.7

                  \[\leadsto \left(\pi \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
              8. Simplified71.7%

                \[\leadsto \color{blue}{\left(\pi \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
              9. Step-by-step derivation
                1. lift-PI.f64N/A

                  \[\leadsto \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                2. lift-PI.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                3. lift-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                4. lift-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)}\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                5. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right)} \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                6. lift-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \frac{1}{32400}\right) \]
                7. *-commutativeN/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \color{blue}{\left(\frac{1}{32400} \cdot \left(angle \cdot angle\right)\right)} \]
                8. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(angle \cdot angle\right)} \]
              10. Applied egg-rr86.0%

                \[\leadsto \color{blue}{\left(\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot a\right) \cdot \left(\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot a\right)} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification67.1%

              \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 5.6 \cdot 10^{+137}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right) \cdot \left(a \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 25: 62.6% accurate, 12.1× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 5.6 \cdot 10^{+137}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\pi \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(a \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)\\ \end{array} \end{array} \]
            (FPCore (a b angle)
             :precision binary64
             (if (<= a 5.6e+137)
               (* b b)
               (* (* (* PI angle) 3.08641975308642e-5) (* a (* a (* PI angle))))))
            double code(double a, double b, double angle) {
            	double tmp;
            	if (a <= 5.6e+137) {
            		tmp = b * b;
            	} else {
            		tmp = ((((double) M_PI) * angle) * 3.08641975308642e-5) * (a * (a * (((double) M_PI) * angle)));
            	}
            	return tmp;
            }
            
            public static double code(double a, double b, double angle) {
            	double tmp;
            	if (a <= 5.6e+137) {
            		tmp = b * b;
            	} else {
            		tmp = ((Math.PI * angle) * 3.08641975308642e-5) * (a * (a * (Math.PI * angle)));
            	}
            	return tmp;
            }
            
            def code(a, b, angle):
            	tmp = 0
            	if a <= 5.6e+137:
            		tmp = b * b
            	else:
            		tmp = ((math.pi * angle) * 3.08641975308642e-5) * (a * (a * (math.pi * angle)))
            	return tmp
            
            function code(a, b, angle)
            	tmp = 0.0
            	if (a <= 5.6e+137)
            		tmp = Float64(b * b);
            	else
            		tmp = Float64(Float64(Float64(pi * angle) * 3.08641975308642e-5) * Float64(a * Float64(a * Float64(pi * angle))));
            	end
            	return tmp
            end
            
            function tmp_2 = code(a, b, angle)
            	tmp = 0.0;
            	if (a <= 5.6e+137)
            		tmp = b * b;
            	else
            		tmp = ((pi * angle) * 3.08641975308642e-5) * (a * (a * (pi * angle)));
            	end
            	tmp_2 = tmp;
            end
            
            code[a_, b_, angle_] := If[LessEqual[a, 5.6e+137], N[(b * b), $MachinePrecision], N[(N[(N[(Pi * angle), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision] * N[(a * N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;a \leq 5.6 \cdot 10^{+137}:\\
            \;\;\;\;b \cdot b\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(\left(\pi \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(a \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < 5.60000000000000002e137

              1. Initial program 78.1%

                \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              2. Add Preprocessing
              3. Taylor expanded in angle around 0

                \[\leadsto \color{blue}{{b}^{2}} \]
              4. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto \color{blue}{b \cdot b} \]
                2. lower-*.f6463.5

                  \[\leadsto \color{blue}{b \cdot b} \]
              5. Simplified63.5%

                \[\leadsto \color{blue}{b \cdot b} \]

              if 5.60000000000000002e137 < a

              1. Initial program 97.6%

                \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              2. Add Preprocessing
              3. Taylor expanded in angle around 0

                \[\leadsto {\color{blue}{\left(\frac{1}{180} \cdot \left(a \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto {\left(\frac{1}{180} \cdot \left(a \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                2. associate-*r*N/A

                  \[\leadsto {\left(\frac{1}{180} \cdot \color{blue}{\left(\left(a \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                3. associate-*l*N/A

                  \[\leadsto {\color{blue}{\left(\left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right) \cdot angle\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                4. *-commutativeN/A

                  \[\leadsto {\color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                5. lower-*.f64N/A

                  \[\leadsto {\color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                6. associate-*r*N/A

                  \[\leadsto {\left(angle \cdot \color{blue}{\left(\left(\frac{1}{180} \cdot a\right) \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                7. *-commutativeN/A

                  \[\leadsto {\left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{180} \cdot a\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                8. lower-*.f64N/A

                  \[\leadsto {\left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{180} \cdot a\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                9. lower-PI.f64N/A

                  \[\leadsto {\left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{1}{180} \cdot a\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                10. lower-*.f6497.6

                  \[\leadsto {\left(angle \cdot \left(\pi \cdot \color{blue}{\left(0.005555555555555556 \cdot a\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              5. Simplified97.6%

                \[\leadsto {\color{blue}{\left(angle \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot a\right)\right)\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              6. Taylor expanded in angle around inf

                \[\leadsto \color{blue}{\frac{1}{32400} \cdot \left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
              7. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \frac{1}{32400} \cdot \left({a}^{2} \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot {angle}^{2}\right)}\right) \]
                2. associate-*r*N/A

                  \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left(\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot {angle}^{2}\right)} \]
                3. associate-*l*N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} \]
                4. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)} \cdot {angle}^{2} \]
                5. associate-*l*N/A

                  \[\leadsto \color{blue}{\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right)} \]
                6. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right)} \]
                7. *-commutativeN/A

                  \[\leadsto \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot {a}^{2}\right)} \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                8. unpow2N/A

                  \[\leadsto \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot {a}^{2}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                9. associate-*l*N/A

                  \[\leadsto \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)\right)} \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                10. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)\right)} \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                11. lower-PI.f64N/A

                  \[\leadsto \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                12. lower-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                13. lower-PI.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot {a}^{2}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                14. unpow2N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                15. lower-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                16. *-commutativeN/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \color{blue}{\left({angle}^{2} \cdot \frac{1}{32400}\right)} \]
                17. lower-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \color{blue}{\left({angle}^{2} \cdot \frac{1}{32400}\right)} \]
                18. unpow2N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \frac{1}{32400}\right) \]
                19. lower-*.f6471.7

                  \[\leadsto \left(\pi \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
              8. Simplified71.7%

                \[\leadsto \color{blue}{\left(\pi \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
              9. Step-by-step derivation
                1. lift-PI.f64N/A

                  \[\leadsto \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                2. lift-PI.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                3. lift-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                4. lift-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)}\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                5. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right)} \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                6. lift-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \frac{1}{32400}\right) \]
                7. *-commutativeN/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \color{blue}{\left(\frac{1}{32400} \cdot \left(angle \cdot angle\right)\right)} \]
                8. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(angle \cdot angle\right)} \]
              10. Applied egg-rr74.5%

                \[\leadsto \color{blue}{angle \cdot \left(angle \cdot \left(\left(a \cdot a\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)} \]
              11. Applied egg-rr83.9%

                \[\leadsto \color{blue}{\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot angle\right)\right) \cdot \left(a \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification66.8%

              \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 5.6 \cdot 10^{+137}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\pi \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(a \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 26: 62.6% accurate, 12.1× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 5.6 \cdot 10^{+137}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\left(a \cdot angle\right) \cdot \left(a \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\ \end{array} \end{array} \]
            (FPCore (a b angle)
             :precision binary64
             (if (<= a 5.6e+137)
               (* b b)
               (* angle (* (* a angle) (* a (* (* PI PI) 3.08641975308642e-5))))))
            double code(double a, double b, double angle) {
            	double tmp;
            	if (a <= 5.6e+137) {
            		tmp = b * b;
            	} else {
            		tmp = angle * ((a * angle) * (a * ((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5)));
            	}
            	return tmp;
            }
            
            public static double code(double a, double b, double angle) {
            	double tmp;
            	if (a <= 5.6e+137) {
            		tmp = b * b;
            	} else {
            		tmp = angle * ((a * angle) * (a * ((Math.PI * Math.PI) * 3.08641975308642e-5)));
            	}
            	return tmp;
            }
            
            def code(a, b, angle):
            	tmp = 0
            	if a <= 5.6e+137:
            		tmp = b * b
            	else:
            		tmp = angle * ((a * angle) * (a * ((math.pi * math.pi) * 3.08641975308642e-5)))
            	return tmp
            
            function code(a, b, angle)
            	tmp = 0.0
            	if (a <= 5.6e+137)
            		tmp = Float64(b * b);
            	else
            		tmp = Float64(angle * Float64(Float64(a * angle) * Float64(a * Float64(Float64(pi * pi) * 3.08641975308642e-5))));
            	end
            	return tmp
            end
            
            function tmp_2 = code(a, b, angle)
            	tmp = 0.0;
            	if (a <= 5.6e+137)
            		tmp = b * b;
            	else
            		tmp = angle * ((a * angle) * (a * ((pi * pi) * 3.08641975308642e-5)));
            	end
            	tmp_2 = tmp;
            end
            
            code[a_, b_, angle_] := If[LessEqual[a, 5.6e+137], N[(b * b), $MachinePrecision], N[(angle * N[(N[(a * angle), $MachinePrecision] * N[(a * N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;a \leq 5.6 \cdot 10^{+137}:\\
            \;\;\;\;b \cdot b\\
            
            \mathbf{else}:\\
            \;\;\;\;angle \cdot \left(\left(a \cdot angle\right) \cdot \left(a \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < 5.60000000000000002e137

              1. Initial program 78.1%

                \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              2. Add Preprocessing
              3. Taylor expanded in angle around 0

                \[\leadsto \color{blue}{{b}^{2}} \]
              4. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto \color{blue}{b \cdot b} \]
                2. lower-*.f6463.5

                  \[\leadsto \color{blue}{b \cdot b} \]
              5. Simplified63.5%

                \[\leadsto \color{blue}{b \cdot b} \]

              if 5.60000000000000002e137 < a

              1. Initial program 97.6%

                \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              2. Add Preprocessing
              3. Taylor expanded in angle around 0

                \[\leadsto {\color{blue}{\left(\frac{1}{180} \cdot \left(a \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto {\left(\frac{1}{180} \cdot \left(a \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                2. associate-*r*N/A

                  \[\leadsto {\left(\frac{1}{180} \cdot \color{blue}{\left(\left(a \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                3. associate-*l*N/A

                  \[\leadsto {\color{blue}{\left(\left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right) \cdot angle\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                4. *-commutativeN/A

                  \[\leadsto {\color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                5. lower-*.f64N/A

                  \[\leadsto {\color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                6. associate-*r*N/A

                  \[\leadsto {\left(angle \cdot \color{blue}{\left(\left(\frac{1}{180} \cdot a\right) \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                7. *-commutativeN/A

                  \[\leadsto {\left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{180} \cdot a\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                8. lower-*.f64N/A

                  \[\leadsto {\left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{180} \cdot a\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                9. lower-PI.f64N/A

                  \[\leadsto {\left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{1}{180} \cdot a\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                10. lower-*.f6497.6

                  \[\leadsto {\left(angle \cdot \left(\pi \cdot \color{blue}{\left(0.005555555555555556 \cdot a\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              5. Simplified97.6%

                \[\leadsto {\color{blue}{\left(angle \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot a\right)\right)\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              6. Taylor expanded in angle around inf

                \[\leadsto \color{blue}{\frac{1}{32400} \cdot \left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
              7. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \frac{1}{32400} \cdot \left({a}^{2} \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot {angle}^{2}\right)}\right) \]
                2. associate-*r*N/A

                  \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left(\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot {angle}^{2}\right)} \]
                3. associate-*l*N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} \]
                4. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)} \cdot {angle}^{2} \]
                5. associate-*l*N/A

                  \[\leadsto \color{blue}{\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right)} \]
                6. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right)} \]
                7. *-commutativeN/A

                  \[\leadsto \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot {a}^{2}\right)} \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                8. unpow2N/A

                  \[\leadsto \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot {a}^{2}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                9. associate-*l*N/A

                  \[\leadsto \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)\right)} \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                10. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)\right)} \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                11. lower-PI.f64N/A

                  \[\leadsto \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                12. lower-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                13. lower-PI.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot {a}^{2}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                14. unpow2N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                15. lower-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                16. *-commutativeN/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \color{blue}{\left({angle}^{2} \cdot \frac{1}{32400}\right)} \]
                17. lower-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \color{blue}{\left({angle}^{2} \cdot \frac{1}{32400}\right)} \]
                18. unpow2N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \frac{1}{32400}\right) \]
                19. lower-*.f6471.7

                  \[\leadsto \left(\pi \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
              8. Simplified71.7%

                \[\leadsto \color{blue}{\left(\pi \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
              9. Step-by-step derivation
                1. lift-PI.f64N/A

                  \[\leadsto \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                2. lift-PI.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                3. lift-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                4. lift-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)}\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                5. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right)} \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                6. lift-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \frac{1}{32400}\right) \]
                7. *-commutativeN/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \color{blue}{\left(\frac{1}{32400} \cdot \left(angle \cdot angle\right)\right)} \]
                8. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(angle \cdot angle\right)} \]
              10. Applied egg-rr74.5%

                \[\leadsto \color{blue}{angle \cdot \left(angle \cdot \left(\left(a \cdot a\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)} \]
              11. Step-by-step derivation
                1. lift-PI.f64N/A

                  \[\leadsto angle \cdot \left(angle \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{1}{32400} \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
                2. lift-PI.f64N/A

                  \[\leadsto angle \cdot \left(angle \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right)\right) \]
                3. lift-*.f64N/A

                  \[\leadsto angle \cdot \left(angle \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{1}{32400} \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)}\right)\right)\right) \]
                4. lift-*.f64N/A

                  \[\leadsto angle \cdot \left(angle \cdot \left(\left(a \cdot a\right) \cdot \color{blue}{\left(\frac{1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
                5. associate-*l*N/A

                  \[\leadsto angle \cdot \left(angle \cdot \color{blue}{\left(a \cdot \left(a \cdot \left(\frac{1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}\right) \]
                6. associate-*r*N/A

                  \[\leadsto angle \cdot \color{blue}{\left(\left(angle \cdot a\right) \cdot \left(a \cdot \left(\frac{1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
                7. lower-*.f64N/A

                  \[\leadsto angle \cdot \color{blue}{\left(\left(angle \cdot a\right) \cdot \left(a \cdot \left(\frac{1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
                8. lower-*.f64N/A

                  \[\leadsto angle \cdot \left(\color{blue}{\left(angle \cdot a\right)} \cdot \left(a \cdot \left(\frac{1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
                9. lower-*.f6483.8

                  \[\leadsto angle \cdot \left(\left(angle \cdot a\right) \cdot \color{blue}{\left(a \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)}\right) \]
                10. lift-*.f64N/A

                  \[\leadsto angle \cdot \left(\left(angle \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(\frac{1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
                11. *-commutativeN/A

                  \[\leadsto angle \cdot \left(\left(angle \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)}\right)\right) \]
                12. lower-*.f6483.8

                  \[\leadsto angle \cdot \left(\left(angle \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)}\right)\right) \]
              12. Applied egg-rr83.8%

                \[\leadsto angle \cdot \color{blue}{\left(\left(angle \cdot a\right) \cdot \left(a \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification66.8%

              \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 5.6 \cdot 10^{+137}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\left(a \cdot angle\right) \cdot \left(a \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 27: 61.7% accurate, 12.1× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 2.15 \cdot 10^{+145}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(a \cdot \left(\pi \cdot \left(\pi \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
            (FPCore (a b angle)
             :precision binary64
             (if (<= a 2.15e+145)
               (* b b)
               (* a (* a (* PI (* PI (* 3.08641975308642e-5 (* angle angle))))))))
            double code(double a, double b, double angle) {
            	double tmp;
            	if (a <= 2.15e+145) {
            		tmp = b * b;
            	} else {
            		tmp = a * (a * (((double) M_PI) * (((double) M_PI) * (3.08641975308642e-5 * (angle * angle)))));
            	}
            	return tmp;
            }
            
            public static double code(double a, double b, double angle) {
            	double tmp;
            	if (a <= 2.15e+145) {
            		tmp = b * b;
            	} else {
            		tmp = a * (a * (Math.PI * (Math.PI * (3.08641975308642e-5 * (angle * angle)))));
            	}
            	return tmp;
            }
            
            def code(a, b, angle):
            	tmp = 0
            	if a <= 2.15e+145:
            		tmp = b * b
            	else:
            		tmp = a * (a * (math.pi * (math.pi * (3.08641975308642e-5 * (angle * angle)))))
            	return tmp
            
            function code(a, b, angle)
            	tmp = 0.0
            	if (a <= 2.15e+145)
            		tmp = Float64(b * b);
            	else
            		tmp = Float64(a * Float64(a * Float64(pi * Float64(pi * Float64(3.08641975308642e-5 * Float64(angle * angle))))));
            	end
            	return tmp
            end
            
            function tmp_2 = code(a, b, angle)
            	tmp = 0.0;
            	if (a <= 2.15e+145)
            		tmp = b * b;
            	else
            		tmp = a * (a * (pi * (pi * (3.08641975308642e-5 * (angle * angle)))));
            	end
            	tmp_2 = tmp;
            end
            
            code[a_, b_, angle_] := If[LessEqual[a, 2.15e+145], N[(b * b), $MachinePrecision], N[(a * N[(a * N[(Pi * N[(Pi * N[(3.08641975308642e-5 * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;a \leq 2.15 \cdot 10^{+145}:\\
            \;\;\;\;b \cdot b\\
            
            \mathbf{else}:\\
            \;\;\;\;a \cdot \left(a \cdot \left(\pi \cdot \left(\pi \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right)\right)\right)\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < 2.14999999999999999e145

              1. Initial program 78.1%

                \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              2. Add Preprocessing
              3. Taylor expanded in angle around 0

                \[\leadsto \color{blue}{{b}^{2}} \]
              4. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto \color{blue}{b \cdot b} \]
                2. lower-*.f6463.5

                  \[\leadsto \color{blue}{b \cdot b} \]
              5. Simplified63.5%

                \[\leadsto \color{blue}{b \cdot b} \]

              if 2.14999999999999999e145 < a

              1. Initial program 97.6%

                \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              2. Add Preprocessing
              3. Taylor expanded in angle around 0

                \[\leadsto {\color{blue}{\left(\frac{1}{180} \cdot \left(a \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto {\left(\frac{1}{180} \cdot \left(a \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                2. associate-*r*N/A

                  \[\leadsto {\left(\frac{1}{180} \cdot \color{blue}{\left(\left(a \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                3. associate-*l*N/A

                  \[\leadsto {\color{blue}{\left(\left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right) \cdot angle\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                4. *-commutativeN/A

                  \[\leadsto {\color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                5. lower-*.f64N/A

                  \[\leadsto {\color{blue}{\left(angle \cdot \left(\frac{1}{180} \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                6. associate-*r*N/A

                  \[\leadsto {\left(angle \cdot \color{blue}{\left(\left(\frac{1}{180} \cdot a\right) \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                7. *-commutativeN/A

                  \[\leadsto {\left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{180} \cdot a\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                8. lower-*.f64N/A

                  \[\leadsto {\left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{180} \cdot a\right)\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                9. lower-PI.f64N/A

                  \[\leadsto {\left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{1}{180} \cdot a\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                10. lower-*.f6497.6

                  \[\leadsto {\left(angle \cdot \left(\pi \cdot \color{blue}{\left(0.005555555555555556 \cdot a\right)}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              5. Simplified97.6%

                \[\leadsto {\color{blue}{\left(angle \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot a\right)\right)\right)}}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
              6. Taylor expanded in angle around inf

                \[\leadsto \color{blue}{\frac{1}{32400} \cdot \left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
              7. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \frac{1}{32400} \cdot \left({a}^{2} \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot {angle}^{2}\right)}\right) \]
                2. associate-*r*N/A

                  \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left(\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot {angle}^{2}\right)} \]
                3. associate-*l*N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} \]
                4. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)} \cdot {angle}^{2} \]
                5. associate-*l*N/A

                  \[\leadsto \color{blue}{\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right)} \]
                6. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right)} \]
                7. *-commutativeN/A

                  \[\leadsto \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot {a}^{2}\right)} \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                8. unpow2N/A

                  \[\leadsto \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot {a}^{2}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                9. associate-*l*N/A

                  \[\leadsto \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)\right)} \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                10. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)\right)} \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                11. lower-PI.f64N/A

                  \[\leadsto \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                12. lower-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot {a}^{2}\right)}\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                13. lower-PI.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot {a}^{2}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                14. unpow2N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                15. lower-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) \cdot \left(\frac{1}{32400} \cdot {angle}^{2}\right) \]
                16. *-commutativeN/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \color{blue}{\left({angle}^{2} \cdot \frac{1}{32400}\right)} \]
                17. lower-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \color{blue}{\left({angle}^{2} \cdot \frac{1}{32400}\right)} \]
                18. unpow2N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \frac{1}{32400}\right) \]
                19. lower-*.f6471.7

                  \[\leadsto \left(\pi \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot 3.08641975308642 \cdot 10^{-5}\right) \]
              8. Simplified71.7%

                \[\leadsto \color{blue}{\left(\pi \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)} \]
              9. Step-by-step derivation
                1. lift-PI.f64N/A

                  \[\leadsto \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                2. lift-PI.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                3. lift-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                4. lift-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)}\right) \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                5. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right)} \cdot \left(\left(angle \cdot angle\right) \cdot \frac{1}{32400}\right) \]
                6. lift-*.f64N/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot \frac{1}{32400}\right) \]
                7. *-commutativeN/A

                  \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \color{blue}{\left(\frac{1}{32400} \cdot \left(angle \cdot angle\right)\right)} \]
                8. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a \cdot a\right)\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(angle \cdot angle\right)} \]
              10. Applied egg-rr74.5%

                \[\leadsto \color{blue}{angle \cdot \left(angle \cdot \left(\left(a \cdot a\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)} \]
              11. Taylor expanded in angle around 0

                \[\leadsto \color{blue}{\frac{1}{32400} \cdot \left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
              12. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \frac{1}{32400}} \]
                2. associate-*r*N/A

                  \[\leadsto \color{blue}{{a}^{2} \cdot \left(\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{1}{32400}\right)} \]
                3. *-commutativeN/A

                  \[\leadsto {a}^{2} \cdot \color{blue}{\left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                4. unpow2N/A

                  \[\leadsto \color{blue}{\left(a \cdot a\right)} \cdot \left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \]
                5. associate-*l*N/A

                  \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)} \]
                6. lower-*.f64N/A

                  \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)} \]
                7. lower-*.f64N/A

                  \[\leadsto a \cdot \color{blue}{\left(a \cdot \left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)} \]
                8. associate-*r*N/A

                  \[\leadsto a \cdot \left(a \cdot \color{blue}{\left(\left(\frac{1}{32400} \cdot {angle}^{2}\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right)}\right) \]
                9. unpow2N/A

                  \[\leadsto a \cdot \left(a \cdot \left(\left(\frac{1}{32400} \cdot {angle}^{2}\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)}\right)\right) \]
                10. associate-*r*N/A

                  \[\leadsto a \cdot \left(a \cdot \color{blue}{\left(\left(\left(\frac{1}{32400} \cdot {angle}^{2}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right)}\right) \]
                11. lower-*.f64N/A

                  \[\leadsto a \cdot \left(a \cdot \color{blue}{\left(\left(\left(\frac{1}{32400} \cdot {angle}^{2}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right)}\right) \]
                12. lower-*.f64N/A

                  \[\leadsto a \cdot \left(a \cdot \left(\color{blue}{\left(\left(\frac{1}{32400} \cdot {angle}^{2}\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \mathsf{PI}\left(\right)\right)\right) \]
                13. lower-*.f64N/A

                  \[\leadsto a \cdot \left(a \cdot \left(\left(\color{blue}{\left(\frac{1}{32400} \cdot {angle}^{2}\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right)\right) \]
                14. unpow2N/A

                  \[\leadsto a \cdot \left(a \cdot \left(\left(\left(\frac{1}{32400} \cdot \color{blue}{\left(angle \cdot angle\right)}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right)\right) \]
                15. lower-*.f64N/A

                  \[\leadsto a \cdot \left(a \cdot \left(\left(\left(\frac{1}{32400} \cdot \color{blue}{\left(angle \cdot angle\right)}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right)\right) \]
                16. lower-PI.f64N/A

                  \[\leadsto a \cdot \left(a \cdot \left(\left(\left(\frac{1}{32400} \cdot \left(angle \cdot angle\right)\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \mathsf{PI}\left(\right)\right)\right) \]
                17. lower-PI.f6479.0

                  \[\leadsto a \cdot \left(a \cdot \left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \pi\right) \cdot \color{blue}{\pi}\right)\right) \]
              13. Simplified79.0%

                \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \pi\right) \cdot \pi\right)\right)} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification66.0%

              \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 2.15 \cdot 10^{+145}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(a \cdot \left(\pi \cdot \left(\pi \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right)\right)\right)\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 28: 57.6% accurate, 74.7× speedup?

            \[\begin{array}{l} \\ b \cdot b \end{array} \]
            (FPCore (a b angle) :precision binary64 (* b b))
            double code(double a, double b, double angle) {
            	return b * b;
            }
            
            real(8) function code(a, b, angle)
                real(8), intent (in) :: a
                real(8), intent (in) :: b
                real(8), intent (in) :: angle
                code = b * b
            end function
            
            public static double code(double a, double b, double angle) {
            	return b * b;
            }
            
            def code(a, b, angle):
            	return b * b
            
            function code(a, b, angle)
            	return Float64(b * b)
            end
            
            function tmp = code(a, b, angle)
            	tmp = b * b;
            end
            
            code[a_, b_, angle_] := N[(b * b), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            b \cdot b
            \end{array}
            
            Derivation
            1. Initial program 81.2%

              \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
            2. Add Preprocessing
            3. Taylor expanded in angle around 0

              \[\leadsto \color{blue}{{b}^{2}} \]
            4. Step-by-step derivation
              1. unpow2N/A

                \[\leadsto \color{blue}{b \cdot b} \]
              2. lower-*.f6459.1

                \[\leadsto \color{blue}{b \cdot b} \]
            5. Simplified59.1%

              \[\leadsto \color{blue}{b \cdot b} \]
            6. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2024212 
            (FPCore (a b angle)
              :name "ab-angle->ABCF A"
              :precision binary64
              (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (/ angle 180.0) PI))) 2.0)))