ab-angle->ABCF A

Percentage Accurate: 79.3% → 79.2%
Time: 7.0s
Alternatives: 16
Speedup: N/A×

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}

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 16 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.3% 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.2% accurate, 0.9× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \sqrt{0.005555555555555556 \cdot angle\_m}\\ {\left(a \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(t\_0 \cdot t\_0, \pi, \frac{\pi}{2}\right)\right)\right)}^{2} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (sqrt (* 0.005555555555555556 angle_m))))
   (+
    (pow (* a (sin (* (* PI angle_m) 0.005555555555555556))) 2.0)
    (pow (* b (sin (fma (* t_0 t_0) PI (/ PI 2.0)))) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = sqrt((0.005555555555555556 * angle_m));
	return pow((a * sin(((((double) M_PI) * angle_m) * 0.005555555555555556))), 2.0) + pow((b * sin(fma((t_0 * t_0), ((double) M_PI), (((double) M_PI) / 2.0)))), 2.0);
}
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = sqrt(Float64(0.005555555555555556 * angle_m))
	return Float64((Float64(a * sin(Float64(Float64(pi * angle_m) * 0.005555555555555556))) ^ 2.0) + (Float64(b * sin(fma(Float64(t_0 * t_0), pi, Float64(pi / 2.0)))) ^ 2.0))
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sqrt[N[(0.005555555555555556 * angle$95$m), $MachinePrecision]], $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(t$95$0 * t$95$0), $MachinePrecision] * Pi + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
    9. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
    10. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(\pi \cdot \color{blue}{\left(\frac{1}{180} \cdot angle\right)}\right)\right)}^{2} \]
    10. cos-fabs-revN/A

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left|\color{blue}{\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
    17. fabs-mulN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\left|\frac{1}{180} \cdot angle\right| \cdot \left|\mathsf{PI}\left(\right)\right|} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
    18. add-exp-logN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left|\frac{1}{180} \cdot angle\right| \cdot \left|\color{blue}{e^{\log \mathsf{PI}\left(\right)}}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
    19. exp-fabsN/A

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left|\frac{1}{180} \cdot angle\right| \cdot \color{blue}{\mathsf{PI}\left(\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
  7. Applied rewrites79.2%

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\color{blue}{\left|\frac{1}{180} \cdot angle\right|}, \pi, \frac{\pi}{2}\right)\right)\right)}^{2} \]
    3. rem-sqrt-square-revN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\color{blue}{\sqrt{\left(\frac{1}{180} \cdot angle\right) \cdot \left(\frac{1}{180} \cdot angle\right)}}, \pi, \frac{\pi}{2}\right)\right)\right)}^{2} \]
    4. sqrt-prodN/A

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\sqrt{\frac{1}{180} \cdot angle} \cdot \color{blue}{\sqrt{\frac{1}{180} \cdot angle}}, \pi, \frac{\pi}{2}\right)\right)\right)}^{2} \]
    9. lift-*.f6479.2

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\sqrt{0.005555555555555556 \cdot angle} \cdot \sqrt{\color{blue}{0.005555555555555556 \cdot angle}}, \pi, \frac{\pi}{2}\right)\right)\right)}^{2} \]
  9. Applied rewrites79.2%

    \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\color{blue}{\sqrt{0.005555555555555556 \cdot angle} \cdot \sqrt{0.005555555555555556 \cdot angle}}, \pi, \frac{\pi}{2}\right)\right)\right)}^{2} \]
  10. Add Preprocessing

Alternative 2: 79.2% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
    9. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
    10. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(\pi \cdot \color{blue}{\left(\frac{1}{180} \cdot angle\right)}\right)\right)}^{2} \]
    10. cos-fabs-revN/A

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left|\color{blue}{\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
    17. fabs-mulN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\left|\frac{1}{180} \cdot angle\right| \cdot \left|\mathsf{PI}\left(\right)\right|} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
    18. add-exp-logN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left|\frac{1}{180} \cdot angle\right| \cdot \left|\color{blue}{e^{\log \mathsf{PI}\left(\right)}}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
    19. exp-fabsN/A

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left|\frac{1}{180} \cdot angle\right| \cdot \color{blue}{\mathsf{PI}\left(\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
  7. Applied rewrites79.2%

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\color{blue}{\left|\frac{1}{180} \cdot angle\right|}, \pi, \frac{\pi}{2}\right)\right)\right)}^{2} \]
    3. rem-sqrt-square-revN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\color{blue}{\sqrt{\left(\frac{1}{180} \cdot angle\right) \cdot \left(\frac{1}{180} \cdot angle\right)}}, \pi, \frac{\pi}{2}\right)\right)\right)}^{2} \]
    4. sqrt-prodN/A

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\sqrt{\frac{1}{180} \cdot angle} \cdot \color{blue}{\sqrt{\frac{1}{180} \cdot angle}}, \pi, \frac{\pi}{2}\right)\right)\right)}^{2} \]
    9. lift-*.f6479.2

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\sqrt{0.005555555555555556 \cdot angle} \cdot \sqrt{\color{blue}{0.005555555555555556 \cdot angle}}, \pi, \frac{\pi}{2}\right)\right)\right)}^{2} \]
  9. Applied rewrites79.2%

    \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\color{blue}{\sqrt{0.005555555555555556 \cdot angle} \cdot \sqrt{0.005555555555555556 \cdot angle}}, \pi, \frac{\pi}{2}\right)\right)\right)}^{2} \]
  10. Applied rewrites79.2%

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

Alternative 3: 79.2% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\ {\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \sin \left(\left(-t\_0\right) + 0.5 \cdot \pi\right)\right)}^{2} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* (* PI angle_m) 0.005555555555555556)))
   (+ (pow (* a (sin t_0)) 2.0) (pow (* b (sin (+ (- t_0) (* 0.5 PI)))) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = (((double) M_PI) * angle_m) * 0.005555555555555556;
	return pow((a * sin(t_0)), 2.0) + pow((b * sin((-t_0 + (0.5 * ((double) M_PI))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double t_0 = (Math.PI * angle_m) * 0.005555555555555556;
	return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.sin((-t_0 + (0.5 * Math.PI)))), 2.0);
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	t_0 = (math.pi * angle_m) * 0.005555555555555556
	return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.sin((-t_0 + (0.5 * math.pi)))), 2.0)
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(Float64(pi * angle_m) * 0.005555555555555556)
	return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * sin(Float64(Float64(-t_0) + Float64(0.5 * pi)))) ^ 2.0))
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	t_0 = (pi * angle_m) * 0.005555555555555556;
	tmp = ((a * sin(t_0)) ^ 2.0) + ((b * sin((-t_0 + (0.5 * pi)))) ^ 2.0);
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[((-t$95$0) + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
    9. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
    10. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(\pi \cdot \color{blue}{\left(\frac{1}{180} \cdot angle\right)}\right)\right)}^{2} \]
    10. cos-fabs-revN/A

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left|\color{blue}{\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
    17. fabs-mulN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\left|\frac{1}{180} \cdot angle\right| \cdot \left|\mathsf{PI}\left(\right)\right|} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
    18. add-exp-logN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left|\frac{1}{180} \cdot angle\right| \cdot \left|\color{blue}{e^{\log \mathsf{PI}\left(\right)}}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
    19. exp-fabsN/A

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left|\frac{1}{180} \cdot angle\right| \cdot \color{blue}{\mathsf{PI}\left(\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
  7. Applied rewrites79.2%

    \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(\mathsf{fma}\left(\left|0.005555555555555556 \cdot angle\right|, \pi, \frac{\pi}{2}\right)\right)}\right)}^{2} \]
  8. Step-by-step derivation
    1. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(\left(-\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) + 0.5 \cdot \pi\right)}\right)}^{2} \]
  10. Add Preprocessing

Alternative 4: 79.2% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\pi \cdot angle\_m, 0.005555555555555556, 0.5 \cdot \pi\right)\right)\right)}^{2} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (+
  (pow (* a (sin (* (* PI angle_m) 0.005555555555555556))) 2.0)
  (pow (* b (sin (fma (* PI angle_m) 0.005555555555555556 (* 0.5 PI)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	return pow((a * sin(((((double) M_PI) * angle_m) * 0.005555555555555556))), 2.0) + pow((b * sin(fma((((double) M_PI) * angle_m), 0.005555555555555556, (0.5 * ((double) M_PI))))), 2.0);
}
angle_m = abs(angle)
function code(a, b, angle_m)
	return Float64((Float64(a * sin(Float64(Float64(pi * angle_m) * 0.005555555555555556))) ^ 2.0) + (Float64(b * sin(fma(Float64(pi * angle_m), 0.005555555555555556, Float64(0.5 * pi)))) ^ 2.0))
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556 + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|

\\
{\left(a \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\pi \cdot angle\_m, 0.005555555555555556, 0.5 \cdot \pi\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
    9. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
    10. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(\pi \cdot \color{blue}{\left(\frac{1}{180} \cdot angle\right)}\right)\right)}^{2} \]
    10. cos-fabs-revN/A

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left|\color{blue}{\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
    17. fabs-mulN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\left|\frac{1}{180} \cdot angle\right| \cdot \left|\mathsf{PI}\left(\right)\right|} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
    18. add-exp-logN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left|\frac{1}{180} \cdot angle\right| \cdot \left|\color{blue}{e^{\log \mathsf{PI}\left(\right)}}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
    19. exp-fabsN/A

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left|\frac{1}{180} \cdot angle\right| \cdot \color{blue}{\mathsf{PI}\left(\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
  7. Applied rewrites79.2%

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\color{blue}{\left|\frac{1}{180} \cdot angle\right|}, \pi, \frac{\pi}{2}\right)\right)\right)}^{2} \]
    3. rem-sqrt-square-revN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\color{blue}{\sqrt{\left(\frac{1}{180} \cdot angle\right) \cdot \left(\frac{1}{180} \cdot angle\right)}}, \pi, \frac{\pi}{2}\right)\right)\right)}^{2} \]
    4. sqrt-prodN/A

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\sqrt{\frac{1}{180} \cdot angle} \cdot \color{blue}{\sqrt{\frac{1}{180} \cdot angle}}, \pi, \frac{\pi}{2}\right)\right)\right)}^{2} \]
    9. lift-*.f6479.2

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\sqrt{0.005555555555555556 \cdot angle} \cdot \sqrt{\color{blue}{0.005555555555555556 \cdot angle}}, \pi, \frac{\pi}{2}\right)\right)\right)}^{2} \]
  9. Applied rewrites79.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\color{blue}{\mathsf{PI}\left(\right) \cdot angle}, \frac{1}{180}, \frac{\pi}{2}\right)\right)\right)}^{2} \]
    14. lift-PI.f6479.2

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\pi \cdot angle, \frac{1}{180}, \color{blue}{\frac{\mathsf{PI}\left(\right)}{2}}\right)\right)\right)}^{2} \]
    17. mult-flipN/A

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\pi \cdot angle, \frac{1}{180}, \color{blue}{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}\right)\right)\right)}^{2} \]
    21. lift-PI.f6479.2

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\pi \cdot angle, 0.005555555555555556, 0.5 \cdot \color{blue}{\pi}\right)\right)\right)}^{2} \]
  11. Applied rewrites79.2%

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

Alternative 5: 79.2% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\pi \cdot 0.005555555555555556, angle\_m, 0.5 \cdot \pi\right)\right)\right)}^{2} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (+
  (pow (* a (sin (* (* PI angle_m) 0.005555555555555556))) 2.0)
  (pow (* b (sin (fma (* PI 0.005555555555555556) angle_m (* 0.5 PI)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	return pow((a * sin(((((double) M_PI) * angle_m) * 0.005555555555555556))), 2.0) + pow((b * sin(fma((((double) M_PI) * 0.005555555555555556), angle_m, (0.5 * ((double) M_PI))))), 2.0);
}
angle_m = abs(angle)
function code(a, b, angle_m)
	return Float64((Float64(a * sin(Float64(Float64(pi * angle_m) * 0.005555555555555556))) ^ 2.0) + (Float64(b * sin(fma(Float64(pi * 0.005555555555555556), angle_m, Float64(0.5 * pi)))) ^ 2.0))
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * angle$95$m + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|

\\
{\left(a \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\pi \cdot 0.005555555555555556, angle\_m, 0.5 \cdot \pi\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
    9. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
    10. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(\pi \cdot \color{blue}{\left(\frac{1}{180} \cdot angle\right)}\right)\right)}^{2} \]
    10. cos-fabs-revN/A

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left|\color{blue}{\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
    17. fabs-mulN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\left|\frac{1}{180} \cdot angle\right| \cdot \left|\mathsf{PI}\left(\right)\right|} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
    18. add-exp-logN/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left|\frac{1}{180} \cdot angle\right| \cdot \left|\color{blue}{e^{\log \mathsf{PI}\left(\right)}}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
    19. exp-fabsN/A

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left|\frac{1}{180} \cdot angle\right| \cdot \color{blue}{\mathsf{PI}\left(\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
  7. Applied rewrites79.2%

    \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(\mathsf{fma}\left(\left|0.005555555555555556 \cdot angle\right|, \pi, \frac{\pi}{2}\right)\right)}\right)}^{2} \]
  8. Step-by-step derivation
    1. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 79.2% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\ {\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* (* PI angle_m) 0.005555555555555556)))
   (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double t_0 = (((double) M_PI) * angle_m) * 0.005555555555555556;
	return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double t_0 = (Math.PI * angle_m) * 0.005555555555555556;
	return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	t_0 = (math.pi * angle_m) * 0.005555555555555556
	return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
angle_m = abs(angle)
function code(a, b, angle_m)
	t_0 = Float64(Float64(pi * angle_m) * 0.005555555555555556)
	return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0))
end
angle_m = abs(angle);
function tmp = code(a, b, angle_m)
	t_0 = (pi * angle_m) * 0.005555555555555556;
	tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0);
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $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}
angle_m = \left|angle\right|

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
    9. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
    10. *-commutativeN/A

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

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

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

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

Alternative 7: 79.2% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
    9. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
    10. *-commutativeN/A

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

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

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

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

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

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

    Alternative 8: 67.0% accurate, 1.5× speedup?

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

      1. Initial program 79.3%

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

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

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

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

      if 6.0000000000000002e-59 < a

      1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(a \cdot \left(\pi \cdot \frac{angle}{\color{blue}{180}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
        10. mult-flipN/A

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

          \[\leadsto {\left(a \cdot \left(\pi \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
        12. *-commutativeN/A

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

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

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

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

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

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

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

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

    Alternative 9: 67.0% accurate, 1.5× speedup?

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

      1. Initial program 79.3%

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

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

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

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

      if 6.0000000000000002e-59 < a

      1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(a \cdot \left(\pi \cdot \frac{angle}{\color{blue}{180}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
        10. mult-flipN/A

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

          \[\leadsto {\left(a \cdot \left(\pi \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
        12. *-commutativeN/A

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

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

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

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

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

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

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

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

    Alternative 10: 67.0% accurate, 1.5× speedup?

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

      1. Initial program 79.3%

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

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

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

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

      if 6.0000000000000002e-59 < a

      1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(a \cdot \left(\pi \cdot \frac{angle}{\color{blue}{180}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
        10. mult-flipN/A

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

          \[\leadsto {\left(a \cdot \left(\pi \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
        12. *-commutativeN/A

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

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

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

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

    Alternative 11: 66.9% accurate, 2.1× speedup?

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

      1. Initial program 79.3%

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

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

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

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

      if 6.0000000000000002e-59 < a

      1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(a \cdot \left(\pi \cdot \frac{angle}{\color{blue}{180}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
        10. mult-flipN/A

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

          \[\leadsto {\left(a \cdot \left(\pi \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
        12. *-commutativeN/A

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(\pi \cdot \frac{1}{180}\right) \cdot angle\right) \cdot a\right) \cdot \left(\left(\left(\pi \cdot \frac{1}{180}\right) \cdot angle\right) \cdot a\right) + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
      8. Step-by-step derivation
        1. Applied rewrites74.3%

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

      Alternative 12: 66.9% accurate, 2.1× speedup?

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

        1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
          9. lower-*.f64N/A

            \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
          10. *-commutativeN/A

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

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

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

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

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

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

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

        if 6.0000000000000002e-59 < a

        1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto {\left(a \cdot \left(\pi \cdot \frac{angle}{\color{blue}{180}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
          10. mult-flipN/A

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

            \[\leadsto {\left(a \cdot \left(\pi \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
          12. *-commutativeN/A

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

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

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

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

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

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

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

          \[\leadsto \left(\left(\left(\pi \cdot \frac{1}{180}\right) \cdot angle\right) \cdot a\right) \cdot \left(\left(\left(\pi \cdot \frac{1}{180}\right) \cdot angle\right) \cdot a\right) + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
        8. Step-by-step derivation
          1. Applied rewrites74.3%

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

        Alternative 13: 66.9% accurate, 2.5× speedup?

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

          1. Initial program 79.3%

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

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

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

              \[\leadsto b \cdot \color{blue}{b} \]
          4. Applied rewrites57.1%

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

          if 6.0000000000000002e-59 < a

          1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto {\left(a \cdot \left(\pi \cdot \frac{angle}{\color{blue}{180}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
            10. mult-flipN/A

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

              \[\leadsto {\left(a \cdot \left(\pi \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} \]
            12. *-commutativeN/A

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

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

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

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

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

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

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

            \[\leadsto \left(\left(\left(\pi \cdot \frac{1}{180}\right) \cdot angle\right) \cdot a\right) \cdot \left(\left(\left(\pi \cdot \frac{1}{180}\right) \cdot angle\right) \cdot a\right) + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
          8. Step-by-step derivation
            1. Applied rewrites74.3%

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

          Alternative 14: 66.5% accurate, 3.4× speedup?

          \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;a \leq 6 \cdot 10^{-59}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, b, {\left(angle\_m \cdot \left(\left(\pi \cdot a\right) \cdot 0.005555555555555556\right)\right)}^{2}\right)\\ \end{array} \end{array} \]
          angle_m = (fabs.f64 angle)
          (FPCore (a b angle_m)
           :precision binary64
           (if (<= a 6e-59)
             (* b b)
             (fma b b (pow (* angle_m (* (* PI a) 0.005555555555555556)) 2.0))))
          angle_m = fabs(angle);
          double code(double a, double b, double angle_m) {
          	double tmp;
          	if (a <= 6e-59) {
          		tmp = b * b;
          	} else {
          		tmp = fma(b, b, pow((angle_m * ((((double) M_PI) * a) * 0.005555555555555556)), 2.0));
          	}
          	return tmp;
          }
          
          angle_m = abs(angle)
          function code(a, b, angle_m)
          	tmp = 0.0
          	if (a <= 6e-59)
          		tmp = Float64(b * b);
          	else
          		tmp = fma(b, b, (Float64(angle_m * Float64(Float64(pi * a) * 0.005555555555555556)) ^ 2.0));
          	end
          	return tmp
          end
          
          angle_m = N[Abs[angle], $MachinePrecision]
          code[a_, b_, angle$95$m_] := If[LessEqual[a, 6e-59], N[(b * b), $MachinePrecision], N[(b * b + N[Power[N[(angle$95$m * N[(N[(Pi * a), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          angle_m = \left|angle\right|
          
          \\
          \begin{array}{l}
          \mathbf{if}\;a \leq 6 \cdot 10^{-59}:\\
          \;\;\;\;b \cdot b\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(b, b, {\left(angle\_m \cdot \left(\left(\pi \cdot a\right) \cdot 0.005555555555555556\right)\right)}^{2}\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if a < 6.0000000000000002e-59

            1. Initial program 79.3%

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

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

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

                \[\leadsto b \cdot \color{blue}{b} \]
            4. Applied rewrites57.1%

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

            if 6.0000000000000002e-59 < a

            1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
              9. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\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} \]
              10. *-commutativeN/A

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

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

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

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

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

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

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

          Alternative 15: 58.6% accurate, 0.9× speedup?

          \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \frac{angle\_m}{180} \cdot \pi\\ \mathbf{if}\;{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \leq 5 \cdot 10^{+303}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)}\\ \end{array} \end{array} \]
          angle_m = (fabs.f64 angle)
          (FPCore (a b angle_m)
           :precision binary64
           (let* ((t_0 (* (/ angle_m 180.0) PI)))
             (if (<= (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0)) 5e+303)
               (* b b)
               (sqrt (* (* b b) (* b b))))))
          angle_m = fabs(angle);
          double code(double a, double b, double angle_m) {
          	double t_0 = (angle_m / 180.0) * ((double) M_PI);
          	double tmp;
          	if ((pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0)) <= 5e+303) {
          		tmp = b * b;
          	} else {
          		tmp = sqrt(((b * b) * (b * b)));
          	}
          	return tmp;
          }
          
          angle_m = Math.abs(angle);
          public static double code(double a, double b, double angle_m) {
          	double t_0 = (angle_m / 180.0) * Math.PI;
          	double tmp;
          	if ((Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0)) <= 5e+303) {
          		tmp = b * b;
          	} else {
          		tmp = Math.sqrt(((b * b) * (b * b)));
          	}
          	return tmp;
          }
          
          angle_m = math.fabs(angle)
          def code(a, b, angle_m):
          	t_0 = (angle_m / 180.0) * math.pi
          	tmp = 0
          	if (math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)) <= 5e+303:
          		tmp = b * b
          	else:
          		tmp = math.sqrt(((b * b) * (b * b)))
          	return tmp
          
          angle_m = abs(angle)
          function code(a, b, angle_m)
          	t_0 = Float64(Float64(angle_m / 180.0) * pi)
          	tmp = 0.0
          	if (Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) <= 5e+303)
          		tmp = Float64(b * b);
          	else
          		tmp = sqrt(Float64(Float64(b * b) * Float64(b * b)));
          	end
          	return tmp
          end
          
          angle_m = abs(angle);
          function tmp_2 = code(a, b, angle_m)
          	t_0 = (angle_m / 180.0) * pi;
          	tmp = 0.0;
          	if ((((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0)) <= 5e+303)
          		tmp = b * b;
          	else
          		tmp = sqrt(((b * b) * (b * b)));
          	end
          	tmp_2 = tmp;
          end
          
          angle_m = N[Abs[angle], $MachinePrecision]
          code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, If[LessEqual[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], 5e+303], N[(b * b), $MachinePrecision], N[Sqrt[N[(N[(b * b), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
          
          \begin{array}{l}
          angle_m = \left|angle\right|
          
          \\
          \begin{array}{l}
          t_0 := \frac{angle\_m}{180} \cdot \pi\\
          \mathbf{if}\;{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \leq 5 \cdot 10^{+303}:\\
          \;\;\;\;b \cdot b\\
          
          \mathbf{else}:\\
          \;\;\;\;\sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) < 4.9999999999999997e303

            1. Initial program 79.3%

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

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

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

                \[\leadsto b \cdot \color{blue}{b} \]
            4. Applied rewrites57.1%

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

            if 4.9999999999999997e303 < (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)))

            1. Initial program 79.3%

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

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

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

                \[\leadsto b \cdot \color{blue}{b} \]
            4. Applied rewrites57.1%

              \[\leadsto \color{blue}{b \cdot b} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto b \cdot \color{blue}{b} \]
              2. pow2N/A

                \[\leadsto {b}^{\color{blue}{2}} \]
              3. pow-to-expN/A

                \[\leadsto e^{\log b \cdot 2} \]
              4. lower-exp.f64N/A

                \[\leadsto e^{\log b \cdot 2} \]
              5. lower-*.f64N/A

                \[\leadsto e^{\log b \cdot 2} \]
              6. lower-log.f6427.1

                \[\leadsto e^{\log b \cdot 2} \]
            6. Applied rewrites27.1%

              \[\leadsto e^{\log b \cdot 2} \]
            7. Step-by-step derivation
              1. lift-exp.f64N/A

                \[\leadsto e^{\log b \cdot 2} \]
              2. lift-*.f64N/A

                \[\leadsto e^{\log b \cdot 2} \]
              3. lift-log.f64N/A

                \[\leadsto e^{\log b \cdot 2} \]
              4. exp-fabsN/A

                \[\leadsto \left|e^{\log b \cdot 2}\right| \]
              5. pow-to-expN/A

                \[\leadsto \left|{b}^{2}\right| \]
              6. rem-sqrt-square-revN/A

                \[\leadsto \sqrt{{b}^{2} \cdot {b}^{2}} \]
              7. lower-sqrt.f64N/A

                \[\leadsto \sqrt{{b}^{2} \cdot {b}^{2}} \]
              8. lower-*.f64N/A

                \[\leadsto \sqrt{{b}^{2} \cdot {b}^{2}} \]
              9. unpow2N/A

                \[\leadsto \sqrt{\left(b \cdot b\right) \cdot {b}^{2}} \]
              10. lower-*.f64N/A

                \[\leadsto \sqrt{\left(b \cdot b\right) \cdot {b}^{2}} \]
              11. unpow2N/A

                \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
              12. lower-*.f6449.5

                \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
            8. Applied rewrites49.5%

              \[\leadsto \sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 16: 57.1% accurate, 29.7× speedup?

          \[\begin{array}{l} angle_m = \left|angle\right| \\ b \cdot b \end{array} \]
          angle_m = (fabs.f64 angle)
          (FPCore (a b angle_m) :precision binary64 (* b b))
          angle_m = fabs(angle);
          double code(double a, double b, double angle_m) {
          	return b * b;
          }
          
          angle_m =     private
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(a, b, angle_m)
          use fmin_fmax_functions
              real(8), intent (in) :: a
              real(8), intent (in) :: b
              real(8), intent (in) :: angle_m
              code = b * b
          end function
          
          angle_m = Math.abs(angle);
          public static double code(double a, double b, double angle_m) {
          	return b * b;
          }
          
          angle_m = math.fabs(angle)
          def code(a, b, angle_m):
          	return b * b
          
          angle_m = abs(angle)
          function code(a, b, angle_m)
          	return Float64(b * b)
          end
          
          angle_m = abs(angle);
          function tmp = code(a, b, angle_m)
          	tmp = b * b;
          end
          
          angle_m = N[Abs[angle], $MachinePrecision]
          code[a_, b_, angle$95$m_] := N[(b * b), $MachinePrecision]
          
          \begin{array}{l}
          angle_m = \left|angle\right|
          
          \\
          b \cdot b
          \end{array}
          
          Derivation
          1. Initial program 79.3%

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

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

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

              \[\leadsto b \cdot \color{blue}{b} \]
          4. Applied rewrites57.1%

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

          Reproduce

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