ab-angle->ABCF A

Percentage Accurate: 80.0% → 80.0%
Time: 16.1s
Alternatives: 12
Speedup: 1.2×

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

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

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

\[\begin{array}{l} \\ {\left(a \cdot \sin \left({\pi}^{0.16666666666666666} \cdot \left(\left(0.005555555555555556 \cdot \left(angle \cdot {\pi}^{0.6666666666666666}\right)\right) \cdot {\pi}^{0.16666666666666666}\right)\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
     (*
      (pow PI 0.16666666666666666)
      (*
       (* 0.005555555555555556 (* angle (pow PI 0.6666666666666666)))
       (pow PI 0.16666666666666666)))))
   2.0)
  (pow (* b (cos (* PI (/ angle 180.0)))) 2.0)))
double code(double a, double b, double angle) {
	return pow((a * sin((pow(((double) M_PI), 0.16666666666666666) * ((0.005555555555555556 * (angle * pow(((double) M_PI), 0.6666666666666666))) * pow(((double) M_PI), 0.16666666666666666))))), 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.pow(Math.PI, 0.16666666666666666) * ((0.005555555555555556 * (angle * Math.pow(Math.PI, 0.6666666666666666))) * Math.pow(Math.PI, 0.16666666666666666))))), 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.pow(math.pi, 0.16666666666666666) * ((0.005555555555555556 * (angle * math.pow(math.pi, 0.6666666666666666))) * math.pow(math.pi, 0.16666666666666666))))), 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 ^ 0.16666666666666666) * Float64(Float64(0.005555555555555556 * Float64(angle * (pi ^ 0.6666666666666666))) * (pi ^ 0.16666666666666666))))) ^ 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.16666666666666666) * ((0.005555555555555556 * (angle * (pi ^ 0.6666666666666666))) * (pi ^ 0.16666666666666666))))) ^ 2.0) + ((b * cos((pi * (angle / 180.0)))) ^ 2.0);
end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[Power[Pi, 0.16666666666666666], $MachinePrecision] * N[(N[(0.005555555555555556 * N[(angle * N[Power[Pi, 0.6666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[Pi, 0.16666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{angle}{180} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \color{blue}{\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right)\right)}^{2} + {\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(\left(\left(\frac{angle}{180} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right)}^{2} + {\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(\left(\left(\frac{angle}{180} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
  4. Applied rewrites77.6%

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

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

Alternative 2: 80.0% 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(0.005555555555555556 \cdot \pi\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 (* 0.005555555555555556 PI)))) 2.0)))
double code(double a, double b, double angle) {
	return pow((b * cos((((double) M_PI) * (angle / 180.0)))), 2.0) + pow((a * sin((angle * (0.005555555555555556 * ((double) M_PI))))), 2.0);
}
public static double code(double a, double b, double angle) {
	return Math.pow((b * Math.cos((Math.PI * (angle / 180.0)))), 2.0) + Math.pow((a * Math.sin((angle * (0.005555555555555556 * Math.PI)))), 2.0);
}
def code(a, b, angle):
	return math.pow((b * math.cos((math.pi * (angle / 180.0)))), 2.0) + math.pow((a * math.sin((angle * (0.005555555555555556 * math.pi)))), 2.0)
function code(a, b, angle)
	return Float64((Float64(b * cos(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(a * sin(Float64(angle * Float64(0.005555555555555556 * pi)))) ^ 2.0))
end
function tmp = code(a, b, angle)
	tmp = ((b * cos((pi * (angle / 180.0)))) ^ 2.0) + ((a * sin((angle * (0.005555555555555556 * pi)))) ^ 2.0);
end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Sin[N[(angle * N[(0.005555555555555556 * Pi), $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(0.005555555555555556 \cdot \pi\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.5%

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

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

      \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\frac{angle}{180}} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
    3. 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} \]
    4. 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} \]
    5. *-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} \]
    6. 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} \]
    7. 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} \]
    8. 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} \]
    9. metadata-eval77.6

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

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

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

Alternative 3: 79.7% accurate, 1.2× speedup?

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{angle}{180} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \color{blue}{\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right)\right)}^{2} + {\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(\left(\left(\frac{angle}{180} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right)}^{2} + {\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(\left(\left(\frac{angle}{180} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
  4. Applied rewrites77.6%

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \left(angle \cdot {\mathsf{PI}\left(\right)}^{\frac{2}{3}}\right)\right) \cdot \sqrt[3]{\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} \]
    11. associate-*l*N/A

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

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

      \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\sqrt{\mathsf{PI}\left(\right)}}{1} \cdot \frac{\frac{\sqrt{\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} \]
    2. lift-/.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\frac{\sqrt{\mathsf{PI}\left(\right)}}{1}} \cdot \frac{\frac{\sqrt{\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} \]
    3. /-rgt-identityN/A

      \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \frac{\frac{\sqrt{\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} \]
    4. lift-/.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\frac{\frac{\sqrt{\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} \]
    5. lift-/.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \frac{\color{blue}{\frac{\sqrt{\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} \]
    6. associate-/l/N/A

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

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

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

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

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

    Alternative 4: 80.0% accurate, 1.2× speedup?

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

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

        \[\leadsto \color{blue}{{\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 \mathsf{PI}\left(\right)\right)\right)}^{2}} \]
      2. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\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 \mathsf{PI}\left(\right)\right)\right)}^{2} \]
      3. unpow2N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot \sin \left(\left(angle \cdot \color{blue}{0.005555555555555556}\right) \cdot \pi\right), a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right), {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}\right) \]
      9. lift-/.f64N/A

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

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

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

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

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

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

    Alternative 5: 79.8% accurate, 1.3× speedup?

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

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

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

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

      Alternative 6: 73.1% accurate, 1.4× speedup?

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

        1. Initial program 84.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. Step-by-step derivation
          1. lift-*.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}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
          2. *-commutativeN/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(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
          3. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{\color{blue}{\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}}}{\frac{180}{angle}}\right)\right)}^{2} \]
        7. 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)} + {\left(b \cdot \cos \left(\frac{\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{180}{angle}}\right)\right)}^{2} \]
        8. Step-by-step derivation
          1. *-commutativeN/A

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

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

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

            \[\leadsto \left({a}^{2} \cdot {angle}^{2}\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{32400}\right)\right)}\right) + {\left(b \cdot \cos \left(\frac{\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{180}{angle}}\right)\right)}^{2} \]
          5. distribute-rgt-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(a \cdot \left(a \cdot \left(angle \cdot angle\right)\right)\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\mathsf{neg}\left(\mathsf{PI}\left(\right) \cdot \frac{-1}{32400}\right)\right)\right) + {\left(b \cdot \cos \left(\frac{\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{180}{angle}}\right)\right)}^{2} \]
          20. distribute-rgt-neg-inN/A

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

            \[\leadsto \left(a \cdot \left(a \cdot \left(angle \cdot angle\right)\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{1}{32400}}\right)\right) + {\left(b \cdot \cos \left(\frac{\sqrt{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\sqrt{\mathsf{PI}\left(\right)}}}{\frac{180}{angle}}\right)\right)}^{2} \]
        9. Applied rewrites74.2%

          \[\leadsto \color{blue}{\left(a \cdot \left(a \cdot \left(angle \cdot angle\right)\right)\right) \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)} + {\left(b \cdot \cos \left(\frac{\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}}{\frac{180}{angle}}\right)\right)}^{2} \]

        if 1e-22 < (/.f64 angle #s(literal 180 binary64))

        1. Initial program 60.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-pow.f64N/A

            \[\leadsto \color{blue}{{\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 \mathsf{PI}\left(\right)\right)\right)}^{2} \]
          2. lift-*.f64N/A

            \[\leadsto {\color{blue}{\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 \mathsf{PI}\left(\right)\right)\right)}^{2} \]
          3. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 7: 69.6% accurate, 1.6× speedup?

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

          1. Initial program 75.3%

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

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

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

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

              \[\leadsto {\left(a \cdot \sin \left(\left(\frac{angle}{180} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \color{blue}{\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right)\right)}^{2} + {\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(\left(\left(\frac{angle}{180} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right)}^{2} + {\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(\left(\left(\frac{angle}{180} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
          4. Applied rewrites75.4%

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

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

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

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

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

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

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

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

              \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot \left(angle \cdot {\mathsf{PI}\left(\right)}^{\frac{2}{3}}\right)\right) \cdot \sqrt[3]{\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} \]
            11. associate-*l*N/A

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

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

              \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\sqrt{\mathsf{PI}\left(\right)}}{1} \cdot \frac{\frac{\sqrt{\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} \]
            2. lift-/.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\frac{\sqrt{\mathsf{PI}\left(\right)}}{1}} \cdot \frac{\frac{\sqrt{\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} \]
            3. /-rgt-identityN/A

              \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \frac{\frac{\sqrt{\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} \]
            4. lift-/.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\frac{\frac{\sqrt{\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} \]
            5. lift-/.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \frac{\color{blue}{\frac{\sqrt{\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} \]
            6. associate-/l/N/A

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

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

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

          if 1.05e166 < a

          1. Initial program 96.1%

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

            \[\leadsto \color{blue}{{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}} \]
          4. Step-by-step derivation
            1. distribute-rgt-inN/A

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

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

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

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

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

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

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

              \[\leadsto \left(\left(\frac{1}{32400} \cdot {a}^{2}\right) \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \left(\frac{-1}{32400} \cdot {b}^{2}\right) \cdot \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}\right) + {b}^{2} \]
            9. distribute-rgt-outN/A

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

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

            \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
          7. Step-by-step derivation
            1. Applied rewrites59.8%

              \[\leadsto \left(a \cdot \left(a \cdot \left(angle \cdot angle\right)\right)\right) \cdot \color{blue}{\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)} \]
            2. Step-by-step derivation
              1. Applied rewrites82.5%

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

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

            Alternative 8: 69.6% accurate, 1.7× speedup?

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

              1. Initial program 75.3%

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

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

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

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

                  \[\leadsto {\left(a \cdot \sin \left(\left(\frac{angle}{180} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \color{blue}{\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right)\right)}^{2} + {\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(\left(\left(\frac{angle}{180} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right)}^{2} + {\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(\left(\left(\frac{angle}{180} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              4. Applied rewrites75.4%

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

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

              if 1.05e166 < a

              1. Initial program 96.1%

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

                \[\leadsto \color{blue}{{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}} \]
              4. Step-by-step derivation
                1. distribute-rgt-inN/A

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

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

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

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

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

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

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

                  \[\leadsto \left(\left(\frac{1}{32400} \cdot {a}^{2}\right) \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \left(\frac{-1}{32400} \cdot {b}^{2}\right) \cdot \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}\right) + {b}^{2} \]
                9. distribute-rgt-outN/A

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

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

                \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
              7. Step-by-step derivation
                1. Applied rewrites59.8%

                  \[\leadsto \left(a \cdot \left(a \cdot \left(angle \cdot angle\right)\right)\right) \cdot \color{blue}{\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)} \]
                2. Step-by-step derivation
                  1. Applied rewrites82.5%

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

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

                Alternative 9: 62.7% accurate, 12.1× speedup?

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

                  1. Initial program 74.9%

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

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

                      \[\leadsto \color{blue}{b \cdot b} \]
                    2. lower-*.f6458.5

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

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

                  if 1.4e154 < a

                  1. Initial program 96.5%

                    \[{\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}{{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}} \]
                  4. Step-by-step derivation
                    1. distribute-rgt-inN/A

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

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

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

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

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

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

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

                      \[\leadsto \left(\left(\frac{1}{32400} \cdot {a}^{2}\right) \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \left(\frac{-1}{32400} \cdot {b}^{2}\right) \cdot \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}\right) + {b}^{2} \]
                    9. distribute-rgt-outN/A

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

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

                    \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                  7. Step-by-step derivation
                    1. Applied rewrites57.4%

                      \[\leadsto \left(a \cdot \left(a \cdot \left(angle \cdot angle\right)\right)\right) \cdot \color{blue}{\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)} \]
                    2. Step-by-step derivation
                      1. Applied rewrites78.0%

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

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

                    Alternative 10: 62.5% accurate, 12.1× speedup?

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

                      1. Initial program 74.9%

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

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

                          \[\leadsto \color{blue}{b \cdot b} \]
                        2. lower-*.f6458.5

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

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

                      if 1.4e154 < a

                      1. Initial program 96.5%

                        \[{\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}{{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}} \]
                      4. Step-by-step derivation
                        1. distribute-rgt-inN/A

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

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

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

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

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

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

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

                          \[\leadsto \left(\left(\frac{1}{32400} \cdot {a}^{2}\right) \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \left(\frac{-1}{32400} \cdot {b}^{2}\right) \cdot \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}\right) + {b}^{2} \]
                        9. distribute-rgt-outN/A

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

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

                        \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                      7. Step-by-step derivation
                        1. Applied rewrites57.4%

                          \[\leadsto \left(a \cdot \left(a \cdot \left(angle \cdot angle\right)\right)\right) \cdot \color{blue}{\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)} \]
                        2. Step-by-step derivation
                          1. Applied rewrites77.9%

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

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

                        Alternative 11: 61.1% accurate, 12.1× speedup?

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

                          1. Initial program 74.9%

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

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

                              \[\leadsto \color{blue}{b \cdot b} \]
                            2. lower-*.f6458.5

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

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

                          if 1.4e154 < a

                          1. Initial program 96.5%

                            \[{\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}{{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}} \]
                          4. Step-by-step derivation
                            1. distribute-rgt-inN/A

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

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

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

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

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

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

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

                              \[\leadsto \left(\left(\frac{1}{32400} \cdot {a}^{2}\right) \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \left(\frac{-1}{32400} \cdot {b}^{2}\right) \cdot \color{blue}{\left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}\right) + {b}^{2} \]
                            9. distribute-rgt-outN/A

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

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

                            \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                          7. Step-by-step derivation
                            1. Applied rewrites57.4%

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

                          Alternative 12: 56.9% 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.5%

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

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

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

                          Reproduce

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