ab-angle->ABCF A

Percentage Accurate: 79.5% → 79.4%
Time: 17.4s
Alternatives: 17
Speedup: 1.0×

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 17 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.5% 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.4% accurate, 0.5× speedup?

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

\\
{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\frac{180}{{\pi}^{0.6666666666666666}}\right)}^{-1} \cdot {\left(\frac{\frac{1}{angle}}{\sqrt[3]{\pi}}\right)}^{-1}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.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. 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. clear-numN/A

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\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} \]
    4. associate-/r*N/A

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

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\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} \]
    6. lower-/.f64N/A

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\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} \]
    7. lower-/.f6477.4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.5% accurate, 0.6× speedup?

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

\\
{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\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 \sqrt[3]{\sqrt{\pi}}\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.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. 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. clear-numN/A

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\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} \]
    4. associate-/r*N/A

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

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\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} \]
    6. lower-/.f64N/A

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\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} \]
    7. lower-/.f6477.4

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

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

      \[\leadsto {\left(a \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\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{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\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{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\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{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\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{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\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{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\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{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\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{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\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{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\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{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\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{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\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{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\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{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\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{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\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{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\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.f6477.5

      \[\leadsto {\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\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} \]
  6. Applied rewrites77.5%

    \[\leadsto {\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\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} \]
  7. Add Preprocessing

Alternative 3: 79.5% accurate, 1.0× speedup?

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

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

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\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} \]
    4. associate-/r*N/A

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

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\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} \]
    6. div-invN/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{\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} \]
    7. associate-/r*N/A

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

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

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

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

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

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

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

Alternative 4: 79.5% 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(\frac{\pi \cdot angle}{180}\right)\right)}^{2} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (+
  (pow (* a (sin (* PI (/ angle 180.0)))) 2.0)
  (pow (* b (cos (/ (* PI angle) 180.0))) 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(((((double) M_PI) * angle) / 180.0))), 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(((Math.PI * angle) / 180.0))), 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(((math.pi * angle) / 180.0))), 2.0)
function code(a, b, angle)
	return Float64((Float64(a * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(b * cos(Float64(Float64(pi * angle) / 180.0))) ^ 2.0))
end
function tmp = code(a, b, angle)
	tmp = ((a * sin((pi * (angle / 180.0)))) ^ 2.0) + ((b * cos(((pi * angle) / 180.0))) ^ 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[(N[(Pi * angle), $MachinePrecision] / 180.0), $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(\frac{\pi \cdot angle}{180}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.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 \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. 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(\frac{angle \cdot \mathsf{PI}\left(\right)}{180}\right)}\right)}^{2} \]
    4. lower-*.f6477.5

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

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

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

Alternative 5: 79.5% 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(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (+
  (pow (* b (cos (* PI (/ angle 180.0)))) 2.0)
  (pow (* a (sin (* angle (* PI 0.005555555555555556)))) 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((angle * (((double) M_PI) * 0.005555555555555556)))), 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((angle * (Math.PI * 0.005555555555555556)))), 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((angle * (math.pi * 0.005555555555555556)))), 2.0)
function code(a, b, angle)
	return Float64((Float64(b * cos(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(a * sin(Float64(angle * Float64(pi * 0.005555555555555556)))) ^ 2.0))
end
function tmp = code(a, b, angle)
	tmp = ((b * cos((pi * (angle / 180.0)))) ^ 2.0) + ((a * sin((angle * (pi * 0.005555555555555556)))) ^ 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[(angle * N[(Pi * 0.005555555555555556), $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(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.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. 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. associate-/l*N/A

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

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

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

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

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

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

Alternative 6: 79.4% accurate, 1.3× speedup?

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

\\
{\left(a \cdot \sin \left(\frac{\pi \cdot 0.005555555555555556}{\frac{1}{angle}}\right)\right)}^{2} + {b}^{2}
\end{array}
Derivation
  1. Initial program 77.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. 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. clear-numN/A

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\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} \]
    4. associate-/r*N/A

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

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\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} \]
    6. div-invN/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{\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} \]
    7. associate-/r*N/A

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

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

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

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

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

    \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\pi \cdot 0.005555555555555556}{\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{\mathsf{PI}\left(\right) \cdot \frac{1}{180}}{\frac{1}{angle}}\right)\right)}^{2} + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
  6. Step-by-step derivation
    1. Applied rewrites76.5%

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

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

    Alternative 7: 79.4% 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 77.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 {\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. Applied rewrites76.4%

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

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

      Alternative 8: 77.1% accurate, 1.6× speedup?

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

        1. Initial program 87.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 \color{blue}{\left(\frac{1}{180} \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. lower-*.f64N/A

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

            \[\leadsto {\left(a \cdot \left(\frac{1}{180} \cdot \color{blue}{\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} \]
          3. lower-PI.f6484.0

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

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

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

        if 2e8 < (/.f64 angle #s(literal 180 binary64))

        1. Initial program 54.8%

          \[{\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 rewrites54.6%

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

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

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

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

        Alternative 9: 77.1% accurate, 1.7× speedup?

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

          1. Initial program 87.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 \color{blue}{\left(\frac{1}{180} \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. lower-*.f64N/A

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

              \[\leadsto {\left(a \cdot \left(\frac{1}{180} \cdot \color{blue}{\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} \]
            3. lower-PI.f6484.0

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

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

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

          if 2e8 < (/.f64 angle #s(literal 180 binary64))

          1. Initial program 54.8%

            \[{\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 rewrites54.6%

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

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

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

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

          Alternative 10: 67.4% accurate, 2.0× speedup?

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

            1. Initial program 78.8%

              \[{\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. clear-numN/A

                \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\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} \]
              4. associate-/r*N/A

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

                \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\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} \]
              6. div-invN/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{\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} \]
              7. associate-/r*N/A

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

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

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

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

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

              \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\pi \cdot 0.005555555555555556}{\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{\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{1}{180}}{\frac{1}{angle}}\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(a \cdot \sin \left(\frac{\mathsf{PI}\left(\right) \cdot \frac{1}{180}}{\color{blue}{\frac{1}{angle}}}\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(a \cdot \sin \left(\frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{180}}}{\frac{1}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              4. clear-numN/A

                \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{1}{\frac{\frac{1}{angle}}{\mathsf{PI}\left(\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. associate-/r/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(b \cdot b\right) \cdot {\cos \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)}\right)}^{2} \]
              12. lower-PI.f6462.9

                \[\leadsto \left(b \cdot b\right) \cdot {\cos \left(angle \cdot \left(\color{blue}{\pi} \cdot 0.005555555555555556\right)\right)}^{2} \]
            9. Applied rewrites62.9%

              \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot {\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{2}} \]

            if 3.5000000000000001e-15 < a

            1. Initial program 74.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 {\left(a \cdot \color{blue}{\left(\frac{1}{180} \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. lower-*.f64N/A

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

                \[\leadsto {\left(a \cdot \left(\frac{1}{180} \cdot \color{blue}{\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} \]
              3. lower-PI.f6470.4

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

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

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

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

          Alternative 11: 67.4% accurate, 2.0× speedup?

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

            1. Initial program 78.8%

              \[{\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 a around 0

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(b \cdot b\right) \cdot {\cos \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
              12. lower-PI.f6462.9

                \[\leadsto \left(b \cdot b\right) \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right)}^{2} \]
            5. Applied rewrites62.9%

              \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}} \]

            if 3.5000000000000001e-15 < a

            1. Initial program 74.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 {\left(a \cdot \color{blue}{\left(\frac{1}{180} \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. lower-*.f64N/A

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

                \[\leadsto {\left(a \cdot \left(\frac{1}{180} \cdot \color{blue}{\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} \]
              3. lower-PI.f6470.4

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

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

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

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

          Alternative 12: 67.4% accurate, 2.5× speedup?

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

            1. Initial program 78.8%

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

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

                \[\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) \]
            6. Applied rewrites62.9%

              \[\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)} \]

            if 3.5000000000000001e-15 < a

            1. Initial program 74.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 {\left(a \cdot \color{blue}{\left(\frac{1}{180} \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. lower-*.f64N/A

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

                \[\leadsto {\left(a \cdot \left(\frac{1}{180} \cdot \color{blue}{\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} \]
              3. lower-PI.f6470.4

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

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

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

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

          Alternative 13: 67.4% accurate, 3.3× speedup?

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

            1. Initial program 78.8%

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

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

                \[\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) \]
            6. Applied rewrites62.9%

              \[\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)} \]

            if 3.5000000000000001e-15 < a

            1. Initial program 74.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 {\left(a \cdot \color{blue}{\left(\frac{1}{180} \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. lower-*.f64N/A

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

                \[\leadsto {\left(a \cdot \left(\frac{1}{180} \cdot \color{blue}{\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} \]
              3. lower-PI.f6470.4

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

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

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

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

                \[\leadsto \mathsf{fma}\left({\left(\left(0.005555555555555556 \cdot a\right) \cdot angle\right)}^{2}, \pi \cdot \pi, b \cdot \left(b \cdot \color{blue}{1}\right)\right) \]
            9. Recombined 2 regimes into one program.
            10. Final simplification64.8%

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

            Alternative 14: 63.0% accurate, 3.4× speedup?

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

              1. Initial program 75.8%

                \[{\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 rewrites71.5%

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

                  \[\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) \]
              6. Applied rewrites60.5%

                \[\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)} \]

              if 2.6000000000000002e127 < a

              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. 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. clear-numN/A

                  \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\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} \]
                4. associate-/r*N/A

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

                  \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\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} \]
                6. div-invN/A

                  \[\leadsto {\left(a \cdot \sin \left(\frac{\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} \]
                7. associate-/r*N/A

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

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

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

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

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

                \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\pi \cdot 0.005555555555555556}{\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 \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. Applied rewrites44.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(a \cdot a\right)\right)} \cdot \left(angle \cdot angle\right) \]
              12. Applied rewrites75.1%

                \[\leadsto \color{blue}{\left(\left(\pi \cdot \pi\right) \cdot \left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)\right) \cdot \left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification62.5%

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

            Alternative 15: 63.0% accurate, 10.7× speedup?

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

              1. Initial program 75.8%

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

                  \[\leadsto \color{blue}{b \cdot b} \]
              5. Applied rewrites60.2%

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

              if 2.6000000000000002e127 < a

              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. 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. clear-numN/A

                  \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\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} \]
                4. associate-/r*N/A

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

                  \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\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} \]
                6. div-invN/A

                  \[\leadsto {\left(a \cdot \sin \left(\frac{\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} \]
                7. associate-/r*N/A

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

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

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

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

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

                \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\pi \cdot 0.005555555555555556}{\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 \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. Applied rewrites44.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(a \cdot a\right)\right)} \cdot \left(angle \cdot angle\right) \]
              12. Applied rewrites75.1%

                \[\leadsto \color{blue}{\left(\left(\pi \cdot \pi\right) \cdot \left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)\right) \cdot \left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification62.2%

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

            Alternative 16: 63.0% accurate, 12.1× speedup?

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

              1. Initial program 75.8%

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

                  \[\leadsto \color{blue}{b \cdot b} \]
              5. Applied rewrites60.2%

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

              if 3.0000000000000002e127 < a

              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. 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. clear-numN/A

                  \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\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} \]
                4. associate-/r*N/A

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

                  \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\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} \]
                6. div-invN/A

                  \[\leadsto {\left(a \cdot \sin \left(\frac{\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} \]
                7. associate-/r*N/A

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

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

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

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

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

                \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\pi \cdot 0.005555555555555556}{\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 \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. Applied rewrites44.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{1}{32400} \cdot \left(\left(a \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(a \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)\right) \]
                13. lower-PI.f6475.0

                  \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot \left(angle \cdot \color{blue}{\pi}\right)\right)\right) \]
              13. Applied rewrites75.0%

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

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

            Alternative 17: 57.4% 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 77.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}{{b}^{2}} \]
            4. Step-by-step derivation
              1. unpow2N/A

                \[\leadsto \color{blue}{b \cdot b} \]
              2. lower-*.f6456.6

                \[\leadsto \color{blue}{b \cdot b} \]
            5. Applied rewrites56.6%

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

            Reproduce

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