ab-angle->ABCF B

Percentage Accurate: 53.2% → 66.4%
Time: 54.5s
Alternatives: 19
Speedup: 32.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 53.2% accurate, 1.0× speedup?

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

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

Alternative 1: 66.4% accurate, 0.9× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \sqrt{angle_m \cdot \pi}\\ t_1 := \left(a + b\right) \cdot \left(b - a\right)\\ t_2 := 2 \cdot t_1\\ t_3 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\ t_4 := \sqrt[3]{angle_m \cdot \pi}\\ t_5 := \frac{angle_m}{180} \cdot \pi\\ t_6 := angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\ t_7 := \cos t_5\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\ \;\;\;\;\cos \left({\left(\sqrt[3]{t_6}\right)}^{3}\right) \cdot \left(t_2 \cdot t_3\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+86}:\\ \;\;\;\;2 \cdot \left(t_7 \cdot \left(t_1 \cdot \sqrt{{t_3}^{2}}\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+132}:\\ \;\;\;\;t_2 \cdot \sin \left(\frac{{t_4}^{2}}{\frac{180}{t_4}}\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+194}:\\ \;\;\;\;\left(t_2 \cdot \sin t_5\right) \cdot \cos \left(\frac{t_0}{\frac{180}{t_0}}\right)\\ \mathbf{else}:\\ \;\;\;\;t_7 \cdot \left(t_2 \cdot \sin \left({\left(\sqrt{t_6}\right)}^{2}\right)\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (sqrt (* angle_m PI)))
        (t_1 (* (+ a b) (- b a)))
        (t_2 (* 2.0 t_1))
        (t_3 (sin (* PI (* angle_m 0.005555555555555556))))
        (t_4 (cbrt (* angle_m PI)))
        (t_5 (* (/ angle_m 180.0) PI))
        (t_6 (* angle_m (* PI 0.005555555555555556)))
        (t_7 (cos t_5)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1e-33)
      (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
      (if (<= (/ angle_m 180.0) 2e+52)
        (* (cos (pow (cbrt t_6) 3.0)) (* t_2 t_3))
        (if (<= (/ angle_m 180.0) 1e+86)
          (* 2.0 (* t_7 (* t_1 (sqrt (pow t_3 2.0)))))
          (if (<= (/ angle_m 180.0) 4e+132)
            (* t_2 (sin (/ (pow t_4 2.0) (/ 180.0 t_4))))
            (if (<= (/ angle_m 180.0) 5e+194)
              (* (* t_2 (sin t_5)) (cos (/ t_0 (/ 180.0 t_0))))
              (* t_7 (* t_2 (sin (pow (sqrt t_6) 2.0))))))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = sqrt((angle_m * ((double) M_PI)));
	double t_1 = (a + b) * (b - a);
	double t_2 = 2.0 * t_1;
	double t_3 = sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
	double t_4 = cbrt((angle_m * ((double) M_PI)));
	double t_5 = (angle_m / 180.0) * ((double) M_PI);
	double t_6 = angle_m * (((double) M_PI) * 0.005555555555555556);
	double t_7 = cos(t_5);
	double tmp;
	if ((angle_m / 180.0) <= 1e-33) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+52) {
		tmp = cos(pow(cbrt(t_6), 3.0)) * (t_2 * t_3);
	} else if ((angle_m / 180.0) <= 1e+86) {
		tmp = 2.0 * (t_7 * (t_1 * sqrt(pow(t_3, 2.0))));
	} else if ((angle_m / 180.0) <= 4e+132) {
		tmp = t_2 * sin((pow(t_4, 2.0) / (180.0 / t_4)));
	} else if ((angle_m / 180.0) <= 5e+194) {
		tmp = (t_2 * sin(t_5)) * cos((t_0 / (180.0 / t_0)));
	} else {
		tmp = t_7 * (t_2 * sin(pow(sqrt(t_6), 2.0)));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = Math.sqrt((angle_m * Math.PI));
	double t_1 = (a + b) * (b - a);
	double t_2 = 2.0 * t_1;
	double t_3 = Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
	double t_4 = Math.cbrt((angle_m * Math.PI));
	double t_5 = (angle_m / 180.0) * Math.PI;
	double t_6 = angle_m * (Math.PI * 0.005555555555555556);
	double t_7 = Math.cos(t_5);
	double tmp;
	if ((angle_m / 180.0) <= 1e-33) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+52) {
		tmp = Math.cos(Math.pow(Math.cbrt(t_6), 3.0)) * (t_2 * t_3);
	} else if ((angle_m / 180.0) <= 1e+86) {
		tmp = 2.0 * (t_7 * (t_1 * Math.sqrt(Math.pow(t_3, 2.0))));
	} else if ((angle_m / 180.0) <= 4e+132) {
		tmp = t_2 * Math.sin((Math.pow(t_4, 2.0) / (180.0 / t_4)));
	} else if ((angle_m / 180.0) <= 5e+194) {
		tmp = (t_2 * Math.sin(t_5)) * Math.cos((t_0 / (180.0 / t_0)));
	} else {
		tmp = t_7 * (t_2 * Math.sin(Math.pow(Math.sqrt(t_6), 2.0)));
	}
	return angle_s * tmp;
}
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = sqrt(Float64(angle_m * pi))
	t_1 = Float64(Float64(a + b) * Float64(b - a))
	t_2 = Float64(2.0 * t_1)
	t_3 = sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))
	t_4 = cbrt(Float64(angle_m * pi))
	t_5 = Float64(Float64(angle_m / 180.0) * pi)
	t_6 = Float64(angle_m * Float64(pi * 0.005555555555555556))
	t_7 = cos(t_5)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1e-33)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	elseif (Float64(angle_m / 180.0) <= 2e+52)
		tmp = Float64(cos((cbrt(t_6) ^ 3.0)) * Float64(t_2 * t_3));
	elseif (Float64(angle_m / 180.0) <= 1e+86)
		tmp = Float64(2.0 * Float64(t_7 * Float64(t_1 * sqrt((t_3 ^ 2.0)))));
	elseif (Float64(angle_m / 180.0) <= 4e+132)
		tmp = Float64(t_2 * sin(Float64((t_4 ^ 2.0) / Float64(180.0 / t_4))));
	elseif (Float64(angle_m / 180.0) <= 5e+194)
		tmp = Float64(Float64(t_2 * sin(t_5)) * cos(Float64(t_0 / Float64(180.0 / t_0))));
	else
		tmp = Float64(t_7 * Float64(t_2 * sin((sqrt(t_6) ^ 2.0))));
	end
	return Float64(angle_s * tmp)
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sqrt[N[(angle$95$m * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Power[N[(angle$95$m * Pi), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$5 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$6 = N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[Cos[t$95$5], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-33], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+52], N[(N[Cos[N[Power[N[Power[t$95$6, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(t$95$2 * t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+86], N[(2.0 * N[(t$95$7 * N[(t$95$1 * N[Sqrt[N[Power[t$95$3, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+132], N[(t$95$2 * N[Sin[N[(N[Power[t$95$4, 2.0], $MachinePrecision] / N[(180.0 / t$95$4), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+194], N[(N[(t$95$2 * N[Sin[t$95$5], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(t$95$0 / N[(180.0 / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$7 * N[(t$95$2 * N[Sin[N[Power[N[Sqrt[t$95$6], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \sqrt{angle_m \cdot \pi}\\
t_1 := \left(a + b\right) \cdot \left(b - a\right)\\
t_2 := 2 \cdot t_1\\
t_3 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\
t_4 := \sqrt[3]{angle_m \cdot \pi}\\
t_5 := \frac{angle_m}{180} \cdot \pi\\
t_6 := angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_7 := \cos t_5\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{t_6}\right)}^{3}\right) \cdot \left(t_2 \cdot t_3\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+86}:\\
\;\;\;\;2 \cdot \left(t_7 \cdot \left(t_1 \cdot \sqrt{{t_3}^{2}}\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+132}:\\
\;\;\;\;t_2 \cdot \sin \left(\frac{{t_4}^{2}}{\frac{180}{t_4}}\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+194}:\\
\;\;\;\;\left(t_2 \cdot \sin t_5\right) \cdot \cos \left(\frac{t_0}{\frac{180}{t_0}}\right)\\

\mathbf{else}:\\
\;\;\;\;t_7 \cdot \left(t_2 \cdot \sin \left({\left(\sqrt{t_6}\right)}^{2}\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if (/.f64 angle 180) < 1.0000000000000001e-33

    1. Initial program 57.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow257.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares59.6%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u46.2%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr33.1%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def46.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p56.7%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*74.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative74.1%

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

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 1.0000000000000001e-33 < (/.f64 angle 180) < 2e52

    1. Initial program 74.2%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares74.2%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. div-inv74.2%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) \]
      2. metadata-eval74.2%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt74.3%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. associate-*r*74.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(\pi \cdot angle\right) \cdot 0.005555555555555556}}\right)}^{3}\right) \]
      6. *-commutative74.1%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{3}\right) \]
      8. associate-*r*74.3%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{3}\right) \]
      10. associate-*l*74.3%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
    8. Step-by-step derivation
      1. associate-*r*74.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
      2. *-commutative74.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
    9. Simplified74.3%

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]

    if 2e52 < (/.f64 angle 180) < 1e86

    1. Initial program 33.8%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*33.8%

        \[\leadsto \color{blue}{\left(2 \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. associate-*l*33.8%

        \[\leadsto \color{blue}{2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    3. Simplified33.8%

      \[\leadsto \color{blue}{2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. unpow233.8%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares43.8%

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

      \[\leadsto 2 \cdot \left(\left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    7. Step-by-step derivation
      1. add-sqr-sqrt41.8%

        \[\leadsto 2 \cdot \left(\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(\sqrt{\sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\sin \left(\pi \cdot \frac{angle}{180}\right)}\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      2. sqrt-unprod72.6%

        \[\leadsto 2 \cdot \left(\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\sqrt{\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      3. pow272.6%

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

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

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

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

    if 1e86 < (/.f64 angle 180) < 3.99999999999999996e132

    1. Initial program 30.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow230.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares53.0%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \color{blue}{1} \]
    6. Step-by-step derivation
      1. associate-*r/44.8%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{\pi \cdot angle}{180}\right)}\right) \cdot 1 \]
      2. *-commutative44.8%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{angle \cdot \pi}}{180}\right)\right) \cdot 1 \]
      3. add-cube-cbrt46.2%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{\left(\sqrt[3]{angle \cdot \pi} \cdot \sqrt[3]{angle \cdot \pi}\right) \cdot \sqrt[3]{angle \cdot \pi}}}{180}\right)\right) \cdot 1 \]
      4. associate-/l*54.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{\sqrt[3]{angle \cdot \pi} \cdot \sqrt[3]{angle \cdot \pi}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)}\right) \cdot 1 \]
      5. pow254.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{{\left(\sqrt[3]{angle \cdot \pi}\right)}^{2}}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)\right) \cdot 1 \]
      6. *-commutative54.3%

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

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

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

    if 3.99999999999999996e132 < (/.f64 angle 180) < 4.99999999999999989e194

    1. Initial program 33.9%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow233.9%

        \[\leadsto \left(\left(2 \cdot \left(\color{blue}{b \cdot b} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. unpow233.9%

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares33.9%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. associate-*r/5.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\frac{\pi \cdot angle}{180}\right)} \]
      2. *-commutative5.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\frac{\color{blue}{angle \cdot \pi}}{180}\right) \]
      3. add-sqr-sqrt34.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\frac{\color{blue}{\sqrt{angle \cdot \pi} \cdot \sqrt{angle \cdot \pi}}}{180}\right) \]
      4. associate-/l*50.9%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\frac{\sqrt{angle \cdot \pi}}{\frac{180}{\sqrt{angle \cdot \pi}}}\right)} \]
      5. *-commutative50.9%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\frac{\sqrt{\color{blue}{\pi \cdot angle}}}{\frac{180}{\sqrt{angle \cdot \pi}}}\right) \]
      6. *-commutative50.9%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\frac{\sqrt{\pi \cdot angle}}{\frac{180}{\sqrt{\color{blue}{\pi \cdot angle}}}}\right) \]
    6. Applied egg-rr50.9%

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

    if 4.99999999999999989e194 < (/.f64 angle 180)

    1. Initial program 25.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow225.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares30.5%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. div-inv29.4%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. metadata-eval29.4%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. add-sqr-sqrt30.3%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left({\left(\sqrt{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{2}\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      5. associate-*r*35.1%

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{2}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      8. associate-*r*30.3%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{2}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      10. associate-*l*30.3%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left({\left(\sqrt{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{2}\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  3. Recombined 6 regimes into one program.
  4. Final simplification69.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{-33}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+52}:\\ \;\;\;\;\cos \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right) \cdot \left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+86}:\\ \;\;\;\;2 \cdot \left(\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sqrt{{\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{2}}\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 4 \cdot 10^{+132}:\\ \;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{{\left(\sqrt[3]{angle \cdot \pi}\right)}^{2}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+194}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{\sqrt{angle \cdot \pi}}{\frac{180}{\sqrt{angle \cdot \pi}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{2}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 66.9% accurate, 0.5× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \sqrt[3]{angle_m \cdot \pi}\\ t_1 := \frac{{t_0}^{2}}{\frac{180}{t_0}}\\ t_2 := 2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\\ t_3 := {\left(\sqrt[3]{angle_m \cdot \left(0.005555555555555556 \cdot \sqrt[3]{{\pi}^{3}}\right)}\right)}^{3}\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-35}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2.2 \cdot 10^{+119}:\\ \;\;\;\;\left(t_2 \cdot \sin t_3\right) \cdot \cos \left({\left(\sqrt[3]{angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+228}:\\ \;\;\;\;\left(t_2 \cdot \sin \left(\frac{angle_m}{180} \cdot \pi\right)\right) \cdot \cos t_3\\ \mathbf{else}:\\ \;\;\;\;\cos t_1 \cdot \left(t_2 \cdot \sin t_1\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (cbrt (* angle_m PI)))
        (t_1 (/ (pow t_0 2.0) (/ 180.0 t_0)))
        (t_2 (* 2.0 (* (+ a b) (- b a))))
        (t_3
         (pow
          (cbrt (* angle_m (* 0.005555555555555556 (cbrt (pow PI 3.0)))))
          3.0)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 2e-35)
      (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
      (if (<= (/ angle_m 180.0) 2.2e+119)
        (*
         (* t_2 (sin t_3))
         (cos (pow (cbrt (* angle_m (* PI 0.005555555555555556))) 3.0)))
        (if (<= (/ angle_m 180.0) 1e+228)
          (* (* t_2 (sin (* (/ angle_m 180.0) PI))) (cos t_3))
          (* (cos t_1) (* t_2 (sin t_1)))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = cbrt((angle_m * ((double) M_PI)));
	double t_1 = pow(t_0, 2.0) / (180.0 / t_0);
	double t_2 = 2.0 * ((a + b) * (b - a));
	double t_3 = pow(cbrt((angle_m * (0.005555555555555556 * cbrt(pow(((double) M_PI), 3.0))))), 3.0);
	double tmp;
	if ((angle_m / 180.0) <= 2e-35) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else if ((angle_m / 180.0) <= 2.2e+119) {
		tmp = (t_2 * sin(t_3)) * cos(pow(cbrt((angle_m * (((double) M_PI) * 0.005555555555555556))), 3.0));
	} else if ((angle_m / 180.0) <= 1e+228) {
		tmp = (t_2 * sin(((angle_m / 180.0) * ((double) M_PI)))) * cos(t_3);
	} else {
		tmp = cos(t_1) * (t_2 * sin(t_1));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = Math.cbrt((angle_m * Math.PI));
	double t_1 = Math.pow(t_0, 2.0) / (180.0 / t_0);
	double t_2 = 2.0 * ((a + b) * (b - a));
	double t_3 = Math.pow(Math.cbrt((angle_m * (0.005555555555555556 * Math.cbrt(Math.pow(Math.PI, 3.0))))), 3.0);
	double tmp;
	if ((angle_m / 180.0) <= 2e-35) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else if ((angle_m / 180.0) <= 2.2e+119) {
		tmp = (t_2 * Math.sin(t_3)) * Math.cos(Math.pow(Math.cbrt((angle_m * (Math.PI * 0.005555555555555556))), 3.0));
	} else if ((angle_m / 180.0) <= 1e+228) {
		tmp = (t_2 * Math.sin(((angle_m / 180.0) * Math.PI))) * Math.cos(t_3);
	} else {
		tmp = Math.cos(t_1) * (t_2 * Math.sin(t_1));
	}
	return angle_s * tmp;
}
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = cbrt(Float64(angle_m * pi))
	t_1 = Float64((t_0 ^ 2.0) / Float64(180.0 / t_0))
	t_2 = Float64(2.0 * Float64(Float64(a + b) * Float64(b - a)))
	t_3 = cbrt(Float64(angle_m * Float64(0.005555555555555556 * cbrt((pi ^ 3.0))))) ^ 3.0
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e-35)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	elseif (Float64(angle_m / 180.0) <= 2.2e+119)
		tmp = Float64(Float64(t_2 * sin(t_3)) * cos((cbrt(Float64(angle_m * Float64(pi * 0.005555555555555556))) ^ 3.0)));
	elseif (Float64(angle_m / 180.0) <= 1e+228)
		tmp = Float64(Float64(t_2 * sin(Float64(Float64(angle_m / 180.0) * pi))) * cos(t_3));
	else
		tmp = Float64(cos(t_1) * Float64(t_2 * sin(t_1)));
	end
	return Float64(angle_s * tmp)
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Power[N[(angle$95$m * Pi), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[t$95$0, 2.0], $MachinePrecision] / N[(180.0 / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Power[N[(angle$95$m * N[(0.005555555555555556 * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-35], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2.2e+119], N[(N[(t$95$2 * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision] * N[Cos[N[Power[N[Power[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+228], N[(N[(t$95$2 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$1], $MachinePrecision] * N[(t$95$2 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \sqrt[3]{angle_m \cdot \pi}\\
t_1 := \frac{{t_0}^{2}}{\frac{180}{t_0}}\\
t_2 := 2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\\
t_3 := {\left(\sqrt[3]{angle_m \cdot \left(0.005555555555555556 \cdot \sqrt[3]{{\pi}^{3}}\right)}\right)}^{3}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-35}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2.2 \cdot 10^{+119}:\\
\;\;\;\;\left(t_2 \cdot \sin t_3\right) \cdot \cos \left({\left(\sqrt[3]{angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+228}:\\
\;\;\;\;\left(t_2 \cdot \sin \left(\frac{angle_m}{180} \cdot \pi\right)\right) \cdot \cos t_3\\

\mathbf{else}:\\
\;\;\;\;\cos t_1 \cdot \left(t_2 \cdot \sin t_1\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 angle 180) < 2.00000000000000002e-35

    1. Initial program 56.8%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow256.8%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares59.4%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u46.0%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef32.8%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*32.8%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative32.8%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr32.8%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def45.9%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p56.5%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*74.0%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative74.0%

        \[\leadsto \left(0.011111111111111112 \cdot \left(\left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(a + b\right)}\right) \cdot \left(b - a\right)\right)\right) \cdot 1 \]
    10. Simplified74.0%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 2.00000000000000002e-35 < (/.f64 angle 180) < 2.2000000000000001e119

    1. Initial program 47.1%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares57.5%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. div-inv57.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) \]
      2. metadata-eval57.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt52.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)} \cdot \sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right) \cdot \sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)} \]
      4. pow352.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. associate-*r*52.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(\pi \cdot angle\right) \cdot 0.005555555555555556}}\right)}^{3}\right) \]
      6. *-commutative52.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.005555555555555556}\right)}^{3}\right) \]
      7. *-commutative52.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{3}\right) \]
      8. associate-*r*52.0%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{3}\right) \]
      10. associate-*l*52.6%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right)} \]
    7. Step-by-step derivation
      1. div-inv57.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) \]
      2. metadata-eval57.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt52.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)} \cdot \sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right) \cdot \sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)} \]
      4. pow352.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. associate-*r*52.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(\pi \cdot angle\right) \cdot 0.005555555555555556}}\right)}^{3}\right) \]
      6. *-commutative52.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.005555555555555556}\right)}^{3}\right) \]
      7. *-commutative52.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{3}\right) \]
      8. associate-*r*52.0%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{3}\right) \]
      10. associate-*l*52.6%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
    9. Step-by-step derivation
      1. add-cbrt-cube63.4%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \color{blue}{\sqrt[3]{\left(\pi \cdot \pi\right) \cdot \pi}}\right)}\right)}^{3}\right)\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
      2. pow363.4%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \sqrt[3]{\color{blue}{{\pi}^{3}}}\right)}\right)}^{3}\right)\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
    10. Applied egg-rr63.4%

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \color{blue}{\sqrt[3]{{\pi}^{3}}}\right)}\right)}^{3}\right)\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]

    if 2.2000000000000001e119 < (/.f64 angle 180) < 9.9999999999999992e227

    1. Initial program 32.4%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow232.4%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares43.5%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. div-inv32.4%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) \]
      2. metadata-eval32.4%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt25.8%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. associate-*r*30.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(\pi \cdot angle\right) \cdot 0.005555555555555556}}\right)}^{3}\right) \]
      6. *-commutative30.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.005555555555555556}\right)}^{3}\right) \]
      7. *-commutative30.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{3}\right) \]
      8. associate-*r*23.7%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(0.005555555555555556 \cdot angle\right) \cdot \pi}}\right)}^{3}\right) \]
      9. *-commutative23.7%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{3}\right) \]
      10. associate-*l*29.2%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right)} \]
    7. Step-by-step derivation
      1. add-cbrt-cube30.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \color{blue}{\sqrt[3]{\left(\pi \cdot \pi\right) \cdot \pi}}\right)}\right)}^{3}\right)\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
      2. pow330.0%

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

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

    if 9.9999999999999992e227 < (/.f64 angle 180)

    1. Initial program 25.4%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow225.4%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares25.4%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. associate-*r/42.5%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{angle \cdot \pi}}{180}\right)\right) \cdot 1 \]
      3. add-cube-cbrt31.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{\left(\sqrt[3]{angle \cdot \pi} \cdot \sqrt[3]{angle \cdot \pi}\right) \cdot \sqrt[3]{angle \cdot \pi}}}{180}\right)\right) \cdot 1 \]
      4. associate-/l*32.7%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{\sqrt[3]{angle \cdot \pi} \cdot \sqrt[3]{angle \cdot \pi}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)}\right) \cdot 1 \]
      5. pow232.7%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{{\left(\sqrt[3]{angle \cdot \pi}\right)}^{2}}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)\right) \cdot 1 \]
      6. *-commutative32.7%

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{angle \cdot \pi}}{180}\right)\right) \cdot 1 \]
      3. add-cube-cbrt31.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{\left(\sqrt[3]{angle \cdot \pi} \cdot \sqrt[3]{angle \cdot \pi}\right) \cdot \sqrt[3]{angle \cdot \pi}}}{180}\right)\right) \cdot 1 \]
      4. associate-/l*32.7%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{\sqrt[3]{angle \cdot \pi} \cdot \sqrt[3]{angle \cdot \pi}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)}\right) \cdot 1 \]
      5. pow232.7%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{{\left(\sqrt[3]{angle \cdot \pi}\right)}^{2}}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)\right) \cdot 1 \]
      6. *-commutative32.7%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{{\left(\sqrt[3]{\pi \cdot angle}\right)}^{2}}{\frac{180}{\sqrt[3]{\pi \cdot angle}}}\right)}\right) \cdot \cos \left(\frac{{\left(\sqrt[3]{\pi \cdot angle}\right)}^{2}}{\frac{180}{\sqrt[3]{\pi \cdot angle}}}\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification69.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-35}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2.2 \cdot 10^{+119}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \sqrt[3]{{\pi}^{3}}\right)}\right)}^{3}\right)\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+228}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \sqrt[3]{{\pi}^{3}}\right)}\right)}^{3}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{{\left(\sqrt[3]{angle \cdot \pi}\right)}^{2}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right) \cdot \left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{{\left(\sqrt[3]{angle \cdot \pi}\right)}^{2}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 66.9% accurate, 0.5× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := {\left(\sqrt[3]{angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\\ t_1 := \cos t_0\\ t_2 := 2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\\ t_3 := {\left(\sqrt[3]{angle_m \cdot \left(0.005555555555555556 \cdot \sqrt[3]{{\pi}^{3}}\right)}\right)}^{3}\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-35}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2.2 \cdot 10^{+119}:\\ \;\;\;\;\left(t_2 \cdot \sin t_3\right) \cdot t_1\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+228}:\\ \;\;\;\;\left(t_2 \cdot \sin \left(\frac{angle_m}{180} \cdot \pi\right)\right) \cdot \cos t_3\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \left(t_2 \cdot \sin t_0\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (pow (cbrt (* angle_m (* PI 0.005555555555555556))) 3.0))
        (t_1 (cos t_0))
        (t_2 (* 2.0 (* (+ a b) (- b a))))
        (t_3
         (pow
          (cbrt (* angle_m (* 0.005555555555555556 (cbrt (pow PI 3.0)))))
          3.0)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 2e-35)
      (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
      (if (<= (/ angle_m 180.0) 2.2e+119)
        (* (* t_2 (sin t_3)) t_1)
        (if (<= (/ angle_m 180.0) 1e+228)
          (* (* t_2 (sin (* (/ angle_m 180.0) PI))) (cos t_3))
          (* t_1 (* t_2 (sin t_0)))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = pow(cbrt((angle_m * (((double) M_PI) * 0.005555555555555556))), 3.0);
	double t_1 = cos(t_0);
	double t_2 = 2.0 * ((a + b) * (b - a));
	double t_3 = pow(cbrt((angle_m * (0.005555555555555556 * cbrt(pow(((double) M_PI), 3.0))))), 3.0);
	double tmp;
	if ((angle_m / 180.0) <= 2e-35) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else if ((angle_m / 180.0) <= 2.2e+119) {
		tmp = (t_2 * sin(t_3)) * t_1;
	} else if ((angle_m / 180.0) <= 1e+228) {
		tmp = (t_2 * sin(((angle_m / 180.0) * ((double) M_PI)))) * cos(t_3);
	} else {
		tmp = t_1 * (t_2 * sin(t_0));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = Math.pow(Math.cbrt((angle_m * (Math.PI * 0.005555555555555556))), 3.0);
	double t_1 = Math.cos(t_0);
	double t_2 = 2.0 * ((a + b) * (b - a));
	double t_3 = Math.pow(Math.cbrt((angle_m * (0.005555555555555556 * Math.cbrt(Math.pow(Math.PI, 3.0))))), 3.0);
	double tmp;
	if ((angle_m / 180.0) <= 2e-35) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else if ((angle_m / 180.0) <= 2.2e+119) {
		tmp = (t_2 * Math.sin(t_3)) * t_1;
	} else if ((angle_m / 180.0) <= 1e+228) {
		tmp = (t_2 * Math.sin(((angle_m / 180.0) * Math.PI))) * Math.cos(t_3);
	} else {
		tmp = t_1 * (t_2 * Math.sin(t_0));
	}
	return angle_s * tmp;
}
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = cbrt(Float64(angle_m * Float64(pi * 0.005555555555555556))) ^ 3.0
	t_1 = cos(t_0)
	t_2 = Float64(2.0 * Float64(Float64(a + b) * Float64(b - a)))
	t_3 = cbrt(Float64(angle_m * Float64(0.005555555555555556 * cbrt((pi ^ 3.0))))) ^ 3.0
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e-35)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	elseif (Float64(angle_m / 180.0) <= 2.2e+119)
		tmp = Float64(Float64(t_2 * sin(t_3)) * t_1);
	elseif (Float64(angle_m / 180.0) <= 1e+228)
		tmp = Float64(Float64(t_2 * sin(Float64(Float64(angle_m / 180.0) * pi))) * cos(t_3));
	else
		tmp = Float64(t_1 * Float64(t_2 * sin(t_0)));
	end
	return Float64(angle_s * tmp)
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Power[N[Power[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Power[N[(angle$95$m * N[(0.005555555555555556 * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-35], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2.2e+119], N[(N[(t$95$2 * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+228], N[(N[(t$95$2 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$2 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := {\left(\sqrt[3]{angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\\
t_1 := \cos t_0\\
t_2 := 2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\\
t_3 := {\left(\sqrt[3]{angle_m \cdot \left(0.005555555555555556 \cdot \sqrt[3]{{\pi}^{3}}\right)}\right)}^{3}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-35}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2.2 \cdot 10^{+119}:\\
\;\;\;\;\left(t_2 \cdot \sin t_3\right) \cdot t_1\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+228}:\\
\;\;\;\;\left(t_2 \cdot \sin \left(\frac{angle_m}{180} \cdot \pi\right)\right) \cdot \cos t_3\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_2 \cdot \sin t_0\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 angle 180) < 2.00000000000000002e-35

    1. Initial program 56.8%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow256.8%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares59.4%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u46.0%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef32.8%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*32.8%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative32.8%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr32.8%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def45.9%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p56.5%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*74.0%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative74.0%

        \[\leadsto \left(0.011111111111111112 \cdot \left(\left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(a + b\right)}\right) \cdot \left(b - a\right)\right)\right) \cdot 1 \]
    10. Simplified74.0%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 2.00000000000000002e-35 < (/.f64 angle 180) < 2.2000000000000001e119

    1. Initial program 47.1%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares57.5%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. div-inv57.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) \]
      2. metadata-eval57.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt52.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)} \cdot \sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right) \cdot \sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)} \]
      4. pow352.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. associate-*r*52.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(\pi \cdot angle\right) \cdot 0.005555555555555556}}\right)}^{3}\right) \]
      6. *-commutative52.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.005555555555555556}\right)}^{3}\right) \]
      7. *-commutative52.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{3}\right) \]
      8. associate-*r*52.0%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{3}\right) \]
      10. associate-*l*52.6%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right)} \]
    7. Step-by-step derivation
      1. div-inv57.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) \]
      2. metadata-eval57.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt52.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)} \cdot \sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right) \cdot \sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)} \]
      4. pow352.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. associate-*r*52.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(\pi \cdot angle\right) \cdot 0.005555555555555556}}\right)}^{3}\right) \]
      6. *-commutative52.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.005555555555555556}\right)}^{3}\right) \]
      7. *-commutative52.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{3}\right) \]
      8. associate-*r*52.0%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{3}\right) \]
      10. associate-*l*52.6%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
    9. Step-by-step derivation
      1. add-cbrt-cube63.4%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \color{blue}{\sqrt[3]{\left(\pi \cdot \pi\right) \cdot \pi}}\right)}\right)}^{3}\right)\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
      2. pow363.4%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \sqrt[3]{\color{blue}{{\pi}^{3}}}\right)}\right)}^{3}\right)\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
    10. Applied egg-rr63.4%

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \color{blue}{\sqrt[3]{{\pi}^{3}}}\right)}\right)}^{3}\right)\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]

    if 2.2000000000000001e119 < (/.f64 angle 180) < 9.9999999999999992e227

    1. Initial program 32.4%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow232.4%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares43.5%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. div-inv32.4%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) \]
      2. metadata-eval32.4%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt25.8%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. associate-*r*30.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(\pi \cdot angle\right) \cdot 0.005555555555555556}}\right)}^{3}\right) \]
      6. *-commutative30.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.005555555555555556}\right)}^{3}\right) \]
      7. *-commutative30.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{3}\right) \]
      8. associate-*r*23.7%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(0.005555555555555556 \cdot angle\right) \cdot \pi}}\right)}^{3}\right) \]
      9. *-commutative23.7%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{3}\right) \]
      10. associate-*l*29.2%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right)} \]
    7. Step-by-step derivation
      1. add-cbrt-cube30.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \color{blue}{\sqrt[3]{\left(\pi \cdot \pi\right) \cdot \pi}}\right)}\right)}^{3}\right)\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
      2. pow330.0%

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

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

    if 9.9999999999999992e227 < (/.f64 angle 180)

    1. Initial program 25.4%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow225.4%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares25.4%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. div-inv24.5%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) \]
      2. metadata-eval24.5%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt26.5%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. associate-*r*23.7%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(\pi \cdot angle\right) \cdot 0.005555555555555556}}\right)}^{3}\right) \]
      6. *-commutative23.7%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{3}\right) \]
      8. associate-*r*24.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(0.005555555555555556 \cdot angle\right) \cdot \pi}}\right)}^{3}\right) \]
      9. *-commutative24.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{3}\right) \]
      10. associate-*l*23.8%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right)} \]
    7. Step-by-step derivation
      1. div-inv24.5%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) \]
      2. metadata-eval24.5%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt26.5%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. associate-*r*23.7%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(\pi \cdot angle\right) \cdot 0.005555555555555556}}\right)}^{3}\right) \]
      6. *-commutative23.7%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{3}\right) \]
      8. associate-*r*24.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(0.005555555555555556 \cdot angle\right) \cdot \pi}}\right)}^{3}\right) \]
      9. *-commutative24.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{3}\right) \]
      10. associate-*l*23.8%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification69.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-35}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2.2 \cdot 10^{+119}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \sqrt[3]{{\pi}^{3}}\right)}\right)}^{3}\right)\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+228}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \sqrt[3]{{\pi}^{3}}\right)}\right)}^{3}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right) \cdot \left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 66.6% accurate, 0.7× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := 2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\\ t_1 := \sqrt{angle_m \cdot \pi}\\ t_2 := {\left(\sqrt[3]{angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\\ t_3 := \sqrt[3]{angle_m \cdot \pi}\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-35}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+60}:\\ \;\;\;\;\cos t_2 \cdot \left(t_0 \cdot \sin t_2\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+132}:\\ \;\;\;\;t_0 \cdot \sin \left(\frac{{t_3}^{2}}{\frac{180}{t_3}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t_0 \cdot \sin \left(\frac{t_1}{\frac{180}{t_1}}\right)\right) \cdot \cos \left(\frac{angle_m}{180} \cdot \pi\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* 2.0 (* (+ a b) (- b a))))
        (t_1 (sqrt (* angle_m PI)))
        (t_2 (pow (cbrt (* angle_m (* PI 0.005555555555555556))) 3.0))
        (t_3 (cbrt (* angle_m PI))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 2e-35)
      (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
      (if (<= (/ angle_m 180.0) 2e+60)
        (* (cos t_2) (* t_0 (sin t_2)))
        (if (<= (/ angle_m 180.0) 4e+132)
          (* t_0 (sin (/ (pow t_3 2.0) (/ 180.0 t_3))))
          (*
           (* t_0 (sin (/ t_1 (/ 180.0 t_1))))
           (cos (* (/ angle_m 180.0) PI)))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = 2.0 * ((a + b) * (b - a));
	double t_1 = sqrt((angle_m * ((double) M_PI)));
	double t_2 = pow(cbrt((angle_m * (((double) M_PI) * 0.005555555555555556))), 3.0);
	double t_3 = cbrt((angle_m * ((double) M_PI)));
	double tmp;
	if ((angle_m / 180.0) <= 2e-35) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+60) {
		tmp = cos(t_2) * (t_0 * sin(t_2));
	} else if ((angle_m / 180.0) <= 4e+132) {
		tmp = t_0 * sin((pow(t_3, 2.0) / (180.0 / t_3)));
	} else {
		tmp = (t_0 * sin((t_1 / (180.0 / t_1)))) * cos(((angle_m / 180.0) * ((double) M_PI)));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = 2.0 * ((a + b) * (b - a));
	double t_1 = Math.sqrt((angle_m * Math.PI));
	double t_2 = Math.pow(Math.cbrt((angle_m * (Math.PI * 0.005555555555555556))), 3.0);
	double t_3 = Math.cbrt((angle_m * Math.PI));
	double tmp;
	if ((angle_m / 180.0) <= 2e-35) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+60) {
		tmp = Math.cos(t_2) * (t_0 * Math.sin(t_2));
	} else if ((angle_m / 180.0) <= 4e+132) {
		tmp = t_0 * Math.sin((Math.pow(t_3, 2.0) / (180.0 / t_3)));
	} else {
		tmp = (t_0 * Math.sin((t_1 / (180.0 / t_1)))) * Math.cos(((angle_m / 180.0) * Math.PI));
	}
	return angle_s * tmp;
}
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(2.0 * Float64(Float64(a + b) * Float64(b - a)))
	t_1 = sqrt(Float64(angle_m * pi))
	t_2 = cbrt(Float64(angle_m * Float64(pi * 0.005555555555555556))) ^ 3.0
	t_3 = cbrt(Float64(angle_m * pi))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e-35)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	elseif (Float64(angle_m / 180.0) <= 2e+60)
		tmp = Float64(cos(t_2) * Float64(t_0 * sin(t_2)));
	elseif (Float64(angle_m / 180.0) <= 4e+132)
		tmp = Float64(t_0 * sin(Float64((t_3 ^ 2.0) / Float64(180.0 / t_3))));
	else
		tmp = Float64(Float64(t_0 * sin(Float64(t_1 / Float64(180.0 / t_1)))) * cos(Float64(Float64(angle_m / 180.0) * pi)));
	end
	return Float64(angle_s * tmp)
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(angle$95$m * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Power[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(angle$95$m * Pi), $MachinePrecision], 1/3], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-35], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+60], N[(N[Cos[t$95$2], $MachinePrecision] * N[(t$95$0 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+132], N[(t$95$0 * N[Sin[N[(N[Power[t$95$3, 2.0], $MachinePrecision] / N[(180.0 / t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[Sin[N[(t$95$1 / N[(180.0 / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\\
t_1 := \sqrt{angle_m \cdot \pi}\\
t_2 := {\left(\sqrt[3]{angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\\
t_3 := \sqrt[3]{angle_m \cdot \pi}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-35}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+60}:\\
\;\;\;\;\cos t_2 \cdot \left(t_0 \cdot \sin t_2\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+132}:\\
\;\;\;\;t_0 \cdot \sin \left(\frac{{t_3}^{2}}{\frac{180}{t_3}}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \sin \left(\frac{t_1}{\frac{180}{t_1}}\right)\right) \cdot \cos \left(\frac{angle_m}{180} \cdot \pi\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 angle 180) < 2.00000000000000002e-35

    1. Initial program 56.8%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow256.8%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares59.4%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u46.0%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef32.8%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*32.8%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative32.8%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr32.8%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def45.9%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p56.5%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*74.0%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative74.0%

        \[\leadsto \left(0.011111111111111112 \cdot \left(\left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(a + b\right)}\right) \cdot \left(b - a\right)\right)\right) \cdot 1 \]
    10. Simplified74.0%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 2.00000000000000002e-35 < (/.f64 angle 180) < 1.9999999999999999e60

    1. Initial program 67.2%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares74.3%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. div-inv74.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) \]
      2. metadata-eval74.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt67.2%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)} \cdot \sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right) \cdot \sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)} \]
      4. pow360.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. associate-*r*60.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(\pi \cdot angle\right) \cdot 0.005555555555555556}}\right)}^{3}\right) \]
      6. *-commutative60.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.005555555555555556}\right)}^{3}\right) \]
      7. *-commutative60.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{3}\right) \]
      8. associate-*r*60.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(0.005555555555555556 \cdot angle\right) \cdot \pi}}\right)}^{3}\right) \]
      9. *-commutative60.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{3}\right) \]
      10. associate-*l*60.1%

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) \]
      2. metadata-eval74.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt67.2%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)} \cdot \sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right) \cdot \sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)} \]
      4. pow360.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. associate-*r*60.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(\pi \cdot angle\right) \cdot 0.005555555555555556}}\right)}^{3}\right) \]
      6. *-commutative60.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.005555555555555556}\right)}^{3}\right) \]
      7. *-commutative60.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{3}\right) \]
      8. associate-*r*60.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(0.005555555555555556 \cdot angle\right) \cdot \pi}}\right)}^{3}\right) \]
      9. *-commutative60.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{3}\right) \]
      10. associate-*l*60.1%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]

    if 1.9999999999999999e60 < (/.f64 angle 180) < 3.99999999999999996e132

    1. Initial program 31.4%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow231.4%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares46.4%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \color{blue}{1} \]
    6. Step-by-step derivation
      1. associate-*r/46.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{\pi \cdot angle}{180}\right)}\right) \cdot 1 \]
      2. *-commutative46.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{angle \cdot \pi}}{180}\right)\right) \cdot 1 \]
      3. add-cube-cbrt41.4%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{\left(\sqrt[3]{angle \cdot \pi} \cdot \sqrt[3]{angle \cdot \pi}\right) \cdot \sqrt[3]{angle \cdot \pi}}}{180}\right)\right) \cdot 1 \]
      4. associate-/l*50.8%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{\sqrt[3]{angle \cdot \pi} \cdot \sqrt[3]{angle \cdot \pi}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)}\right) \cdot 1 \]
      5. pow250.8%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{{\left(\sqrt[3]{\color{blue}{\pi \cdot angle}}\right)}^{2}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)\right) \cdot 1 \]
      7. *-commutative50.8%

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

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

    if 3.99999999999999996e132 < (/.f64 angle 180)

    1. Initial program 27.5%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow227.5%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares31.5%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. associate-*r/22.8%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\frac{\pi \cdot angle}{180}\right)} \]
      2. *-commutative22.8%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\frac{\color{blue}{angle \cdot \pi}}{180}\right) \]
      3. add-sqr-sqrt32.4%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\frac{\color{blue}{\sqrt{angle \cdot \pi} \cdot \sqrt{angle \cdot \pi}}}{180}\right) \]
      4. associate-/l*33.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\frac{\sqrt{angle \cdot \pi}}{\frac{180}{\sqrt{angle \cdot \pi}}}\right)} \]
      5. *-commutative33.1%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{\sqrt{\pi \cdot angle}}{\frac{180}{\sqrt{\pi \cdot angle}}}\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification69.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-35}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+60}:\\ \;\;\;\;\cos \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right) \cdot \left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 4 \cdot 10^{+132}:\\ \;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{{\left(\sqrt[3]{angle \cdot \pi}\right)}^{2}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\sqrt{angle \cdot \pi}}{\frac{180}{\sqrt{angle \cdot \pi}}}\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 66.2% accurate, 0.9× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \left(a + b\right) \cdot \left(b - a\right)\\ t_1 := 2 \cdot t_0\\ t_2 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\ t_3 := \sqrt[3]{angle_m \cdot \pi}\\ t_4 := \frac{angle_m}{180} \cdot \pi\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\ \;\;\;\;\cos \left({\left(\sqrt[3]{angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right) \cdot \left(t_1 \cdot t_2\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+86}:\\ \;\;\;\;2 \cdot \left(\cos t_4 \cdot \left(t_0 \cdot \sqrt{{t_2}^{2}}\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+145}:\\ \;\;\;\;t_1 \cdot \sin \left(\frac{{t_3}^{2}}{\frac{180}{t_3}}\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+210}:\\ \;\;\;\;2 \cdot \left(\frac{{b}^{2} - {a}^{2}}{\frac{1}{t_2}} \cdot \cos \left(\frac{\pi}{\frac{180}{angle_m}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t_1 \cdot \sin t_4\right) \cdot \cos \left(\frac{1}{\frac{180}{angle_m \cdot \pi}}\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (+ a b) (- b a)))
        (t_1 (* 2.0 t_0))
        (t_2 (sin (* PI (* angle_m 0.005555555555555556))))
        (t_3 (cbrt (* angle_m PI)))
        (t_4 (* (/ angle_m 180.0) PI)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1e-33)
      (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
      (if (<= (/ angle_m 180.0) 2e+52)
        (*
         (cos (pow (cbrt (* angle_m (* PI 0.005555555555555556))) 3.0))
         (* t_1 t_2))
        (if (<= (/ angle_m 180.0) 1e+86)
          (* 2.0 (* (cos t_4) (* t_0 (sqrt (pow t_2 2.0)))))
          (if (<= (/ angle_m 180.0) 2e+145)
            (* t_1 (sin (/ (pow t_3 2.0) (/ 180.0 t_3))))
            (if (<= (/ angle_m 180.0) 1e+210)
              (*
               2.0
               (*
                (/ (- (pow b 2.0) (pow a 2.0)) (/ 1.0 t_2))
                (cos (/ PI (/ 180.0 angle_m)))))
              (*
               (* t_1 (sin t_4))
               (cos (/ 1.0 (/ 180.0 (* angle_m PI)))))))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (a + b) * (b - a);
	double t_1 = 2.0 * t_0;
	double t_2 = sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
	double t_3 = cbrt((angle_m * ((double) M_PI)));
	double t_4 = (angle_m / 180.0) * ((double) M_PI);
	double tmp;
	if ((angle_m / 180.0) <= 1e-33) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+52) {
		tmp = cos(pow(cbrt((angle_m * (((double) M_PI) * 0.005555555555555556))), 3.0)) * (t_1 * t_2);
	} else if ((angle_m / 180.0) <= 1e+86) {
		tmp = 2.0 * (cos(t_4) * (t_0 * sqrt(pow(t_2, 2.0))));
	} else if ((angle_m / 180.0) <= 2e+145) {
		tmp = t_1 * sin((pow(t_3, 2.0) / (180.0 / t_3)));
	} else if ((angle_m / 180.0) <= 1e+210) {
		tmp = 2.0 * (((pow(b, 2.0) - pow(a, 2.0)) / (1.0 / t_2)) * cos((((double) M_PI) / (180.0 / angle_m))));
	} else {
		tmp = (t_1 * sin(t_4)) * cos((1.0 / (180.0 / (angle_m * ((double) M_PI)))));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (a + b) * (b - a);
	double t_1 = 2.0 * t_0;
	double t_2 = Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
	double t_3 = Math.cbrt((angle_m * Math.PI));
	double t_4 = (angle_m / 180.0) * Math.PI;
	double tmp;
	if ((angle_m / 180.0) <= 1e-33) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+52) {
		tmp = Math.cos(Math.pow(Math.cbrt((angle_m * (Math.PI * 0.005555555555555556))), 3.0)) * (t_1 * t_2);
	} else if ((angle_m / 180.0) <= 1e+86) {
		tmp = 2.0 * (Math.cos(t_4) * (t_0 * Math.sqrt(Math.pow(t_2, 2.0))));
	} else if ((angle_m / 180.0) <= 2e+145) {
		tmp = t_1 * Math.sin((Math.pow(t_3, 2.0) / (180.0 / t_3)));
	} else if ((angle_m / 180.0) <= 1e+210) {
		tmp = 2.0 * (((Math.pow(b, 2.0) - Math.pow(a, 2.0)) / (1.0 / t_2)) * Math.cos((Math.PI / (180.0 / angle_m))));
	} else {
		tmp = (t_1 * Math.sin(t_4)) * Math.cos((1.0 / (180.0 / (angle_m * Math.PI))));
	}
	return angle_s * tmp;
}
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(Float64(a + b) * Float64(b - a))
	t_1 = Float64(2.0 * t_0)
	t_2 = sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))
	t_3 = cbrt(Float64(angle_m * pi))
	t_4 = Float64(Float64(angle_m / 180.0) * pi)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1e-33)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	elseif (Float64(angle_m / 180.0) <= 2e+52)
		tmp = Float64(cos((cbrt(Float64(angle_m * Float64(pi * 0.005555555555555556))) ^ 3.0)) * Float64(t_1 * t_2));
	elseif (Float64(angle_m / 180.0) <= 1e+86)
		tmp = Float64(2.0 * Float64(cos(t_4) * Float64(t_0 * sqrt((t_2 ^ 2.0)))));
	elseif (Float64(angle_m / 180.0) <= 2e+145)
		tmp = Float64(t_1 * sin(Float64((t_3 ^ 2.0) / Float64(180.0 / t_3))));
	elseif (Float64(angle_m / 180.0) <= 1e+210)
		tmp = Float64(2.0 * Float64(Float64(Float64((b ^ 2.0) - (a ^ 2.0)) / Float64(1.0 / t_2)) * cos(Float64(pi / Float64(180.0 / angle_m)))));
	else
		tmp = Float64(Float64(t_1 * sin(t_4)) * cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * pi)))));
	end
	return Float64(angle_s * tmp)
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(angle$95$m * Pi), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$4 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-33], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+52], N[(N[Cos[N[Power[N[Power[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+86], N[(2.0 * N[(N[Cos[t$95$4], $MachinePrecision] * N[(t$95$0 * N[Sqrt[N[Power[t$95$2, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+145], N[(t$95$1 * N[Sin[N[(N[Power[t$95$3, 2.0], $MachinePrecision] / N[(180.0 / t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+210], N[(2.0 * N[(N[(N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] / N[(1.0 / t$95$2), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]), $MachinePrecision]]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(b - a\right)\\
t_1 := 2 \cdot t_0\\
t_2 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\
t_3 := \sqrt[3]{angle_m \cdot \pi}\\
t_4 := \frac{angle_m}{180} \cdot \pi\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right) \cdot \left(t_1 \cdot t_2\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+86}:\\
\;\;\;\;2 \cdot \left(\cos t_4 \cdot \left(t_0 \cdot \sqrt{{t_2}^{2}}\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+145}:\\
\;\;\;\;t_1 \cdot \sin \left(\frac{{t_3}^{2}}{\frac{180}{t_3}}\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+210}:\\
\;\;\;\;2 \cdot \left(\frac{{b}^{2} - {a}^{2}}{\frac{1}{t_2}} \cdot \cos \left(\frac{\pi}{\frac{180}{angle_m}}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(t_1 \cdot \sin t_4\right) \cdot \cos \left(\frac{1}{\frac{180}{angle_m \cdot \pi}}\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if (/.f64 angle 180) < 1.0000000000000001e-33

    1. Initial program 57.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow257.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares59.6%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u46.2%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr33.1%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def46.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p56.7%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*74.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative74.1%

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

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 1.0000000000000001e-33 < (/.f64 angle 180) < 2e52

    1. Initial program 74.2%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares74.2%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. div-inv74.2%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) \]
      2. metadata-eval74.2%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt74.3%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. associate-*r*74.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(\pi \cdot angle\right) \cdot 0.005555555555555556}}\right)}^{3}\right) \]
      6. *-commutative74.1%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{3}\right) \]
      8. associate-*r*74.3%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{3}\right) \]
      10. associate-*l*74.3%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
    8. Step-by-step derivation
      1. associate-*r*74.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
      2. *-commutative74.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
    9. Simplified74.3%

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]

    if 2e52 < (/.f64 angle 180) < 1e86

    1. Initial program 33.8%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*33.8%

        \[\leadsto \color{blue}{\left(2 \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. associate-*l*33.8%

        \[\leadsto \color{blue}{2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    3. Simplified33.8%

      \[\leadsto \color{blue}{2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. unpow233.8%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares43.8%

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

      \[\leadsto 2 \cdot \left(\left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    7. Step-by-step derivation
      1. add-sqr-sqrt41.8%

        \[\leadsto 2 \cdot \left(\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(\sqrt{\sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\sin \left(\pi \cdot \frac{angle}{180}\right)}\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      2. sqrt-unprod72.6%

        \[\leadsto 2 \cdot \left(\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\sqrt{\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      3. pow272.6%

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

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

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

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

    if 1e86 < (/.f64 angle 180) < 2e145

    1. Initial program 28.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow228.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares49.4%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \color{blue}{1} \]
    6. Step-by-step derivation
      1. associate-*r/41.7%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{\pi \cdot angle}{180}\right)}\right) \cdot 1 \]
      2. *-commutative41.7%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{\left(\sqrt[3]{angle \cdot \pi} \cdot \sqrt[3]{angle \cdot \pi}\right) \cdot \sqrt[3]{angle \cdot \pi}}}{180}\right)\right) \cdot 1 \]
      4. associate-/l*50.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{\sqrt[3]{angle \cdot \pi} \cdot \sqrt[3]{angle \cdot \pi}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)}\right) \cdot 1 \]
      5. pow250.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{{\left(\sqrt[3]{angle \cdot \pi}\right)}^{2}}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)\right) \cdot 1 \]
      6. *-commutative50.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{{\left(\sqrt[3]{\color{blue}{\pi \cdot angle}}\right)}^{2}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)\right) \cdot 1 \]
      7. *-commutative50.6%

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

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

    if 2e145 < (/.f64 angle 180) < 9.99999999999999927e209

    1. Initial program 28.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*28.7%

        \[\leadsto \color{blue}{\left(2 \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. associate-*l*28.7%

        \[\leadsto \color{blue}{2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    3. Simplified28.7%

      \[\leadsto \color{blue}{2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. unpow228.7%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares28.7%

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

      \[\leadsto 2 \cdot \left(\left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    7. Step-by-step derivation
      1. associate-*l*28.7%

        \[\leadsto 2 \cdot \left(\color{blue}{\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      2. flip-+28.7%

        \[\leadsto 2 \cdot \left(\left(\color{blue}{\frac{b \cdot b - a \cdot a}{b - a}} \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      3. unpow228.7%

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

        \[\leadsto 2 \cdot \left(\left(\frac{{b}^{2} - \color{blue}{{a}^{2}}}{b - a} \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      5. associate-*l/25.8%

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

        \[\leadsto 2 \cdot \left(\frac{\left({b}^{2} - {a}^{2}\right) \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(\frac{angle}{180} \cdot \pi\right)}\right)}{b - a} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      7. div-inv37.0%

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

        \[\leadsto 2 \cdot \left(\frac{\left({b}^{2} - {a}^{2}\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \color{blue}{0.005555555555555556}\right) \cdot \pi\right)\right)}{b - a} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      9. associate-*l*35.5%

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

      \[\leadsto 2 \cdot \left(\color{blue}{\frac{\left({b}^{2} - {a}^{2}\right) \cdot \left(\left(b - a\right) \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)}{b - a}} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    9. Step-by-step derivation
      1. associate-/l*38.0%

        \[\leadsto 2 \cdot \left(\color{blue}{\frac{{b}^{2} - {a}^{2}}{\frac{b - a}{\left(b - a\right) \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}}} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      2. associate-/r*38.0%

        \[\leadsto 2 \cdot \left(\frac{{b}^{2} - {a}^{2}}{\color{blue}{\frac{\frac{b - a}{b - a}}{\sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}}} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      3. *-inverses38.0%

        \[\leadsto 2 \cdot \left(\frac{{b}^{2} - {a}^{2}}{\frac{\color{blue}{1}}{\sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      4. *-commutative38.0%

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

        \[\leadsto 2 \cdot \left(\frac{{b}^{2} - {a}^{2}}{\frac{1}{\sin \left(\color{blue}{\left(\pi \cdot 0.005555555555555556\right)} \cdot angle\right)}} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      6. associate-*l*39.8%

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

      \[\leadsto 2 \cdot \left(\color{blue}{\frac{{b}^{2} - {a}^{2}}{\frac{1}{\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}}} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    11. Step-by-step derivation
      1. associate-*r/17.7%

        \[\leadsto 2 \cdot \left(\frac{{b}^{2} - {a}^{2}}{\frac{1}{\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}} \cdot \cos \color{blue}{\left(\frac{\pi \cdot angle}{180}\right)}\right) \]
      2. associate-/l*51.2%

        \[\leadsto 2 \cdot \left(\frac{{b}^{2} - {a}^{2}}{\frac{1}{\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}} \cdot \cos \color{blue}{\left(\frac{\pi}{\frac{180}{angle}}\right)}\right) \]
    12. Applied egg-rr51.2%

      \[\leadsto 2 \cdot \left(\frac{{b}^{2} - {a}^{2}}{\frac{1}{\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}} \cdot \cos \color{blue}{\left(\frac{\pi}{\frac{180}{angle}}\right)}\right) \]

    if 9.99999999999999927e209 < (/.f64 angle 180)

    1. Initial program 28.5%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow228.5%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares35.1%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. associate-*r/34.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\frac{\pi \cdot angle}{180}\right)} \]
      2. *-commutative34.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\frac{\color{blue}{angle \cdot \pi}}{180}\right) \]
      3. clear-num42.2%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)} \]
      4. *-commutative42.2%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification70.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{-33}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+52}:\\ \;\;\;\;\cos \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right) \cdot \left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+86}:\\ \;\;\;\;2 \cdot \left(\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sqrt{{\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{2}}\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+145}:\\ \;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{{\left(\sqrt[3]{angle \cdot \pi}\right)}^{2}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+210}:\\ \;\;\;\;2 \cdot \left(\frac{{b}^{2} - {a}^{2}}{\frac{1}{\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}} \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 66.3% accurate, 0.9× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \left(a + b\right) \cdot \left(b - a\right)\\ t_1 := 2 \cdot t_0\\ t_2 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\ t_3 := \sqrt[3]{angle_m \cdot \pi}\\ t_4 := angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\ t_5 := \cos \left(\frac{angle_m}{180} \cdot \pi\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\ \;\;\;\;\cos \left({\left(\sqrt[3]{t_4}\right)}^{3}\right) \cdot \left(t_1 \cdot t_2\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+86}:\\ \;\;\;\;2 \cdot \left(t_5 \cdot \left(t_0 \cdot \sqrt{{t_2}^{2}}\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+145}:\\ \;\;\;\;t_1 \cdot \sin \left(\frac{{t_3}^{2}}{\frac{180}{t_3}}\right)\\ \mathbf{else}:\\ \;\;\;\;t_5 \cdot \left(t_1 \cdot \sin \left({\left(\sqrt{t_4}\right)}^{2}\right)\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (+ a b) (- b a)))
        (t_1 (* 2.0 t_0))
        (t_2 (sin (* PI (* angle_m 0.005555555555555556))))
        (t_3 (cbrt (* angle_m PI)))
        (t_4 (* angle_m (* PI 0.005555555555555556)))
        (t_5 (cos (* (/ angle_m 180.0) PI))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1e-33)
      (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
      (if (<= (/ angle_m 180.0) 2e+52)
        (* (cos (pow (cbrt t_4) 3.0)) (* t_1 t_2))
        (if (<= (/ angle_m 180.0) 1e+86)
          (* 2.0 (* t_5 (* t_0 (sqrt (pow t_2 2.0)))))
          (if (<= (/ angle_m 180.0) 2e+145)
            (* t_1 (sin (/ (pow t_3 2.0) (/ 180.0 t_3))))
            (* t_5 (* t_1 (sin (pow (sqrt t_4) 2.0)))))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (a + b) * (b - a);
	double t_1 = 2.0 * t_0;
	double t_2 = sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
	double t_3 = cbrt((angle_m * ((double) M_PI)));
	double t_4 = angle_m * (((double) M_PI) * 0.005555555555555556);
	double t_5 = cos(((angle_m / 180.0) * ((double) M_PI)));
	double tmp;
	if ((angle_m / 180.0) <= 1e-33) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+52) {
		tmp = cos(pow(cbrt(t_4), 3.0)) * (t_1 * t_2);
	} else if ((angle_m / 180.0) <= 1e+86) {
		tmp = 2.0 * (t_5 * (t_0 * sqrt(pow(t_2, 2.0))));
	} else if ((angle_m / 180.0) <= 2e+145) {
		tmp = t_1 * sin((pow(t_3, 2.0) / (180.0 / t_3)));
	} else {
		tmp = t_5 * (t_1 * sin(pow(sqrt(t_4), 2.0)));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (a + b) * (b - a);
	double t_1 = 2.0 * t_0;
	double t_2 = Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
	double t_3 = Math.cbrt((angle_m * Math.PI));
	double t_4 = angle_m * (Math.PI * 0.005555555555555556);
	double t_5 = Math.cos(((angle_m / 180.0) * Math.PI));
	double tmp;
	if ((angle_m / 180.0) <= 1e-33) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+52) {
		tmp = Math.cos(Math.pow(Math.cbrt(t_4), 3.0)) * (t_1 * t_2);
	} else if ((angle_m / 180.0) <= 1e+86) {
		tmp = 2.0 * (t_5 * (t_0 * Math.sqrt(Math.pow(t_2, 2.0))));
	} else if ((angle_m / 180.0) <= 2e+145) {
		tmp = t_1 * Math.sin((Math.pow(t_3, 2.0) / (180.0 / t_3)));
	} else {
		tmp = t_5 * (t_1 * Math.sin(Math.pow(Math.sqrt(t_4), 2.0)));
	}
	return angle_s * tmp;
}
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(Float64(a + b) * Float64(b - a))
	t_1 = Float64(2.0 * t_0)
	t_2 = sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))
	t_3 = cbrt(Float64(angle_m * pi))
	t_4 = Float64(angle_m * Float64(pi * 0.005555555555555556))
	t_5 = cos(Float64(Float64(angle_m / 180.0) * pi))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1e-33)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	elseif (Float64(angle_m / 180.0) <= 2e+52)
		tmp = Float64(cos((cbrt(t_4) ^ 3.0)) * Float64(t_1 * t_2));
	elseif (Float64(angle_m / 180.0) <= 1e+86)
		tmp = Float64(2.0 * Float64(t_5 * Float64(t_0 * sqrt((t_2 ^ 2.0)))));
	elseif (Float64(angle_m / 180.0) <= 2e+145)
		tmp = Float64(t_1 * sin(Float64((t_3 ^ 2.0) / Float64(180.0 / t_3))));
	else
		tmp = Float64(t_5 * Float64(t_1 * sin((sqrt(t_4) ^ 2.0))));
	end
	return Float64(angle_s * tmp)
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(angle$95$m * Pi), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$4 = N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-33], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+52], N[(N[Cos[N[Power[N[Power[t$95$4, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+86], N[(2.0 * N[(t$95$5 * N[(t$95$0 * N[Sqrt[N[Power[t$95$2, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+145], N[(t$95$1 * N[Sin[N[(N[Power[t$95$3, 2.0], $MachinePrecision] / N[(180.0 / t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$5 * N[(t$95$1 * N[Sin[N[Power[N[Sqrt[t$95$4], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(b - a\right)\\
t_1 := 2 \cdot t_0\\
t_2 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\
t_3 := \sqrt[3]{angle_m \cdot \pi}\\
t_4 := angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_5 := \cos \left(\frac{angle_m}{180} \cdot \pi\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{t_4}\right)}^{3}\right) \cdot \left(t_1 \cdot t_2\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+86}:\\
\;\;\;\;2 \cdot \left(t_5 \cdot \left(t_0 \cdot \sqrt{{t_2}^{2}}\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+145}:\\
\;\;\;\;t_1 \cdot \sin \left(\frac{{t_3}^{2}}{\frac{180}{t_3}}\right)\\

\mathbf{else}:\\
\;\;\;\;t_5 \cdot \left(t_1 \cdot \sin \left({\left(\sqrt{t_4}\right)}^{2}\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 angle 180) < 1.0000000000000001e-33

    1. Initial program 57.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow257.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares59.6%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u46.2%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr33.1%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def46.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p56.7%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*74.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative74.1%

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

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 1.0000000000000001e-33 < (/.f64 angle 180) < 2e52

    1. Initial program 74.2%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares74.2%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. div-inv74.2%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) \]
      2. metadata-eval74.2%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt74.3%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. associate-*r*74.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(\pi \cdot angle\right) \cdot 0.005555555555555556}}\right)}^{3}\right) \]
      6. *-commutative74.1%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{3}\right) \]
      8. associate-*r*74.3%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{3}\right) \]
      10. associate-*l*74.3%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
    8. Step-by-step derivation
      1. associate-*r*74.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
      2. *-commutative74.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
    9. Simplified74.3%

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]

    if 2e52 < (/.f64 angle 180) < 1e86

    1. Initial program 33.8%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*33.8%

        \[\leadsto \color{blue}{\left(2 \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. associate-*l*33.8%

        \[\leadsto \color{blue}{2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    3. Simplified33.8%

      \[\leadsto \color{blue}{2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. unpow233.8%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares43.8%

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

      \[\leadsto 2 \cdot \left(\left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    7. Step-by-step derivation
      1. add-sqr-sqrt41.8%

        \[\leadsto 2 \cdot \left(\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(\sqrt{\sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\sin \left(\pi \cdot \frac{angle}{180}\right)}\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      2. sqrt-unprod72.6%

        \[\leadsto 2 \cdot \left(\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\sqrt{\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      3. pow272.6%

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

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

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

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

    if 1e86 < (/.f64 angle 180) < 2e145

    1. Initial program 28.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow228.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares49.4%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \color{blue}{1} \]
    6. Step-by-step derivation
      1. associate-*r/41.7%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{\pi \cdot angle}{180}\right)}\right) \cdot 1 \]
      2. *-commutative41.7%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{\left(\sqrt[3]{angle \cdot \pi} \cdot \sqrt[3]{angle \cdot \pi}\right) \cdot \sqrt[3]{angle \cdot \pi}}}{180}\right)\right) \cdot 1 \]
      4. associate-/l*50.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{\sqrt[3]{angle \cdot \pi} \cdot \sqrt[3]{angle \cdot \pi}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)}\right) \cdot 1 \]
      5. pow250.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{{\left(\sqrt[3]{angle \cdot \pi}\right)}^{2}}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)\right) \cdot 1 \]
      6. *-commutative50.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{{\left(\sqrt[3]{\color{blue}{\pi \cdot angle}}\right)}^{2}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)\right) \cdot 1 \]
      7. *-commutative50.6%

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

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

    if 2e145 < (/.f64 angle 180)

    1. Initial program 28.5%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow228.5%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares32.7%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. div-inv36.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. metadata-eval36.0%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. add-sqr-sqrt32.7%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left({\left(\sqrt{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{2}\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      5. associate-*r*36.3%

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{2}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      8. associate-*r*32.7%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{2}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      10. associate-*l*32.7%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left({\left(\sqrt{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{2}\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  3. Recombined 5 regimes into one program.
  4. Final simplification68.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{-33}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+52}:\\ \;\;\;\;\cos \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right) \cdot \left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+86}:\\ \;\;\;\;2 \cdot \left(\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sqrt{{\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{2}}\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+145}:\\ \;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{{\left(\sqrt[3]{angle \cdot \pi}\right)}^{2}}{\frac{180}{\sqrt[3]{angle \cdot \pi}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{2}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 66.8% accurate, 0.9× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \left(a + b\right) \cdot \left(b - a\right)\\ t_1 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\ t_2 := \left(2 \cdot t_0\right) \cdot t_1\\ t_3 := \cos \left(\frac{angle_m}{180} \cdot \pi\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\ \;\;\;\;\cos \left({\left(\sqrt[3]{angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right) \cdot t_2\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+92}:\\ \;\;\;\;2 \cdot \left(t_3 \cdot \left(t_0 \cdot \sqrt{{t_1}^{2}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_3 \cdot t_2\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (+ a b) (- b a)))
        (t_1 (sin (* PI (* angle_m 0.005555555555555556))))
        (t_2 (* (* 2.0 t_0) t_1))
        (t_3 (cos (* (/ angle_m 180.0) PI))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1e-33)
      (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
      (if (<= (/ angle_m 180.0) 2e+52)
        (* (cos (pow (cbrt (* angle_m (* PI 0.005555555555555556))) 3.0)) t_2)
        (if (<= (/ angle_m 180.0) 5e+92)
          (* 2.0 (* t_3 (* t_0 (sqrt (pow t_1 2.0)))))
          (* t_3 t_2)))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (a + b) * (b - a);
	double t_1 = sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
	double t_2 = (2.0 * t_0) * t_1;
	double t_3 = cos(((angle_m / 180.0) * ((double) M_PI)));
	double tmp;
	if ((angle_m / 180.0) <= 1e-33) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+52) {
		tmp = cos(pow(cbrt((angle_m * (((double) M_PI) * 0.005555555555555556))), 3.0)) * t_2;
	} else if ((angle_m / 180.0) <= 5e+92) {
		tmp = 2.0 * (t_3 * (t_0 * sqrt(pow(t_1, 2.0))));
	} else {
		tmp = t_3 * t_2;
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (a + b) * (b - a);
	double t_1 = Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
	double t_2 = (2.0 * t_0) * t_1;
	double t_3 = Math.cos(((angle_m / 180.0) * Math.PI));
	double tmp;
	if ((angle_m / 180.0) <= 1e-33) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+52) {
		tmp = Math.cos(Math.pow(Math.cbrt((angle_m * (Math.PI * 0.005555555555555556))), 3.0)) * t_2;
	} else if ((angle_m / 180.0) <= 5e+92) {
		tmp = 2.0 * (t_3 * (t_0 * Math.sqrt(Math.pow(t_1, 2.0))));
	} else {
		tmp = t_3 * t_2;
	}
	return angle_s * tmp;
}
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(Float64(a + b) * Float64(b - a))
	t_1 = sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))
	t_2 = Float64(Float64(2.0 * t_0) * t_1)
	t_3 = cos(Float64(Float64(angle_m / 180.0) * pi))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1e-33)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	elseif (Float64(angle_m / 180.0) <= 2e+52)
		tmp = Float64(cos((cbrt(Float64(angle_m * Float64(pi * 0.005555555555555556))) ^ 3.0)) * t_2);
	elseif (Float64(angle_m / 180.0) <= 5e+92)
		tmp = Float64(2.0 * Float64(t_3 * Float64(t_0 * sqrt((t_1 ^ 2.0)))));
	else
		tmp = Float64(t_3 * t_2);
	end
	return Float64(angle_s * tmp)
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-33], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+52], N[(N[Cos[N[Power[N[Power[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+92], N[(2.0 * N[(t$95$3 * N[(t$95$0 * N[Sqrt[N[Power[t$95$1, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * t$95$2), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(b - a\right)\\
t_1 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\
t_2 := \left(2 \cdot t_0\right) \cdot t_1\\
t_3 := \cos \left(\frac{angle_m}{180} \cdot \pi\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right) \cdot t_2\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+92}:\\
\;\;\;\;2 \cdot \left(t_3 \cdot \left(t_0 \cdot \sqrt{{t_1}^{2}}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_3 \cdot t_2\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 angle 180) < 1.0000000000000001e-33

    1. Initial program 57.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow257.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares59.6%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u46.2%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr33.1%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def46.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p56.7%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*74.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative74.1%

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

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 1.0000000000000001e-33 < (/.f64 angle 180) < 2e52

    1. Initial program 74.2%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares74.2%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. div-inv74.2%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) \]
      2. metadata-eval74.2%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt74.3%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. associate-*r*74.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(\pi \cdot angle\right) \cdot 0.005555555555555556}}\right)}^{3}\right) \]
      6. *-commutative74.1%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}}\right)}^{3}\right) \]
      8. associate-*r*74.3%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi}\right)}^{3}\right) \]
      10. associate-*l*74.3%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
    8. Step-by-step derivation
      1. associate-*r*74.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
      2. *-commutative74.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
    9. Simplified74.3%

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]

    if 2e52 < (/.f64 angle 180) < 5.00000000000000022e92

    1. Initial program 33.8%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*33.8%

        \[\leadsto \color{blue}{\left(2 \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. associate-*l*33.8%

        \[\leadsto \color{blue}{2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    3. Simplified33.8%

      \[\leadsto \color{blue}{2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. unpow233.8%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares43.8%

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

      \[\leadsto 2 \cdot \left(\left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    7. Step-by-step derivation
      1. add-sqr-sqrt41.8%

        \[\leadsto 2 \cdot \left(\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(\sqrt{\sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\sin \left(\pi \cdot \frac{angle}{180}\right)}\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      2. sqrt-unprod72.6%

        \[\leadsto 2 \cdot \left(\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\sqrt{\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      3. pow272.6%

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

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

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

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

    if 5.00000000000000022e92 < (/.f64 angle 180)

    1. Initial program 28.3%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares38.9%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    6. Step-by-step derivation
      1. *-commutative32.3%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. associate-*l*38.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      4. *-commutative38.3%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification68.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{-33}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+52}:\\ \;\;\;\;\cos \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right) \cdot \left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+92}:\\ \;\;\;\;2 \cdot \left(\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sqrt{{\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{2}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 65.7% accurate, 1.2× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\\ t_1 := \frac{angle_m}{180} \cdot \pi\\ t_2 := \left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin t_1\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+17}:\\ \;\;\;\;t_2 \cdot \cos t_0\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+133}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+183}:\\ \;\;\;\;\cos t_1 \cdot \left({a}^{2} \cdot \left(\sin t_0 \cdot -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \cos \left(\frac{1}{\frac{180}{angle_m \cdot \pi}}\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* 0.005555555555555556 (* angle_m PI)))
        (t_1 (* (/ angle_m 180.0) PI))
        (t_2 (* (* 2.0 (* (+ a b) (- b a))) (sin t_1))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1e-33)
      (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
      (if (<= (/ angle_m 180.0) 1e+17)
        (* t_2 (cos t_0))
        (if (<= (/ angle_m 180.0) 5e+133)
          t_2
          (if (<= (/ angle_m 180.0) 1e+183)
            (* (cos t_1) (* (pow a 2.0) (* (sin t_0) -2.0)))
            (* t_2 (cos (/ 1.0 (/ 180.0 (* angle_m PI))))))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = 0.005555555555555556 * (angle_m * ((double) M_PI));
	double t_1 = (angle_m / 180.0) * ((double) M_PI);
	double t_2 = (2.0 * ((a + b) * (b - a))) * sin(t_1);
	double tmp;
	if ((angle_m / 180.0) <= 1e-33) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else if ((angle_m / 180.0) <= 1e+17) {
		tmp = t_2 * cos(t_0);
	} else if ((angle_m / 180.0) <= 5e+133) {
		tmp = t_2;
	} else if ((angle_m / 180.0) <= 1e+183) {
		tmp = cos(t_1) * (pow(a, 2.0) * (sin(t_0) * -2.0));
	} else {
		tmp = t_2 * cos((1.0 / (180.0 / (angle_m * ((double) M_PI)))));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = 0.005555555555555556 * (angle_m * Math.PI);
	double t_1 = (angle_m / 180.0) * Math.PI;
	double t_2 = (2.0 * ((a + b) * (b - a))) * Math.sin(t_1);
	double tmp;
	if ((angle_m / 180.0) <= 1e-33) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else if ((angle_m / 180.0) <= 1e+17) {
		tmp = t_2 * Math.cos(t_0);
	} else if ((angle_m / 180.0) <= 5e+133) {
		tmp = t_2;
	} else if ((angle_m / 180.0) <= 1e+183) {
		tmp = Math.cos(t_1) * (Math.pow(a, 2.0) * (Math.sin(t_0) * -2.0));
	} else {
		tmp = t_2 * Math.cos((1.0 / (180.0 / (angle_m * Math.PI))));
	}
	return angle_s * tmp;
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = 0.005555555555555556 * (angle_m * math.pi)
	t_1 = (angle_m / 180.0) * math.pi
	t_2 = (2.0 * ((a + b) * (b - a))) * math.sin(t_1)
	tmp = 0
	if (angle_m / 180.0) <= 1e-33:
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a))
	elif (angle_m / 180.0) <= 1e+17:
		tmp = t_2 * math.cos(t_0)
	elif (angle_m / 180.0) <= 5e+133:
		tmp = t_2
	elif (angle_m / 180.0) <= 1e+183:
		tmp = math.cos(t_1) * (math.pow(a, 2.0) * (math.sin(t_0) * -2.0))
	else:
		tmp = t_2 * math.cos((1.0 / (180.0 / (angle_m * math.pi))))
	return angle_s * tmp
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(0.005555555555555556 * Float64(angle_m * pi))
	t_1 = Float64(Float64(angle_m / 180.0) * pi)
	t_2 = Float64(Float64(2.0 * Float64(Float64(a + b) * Float64(b - a))) * sin(t_1))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1e-33)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	elseif (Float64(angle_m / 180.0) <= 1e+17)
		tmp = Float64(t_2 * cos(t_0));
	elseif (Float64(angle_m / 180.0) <= 5e+133)
		tmp = t_2;
	elseif (Float64(angle_m / 180.0) <= 1e+183)
		tmp = Float64(cos(t_1) * Float64((a ^ 2.0) * Float64(sin(t_0) * -2.0)));
	else
		tmp = Float64(t_2 * cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * pi)))));
	end
	return Float64(angle_s * tmp)
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = 0.005555555555555556 * (angle_m * pi);
	t_1 = (angle_m / 180.0) * pi;
	t_2 = (2.0 * ((a + b) * (b - a))) * sin(t_1);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 1e-33)
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a));
	elseif ((angle_m / 180.0) <= 1e+17)
		tmp = t_2 * cos(t_0);
	elseif ((angle_m / 180.0) <= 5e+133)
		tmp = t_2;
	elseif ((angle_m / 180.0) <= 1e+183)
		tmp = cos(t_1) * ((a ^ 2.0) * (sin(t_0) * -2.0));
	else
		tmp = t_2 * cos((1.0 / (180.0 / (angle_m * pi))));
	end
	tmp_2 = angle_s * tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-33], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+17], N[(t$95$2 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+133], t$95$2, If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+183], N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\\
t_1 := \frac{angle_m}{180} \cdot \pi\\
t_2 := \left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin t_1\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+17}:\\
\;\;\;\;t_2 \cdot \cos t_0\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+133}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+183}:\\
\;\;\;\;\cos t_1 \cdot \left({a}^{2} \cdot \left(\sin t_0 \cdot -2\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_2 \cdot \cos \left(\frac{1}{\frac{180}{angle_m \cdot \pi}}\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 angle 180) < 1.0000000000000001e-33

    1. Initial program 57.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow257.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares59.6%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u46.2%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr33.1%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def46.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p56.7%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*74.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative74.1%

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

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 1.0000000000000001e-33 < (/.f64 angle 180) < 1e17

    1. Initial program 99.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow299.7%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares99.7%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \]

    if 1e17 < (/.f64 angle 180) < 4.99999999999999961e133

    1. Initial program 32.3%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares47.1%

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

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

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

    if 4.99999999999999961e133 < (/.f64 angle 180) < 9.99999999999999947e182

    1. Initial program 33.9%

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

      \[\leadsto \color{blue}{\left(-2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    4. Step-by-step derivation
      1. *-commutative60.2%

        \[\leadsto \color{blue}{\left(\left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot -2\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. *-commutative60.2%

        \[\leadsto \left(\left({a}^{2} \cdot \sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}\right) \cdot -2\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. *-commutative60.2%

        \[\leadsto \left(\left({a}^{2} \cdot \sin \left(\color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556\right)\right) \cdot -2\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      4. associate-*r*59.6%

        \[\leadsto \left(\left({a}^{2} \cdot \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot -2\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      5. associate-*l*59.6%

        \[\leadsto \color{blue}{\left({a}^{2} \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot -2\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      6. associate-*r*60.2%

        \[\leadsto \left({a}^{2} \cdot \left(\sin \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot -2\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      7. *-commutative60.2%

        \[\leadsto \left({a}^{2} \cdot \left(\sin \left(\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.005555555555555556\right) \cdot -2\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      8. *-commutative60.2%

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

      \[\leadsto \color{blue}{\left({a}^{2} \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot -2\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]

    if 9.99999999999999947e182 < (/.f64 angle 180)

    1. Initial program 25.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow225.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares30.5%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. associate-*r/29.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\frac{\pi \cdot angle}{180}\right)} \]
      2. *-commutative29.6%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\frac{\color{blue}{angle \cdot \pi}}{180}\right) \]
      3. clear-num35.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)} \]
      4. *-commutative35.3%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification69.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{-33}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+17}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+133}:\\ \;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+183}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left({a}^{2} \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 65.1% accurate, 1.7× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \frac{angle_m}{180} \cdot \pi\\ t_1 := \cos t_0\\ t_2 := \left(a + b\right) \cdot \left(b - a\right)\\ t_3 := \pi \cdot t_2\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 1000:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \sqrt{{t_3}^{2}}\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+82}:\\ \;\;\;\;t_1 \cdot \left(0.011111111111111112 \cdot \left(angle_m \cdot t_3\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t_1 \cdot \left(t_2 \cdot \sin t_0\right)\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (/ angle_m 180.0) PI))
        (t_1 (cos t_0))
        (t_2 (* (+ a b) (- b a)))
        (t_3 (* PI t_2)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1000.0)
      (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
      (if (<= (/ angle_m 180.0) 2e+52)
        (* 0.011111111111111112 (* angle_m (sqrt (pow t_3 2.0))))
        (if (<= (/ angle_m 180.0) 5e+82)
          (* t_1 (* 0.011111111111111112 (* angle_m t_3)))
          (* 2.0 (* t_1 (* t_2 (sin t_0))))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * ((double) M_PI);
	double t_1 = cos(t_0);
	double t_2 = (a + b) * (b - a);
	double t_3 = ((double) M_PI) * t_2;
	double tmp;
	if ((angle_m / 180.0) <= 1000.0) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+52) {
		tmp = 0.011111111111111112 * (angle_m * sqrt(pow(t_3, 2.0)));
	} else if ((angle_m / 180.0) <= 5e+82) {
		tmp = t_1 * (0.011111111111111112 * (angle_m * t_3));
	} else {
		tmp = 2.0 * (t_1 * (t_2 * sin(t_0)));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * Math.PI;
	double t_1 = Math.cos(t_0);
	double t_2 = (a + b) * (b - a);
	double t_3 = Math.PI * t_2;
	double tmp;
	if ((angle_m / 180.0) <= 1000.0) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+52) {
		tmp = 0.011111111111111112 * (angle_m * Math.sqrt(Math.pow(t_3, 2.0)));
	} else if ((angle_m / 180.0) <= 5e+82) {
		tmp = t_1 * (0.011111111111111112 * (angle_m * t_3));
	} else {
		tmp = 2.0 * (t_1 * (t_2 * Math.sin(t_0)));
	}
	return angle_s * tmp;
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = (angle_m / 180.0) * math.pi
	t_1 = math.cos(t_0)
	t_2 = (a + b) * (b - a)
	t_3 = math.pi * t_2
	tmp = 0
	if (angle_m / 180.0) <= 1000.0:
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a))
	elif (angle_m / 180.0) <= 2e+52:
		tmp = 0.011111111111111112 * (angle_m * math.sqrt(math.pow(t_3, 2.0)))
	elif (angle_m / 180.0) <= 5e+82:
		tmp = t_1 * (0.011111111111111112 * (angle_m * t_3))
	else:
		tmp = 2.0 * (t_1 * (t_2 * math.sin(t_0)))
	return angle_s * tmp
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(Float64(angle_m / 180.0) * pi)
	t_1 = cos(t_0)
	t_2 = Float64(Float64(a + b) * Float64(b - a))
	t_3 = Float64(pi * t_2)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1000.0)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	elseif (Float64(angle_m / 180.0) <= 2e+52)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * sqrt((t_3 ^ 2.0))));
	elseif (Float64(angle_m / 180.0) <= 5e+82)
		tmp = Float64(t_1 * Float64(0.011111111111111112 * Float64(angle_m * t_3)));
	else
		tmp = Float64(2.0 * Float64(t_1 * Float64(t_2 * sin(t_0))));
	end
	return Float64(angle_s * tmp)
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = (angle_m / 180.0) * pi;
	t_1 = cos(t_0);
	t_2 = (a + b) * (b - a);
	t_3 = pi * t_2;
	tmp = 0.0;
	if ((angle_m / 180.0) <= 1000.0)
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a));
	elseif ((angle_m / 180.0) <= 2e+52)
		tmp = 0.011111111111111112 * (angle_m * sqrt((t_3 ^ 2.0)));
	elseif ((angle_m / 180.0) <= 5e+82)
		tmp = t_1 * (0.011111111111111112 * (angle_m * t_3));
	else
		tmp = 2.0 * (t_1 * (t_2 * sin(t_0)));
	end
	tmp_2 = angle_s * tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(Pi * t$95$2), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1000.0], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+52], N[(0.011111111111111112 * N[(angle$95$m * N[Sqrt[N[Power[t$95$3, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+82], N[(t$95$1 * N[(0.011111111111111112 * N[(angle$95$m * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[(t$95$2 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \frac{angle_m}{180} \cdot \pi\\
t_1 := \cos t_0\\
t_2 := \left(a + b\right) \cdot \left(b - a\right)\\
t_3 := \pi \cdot t_2\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 1000:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \sqrt{{t_3}^{2}}\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+82}:\\
\;\;\;\;t_1 \cdot \left(0.011111111111111112 \cdot \left(angle_m \cdot t_3\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(t_2 \cdot \sin t_0\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 angle 180) < 1e3

    1. Initial program 58.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow258.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares60.6%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u46.4%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef33.6%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*33.6%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative33.6%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr33.6%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def46.4%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p57.6%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*74.6%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative74.6%

        \[\leadsto \left(0.011111111111111112 \cdot \left(\left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(a + b\right)}\right) \cdot \left(b - a\right)\right)\right) \cdot 1 \]
    10. Simplified74.6%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 1e3 < (/.f64 angle 180) < 2e52

    1. Initial program 48.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow248.7%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares48.7%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. add-sqr-sqrt24.5%

        \[\leadsto \left(0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\left(\sqrt{\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)} \cdot \sqrt{\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)}\right)\right) \cdot 1 \]
      2. sqrt-unprod43.9%

        \[\leadsto \left(0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\sqrt{\left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)}}\right)\right) \cdot 1 \]
      3. pow243.9%

        \[\leadsto \left(0.011111111111111112 \cdot \left(angle \cdot \sqrt{\color{blue}{{\left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)}^{2}}}\right)\right) \cdot 1 \]
      4. *-commutative43.9%

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

        \[\leadsto \left(0.011111111111111112 \cdot \left(angle \cdot \sqrt{{\left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \cdot \pi\right)}^{2}}\right)\right) \cdot 1 \]
    8. Applied egg-rr43.9%

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

    if 2e52 < (/.f64 angle 180) < 5.00000000000000015e82

    1. Initial program 31.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow231.7%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares46.0%

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]

    if 5.00000000000000015e82 < (/.f64 angle 180)

    1. Initial program 29.1%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*29.1%

        \[\leadsto \color{blue}{\left(2 \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. associate-*l*29.1%

        \[\leadsto \color{blue}{2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    3. Simplified29.1%

      \[\leadsto \color{blue}{2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. unpow229.1%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares38.9%

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

      \[\leadsto 2 \cdot \left(\left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification68.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 1000:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+52}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \sqrt{{\left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)}^{2}}\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+82}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 66.4% accurate, 1.7× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \frac{angle_m}{180} \cdot \pi\\ t_1 := \sin t_0\\ t_2 := \cos t_0\\ t_3 := \left(a + b\right) \cdot \left(b - a\right)\\ t_4 := 2 \cdot t_3\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-75}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+66}:\\ \;\;\;\;t_2 \cdot \left(t_4 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+83}:\\ \;\;\;\;t_4 \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t_2 \cdot \left(t_3 \cdot t_1\right)\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (/ angle_m 180.0) PI))
        (t_1 (sin t_0))
        (t_2 (cos t_0))
        (t_3 (* (+ a b) (- b a)))
        (t_4 (* 2.0 t_3)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 2e-75)
      (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
      (if (<= (/ angle_m 180.0) 2e+66)
        (* t_2 (* t_4 (sin (* 0.005555555555555556 (* angle_m PI)))))
        (if (<= (/ angle_m 180.0) 5e+83)
          (* t_4 t_1)
          (* 2.0 (* t_2 (* t_3 t_1)))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * ((double) M_PI);
	double t_1 = sin(t_0);
	double t_2 = cos(t_0);
	double t_3 = (a + b) * (b - a);
	double t_4 = 2.0 * t_3;
	double tmp;
	if ((angle_m / 180.0) <= 2e-75) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+66) {
		tmp = t_2 * (t_4 * sin((0.005555555555555556 * (angle_m * ((double) M_PI)))));
	} else if ((angle_m / 180.0) <= 5e+83) {
		tmp = t_4 * t_1;
	} else {
		tmp = 2.0 * (t_2 * (t_3 * t_1));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * Math.PI;
	double t_1 = Math.sin(t_0);
	double t_2 = Math.cos(t_0);
	double t_3 = (a + b) * (b - a);
	double t_4 = 2.0 * t_3;
	double tmp;
	if ((angle_m / 180.0) <= 2e-75) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+66) {
		tmp = t_2 * (t_4 * Math.sin((0.005555555555555556 * (angle_m * Math.PI))));
	} else if ((angle_m / 180.0) <= 5e+83) {
		tmp = t_4 * t_1;
	} else {
		tmp = 2.0 * (t_2 * (t_3 * t_1));
	}
	return angle_s * tmp;
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = (angle_m / 180.0) * math.pi
	t_1 = math.sin(t_0)
	t_2 = math.cos(t_0)
	t_3 = (a + b) * (b - a)
	t_4 = 2.0 * t_3
	tmp = 0
	if (angle_m / 180.0) <= 2e-75:
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a))
	elif (angle_m / 180.0) <= 2e+66:
		tmp = t_2 * (t_4 * math.sin((0.005555555555555556 * (angle_m * math.pi))))
	elif (angle_m / 180.0) <= 5e+83:
		tmp = t_4 * t_1
	else:
		tmp = 2.0 * (t_2 * (t_3 * t_1))
	return angle_s * tmp
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(Float64(angle_m / 180.0) * pi)
	t_1 = sin(t_0)
	t_2 = cos(t_0)
	t_3 = Float64(Float64(a + b) * Float64(b - a))
	t_4 = Float64(2.0 * t_3)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e-75)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	elseif (Float64(angle_m / 180.0) <= 2e+66)
		tmp = Float64(t_2 * Float64(t_4 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))));
	elseif (Float64(angle_m / 180.0) <= 5e+83)
		tmp = Float64(t_4 * t_1);
	else
		tmp = Float64(2.0 * Float64(t_2 * Float64(t_3 * t_1)));
	end
	return Float64(angle_s * tmp)
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = (angle_m / 180.0) * pi;
	t_1 = sin(t_0);
	t_2 = cos(t_0);
	t_3 = (a + b) * (b - a);
	t_4 = 2.0 * t_3;
	tmp = 0.0;
	if ((angle_m / 180.0) <= 2e-75)
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a));
	elseif ((angle_m / 180.0) <= 2e+66)
		tmp = t_2 * (t_4 * sin((0.005555555555555556 * (angle_m * pi))));
	elseif ((angle_m / 180.0) <= 5e+83)
		tmp = t_4 * t_1;
	else
		tmp = 2.0 * (t_2 * (t_3 * t_1));
	end
	tmp_2 = angle_s * tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * t$95$3), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-75], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+66], N[(t$95$2 * N[(t$95$4 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+83], N[(t$95$4 * t$95$1), $MachinePrecision], N[(2.0 * N[(t$95$2 * N[(t$95$3 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \frac{angle_m}{180} \cdot \pi\\
t_1 := \sin t_0\\
t_2 := \cos t_0\\
t_3 := \left(a + b\right) \cdot \left(b - a\right)\\
t_4 := 2 \cdot t_3\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-75}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+66}:\\
\;\;\;\;t_2 \cdot \left(t_4 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+83}:\\
\;\;\;\;t_4 \cdot t_1\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \left(t_3 \cdot t_1\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 angle 180) < 1.9999999999999999e-75

    1. Initial program 56.2%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares58.3%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u45.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef32.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*32.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative32.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr32.1%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def45.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p55.4%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*73.3%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative73.3%

        \[\leadsto \left(0.011111111111111112 \cdot \left(\left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(a + b\right)}\right) \cdot \left(b - a\right)\right)\right) \cdot 1 \]
    10. Simplified73.3%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 1.9999999999999999e-75 < (/.f64 angle 180) < 1.99999999999999989e66

    1. Initial program 70.5%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow270.5%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares81.0%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]

    if 1.99999999999999989e66 < (/.f64 angle 180) < 5.00000000000000029e83

    1. Initial program 30.5%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow230.5%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares30.5%

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

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

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

    if 5.00000000000000029e83 < (/.f64 angle 180)

    1. Initial program 29.1%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*29.1%

        \[\leadsto \color{blue}{\left(2 \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. associate-*l*29.1%

        \[\leadsto \color{blue}{2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    3. Simplified29.1%

      \[\leadsto \color{blue}{2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. unpow229.1%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares38.9%

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

      \[\leadsto 2 \cdot \left(\left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification68.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-75}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+66}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+83}:\\ \;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 66.5% accurate, 1.7× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \frac{angle_m}{180} \cdot \pi\\ t_1 := \cos t_0\\ t_2 := 2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-75}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+66}:\\ \;\;\;\;t_1 \cdot \left(t_2 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+83}:\\ \;\;\;\;t_2 \cdot \sin t_0\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \left(t_2 \cdot \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (/ angle_m 180.0) PI))
        (t_1 (cos t_0))
        (t_2 (* 2.0 (* (+ a b) (- b a)))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 2e-75)
      (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
      (if (<= (/ angle_m 180.0) 2e+66)
        (* t_1 (* t_2 (sin (* 0.005555555555555556 (* angle_m PI)))))
        (if (<= (/ angle_m 180.0) 5e+83)
          (* t_2 (sin t_0))
          (* t_1 (* t_2 (sin (* PI (* angle_m 0.005555555555555556)))))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * ((double) M_PI);
	double t_1 = cos(t_0);
	double t_2 = 2.0 * ((a + b) * (b - a));
	double tmp;
	if ((angle_m / 180.0) <= 2e-75) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+66) {
		tmp = t_1 * (t_2 * sin((0.005555555555555556 * (angle_m * ((double) M_PI)))));
	} else if ((angle_m / 180.0) <= 5e+83) {
		tmp = t_2 * sin(t_0);
	} else {
		tmp = t_1 * (t_2 * sin((((double) M_PI) * (angle_m * 0.005555555555555556))));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * Math.PI;
	double t_1 = Math.cos(t_0);
	double t_2 = 2.0 * ((a + b) * (b - a));
	double tmp;
	if ((angle_m / 180.0) <= 2e-75) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+66) {
		tmp = t_1 * (t_2 * Math.sin((0.005555555555555556 * (angle_m * Math.PI))));
	} else if ((angle_m / 180.0) <= 5e+83) {
		tmp = t_2 * Math.sin(t_0);
	} else {
		tmp = t_1 * (t_2 * Math.sin((Math.PI * (angle_m * 0.005555555555555556))));
	}
	return angle_s * tmp;
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = (angle_m / 180.0) * math.pi
	t_1 = math.cos(t_0)
	t_2 = 2.0 * ((a + b) * (b - a))
	tmp = 0
	if (angle_m / 180.0) <= 2e-75:
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a))
	elif (angle_m / 180.0) <= 2e+66:
		tmp = t_1 * (t_2 * math.sin((0.005555555555555556 * (angle_m * math.pi))))
	elif (angle_m / 180.0) <= 5e+83:
		tmp = t_2 * math.sin(t_0)
	else:
		tmp = t_1 * (t_2 * math.sin((math.pi * (angle_m * 0.005555555555555556))))
	return angle_s * tmp
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(Float64(angle_m / 180.0) * pi)
	t_1 = cos(t_0)
	t_2 = Float64(2.0 * Float64(Float64(a + b) * Float64(b - a)))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e-75)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	elseif (Float64(angle_m / 180.0) <= 2e+66)
		tmp = Float64(t_1 * Float64(t_2 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))));
	elseif (Float64(angle_m / 180.0) <= 5e+83)
		tmp = Float64(t_2 * sin(t_0));
	else
		tmp = Float64(t_1 * Float64(t_2 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))));
	end
	return Float64(angle_s * tmp)
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = (angle_m / 180.0) * pi;
	t_1 = cos(t_0);
	t_2 = 2.0 * ((a + b) * (b - a));
	tmp = 0.0;
	if ((angle_m / 180.0) <= 2e-75)
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a));
	elseif ((angle_m / 180.0) <= 2e+66)
		tmp = t_1 * (t_2 * sin((0.005555555555555556 * (angle_m * pi))));
	elseif ((angle_m / 180.0) <= 5e+83)
		tmp = t_2 * sin(t_0);
	else
		tmp = t_1 * (t_2 * sin((pi * (angle_m * 0.005555555555555556))));
	end
	tmp_2 = angle_s * tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-75], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+66], N[(t$95$1 * N[(t$95$2 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+83], N[(t$95$2 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$2 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \frac{angle_m}{180} \cdot \pi\\
t_1 := \cos t_0\\
t_2 := 2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-75}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+66}:\\
\;\;\;\;t_1 \cdot \left(t_2 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+83}:\\
\;\;\;\;t_2 \cdot \sin t_0\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_2 \cdot \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 angle 180) < 1.9999999999999999e-75

    1. Initial program 56.2%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares58.3%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u45.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef32.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*32.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative32.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr32.1%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def45.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p55.4%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*73.3%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative73.3%

        \[\leadsto \left(0.011111111111111112 \cdot \left(\left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(a + b\right)}\right) \cdot \left(b - a\right)\right)\right) \cdot 1 \]
    10. Simplified73.3%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 1.9999999999999999e-75 < (/.f64 angle 180) < 1.99999999999999989e66

    1. Initial program 70.5%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow270.5%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares81.0%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]

    if 1.99999999999999989e66 < (/.f64 angle 180) < 5.00000000000000029e83

    1. Initial program 30.5%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow230.5%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares30.5%

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

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

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

    if 5.00000000000000029e83 < (/.f64 angle 180)

    1. Initial program 29.1%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares38.9%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    6. Step-by-step derivation
      1. *-commutative30.3%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. associate-*l*38.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      4. *-commutative38.3%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification68.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-75}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+66}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+83}:\\ \;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 66.5% accurate, 1.7× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \left(a + b\right) \cdot \left(b - a\right)\\ t_1 := 2 \cdot t_0\\ t_2 := \frac{angle_m}{180} \cdot \pi\\ t_3 := \cos t_2\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+17}:\\ \;\;\;\;\left(t_1 \cdot \sin t_2\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 7 \cdot 10^{+85}:\\ \;\;\;\;t_3 \cdot \left(0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot t_0\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_3 \cdot \left(t_1 \cdot \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (+ a b) (- b a)))
        (t_1 (* 2.0 t_0))
        (t_2 (* (/ angle_m 180.0) PI))
        (t_3 (cos t_2)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1e-33)
      (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
      (if (<= (/ angle_m 180.0) 1e+17)
        (* (* t_1 (sin t_2)) (cos (* 0.005555555555555556 (* angle_m PI))))
        (if (<= (/ angle_m 180.0) 7e+85)
          (* t_3 (* 0.011111111111111112 (* angle_m (* PI t_0))))
          (* t_3 (* t_1 (sin (* PI (* angle_m 0.005555555555555556)))))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (a + b) * (b - a);
	double t_1 = 2.0 * t_0;
	double t_2 = (angle_m / 180.0) * ((double) M_PI);
	double t_3 = cos(t_2);
	double tmp;
	if ((angle_m / 180.0) <= 1e-33) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else if ((angle_m / 180.0) <= 1e+17) {
		tmp = (t_1 * sin(t_2)) * cos((0.005555555555555556 * (angle_m * ((double) M_PI))));
	} else if ((angle_m / 180.0) <= 7e+85) {
		tmp = t_3 * (0.011111111111111112 * (angle_m * (((double) M_PI) * t_0)));
	} else {
		tmp = t_3 * (t_1 * sin((((double) M_PI) * (angle_m * 0.005555555555555556))));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (a + b) * (b - a);
	double t_1 = 2.0 * t_0;
	double t_2 = (angle_m / 180.0) * Math.PI;
	double t_3 = Math.cos(t_2);
	double tmp;
	if ((angle_m / 180.0) <= 1e-33) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else if ((angle_m / 180.0) <= 1e+17) {
		tmp = (t_1 * Math.sin(t_2)) * Math.cos((0.005555555555555556 * (angle_m * Math.PI)));
	} else if ((angle_m / 180.0) <= 7e+85) {
		tmp = t_3 * (0.011111111111111112 * (angle_m * (Math.PI * t_0)));
	} else {
		tmp = t_3 * (t_1 * Math.sin((Math.PI * (angle_m * 0.005555555555555556))));
	}
	return angle_s * tmp;
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = (a + b) * (b - a)
	t_1 = 2.0 * t_0
	t_2 = (angle_m / 180.0) * math.pi
	t_3 = math.cos(t_2)
	tmp = 0
	if (angle_m / 180.0) <= 1e-33:
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a))
	elif (angle_m / 180.0) <= 1e+17:
		tmp = (t_1 * math.sin(t_2)) * math.cos((0.005555555555555556 * (angle_m * math.pi)))
	elif (angle_m / 180.0) <= 7e+85:
		tmp = t_3 * (0.011111111111111112 * (angle_m * (math.pi * t_0)))
	else:
		tmp = t_3 * (t_1 * math.sin((math.pi * (angle_m * 0.005555555555555556))))
	return angle_s * tmp
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(Float64(a + b) * Float64(b - a))
	t_1 = Float64(2.0 * t_0)
	t_2 = Float64(Float64(angle_m / 180.0) * pi)
	t_3 = cos(t_2)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1e-33)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	elseif (Float64(angle_m / 180.0) <= 1e+17)
		tmp = Float64(Float64(t_1 * sin(t_2)) * cos(Float64(0.005555555555555556 * Float64(angle_m * pi))));
	elseif (Float64(angle_m / 180.0) <= 7e+85)
		tmp = Float64(t_3 * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_0))));
	else
		tmp = Float64(t_3 * Float64(t_1 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))));
	end
	return Float64(angle_s * tmp)
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = (a + b) * (b - a);
	t_1 = 2.0 * t_0;
	t_2 = (angle_m / 180.0) * pi;
	t_3 = cos(t_2);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 1e-33)
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a));
	elseif ((angle_m / 180.0) <= 1e+17)
		tmp = (t_1 * sin(t_2)) * cos((0.005555555555555556 * (angle_m * pi)));
	elseif ((angle_m / 180.0) <= 7e+85)
		tmp = t_3 * (0.011111111111111112 * (angle_m * (pi * t_0)));
	else
		tmp = t_3 * (t_1 * sin((pi * (angle_m * 0.005555555555555556))));
	end
	tmp_2 = angle_s * tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$2], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-33], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+17], N[(N[(t$95$1 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 7e+85], N[(t$95$3 * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[(t$95$1 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(b - a\right)\\
t_1 := 2 \cdot t_0\\
t_2 := \frac{angle_m}{180} \cdot \pi\\
t_3 := \cos t_2\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+17}:\\
\;\;\;\;\left(t_1 \cdot \sin t_2\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 7 \cdot 10^{+85}:\\
\;\;\;\;t_3 \cdot \left(0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot t_0\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_3 \cdot \left(t_1 \cdot \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 angle 180) < 1.0000000000000001e-33

    1. Initial program 57.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow257.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares59.6%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u46.2%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr33.1%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def46.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p56.7%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*74.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative74.1%

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

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 1.0000000000000001e-33 < (/.f64 angle 180) < 1e17

    1. Initial program 99.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow299.7%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares99.7%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \]

    if 1e17 < (/.f64 angle 180) < 7.0000000000000001e85

    1. Initial program 35.8%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow235.8%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares43.5%

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]

    if 7.0000000000000001e85 < (/.f64 angle 180)

    1. Initial program 28.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow228.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares38.3%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    6. Step-by-step derivation
      1. *-commutative31.8%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \color{blue}{\left(\pi \cdot angle\right)}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. *-commutative31.8%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. associate-*l*37.7%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification68.6%

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

Alternative 13: 65.0% accurate, 1.8× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \left(a + b\right) \cdot \left(b - a\right)\\ t_1 := \pi \cdot t_0\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 1000:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \sqrt{{t_1}^{2}}\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+82}:\\ \;\;\;\;\cos \left(\frac{angle_m}{180} \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(angle_m \cdot t_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot t_0\right) \cdot \sin \left(\frac{angle_m}{\frac{180}{\pi}}\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (+ a b) (- b a))) (t_1 (* PI t_0)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1000.0)
      (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
      (if (<= (/ angle_m 180.0) 2e+52)
        (* 0.011111111111111112 (* angle_m (sqrt (pow t_1 2.0))))
        (if (<= (/ angle_m 180.0) 5e+82)
          (*
           (cos (* (/ angle_m 180.0) PI))
           (* 0.011111111111111112 (* angle_m t_1)))
          (* (* 2.0 t_0) (sin (/ angle_m (/ 180.0 PI))))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (a + b) * (b - a);
	double t_1 = ((double) M_PI) * t_0;
	double tmp;
	if ((angle_m / 180.0) <= 1000.0) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+52) {
		tmp = 0.011111111111111112 * (angle_m * sqrt(pow(t_1, 2.0)));
	} else if ((angle_m / 180.0) <= 5e+82) {
		tmp = cos(((angle_m / 180.0) * ((double) M_PI))) * (0.011111111111111112 * (angle_m * t_1));
	} else {
		tmp = (2.0 * t_0) * sin((angle_m / (180.0 / ((double) M_PI))));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (a + b) * (b - a);
	double t_1 = Math.PI * t_0;
	double tmp;
	if ((angle_m / 180.0) <= 1000.0) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else if ((angle_m / 180.0) <= 2e+52) {
		tmp = 0.011111111111111112 * (angle_m * Math.sqrt(Math.pow(t_1, 2.0)));
	} else if ((angle_m / 180.0) <= 5e+82) {
		tmp = Math.cos(((angle_m / 180.0) * Math.PI)) * (0.011111111111111112 * (angle_m * t_1));
	} else {
		tmp = (2.0 * t_0) * Math.sin((angle_m / (180.0 / Math.PI)));
	}
	return angle_s * tmp;
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = (a + b) * (b - a)
	t_1 = math.pi * t_0
	tmp = 0
	if (angle_m / 180.0) <= 1000.0:
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a))
	elif (angle_m / 180.0) <= 2e+52:
		tmp = 0.011111111111111112 * (angle_m * math.sqrt(math.pow(t_1, 2.0)))
	elif (angle_m / 180.0) <= 5e+82:
		tmp = math.cos(((angle_m / 180.0) * math.pi)) * (0.011111111111111112 * (angle_m * t_1))
	else:
		tmp = (2.0 * t_0) * math.sin((angle_m / (180.0 / math.pi)))
	return angle_s * tmp
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(Float64(a + b) * Float64(b - a))
	t_1 = Float64(pi * t_0)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1000.0)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	elseif (Float64(angle_m / 180.0) <= 2e+52)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * sqrt((t_1 ^ 2.0))));
	elseif (Float64(angle_m / 180.0) <= 5e+82)
		tmp = Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * Float64(0.011111111111111112 * Float64(angle_m * t_1)));
	else
		tmp = Float64(Float64(2.0 * t_0) * sin(Float64(angle_m / Float64(180.0 / pi))));
	end
	return Float64(angle_s * tmp)
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = (a + b) * (b - a);
	t_1 = pi * t_0;
	tmp = 0.0;
	if ((angle_m / 180.0) <= 1000.0)
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a));
	elseif ((angle_m / 180.0) <= 2e+52)
		tmp = 0.011111111111111112 * (angle_m * sqrt((t_1 ^ 2.0)));
	elseif ((angle_m / 180.0) <= 5e+82)
		tmp = cos(((angle_m / 180.0) * pi)) * (0.011111111111111112 * (angle_m * t_1));
	else
		tmp = (2.0 * t_0) * sin((angle_m / (180.0 / pi)));
	end
	tmp_2 = angle_s * tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * t$95$0), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1000.0], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+52], N[(0.011111111111111112 * N[(angle$95$m * N[Sqrt[N[Power[t$95$1, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+82], N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(0.011111111111111112 * N[(angle$95$m * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * t$95$0), $MachinePrecision] * N[Sin[N[(angle$95$m / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(b - a\right)\\
t_1 := \pi \cdot t_0\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 1000:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \sqrt{{t_1}^{2}}\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+82}:\\
\;\;\;\;\cos \left(\frac{angle_m}{180} \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(angle_m \cdot t_1\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot t_0\right) \cdot \sin \left(\frac{angle_m}{\frac{180}{\pi}}\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 angle 180) < 1e3

    1. Initial program 58.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow258.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares60.6%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u46.4%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef33.6%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*33.6%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative33.6%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr33.6%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def46.4%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p57.6%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*74.6%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative74.6%

        \[\leadsto \left(0.011111111111111112 \cdot \left(\left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(a + b\right)}\right) \cdot \left(b - a\right)\right)\right) \cdot 1 \]
    10. Simplified74.6%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 1e3 < (/.f64 angle 180) < 2e52

    1. Initial program 48.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow248.7%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares48.7%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. add-sqr-sqrt24.5%

        \[\leadsto \left(0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\left(\sqrt{\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)} \cdot \sqrt{\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)}\right)\right) \cdot 1 \]
      2. sqrt-unprod43.9%

        \[\leadsto \left(0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\sqrt{\left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)}}\right)\right) \cdot 1 \]
      3. pow243.9%

        \[\leadsto \left(0.011111111111111112 \cdot \left(angle \cdot \sqrt{\color{blue}{{\left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)}^{2}}}\right)\right) \cdot 1 \]
      4. *-commutative43.9%

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

        \[\leadsto \left(0.011111111111111112 \cdot \left(angle \cdot \sqrt{{\left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \cdot \pi\right)}^{2}}\right)\right) \cdot 1 \]
    8. Applied egg-rr43.9%

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

    if 2e52 < (/.f64 angle 180) < 5.00000000000000015e82

    1. Initial program 31.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow231.7%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares46.0%

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]

    if 5.00000000000000015e82 < (/.f64 angle 180)

    1. Initial program 29.1%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares38.9%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \color{blue}{1} \]
    6. Step-by-step derivation
      1. associate-*r/39.8%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{\pi \cdot angle}{180}\right)}\right) \cdot 1 \]
      2. *-commutative39.8%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{angle \cdot \pi}}{180}\right)\right) \cdot 1 \]
      3. associate-/l*40.1%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{angle}{\frac{180}{\pi}}\right)}\right) \cdot 1 \]
  3. Recombined 4 regimes into one program.
  4. Final simplification68.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 1000:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+52}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \sqrt{{\left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)}^{2}}\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+82}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle}{\frac{180}{\pi}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 65.3% accurate, 3.4× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle_m}{180} \cdot \pi\right)\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= (/ angle_m 180.0) 1e-33)
    (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
    (* (* 2.0 (* (+ a b) (- b a))) (sin (* (/ angle_m 180.0) PI))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if ((angle_m / 180.0) <= 1e-33) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else {
		tmp = (2.0 * ((a + b) * (b - a))) * sin(((angle_m / 180.0) * ((double) M_PI)));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if ((angle_m / 180.0) <= 1e-33) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else {
		tmp = (2.0 * ((a + b) * (b - a))) * Math.sin(((angle_m / 180.0) * Math.PI));
	}
	return angle_s * tmp;
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if (angle_m / 180.0) <= 1e-33:
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a))
	else:
		tmp = (2.0 * ((a + b) * (b - a))) * math.sin(((angle_m / 180.0) * math.pi))
	return angle_s * tmp
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1e-33)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	else
		tmp = Float64(Float64(2.0 * Float64(Float64(a + b) * Float64(b - a))) * sin(Float64(Float64(angle_m / 180.0) * pi)));
	end
	return Float64(angle_s * tmp)
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if ((angle_m / 180.0) <= 1e-33)
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a));
	else
		tmp = (2.0 * ((a + b) * (b - a))) * sin(((angle_m / 180.0) * pi));
	end
	tmp_2 = angle_s * tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-33], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle_m}{180} \cdot \pi\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 angle 180) < 1.0000000000000001e-33

    1. Initial program 57.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow257.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares59.6%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u46.2%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr33.1%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def46.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p56.7%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*74.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative74.1%

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

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 1.0000000000000001e-33 < (/.f64 angle 180)

    1. Initial program 37.2%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares45.8%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification67.9%

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

Alternative 15: 65.3% accurate, 3.4× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-50}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle_m}{\frac{180}{\pi}}\right)\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= (/ angle_m 180.0) 2e-50)
    (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
    (* (* 2.0 (* (+ a b) (- b a))) (sin (/ angle_m (/ 180.0 PI)))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if ((angle_m / 180.0) <= 2e-50) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else {
		tmp = (2.0 * ((a + b) * (b - a))) * sin((angle_m / (180.0 / ((double) M_PI))));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if ((angle_m / 180.0) <= 2e-50) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else {
		tmp = (2.0 * ((a + b) * (b - a))) * Math.sin((angle_m / (180.0 / Math.PI)));
	}
	return angle_s * tmp;
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if (angle_m / 180.0) <= 2e-50:
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a))
	else:
		tmp = (2.0 * ((a + b) * (b - a))) * math.sin((angle_m / (180.0 / math.pi)))
	return angle_s * tmp
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e-50)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	else
		tmp = Float64(Float64(2.0 * Float64(Float64(a + b) * Float64(b - a))) * sin(Float64(angle_m / Float64(180.0 / pi))));
	end
	return Float64(angle_s * tmp)
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if ((angle_m / 180.0) <= 2e-50)
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a));
	else
		tmp = (2.0 * ((a + b) * (b - a))) * sin((angle_m / (180.0 / pi)));
	end
	tmp_2 = angle_s * tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-50], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-50}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle_m}{\frac{180}{\pi}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 angle 180) < 2.00000000000000002e-50

    1. Initial program 56.3%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares59.0%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u45.4%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef32.6%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*32.6%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative32.6%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr32.6%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def45.4%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p56.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*73.7%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative73.7%

        \[\leadsto \left(0.011111111111111112 \cdot \left(\left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(a + b\right)}\right) \cdot \left(b - a\right)\right)\right) \cdot 1 \]
    10. Simplified73.7%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 2.00000000000000002e-50 < (/.f64 angle 180)

    1. Initial program 40.2%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares48.4%

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \color{blue}{1} \]
    6. Step-by-step derivation
      1. associate-*r/47.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{\pi \cdot angle}{180}\right)}\right) \cdot 1 \]
      2. *-commutative47.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\color{blue}{angle \cdot \pi}}{180}\right)\right) \cdot 1 \]
      3. associate-/l*47.5%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{angle}{\frac{180}{\pi}}\right)}\right) \cdot 1 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification67.5%

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

Alternative 16: 64.6% accurate, 3.5× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \begin{array}{l} \mathbf{if}\;angle_m \leq 3.7 \cdot 10^{-73}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= angle_m 3.7e-73)
    (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
    (*
     (* 2.0 (* (+ a b) (- b a)))
     (sin (* 0.005555555555555556 (* angle_m PI)))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (angle_m <= 3.7e-73) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else {
		tmp = (2.0 * ((a + b) * (b - a))) * sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (angle_m <= 3.7e-73) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else {
		tmp = (2.0 * ((a + b) * (b - a))) * Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
	}
	return angle_s * tmp;
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if angle_m <= 3.7e-73:
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a))
	else:
		tmp = (2.0 * ((a + b) * (b - a))) * math.sin((0.005555555555555556 * (angle_m * math.pi)))
	return angle_s * tmp
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (angle_m <= 3.7e-73)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	else
		tmp = Float64(Float64(2.0 * Float64(Float64(a + b) * Float64(b - a))) * sin(Float64(0.005555555555555556 * Float64(angle_m * pi))));
	end
	return Float64(angle_s * tmp)
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (angle_m <= 3.7e-73)
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a));
	else
		tmp = (2.0 * ((a + b) * (b - a))) * sin((0.005555555555555556 * (angle_m * pi)));
	end
	tmp_2 = angle_s * tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 3.7e-73], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;angle_m \leq 3.7 \cdot 10^{-73}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 3.7000000000000001e-73

    1. Initial program 56.2%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares58.3%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u45.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef32.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*32.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative32.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr32.1%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def45.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p55.4%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*73.3%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative73.3%

        \[\leadsto \left(0.011111111111111112 \cdot \left(\left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(a + b\right)}\right) \cdot \left(b - a\right)\right)\right) \cdot 1 \]
    10. Simplified73.3%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 3.7000000000000001e-73 < angle

    1. Initial program 41.5%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow241.5%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares50.8%

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

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

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

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

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

Alternative 17: 65.5% accurate, 3.5× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \begin{array}{l} \mathbf{if}\;angle_m \leq 2 \cdot 10^{-22}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= angle_m 2e-22)
    (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
    (*
     (* 2.0 (* (+ a b) (- b a)))
     (sin (* PI (* angle_m 0.005555555555555556)))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (angle_m <= 2e-22) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
	} else {
		tmp = (2.0 * ((a + b) * (b - a))) * sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (angle_m <= 2e-22) {
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
	} else {
		tmp = (2.0 * ((a + b) * (b - a))) * Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
	}
	return angle_s * tmp;
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if angle_m <= 2e-22:
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a))
	else:
		tmp = (2.0 * ((a + b) * (b - a))) * math.sin((math.pi * (angle_m * 0.005555555555555556)))
	return angle_s * tmp
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (angle_m <= 2e-22)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)));
	else
		tmp = Float64(Float64(2.0 * Float64(Float64(a + b) * Float64(b - a))) * sin(Float64(pi * Float64(angle_m * 0.005555555555555556))));
	end
	return Float64(angle_s * tmp)
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (angle_m <= 2e-22)
		tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a));
	else
		tmp = (2.0 * ((a + b) * (b - a))) * sin((pi * (angle_m * 0.005555555555555556)));
	end
	tmp_2 = angle_s * tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 2e-22], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;angle_m \leq 2 \cdot 10^{-22}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 2.0000000000000001e-22

    1. Initial program 57.0%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow257.0%

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares59.6%

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

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

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

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
    7. Step-by-step derivation
      1. expm1-log1p-u46.2%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-udef33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
      3. associate-*r*33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
      4. +-commutative33.1%

        \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
    8. Applied egg-rr33.1%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    9. Step-by-step derivation
      1. expm1-def46.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
      2. expm1-log1p56.7%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
      3. associate-*r*74.1%

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
      4. +-commutative74.1%

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

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]

    if 2.0000000000000001e-22 < angle

    1. Initial program 37.2%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares45.8%

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

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot 1 \]
    7. Step-by-step derivation
      1. associate-*r*36.9%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
      2. *-commutative36.9%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right) \]
    8. Simplified41.3%

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right) \cdot 1 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.7%

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

Alternative 18: 53.6% accurate, 32.2× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \left(0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right) \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* 0.011111111111111112 (* angle_m (* PI (* (+ a b) (- b a)))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (angle_m * (((double) M_PI) * ((a + b) * (b - a)))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (angle_m * (Math.PI * ((a + b) * (b - a)))));
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (0.011111111111111112 * (angle_m * (math.pi * ((a + b) * (b - a)))))
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(a + b) * Float64(b - a))))))
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (0.011111111111111112 * (angle_m * (pi * ((a + b) * (b - a)))));
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle_s \cdot \left(0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.5%

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. unpow252.5%

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

      \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    3. difference-of-squares56.5%

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

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

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

    \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
  7. Final simplification51.7%

    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right) \]
  8. Add Preprocessing

Alternative 19: 61.5% accurate, 32.2× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \left(0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right) \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a)));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a)));
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a)))
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))))
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a)));
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle_s \cdot \left(0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.5%

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. unpow252.5%

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

      \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    3. difference-of-squares56.5%

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

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

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

    \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)} \cdot 1 \]
  7. Step-by-step derivation
    1. expm1-log1p-u40.2%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)}\right) \cdot 1 \]
    2. expm1-udef30.2%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
    3. associate-*r*30.2%

      \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right)} - 1\right)\right) \cdot 1 \]
    4. +-commutative30.2%

      \[\leadsto \left(0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right)} - 1\right)\right) \cdot 1 \]
  8. Applied egg-rr30.2%

    \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1 \]
  9. Step-by-step derivation
    1. expm1-def40.2%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot 1 \]
    2. expm1-log1p51.7%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}\right) \cdot 1 \]
    3. associate-*r*64.5%

      \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
    4. +-commutative64.5%

      \[\leadsto \left(0.011111111111111112 \cdot \left(\left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(a + b\right)}\right) \cdot \left(b - a\right)\right)\right) \cdot 1 \]
  10. Simplified64.5%

    \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)}\right) \cdot 1 \]
  11. Final simplification64.5%

    \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b - a\right)\right) \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024021 
(FPCore (a b angle)
  :name "ab-angle->ABCF B"
  :precision binary64
  (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0)))) (cos (* PI (/ angle 180.0)))))