ab-angle->ABCF A

Percentage Accurate: 79.6% → 79.5%
Time: 19.1s
Alternatives: 19
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 79.6% accurate, 1.0× speedup?

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

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

Alternative 1: 79.5% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.6% accurate, 1.0× speedup?

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\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-/.f6478.7

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

    \[\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. Add Preprocessing

Alternative 3: 79.5% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

Alternative 4: 79.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 79.6% accurate, 1.0× speedup?

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

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

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

      \[\leadsto {\left(a \cdot \sin \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-eval78.7

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

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

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

Alternative 6: 79.5% accurate, 1.0× speedup?

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

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

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

      \[\leadsto {\left(a \cdot \sin \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. div-invN/A

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

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

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

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

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

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

Alternative 7: 79.4% accurate, 1.3× speedup?

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

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

    \[\leadsto {\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 rewrites78.4%

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

    Alternative 8: 77.0% accurate, 1.6× speedup?

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

      1. Initial program 88.7%

        \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
      2. Add Preprocessing
      3. 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. 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(\color{blue}{\frac{angle}{180}} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
        3. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(a \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \sqrt{\pi}\right) \cdot \left(\sqrt{\pi} \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      7. Applied rewrites84.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot a} + {\left(b \cdot \cos \left(\left(angle \cdot \sqrt{\pi}\right) \cdot \left(\sqrt{\pi} \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      10. Applied rewrites84.8%

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

      if 1.00000000000000006e-9 < (/.f64 angle #s(literal 180 binary64))

      1. Initial program 52.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. Applied rewrites28.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(e^{\log \left(a \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\left(\color{blue}{\left(\left(2 \cdot \frac{1}{180}\right) \cdot angle\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)\right)}, a, \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        20. metadata-eval27.6

          \[\leadsto \mathsf{fma}\left(e^{\log \left(a \cdot \left(0.5 - 0.5 \cdot \cos \left(\left(\left(\color{blue}{0.011111111111111112} \cdot angle\right) \cdot \sqrt{\pi}\right) \cdot \sqrt{\pi}\right)\right)\right)}, a, \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. Applied rewrites27.6%

        \[\leadsto \mathsf{fma}\left(e^{\log \left(a \cdot \left(0.5 - 0.5 \cdot \cos \color{blue}{\left(\left(\left(0.011111111111111112 \cdot angle\right) \cdot \sqrt{\pi}\right) \cdot \sqrt{\pi}\right)}\right)\right)}, a, \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) \]
      6. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(a \cdot \mathsf{fma}\left(\cos \left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{1}{90}\right)\right), \mathsf{neg}\left(\frac{1}{2}\right), \frac{1}{2}\right), a, \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        13. metadata-eval52.2

          \[\leadsto \mathsf{fma}\left(a \cdot \mathsf{fma}\left(\cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right), \color{blue}{-0.5}, 0.5\right), a, \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) \]
      8. Applied rewrites52.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{a \cdot \mathsf{fma}\left(\cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right), -0.5, 0.5\right)}, a, \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) \]
    3. Recombined 2 regimes into one program.
    4. Final simplification75.9%

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

    Alternative 9: 77.0% accurate, 1.7× speedup?

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

      1. Initial program 88.7%

        \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
      2. Add Preprocessing
      3. 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. 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(\color{blue}{\frac{angle}{180}} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
        3. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(a \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \sqrt{\pi}\right) \cdot \left(\sqrt{\pi} \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      7. Applied rewrites84.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot a} + {\left(b \cdot \cos \left(\left(angle \cdot \sqrt{\pi}\right) \cdot \left(\sqrt{\pi} \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      10. Applied rewrites84.8%

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

      if 1.00000000000000006e-9 < (/.f64 angle #s(literal 180 binary64))

      1. Initial program 52.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. Applied rewrites28.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(e^{\log \left(a \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\right)}, a, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\right)} \]
      4. Step-by-step derivation
        1. rem-square-sqrtN/A

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

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

          \[\leadsto \mathsf{fma}\left(e^{\log \left(a \cdot \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 \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right)\right)\right)\right)\right)}, a, \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        4. lower-*.f6427.5

          \[\leadsto \mathsf{fma}\left(e^{\log \left(a \cdot \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}\right)}\right)\right)\right)\right)}, a, \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. Applied rewrites27.5%

        \[\leadsto \mathsf{fma}\left(e^{\log \left(a \cdot \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}\right)}\right)\right)\right)\right)}, a, \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) \]
      6. Taylor expanded in a around 0

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(b, b \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right), {a}^{2} \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
      8. Applied rewrites52.3%

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

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

    Alternative 10: 67.7% accurate, 1.9× speedup?

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

      1. Initial program 76.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 a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 8.99999999999999936e-21 < a

      1. Initial program 83.8%

        \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.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. 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(\color{blue}{\frac{angle}{180}} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
        3. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(a \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \sqrt{\pi}\right) \cdot \left(\sqrt{\pi} \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
      7. Applied rewrites80.7%

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

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

          \[\leadsto {\left(a \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
      10. Recombined 2 regimes into one program.
      11. Add Preprocessing

      Alternative 11: 67.7% accurate, 2.0× speedup?

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

        1. Initial program 76.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 a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 8.99999999999999936e-21 < a

        1. Initial program 83.8%

          \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.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. 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(\color{blue}{\frac{angle}{180}} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
          3. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto {\left(a \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \sqrt{\pi}\right) \cdot \left(\sqrt{\pi} \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
        7. Applied rewrites80.7%

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left(\left(a \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot a} + {\left(b \cdot \cos \left(\left(angle \cdot \sqrt{\pi}\right) \cdot \left(\sqrt{\pi} \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
        10. Applied rewrites80.7%

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

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

      Alternative 12: 67.7% accurate, 2.7× speedup?

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

        1. Initial program 76.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. Applied rewrites51.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\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)} \]

        if 8.99999999999999936e-21 < a

        1. Initial program 83.8%

          \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.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. 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(\color{blue}{\frac{angle}{180}} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
          3. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto {\left(a \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \sqrt{\pi}\right) \cdot \left(\sqrt{\pi} \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
        7. Applied rewrites80.7%

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left(\left(a \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot a} + {\left(b \cdot \cos \left(\left(angle \cdot \sqrt{\pi}\right) \cdot \left(\sqrt{\pi} \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
        10. Applied rewrites80.7%

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

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

      Alternative 13: 67.3% accurate, 3.0× speedup?

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

        1. Initial program 76.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. Applied rewrites51.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\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)} \]

        if 8.99999999999999936e-21 < a

        1. Initial program 83.8%

          \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.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. 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(\color{blue}{\frac{angle}{180}} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
          3. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto {\left(a \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \sqrt{\pi}\right) \cdot \left(\sqrt{\pi} \cdot 0.005555555555555556\right)\right)\right)}^{2} \]
        7. Applied rewrites80.7%

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\left(a \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot a + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
        12. Recombined 2 regimes into one program.
        13. Final simplification66.9%

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

        Alternative 14: 63.9% accurate, 3.4× speedup?

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

          1. Initial program 76.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. Applied rewrites51.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\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)} \]

          if 8.99999999999999936e-21 < a < 5.20000000000000022e157

          1. Initial program 72.1%

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

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

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

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

            \[\leadsto \color{blue}{b \cdot b} \]
          6. 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}} \]
          7. Step-by-step derivation
            1. lower-fma.f64N/A

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

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

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

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

            if 5.20000000000000022e157 < a

            1. Initial program 99.8%

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

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

                \[\leadsto \color{blue}{b \cdot b} \]
              2. lower-*.f6428.0

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

              \[\leadsto \color{blue}{b \cdot b} \]
            6. 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}} \]
            7. Step-by-step derivation
              1. lower-fma.f64N/A

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(b \cdot b, -3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right), b \cdot b\right)} \]
            9. 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)} \]
            10. Step-by-step derivation
              1. Applied rewrites74.3%

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 9 \cdot 10^{-21}:\\ \;\;\;\;\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)\\ \mathbf{elif}\;a \leq 5.2 \cdot 10^{+157}:\\ \;\;\;\;\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \left(\left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right), b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot \left(angle \cdot \left(\pi \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \left(a \cdot 3.08641975308642 \cdot 10^{-5}\right)\\ \end{array} \]
              5. Add Preprocessing

              Alternative 15: 63.9% accurate, 3.4× speedup?

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

                1. Initial program 76.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. Applied rewrites51.9%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(e^{\log \left(a \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\right)}, a, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\right)} \]
                4. Step-by-step derivation
                  1. rem-square-sqrtN/A

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

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

                    \[\leadsto \mathsf{fma}\left(e^{\log \left(a \cdot \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 \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right)\right)\right)\right)\right)}, a, \left(b \cdot b\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
                  4. lower-*.f6451.9

                    \[\leadsto \mathsf{fma}\left(e^{\log \left(a \cdot \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}\right)}\right)\right)\right)\right)}, a, \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. Applied rewrites51.9%

                  \[\leadsto \mathsf{fma}\left(e^{\log \left(a \cdot \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}\right)}\right)\right)\right)\right)}, a, \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) \]
                6. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 8.99999999999999936e-21 < a < 5.20000000000000022e157

                1. Initial program 72.1%

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

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

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

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

                  \[\leadsto \color{blue}{b \cdot b} \]
                6. 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}} \]
                7. Step-by-step derivation
                  1. lower-fma.f64N/A

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

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

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

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

                  if 5.20000000000000022e157 < a

                  1. Initial program 99.8%

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

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

                      \[\leadsto \color{blue}{b \cdot b} \]
                    2. lower-*.f6428.0

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

                    \[\leadsto \color{blue}{b \cdot b} \]
                  6. 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}} \]
                  7. Step-by-step derivation
                    1. lower-fma.f64N/A

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

                    \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(b \cdot b, -3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right), b \cdot b\right)} \]
                  9. 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)} \]
                  10. Step-by-step derivation
                    1. Applied rewrites74.3%

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

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

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

                    Alternative 16: 64.0% accurate, 9.1× speedup?

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

                      1. Initial program 76.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-*.f6463.0

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

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

                      if 8.99999999999999936e-21 < a < 5.20000000000000022e157

                      1. Initial program 72.1%

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

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

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

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

                        \[\leadsto \color{blue}{b \cdot b} \]
                      6. 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}} \]
                      7. Step-by-step derivation
                        1. lower-fma.f64N/A

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

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

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

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

                        if 5.20000000000000022e157 < a

                        1. Initial program 99.8%

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

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

                            \[\leadsto \color{blue}{b \cdot b} \]
                          2. lower-*.f6428.0

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

                          \[\leadsto \color{blue}{b \cdot b} \]
                        6. 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}} \]
                        7. Step-by-step derivation
                          1. lower-fma.f64N/A

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(b \cdot b, -3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right), b \cdot b\right)} \]
                        9. 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)} \]
                        10. Step-by-step derivation
                          1. Applied rewrites74.3%

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

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

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

                          Alternative 17: 62.2% accurate, 12.1× speedup?

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

                            1. Initial program 76.0%

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

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

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

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

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

                            if 8.4999999999999993e152 < a

                            1. Initial program 99.8%

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

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

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

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

                              \[\leadsto \color{blue}{b \cdot b} \]
                            6. 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}} \]
                            7. Step-by-step derivation
                              1. lower-fma.f64N/A

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(b \cdot b, -3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right), b \cdot b\right)} \]
                            9. 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)} \]
                            10. Step-by-step derivation
                              1. Applied rewrites75.2%

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

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

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

                              Alternative 18: 62.2% accurate, 12.1× speedup?

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

                                1. Initial program 76.0%

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

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

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

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

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

                                if 8.4999999999999993e152 < a

                                1. Initial program 99.8%

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

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

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

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

                                  \[\leadsto \color{blue}{b \cdot b} \]
                                6. 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}} \]
                                7. Step-by-step derivation
                                  1. lower-fma.f64N/A

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

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(b \cdot b, -3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right), b \cdot b\right)} \]
                                9. 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)} \]
                                10. Step-by-step derivation
                                  1. Applied rewrites75.2%

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

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

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

                                  Alternative 19: 57.4% accurate, 74.7× speedup?

                                  \[\begin{array}{l} \\ b \cdot b \end{array} \]
                                  (FPCore (a b angle) :precision binary64 (* b b))
                                  double code(double a, double b, double angle) {
                                  	return b * b;
                                  }
                                  
                                  real(8) function code(a, b, angle)
                                      real(8), intent (in) :: a
                                      real(8), intent (in) :: b
                                      real(8), intent (in) :: angle
                                      code = b * b
                                  end function
                                  
                                  public static double code(double a, double b, double angle) {
                                  	return b * b;
                                  }
                                  
                                  def code(a, b, angle):
                                  	return b * b
                                  
                                  function code(a, b, angle)
                                  	return Float64(b * b)
                                  end
                                  
                                  function tmp = code(a, b, angle)
                                  	tmp = b * b;
                                  end
                                  
                                  code[a_, b_, angle_] := N[(b * b), $MachinePrecision]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  b \cdot b
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 78.6%

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

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

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

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

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

                                  Reproduce

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