ab-angle->ABCF A

Percentage Accurate: 79.9% → 79.4%
Time: 12.3s
Alternatives: 7
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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

Alternative 1: 79.4% accurate, 1.8× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{-13}:\\ \;\;\;\;{b}^{2} + \left(a \cdot angle\_m\right) \cdot \left(angle\_m \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{b}^{2} + \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(a \cdot a\right)\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (if (<= (/ angle_m 180.0) 2e-13)
   (+
    (pow b 2.0)
    (* (* a angle_m) (* angle_m (* 3.08641975308642e-5 (* a (* PI PI))))))
   (+
    (pow b 2.0)
    (*
     (- 0.5 (* 0.5 (cos (* 2.0 (* PI (* angle_m 0.005555555555555556))))))
     (* a a)))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
	double tmp;
	if ((angle_m / 180.0) <= 2e-13) {
		tmp = pow(b, 2.0) + ((a * angle_m) * (angle_m * (3.08641975308642e-5 * (a * (((double) M_PI) * ((double) M_PI))))));
	} else {
		tmp = pow(b, 2.0) + ((0.5 - (0.5 * cos((2.0 * (((double) M_PI) * (angle_m * 0.005555555555555556)))))) * (a * a));
	}
	return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
	double tmp;
	if ((angle_m / 180.0) <= 2e-13) {
		tmp = Math.pow(b, 2.0) + ((a * angle_m) * (angle_m * (3.08641975308642e-5 * (a * (Math.PI * Math.PI)))));
	} else {
		tmp = Math.pow(b, 2.0) + ((0.5 - (0.5 * Math.cos((2.0 * (Math.PI * (angle_m * 0.005555555555555556)))))) * (a * a));
	}
	return tmp;
}
angle_m = math.fabs(angle)
def code(a, b, angle_m):
	tmp = 0
	if (angle_m / 180.0) <= 2e-13:
		tmp = math.pow(b, 2.0) + ((a * angle_m) * (angle_m * (3.08641975308642e-5 * (a * (math.pi * math.pi)))))
	else:
		tmp = math.pow(b, 2.0) + ((0.5 - (0.5 * math.cos((2.0 * (math.pi * (angle_m * 0.005555555555555556)))))) * (a * a))
	return tmp
angle_m = abs(angle)
function code(a, b, angle_m)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e-13)
		tmp = Float64((b ^ 2.0) + Float64(Float64(a * angle_m) * Float64(angle_m * Float64(3.08641975308642e-5 * Float64(a * Float64(pi * pi))))));
	else
		tmp = Float64((b ^ 2.0) + Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(pi * Float64(angle_m * 0.005555555555555556)))))) * Float64(a * a)));
	end
	return tmp
end
angle_m = abs(angle);
function tmp_2 = code(a, b, angle_m)
	tmp = 0.0;
	if ((angle_m / 180.0) <= 2e-13)
		tmp = (b ^ 2.0) + ((a * angle_m) * (angle_m * (3.08641975308642e-5 * (a * (pi * pi)))));
	else
		tmp = (b ^ 2.0) + ((0.5 - (0.5 * cos((2.0 * (pi * (angle_m * 0.005555555555555556)))))) * (a * a));
	end
	tmp_2 = tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-13], N[(N[Power[b, 2.0], $MachinePrecision] + N[(N[(a * angle$95$m), $MachinePrecision] * N[(angle$95$m * N[(3.08641975308642e-5 * N[(a * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[b, 2.0], $MachinePrecision] + N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{-13}:\\
\;\;\;\;{b}^{2} + \left(a \cdot angle\_m\right) \cdot \left(angle\_m \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;{b}^{2} + \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(a \cdot a\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 2.0000000000000001e-13

    1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{1}{32400} \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right) + {\left(b \cdot 1\right)}^{2} \]
        18. lower-PI.f6469.8

          \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right) + {\left(b \cdot 1\right)}^{2} \]
      4. Simplified69.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(angle \cdot a\right) \cdot \left(\left(\frac{1}{32400} \cdot \left(a \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot angle\right) + {\left(b \cdot 1\right)}^{2} \]
        6. lower-PI.f6483.9

          \[\leadsto \left(angle \cdot a\right) \cdot \left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right) \cdot angle\right) + {\left(b \cdot 1\right)}^{2} \]
      9. Simplified83.9%

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

      if 2.0000000000000001e-13 < (/.f64 angle #s(literal 180 binary64))

      1. Initial program 59.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 2: 79.7% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

        Alternative 3: 79.9% accurate, 1.4× speedup?

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

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

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

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

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

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

              \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle}{180} \cdot \pi\right)}\right)}^{2} + {\left(b \cdot 1\right)}^{2} \]
            4. 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 1\right)}^{2} \]
            5. div-invN/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 1\right)}^{2} \]
            6. 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 1\right)}^{2} \]
            7. lower-*.f6479.0

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

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

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

          Alternative 4: 79.0% accurate, 1.8× speedup?

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

            1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{1}{32400} \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right) + {\left(b \cdot 1\right)}^{2} \]
                18. lower-PI.f6469.6

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right) + {\left(b \cdot 1\right)}^{2} \]
              4. Simplified69.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(angle \cdot a\right) \cdot \left(\left(\frac{1}{32400} \cdot \left(a \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot angle\right) + {\left(b \cdot 1\right)}^{2} \]
                6. lower-PI.f6483.8

                  \[\leadsto \left(angle \cdot a\right) \cdot \left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right) \cdot angle\right) + {\left(b \cdot 1\right)}^{2} \]
              9. Simplified83.8%

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

              if 4.9999999999999999e-20 < (/.f64 angle #s(literal 180 binary64))

              1. Initial program 59.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 5: 73.9% accurate, 3.2× speedup?

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

                1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{1}{32400} \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right) + {\left(b \cdot 1\right)}^{2} \]
                    18. lower-PI.f6462.0

                      \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right) + {\left(b \cdot 1\right)}^{2} \]
                  4. Simplified62.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 2e120 < a

                  1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{1}{32400} \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right) + {\left(b \cdot 1\right)}^{2} \]
                      18. lower-PI.f6470.4

                        \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right) + {\left(b \cdot 1\right)}^{2} \]
                    4. Simplified70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \left(angle \cdot a\right) \cdot \left(\left(\frac{1}{32400} \cdot \left(a \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot angle\right) + {\left(b \cdot 1\right)}^{2} \]
                      6. lower-PI.f6495.8

                        \[\leadsto \left(angle \cdot a\right) \cdot \left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right) \cdot angle\right) + {\left(b \cdot 1\right)}^{2} \]
                    9. Simplified95.8%

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

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

                  Alternative 6: 73.7% accurate, 3.2× speedup?

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

                    1. Initial program 78.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{1}{32400} \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right) + {\left(b \cdot 1\right)}^{2} \]
                        18. lower-PI.f6463.4

                          \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right) + {\left(b \cdot 1\right)}^{2} \]
                      4. Simplified63.4%

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

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

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

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

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

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

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

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

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

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

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

                      if 1.85000000000000005e-187 < a

                      1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{1}{32400} \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right) + {\left(b \cdot 1\right)}^{2} \]
                          18. lower-PI.f6463.6

                            \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right) + {\left(b \cdot 1\right)}^{2} \]
                        4. Simplified63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(angle \cdot a\right) \cdot \left(\left(\frac{1}{32400} \cdot \left(a \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot angle\right) + {\left(b \cdot 1\right)}^{2} \]
                          6. lower-PI.f6476.3

                            \[\leadsto \left(angle \cdot a\right) \cdot \left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right) \cdot angle\right) + {\left(b \cdot 1\right)}^{2} \]
                        9. Simplified76.3%

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

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

                      Alternative 7: 74.6% accurate, 3.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right) + {\left(b \cdot 1\right)}^{2} \]
                        4. Simplified63.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(angle \cdot a\right) \cdot \left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right) \cdot angle\right) + {\left(b \cdot 1\right)}^{2} \]
                        9. Simplified74.5%

                          \[\leadsto \left(angle \cdot a\right) \cdot \left(\color{blue}{\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\pi \cdot \pi\right)\right)\right)} \cdot angle\right) + {\left(b \cdot 1\right)}^{2} \]
                        10. Final simplification74.5%

                          \[\leadsto {b}^{2} + \left(a \cdot angle\right) \cdot \left(angle \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\pi \cdot \pi\right)\right)\right)\right) \]
                        11. Add Preprocessing

                        Reproduce

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