ab-angle->ABCF B

Percentage Accurate: 53.3% → 66.0%
Time: 43.4s
Alternatives: 18
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 18 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.3% 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.0% accurate, 0.6× 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(b + a\right) \cdot \left(b - a\right)\right)\\ t_1 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+41}:\\ \;\;\;\;\left(\left(t_1 \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle_m \cdot \frac{\sqrt[3]{{\pi}^{3}}}{180}\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+105}:\\ \;\;\;\;t_0 \cdot \left(-2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot {angle_m}^{3}\right) + 0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+133}:\\ \;\;\;\;t_0 \cdot \sqrt{{t_1}^{2}}\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+238}:\\ \;\;\;\;t_0 \cdot \sin \left(\frac{angle_m \cdot \pi}{180}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t_0 \cdot \sin \left({\left({\left(\sqrt[3]{\sqrt[3]{angle_m}}\right)}^{2}\right)}^{3} \cdot \left(\sqrt[3]{angle_m} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\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 (* (+ b a) (- b a))))
        (t_1 (sin (* PI (* angle_m 0.005555555555555556)))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 2e+41)
      (*
       (* (* t_1 (* 2.0 (+ b a))) (- b a))
       (cos (* angle_m (/ (cbrt (pow PI 3.0)) 180.0))))
      (if (<= (/ angle_m 180.0) 4e+105)
        (*
         t_0
         (+
          (* -2.8577960676726107e-8 (* (pow PI 3.0) (pow angle_m 3.0)))
          (* 0.005555555555555556 (* angle_m PI))))
        (if (<= (/ angle_m 180.0) 2e+133)
          (* t_0 (sqrt (pow t_1 2.0)))
          (if (<= (/ angle_m 180.0) 2e+238)
            (* t_0 (sin (/ (* angle_m PI) 180.0)))
            (*
             (*
              t_0
              (sin
               (*
                (pow (pow (cbrt (cbrt angle_m)) 2.0) 3.0)
                (* (cbrt angle_m) (* PI 0.005555555555555556)))))
             (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 * ((b + a) * (b - a));
	double t_1 = sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
	double tmp;
	if ((angle_m / 180.0) <= 2e+41) {
		tmp = ((t_1 * (2.0 * (b + a))) * (b - a)) * cos((angle_m * (cbrt(pow(((double) M_PI), 3.0)) / 180.0)));
	} else if ((angle_m / 180.0) <= 4e+105) {
		tmp = t_0 * ((-2.8577960676726107e-8 * (pow(((double) M_PI), 3.0) * pow(angle_m, 3.0))) + (0.005555555555555556 * (angle_m * ((double) M_PI))));
	} else if ((angle_m / 180.0) <= 2e+133) {
		tmp = t_0 * sqrt(pow(t_1, 2.0));
	} else if ((angle_m / 180.0) <= 2e+238) {
		tmp = t_0 * sin(((angle_m * ((double) M_PI)) / 180.0));
	} else {
		tmp = (t_0 * sin((pow(pow(cbrt(cbrt(angle_m)), 2.0), 3.0) * (cbrt(angle_m) * (((double) M_PI) * 0.005555555555555556))))) * 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 * ((b + a) * (b - a));
	double t_1 = Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
	double tmp;
	if ((angle_m / 180.0) <= 2e+41) {
		tmp = ((t_1 * (2.0 * (b + a))) * (b - a)) * Math.cos((angle_m * (Math.cbrt(Math.pow(Math.PI, 3.0)) / 180.0)));
	} else if ((angle_m / 180.0) <= 4e+105) {
		tmp = t_0 * ((-2.8577960676726107e-8 * (Math.pow(Math.PI, 3.0) * Math.pow(angle_m, 3.0))) + (0.005555555555555556 * (angle_m * Math.PI)));
	} else if ((angle_m / 180.0) <= 2e+133) {
		tmp = t_0 * Math.sqrt(Math.pow(t_1, 2.0));
	} else if ((angle_m / 180.0) <= 2e+238) {
		tmp = t_0 * Math.sin(((angle_m * Math.PI) / 180.0));
	} else {
		tmp = (t_0 * Math.sin((Math.pow(Math.pow(Math.cbrt(Math.cbrt(angle_m)), 2.0), 3.0) * (Math.cbrt(angle_m) * (Math.PI * 0.005555555555555556))))) * 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(b + a) * Float64(b - a)))
	t_1 = sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e+41)
		tmp = Float64(Float64(Float64(t_1 * Float64(2.0 * Float64(b + a))) * Float64(b - a)) * cos(Float64(angle_m * Float64(cbrt((pi ^ 3.0)) / 180.0))));
	elseif (Float64(angle_m / 180.0) <= 4e+105)
		tmp = Float64(t_0 * Float64(Float64(-2.8577960676726107e-8 * Float64((pi ^ 3.0) * (angle_m ^ 3.0))) + Float64(0.005555555555555556 * Float64(angle_m * pi))));
	elseif (Float64(angle_m / 180.0) <= 2e+133)
		tmp = Float64(t_0 * sqrt((t_1 ^ 2.0)));
	elseif (Float64(angle_m / 180.0) <= 2e+238)
		tmp = Float64(t_0 * sin(Float64(Float64(angle_m * pi) / 180.0)));
	else
		tmp = Float64(Float64(t_0 * sin(Float64(((cbrt(cbrt(angle_m)) ^ 2.0) ^ 3.0) * Float64(cbrt(angle_m) * Float64(pi * 0.005555555555555556))))) * 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[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+41], N[(N[(N[(t$95$1 * N[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+105], N[(t$95$0 * N[(N[(-2.8577960676726107e-8 * N[(N[Power[Pi, 3.0], $MachinePrecision] * N[Power[angle$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+133], N[(t$95$0 * N[Sqrt[N[Power[t$95$1, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+238], N[(t$95$0 * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[Sin[N[(N[Power[N[Power[N[Power[N[Power[angle$95$m, 1/3], $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision], 3.0], $MachinePrecision] * N[(N[Power[angle$95$m, 1/3], $MachinePrecision] * N[(Pi * 0.005555555555555556), $MachinePrecision]), $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(b + a\right) \cdot \left(b - a\right)\right)\\
t_1 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+41}:\\
\;\;\;\;\left(\left(t_1 \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle_m \cdot \frac{\sqrt[3]{{\pi}^{3}}}{180}\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+105}:\\
\;\;\;\;t_0 \cdot \left(-2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot {angle_m}^{3}\right) + 0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+133}:\\
\;\;\;\;t_0 \cdot \sqrt{{t_1}^{2}}\\

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

\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \sin \left({\left({\left(\sqrt[3]{\sqrt[3]{angle_m}}\right)}^{2}\right)}^{3} \cdot \left(\sqrt[3]{angle_m} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \cos \left(\frac{angle_m}{180} \cdot \pi\right)\\


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

    1. Initial program 64.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. add-sqr-sqrt32.2%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod30.8%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow230.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000001e41 < (/.f64 angle 180) < 3.9999999999999998e105

    1. Initial program 22.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. unpow222.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. unpow222.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-squares29.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-rr29.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 29.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 45.4%

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left({angle}^{3} \cdot {\pi}^{3}\right) + 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot 1 \]

    if 3.9999999999999998e105 < (/.f64 angle 180) < 2e133

    1. Initial program 52.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. unpow252.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. unpow252.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-squares52.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-rr52.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 24.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 \color{blue}{1} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt13.9%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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 1 \]
      2. sqrt-unprod50.5%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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 1 \]
      3. pow250.5%

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

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

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

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

    if 2e133 < (/.f64 angle 180) < 2.0000000000000001e238

    1. Initial program 27.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. unpow227.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. unpow227.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-squares27.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-rr27.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. Step-by-step derivation
      1. associate-*r/27.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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    6. Applied egg-rr27.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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    7. Taylor expanded in angle around 0 47.9%

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

    if 2.0000000000000001e238 < (/.f64 angle 180)

    1. Initial program 13.6%

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

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

        \[\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-squares13.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-rr13.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. associate-*r/21.6%

        \[\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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    6. Applied egg-rr21.6%

      \[\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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    7. Step-by-step derivation
      1. div-inv16.7%

        \[\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 \frac{1}{180}\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. *-commutative16.7%

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

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

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

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

        \[\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 \sqrt[3]{angle}\right) \cdot \left(\sqrt[3]{angle} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      7. cbrt-unprod0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 66.8% 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 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\ t_1 := \frac{angle_m}{180} \cdot \pi\\ t_2 := \left(\sin t_0 \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\cos t_1 \cdot \left(\sin t_1 \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \leq -1 \cdot 10^{-99}:\\ \;\;\;\;t_2 \cdot \cos \left(angle_m \cdot \frac{\sqrt[3]{{\pi}^{3}}}{180}\right)\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \log \left(e^{\cos 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 (* PI (* angle_m 0.005555555555555556)))
        (t_1 (* (/ angle_m 180.0) PI))
        (t_2 (* (* (sin t_0) (* 2.0 (+ b a))) (- b a))))
   (*
    angle_s
    (if (<=
         (* (cos t_1) (* (sin t_1) (* 2.0 (- (pow b 2.0) (pow a 2.0)))))
         -1e-99)
      (* t_2 (cos (* angle_m (/ (cbrt (pow PI 3.0)) 180.0))))
      (* t_2 (log (exp (cos 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 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double t_1 = (angle_m / 180.0) * ((double) M_PI);
	double t_2 = (sin(t_0) * (2.0 * (b + a))) * (b - a);
	double tmp;
	if ((cos(t_1) * (sin(t_1) * (2.0 * (pow(b, 2.0) - pow(a, 2.0))))) <= -1e-99) {
		tmp = t_2 * cos((angle_m * (cbrt(pow(((double) M_PI), 3.0)) / 180.0)));
	} else {
		tmp = t_2 * log(exp(cos(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.PI * (angle_m * 0.005555555555555556);
	double t_1 = (angle_m / 180.0) * Math.PI;
	double t_2 = (Math.sin(t_0) * (2.0 * (b + a))) * (b - a);
	double tmp;
	if ((Math.cos(t_1) * (Math.sin(t_1) * (2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))))) <= -1e-99) {
		tmp = t_2 * Math.cos((angle_m * (Math.cbrt(Math.pow(Math.PI, 3.0)) / 180.0)));
	} else {
		tmp = t_2 * Math.log(Math.exp(Math.cos(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(pi * Float64(angle_m * 0.005555555555555556))
	t_1 = Float64(Float64(angle_m / 180.0) * pi)
	t_2 = Float64(Float64(sin(t_0) * Float64(2.0 * Float64(b + a))) * Float64(b - a))
	tmp = 0.0
	if (Float64(cos(t_1) * Float64(sin(t_1) * Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))))) <= -1e-99)
		tmp = Float64(t_2 * cos(Float64(angle_m * Float64(cbrt((pi ^ 3.0)) / 180.0))));
	else
		tmp = Float64(t_2 * log(exp(cos(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[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[Sin[t$95$1], $MachinePrecision] * N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-99], N[(t$95$2 * N[Cos[N[(angle$95$m * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Log[N[Exp[N[Cos[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 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\
t_1 := \frac{angle_m}{180} \cdot \pi\\
t_2 := \left(\sin t_0 \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\cos t_1 \cdot \left(\sin t_1 \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \leq -1 \cdot 10^{-99}:\\
\;\;\;\;t_2 \cdot \cos \left(angle_m \cdot \frac{\sqrt[3]{{\pi}^{3}}}{180}\right)\\

\mathbf{else}:\\
\;\;\;\;t_2 \cdot \log \left(e^{\cos t_0}\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) < -1e-99

    1. Initial program 53.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. add-sqr-sqrt8.4%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod14.7%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow214.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e-99 < (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))

    1. Initial program 57.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. add-sqr-sqrt41.2%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod38.8%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow238.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\log \left(e^{\cos \left(\pi \cdot \frac{angle}{180}\right)}\right)} \]
      2. div-inv68.8%

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

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

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

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

Alternative 3: 66.8% 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 := 2 \cdot \left(b + a\right)\\ t_1 := \frac{angle_m}{180} \cdot \pi\\ t_2 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\cos t_1 \cdot \left(\sin t_1 \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \leq -5 \cdot 10^{+30}:\\ \;\;\;\;\cos \left(angle_m \cdot \frac{\pi}{180}\right) \cdot \left(\left(b - a\right) \cdot \left(t_0 \cdot \sin \left(\left(angle_m \cdot 0.005555555555555556\right) \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\sin t_2 \cdot t_0\right) \cdot \left(b - a\right)\right) \cdot \log \left(e^{\cos t_2}\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 (+ b a)))
        (t_1 (* (/ angle_m 180.0) PI))
        (t_2 (* PI (* angle_m 0.005555555555555556))))
   (*
    angle_s
    (if (<=
         (* (cos t_1) (* (sin t_1) (* 2.0 (- (pow b 2.0) (pow a 2.0)))))
         -5e+30)
      (*
       (cos (* angle_m (/ PI 180.0)))
       (*
        (- b a)
        (*
         t_0
         (sin (* (* angle_m 0.005555555555555556) (cbrt (pow PI 3.0)))))))
      (* (* (* (sin t_2) t_0) (- b a)) (log (exp (cos 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 = 2.0 * (b + a);
	double t_1 = (angle_m / 180.0) * ((double) M_PI);
	double t_2 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double tmp;
	if ((cos(t_1) * (sin(t_1) * (2.0 * (pow(b, 2.0) - pow(a, 2.0))))) <= -5e+30) {
		tmp = cos((angle_m * (((double) M_PI) / 180.0))) * ((b - a) * (t_0 * sin(((angle_m * 0.005555555555555556) * cbrt(pow(((double) M_PI), 3.0))))));
	} else {
		tmp = ((sin(t_2) * t_0) * (b - a)) * log(exp(cos(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 = 2.0 * (b + a);
	double t_1 = (angle_m / 180.0) * Math.PI;
	double t_2 = Math.PI * (angle_m * 0.005555555555555556);
	double tmp;
	if ((Math.cos(t_1) * (Math.sin(t_1) * (2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))))) <= -5e+30) {
		tmp = Math.cos((angle_m * (Math.PI / 180.0))) * ((b - a) * (t_0 * Math.sin(((angle_m * 0.005555555555555556) * Math.cbrt(Math.pow(Math.PI, 3.0))))));
	} else {
		tmp = ((Math.sin(t_2) * t_0) * (b - a)) * Math.log(Math.exp(Math.cos(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(2.0 * Float64(b + a))
	t_1 = Float64(Float64(angle_m / 180.0) * pi)
	t_2 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	tmp = 0.0
	if (Float64(cos(t_1) * Float64(sin(t_1) * Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))))) <= -5e+30)
		tmp = Float64(cos(Float64(angle_m * Float64(pi / 180.0))) * Float64(Float64(b - a) * Float64(t_0 * sin(Float64(Float64(angle_m * 0.005555555555555556) * cbrt((pi ^ 3.0)))))));
	else
		tmp = Float64(Float64(Float64(sin(t_2) * t_0) * Float64(b - a)) * log(exp(cos(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[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[Sin[t$95$1], $MachinePrecision] * N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e+30], N[(N[Cos[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(t$95$0 * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sin[t$95$2], $MachinePrecision] * t$95$0), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Log[N[Exp[N[Cos[t$95$2], $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 := 2 \cdot \left(b + a\right)\\
t_1 := \frac{angle_m}{180} \cdot \pi\\
t_2 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\cos t_1 \cdot \left(\sin t_1 \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \leq -5 \cdot 10^{+30}:\\
\;\;\;\;\cos \left(angle_m \cdot \frac{\pi}{180}\right) \cdot \left(\left(b - a\right) \cdot \left(t_0 \cdot \sin \left(\left(angle_m \cdot 0.005555555555555556\right) \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(\sin t_2 \cdot t_0\right) \cdot \left(b - a\right)\right) \cdot \log \left(e^{\cos t_2}\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) < -4.9999999999999998e30

    1. Initial program 49.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. add-sqr-sqrt9.1%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod16.0%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow216.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999998e30 < (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))

    1. Initial program 59.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. add-sqr-sqrt38.9%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod36.7%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow236.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\log \left(e^{\cos \left(\pi \cdot \frac{angle}{180}\right)}\right)} \]
      2. div-inv69.6%

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

        \[\leadsto \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \log \left(e^{\cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right)}\right) \]
    8. Applied egg-rr69.6%

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

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

Alternative 4: 66.7% accurate, 0.8× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\ t_1 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\ t_2 := \frac{angle_m}{180} \cdot \pi\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+38}:\\ \;\;\;\;\left(\left(\sin t_0 \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle_m \cdot \frac{\sqrt[3]{{\pi}^{3}}}{180}\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+108}:\\ \;\;\;\;t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+131}:\\ \;\;\;\;\left(t_1 \cdot \sin t_2\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 1.5 \cdot 10^{+228}:\\ \;\;\;\;t_1 \cdot \sin \left({\left(\sqrt{t_0}\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos t_2 \cdot \left(t_1 \cdot \sin \left(\left(\sqrt[3]{angle_m} \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot {\left(\sqrt[3]{angle_m}\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 (* PI (* angle_m 0.005555555555555556)))
        (t_1 (* 2.0 (* (+ b a) (- b a))))
        (t_2 (* (/ angle_m 180.0) PI)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 2e+38)
      (*
       (* (* (sin t_0) (* 2.0 (+ b a))) (- b a))
       (cos (* angle_m (/ (cbrt (pow PI 3.0)) 180.0))))
      (if (<= (/ angle_m 180.0) 5e+108)
        (* t_1 (sin (* 0.005555555555555556 (* angle_m PI))))
        (if (<= (/ angle_m 180.0) 5e+131)
          (* (* t_1 (sin t_2)) (cos (expm1 (log1p t_0))))
          (if (<= (/ angle_m 180.0) 1.5e+228)
            (* t_1 (sin (pow (sqrt t_0) 2.0)))
            (*
             (cos t_2)
             (*
              t_1
              (sin
               (*
                (* (cbrt angle_m) (* PI 0.005555555555555556))
                (pow (cbrt angle_m) 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 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double t_1 = 2.0 * ((b + a) * (b - a));
	double t_2 = (angle_m / 180.0) * ((double) M_PI);
	double tmp;
	if ((angle_m / 180.0) <= 2e+38) {
		tmp = ((sin(t_0) * (2.0 * (b + a))) * (b - a)) * cos((angle_m * (cbrt(pow(((double) M_PI), 3.0)) / 180.0)));
	} else if ((angle_m / 180.0) <= 5e+108) {
		tmp = t_1 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	} else if ((angle_m / 180.0) <= 5e+131) {
		tmp = (t_1 * sin(t_2)) * cos(expm1(log1p(t_0)));
	} else if ((angle_m / 180.0) <= 1.5e+228) {
		tmp = t_1 * sin(pow(sqrt(t_0), 2.0));
	} else {
		tmp = cos(t_2) * (t_1 * sin(((cbrt(angle_m) * (((double) M_PI) * 0.005555555555555556)) * pow(cbrt(angle_m), 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.PI * (angle_m * 0.005555555555555556);
	double t_1 = 2.0 * ((b + a) * (b - a));
	double t_2 = (angle_m / 180.0) * Math.PI;
	double tmp;
	if ((angle_m / 180.0) <= 2e+38) {
		tmp = ((Math.sin(t_0) * (2.0 * (b + a))) * (b - a)) * Math.cos((angle_m * (Math.cbrt(Math.pow(Math.PI, 3.0)) / 180.0)));
	} else if ((angle_m / 180.0) <= 5e+108) {
		tmp = t_1 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
	} else if ((angle_m / 180.0) <= 5e+131) {
		tmp = (t_1 * Math.sin(t_2)) * Math.cos(Math.expm1(Math.log1p(t_0)));
	} else if ((angle_m / 180.0) <= 1.5e+228) {
		tmp = t_1 * Math.sin(Math.pow(Math.sqrt(t_0), 2.0));
	} else {
		tmp = Math.cos(t_2) * (t_1 * Math.sin(((Math.cbrt(angle_m) * (Math.PI * 0.005555555555555556)) * Math.pow(Math.cbrt(angle_m), 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(pi * Float64(angle_m * 0.005555555555555556))
	t_1 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a)))
	t_2 = Float64(Float64(angle_m / 180.0) * pi)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e+38)
		tmp = Float64(Float64(Float64(sin(t_0) * Float64(2.0 * Float64(b + a))) * Float64(b - a)) * cos(Float64(angle_m * Float64(cbrt((pi ^ 3.0)) / 180.0))));
	elseif (Float64(angle_m / 180.0) <= 5e+108)
		tmp = Float64(t_1 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi))));
	elseif (Float64(angle_m / 180.0) <= 5e+131)
		tmp = Float64(Float64(t_1 * sin(t_2)) * cos(expm1(log1p(t_0))));
	elseif (Float64(angle_m / 180.0) <= 1.5e+228)
		tmp = Float64(t_1 * sin((sqrt(t_0) ^ 2.0)));
	else
		tmp = Float64(cos(t_2) * Float64(t_1 * sin(Float64(Float64(cbrt(angle_m) * Float64(pi * 0.005555555555555556)) * (cbrt(angle_m) ^ 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[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+38], N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+108], N[(t$95$1 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+131], N[(N[(t$95$1 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1.5e+228], N[(t$95$1 * N[Sin[N[Power[N[Sqrt[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$2], $MachinePrecision] * N[(t$95$1 * N[Sin[N[(N[(N[Power[angle$95$m, 1/3], $MachinePrecision] * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision] * N[Power[N[Power[angle$95$m, 1/3], $MachinePrecision], 2.0], $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 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\
t_1 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_2 := \frac{angle_m}{180} \cdot \pi\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+38}:\\
\;\;\;\;\left(\left(\sin t_0 \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle_m \cdot \frac{\sqrt[3]{{\pi}^{3}}}{180}\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+108}:\\
\;\;\;\;t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+131}:\\
\;\;\;\;\left(t_1 \cdot \sin t_2\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 1.5 \cdot 10^{+228}:\\
\;\;\;\;t_1 \cdot \sin \left({\left(\sqrt{t_0}\right)}^{2}\right)\\

\mathbf{else}:\\
\;\;\;\;\cos t_2 \cdot \left(t_1 \cdot \sin \left(\left(\sqrt[3]{angle_m} \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot {\left(\sqrt[3]{angle_m}\right)}^{2}\right)\right)\\


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

    1. Initial program 64.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. add-sqr-sqrt32.2%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod30.8%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow230.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999995e38 < (/.f64 angle 180) < 4.99999999999999991e108

    1. Initial program 26.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. unpow226.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. unpow226.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-squares31.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-rr31.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 25.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 \color{blue}{1} \]
    6. Taylor expanded in angle around 0 38.7%

      \[\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 1 \]

    if 4.99999999999999991e108 < (/.f64 angle 180) < 4.99999999999999995e131

    1. Initial program 59.6%

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

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

        \[\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. Step-by-step derivation
      1. div-inv59.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(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right) \]
      2. metadata-eval59.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(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. expm1-log1p-u76.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(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)} \]
    6. Applied egg-rr76.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(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)} \]

    if 4.99999999999999995e131 < (/.f64 angle 180) < 1.5000000000000001e228

    1. Initial program 13.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. unpow213.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. unpow213.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-squares13.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-rr13.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 31.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. div-inv31.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(angle \cdot \frac{1}{180}\right)}\right)\right) \cdot 1 \]
      2. metadata-eval31.7%

        \[\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 1 \]
      3. add-sqr-sqrt38.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 1 \]
      4. pow238.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 1 \]
    7. Applied egg-rr38.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 1 \]

    if 1.5000000000000001e228 < (/.f64 angle 180)

    1. Initial program 26.6%

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

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

        \[\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-squares26.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-rr26.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. Step-by-step derivation
      1. associate-*r/26.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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    6. Applied egg-rr26.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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    7. Step-by-step derivation
      1. div-inv28.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 \frac{1}{180}\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. *-commutative28.8%

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\color{blue}{\left(\left(\sqrt[3]{angle} \cdot \sqrt[3]{angle}\right) \cdot \sqrt[3]{angle}\right)} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      6. associate-*l*38.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 \sqrt[3]{angle}\right) \cdot \left(\sqrt[3]{angle} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      7. cbrt-unprod0.0%

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

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

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

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt[3]{{angle}^{2}}\right)} - 1\right)} \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \sqrt[3]{angle}\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. unpow20.0%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt[3]{angle} \cdot \sqrt[3]{angle}}\right)} - 1\right) \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \sqrt[3]{angle}\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      5. pow237.2%

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\color{blue}{\left(e^{\mathsf{log1p}\left({\left(\sqrt[3]{angle}\right)}^{2}\right)} - 1\right)} \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \sqrt[3]{angle}\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    13. Step-by-step derivation
      1. expm1-def38.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{+38}:\\ \;\;\;\;\left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{180}\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+108}:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+131}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 1.5 \cdot 10^{+228}:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \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(\pi \cdot 0.005555555555555556\right)\right) \cdot {\left(\sqrt[3]{angle}\right)}^{2}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 66.5% 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 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\ t_1 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\ t_2 := \frac{angle_m}{180} \cdot \pi\\ t_3 := \sin t_0\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+38}:\\ \;\;\;\;\left(\left(t_3 \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{angle_m \cdot \pi}}\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+108}:\\ \;\;\;\;t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+133}:\\ \;\;\;\;\left(t_1 \cdot \sin t_2\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+200}:\\ \;\;\;\;t_1 \cdot \sin \left({\left(\sqrt[3]{t_0}\right)}^{3}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos t_2 \cdot \sqrt{{\left(t_3 \cdot t_1\right)}^{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 (* PI (* angle_m 0.005555555555555556)))
        (t_1 (* 2.0 (* (+ b a) (- b a))))
        (t_2 (* (/ angle_m 180.0) PI))
        (t_3 (sin t_0)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 2e+38)
      (*
       (* (* t_3 (* 2.0 (+ b a))) (- b a))
       (cos (/ 1.0 (/ 180.0 (* angle_m PI)))))
      (if (<= (/ angle_m 180.0) 5e+108)
        (* t_1 (sin (* 0.005555555555555556 (* angle_m PI))))
        (if (<= (/ angle_m 180.0) 1e+133)
          (* (* t_1 (sin t_2)) (cos (expm1 (log1p t_0))))
          (if (<= (/ angle_m 180.0) 1e+200)
            (* t_1 (sin (pow (cbrt t_0) 3.0)))
            (* (cos t_2) (sqrt (pow (* t_3 t_1) 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 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double t_1 = 2.0 * ((b + a) * (b - a));
	double t_2 = (angle_m / 180.0) * ((double) M_PI);
	double t_3 = sin(t_0);
	double tmp;
	if ((angle_m / 180.0) <= 2e+38) {
		tmp = ((t_3 * (2.0 * (b + a))) * (b - a)) * cos((1.0 / (180.0 / (angle_m * ((double) M_PI)))));
	} else if ((angle_m / 180.0) <= 5e+108) {
		tmp = t_1 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	} else if ((angle_m / 180.0) <= 1e+133) {
		tmp = (t_1 * sin(t_2)) * cos(expm1(log1p(t_0)));
	} else if ((angle_m / 180.0) <= 1e+200) {
		tmp = t_1 * sin(pow(cbrt(t_0), 3.0));
	} else {
		tmp = cos(t_2) * sqrt(pow((t_3 * t_1), 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.PI * (angle_m * 0.005555555555555556);
	double t_1 = 2.0 * ((b + a) * (b - a));
	double t_2 = (angle_m / 180.0) * Math.PI;
	double t_3 = Math.sin(t_0);
	double tmp;
	if ((angle_m / 180.0) <= 2e+38) {
		tmp = ((t_3 * (2.0 * (b + a))) * (b - a)) * Math.cos((1.0 / (180.0 / (angle_m * Math.PI))));
	} else if ((angle_m / 180.0) <= 5e+108) {
		tmp = t_1 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
	} else if ((angle_m / 180.0) <= 1e+133) {
		tmp = (t_1 * Math.sin(t_2)) * Math.cos(Math.expm1(Math.log1p(t_0)));
	} else if ((angle_m / 180.0) <= 1e+200) {
		tmp = t_1 * Math.sin(Math.pow(Math.cbrt(t_0), 3.0));
	} else {
		tmp = Math.cos(t_2) * Math.sqrt(Math.pow((t_3 * t_1), 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(pi * Float64(angle_m * 0.005555555555555556))
	t_1 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a)))
	t_2 = Float64(Float64(angle_m / 180.0) * pi)
	t_3 = sin(t_0)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e+38)
		tmp = Float64(Float64(Float64(t_3 * Float64(2.0 * Float64(b + a))) * Float64(b - a)) * cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * pi)))));
	elseif (Float64(angle_m / 180.0) <= 5e+108)
		tmp = Float64(t_1 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi))));
	elseif (Float64(angle_m / 180.0) <= 1e+133)
		tmp = Float64(Float64(t_1 * sin(t_2)) * cos(expm1(log1p(t_0))));
	elseif (Float64(angle_m / 180.0) <= 1e+200)
		tmp = Float64(t_1 * sin((cbrt(t_0) ^ 3.0)));
	else
		tmp = Float64(cos(t_2) * sqrt((Float64(t_3 * t_1) ^ 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[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+38], N[(N[(N[(t$95$3 * N[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+108], N[(t$95$1 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+133], N[(N[(t$95$1 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+200], N[(t$95$1 * N[Sin[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$2], $MachinePrecision] * N[Sqrt[N[Power[N[(t$95$3 * t$95$1), $MachinePrecision], 2.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 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\
t_1 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_2 := \frac{angle_m}{180} \cdot \pi\\
t_3 := \sin t_0\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+38}:\\
\;\;\;\;\left(\left(t_3 \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{angle_m \cdot \pi}}\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+108}:\\
\;\;\;\;t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+133}:\\
\;\;\;\;\left(t_1 \cdot \sin t_2\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+200}:\\
\;\;\;\;t_1 \cdot \sin \left({\left(\sqrt[3]{t_0}\right)}^{3}\right)\\

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


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

    1. Initial program 64.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. add-sqr-sqrt32.2%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod30.8%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow230.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999995e38 < (/.f64 angle 180) < 4.99999999999999991e108

    1. Initial program 26.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. unpow226.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. unpow226.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-squares31.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-rr31.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 25.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 \color{blue}{1} \]
    6. Taylor expanded in angle around 0 38.7%

      \[\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 1 \]

    if 4.99999999999999991e108 < (/.f64 angle 180) < 1e133

    1. Initial program 55.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. unpow255.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. unpow255.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-squares55.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-rr55.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. Step-by-step derivation
      1. div-inv55.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-eval55.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. expm1-log1p-u67.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 \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)} \]
    6. Applied egg-rr67.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 \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)} \]

    if 1e133 < (/.f64 angle 180) < 9.9999999999999997e199

    1. Initial program 19.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. unpow219.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. unpow219.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-squares19.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-rr19.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 22.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. div-inv22.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 1 \]
      2. metadata-eval22.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 1 \]
      3. add-cube-cbrt32.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]{\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)}\right) \cdot 1 \]
      4. pow329.9%

        \[\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]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)}\right) \cdot 1 \]
    7. Applied egg-rr29.9%

      \[\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]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)}\right) \cdot 1 \]

    if 9.9999999999999997e199 < (/.f64 angle 180)

    1. Initial program 21.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. add-sqr-sqrt10.9%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod34.8%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow234.8%

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{{\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)}^{2}}} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. unpow221.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. unpow221.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-squares21.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-rr39.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{+38}:\\ \;\;\;\;\left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+108}:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+133}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+200}:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \sqrt{{\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}^{2}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 66.0% 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 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\ t_1 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+41}:\\ \;\;\;\;\left(\left(t_1 \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle_m \cdot \frac{\sqrt[3]{{\pi}^{3}}}{180}\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+105}:\\ \;\;\;\;t_0 \cdot \left(-2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot {angle_m}^{3}\right) + 0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+122}:\\ \;\;\;\;t_0 \cdot \sqrt{{t_1}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{angle_m}{180} \cdot \pi\right) \cdot \left(t_0 \cdot \sin \left(\left(\sqrt[3]{angle_m} \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot {angle_m}^{0.6666666666666666}\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 (* 2.0 (* (+ b a) (- b a))))
        (t_1 (sin (* PI (* angle_m 0.005555555555555556)))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 2e+41)
      (*
       (* (* t_1 (* 2.0 (+ b a))) (- b a))
       (cos (* angle_m (/ (cbrt (pow PI 3.0)) 180.0))))
      (if (<= (/ angle_m 180.0) 4e+105)
        (*
         t_0
         (+
          (* -2.8577960676726107e-8 (* (pow PI 3.0) (pow angle_m 3.0)))
          (* 0.005555555555555556 (* angle_m PI))))
        (if (<= (/ angle_m 180.0) 5e+122)
          (* t_0 (sqrt (pow t_1 2.0)))
          (*
           (cos (* (/ angle_m 180.0) PI))
           (*
            t_0
            (sin
             (*
              (* (cbrt angle_m) (* PI 0.005555555555555556))
              (pow angle_m 0.6666666666666666)))))))))))
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 * ((b + a) * (b - a));
	double t_1 = sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
	double tmp;
	if ((angle_m / 180.0) <= 2e+41) {
		tmp = ((t_1 * (2.0 * (b + a))) * (b - a)) * cos((angle_m * (cbrt(pow(((double) M_PI), 3.0)) / 180.0)));
	} else if ((angle_m / 180.0) <= 4e+105) {
		tmp = t_0 * ((-2.8577960676726107e-8 * (pow(((double) M_PI), 3.0) * pow(angle_m, 3.0))) + (0.005555555555555556 * (angle_m * ((double) M_PI))));
	} else if ((angle_m / 180.0) <= 5e+122) {
		tmp = t_0 * sqrt(pow(t_1, 2.0));
	} else {
		tmp = cos(((angle_m / 180.0) * ((double) M_PI))) * (t_0 * sin(((cbrt(angle_m) * (((double) M_PI) * 0.005555555555555556)) * pow(angle_m, 0.6666666666666666))));
	}
	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 * ((b + a) * (b - a));
	double t_1 = Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
	double tmp;
	if ((angle_m / 180.0) <= 2e+41) {
		tmp = ((t_1 * (2.0 * (b + a))) * (b - a)) * Math.cos((angle_m * (Math.cbrt(Math.pow(Math.PI, 3.0)) / 180.0)));
	} else if ((angle_m / 180.0) <= 4e+105) {
		tmp = t_0 * ((-2.8577960676726107e-8 * (Math.pow(Math.PI, 3.0) * Math.pow(angle_m, 3.0))) + (0.005555555555555556 * (angle_m * Math.PI)));
	} else if ((angle_m / 180.0) <= 5e+122) {
		tmp = t_0 * Math.sqrt(Math.pow(t_1, 2.0));
	} else {
		tmp = Math.cos(((angle_m / 180.0) * Math.PI)) * (t_0 * Math.sin(((Math.cbrt(angle_m) * (Math.PI * 0.005555555555555556)) * Math.pow(angle_m, 0.6666666666666666))));
	}
	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(b + a) * Float64(b - a)))
	t_1 = sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e+41)
		tmp = Float64(Float64(Float64(t_1 * Float64(2.0 * Float64(b + a))) * Float64(b - a)) * cos(Float64(angle_m * Float64(cbrt((pi ^ 3.0)) / 180.0))));
	elseif (Float64(angle_m / 180.0) <= 4e+105)
		tmp = Float64(t_0 * Float64(Float64(-2.8577960676726107e-8 * Float64((pi ^ 3.0) * (angle_m ^ 3.0))) + Float64(0.005555555555555556 * Float64(angle_m * pi))));
	elseif (Float64(angle_m / 180.0) <= 5e+122)
		tmp = Float64(t_0 * sqrt((t_1 ^ 2.0)));
	else
		tmp = Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * Float64(t_0 * sin(Float64(Float64(cbrt(angle_m) * Float64(pi * 0.005555555555555556)) * (angle_m ^ 0.6666666666666666)))));
	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[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+41], N[(N[(N[(t$95$1 * N[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+105], N[(t$95$0 * N[(N[(-2.8577960676726107e-8 * N[(N[Power[Pi, 3.0], $MachinePrecision] * N[Power[angle$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+122], N[(t$95$0 * N[Sqrt[N[Power[t$95$1, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Sin[N[(N[(N[Power[angle$95$m, 1/3], $MachinePrecision] * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision] * N[Power[angle$95$m, 0.6666666666666666], $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 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_1 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+41}:\\
\;\;\;\;\left(\left(t_1 \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle_m \cdot \frac{\sqrt[3]{{\pi}^{3}}}{180}\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+105}:\\
\;\;\;\;t_0 \cdot \left(-2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot {angle_m}^{3}\right) + 0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+122}:\\
\;\;\;\;t_0 \cdot \sqrt{{t_1}^{2}}\\

\mathbf{else}:\\
\;\;\;\;\cos \left(\frac{angle_m}{180} \cdot \pi\right) \cdot \left(t_0 \cdot \sin \left(\left(\sqrt[3]{angle_m} \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot {angle_m}^{0.6666666666666666}\right)\right)\\


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

    1. Initial program 64.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. add-sqr-sqrt32.2%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod30.8%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow230.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000001e41 < (/.f64 angle 180) < 3.9999999999999998e105

    1. Initial program 22.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. unpow222.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. unpow222.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-squares29.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-rr29.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 29.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 45.4%

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left({angle}^{3} \cdot {\pi}^{3}\right) + 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot 1 \]

    if 3.9999999999999998e105 < (/.f64 angle 180) < 4.99999999999999989e122

    1. Initial program 72.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. unpow272.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. unpow272.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-squares72.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-rr72.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 19.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. Step-by-step derivation
      1. add-sqr-sqrt16.7%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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 1 \]
      2. sqrt-unprod67.1%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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 1 \]
      3. pow267.1%

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

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

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

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

    if 4.99999999999999989e122 < (/.f64 angle 180)

    1. Initial program 22.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. unpow222.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. unpow222.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-squares22.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-rr22.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. associate-*r/21.9%

        \[\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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    6. Applied egg-rr21.9%

      \[\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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    7. Step-by-step derivation
      1. div-inv23.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 \frac{1}{180}\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. *-commutative23.3%

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

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

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

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

        \[\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 \sqrt[3]{angle}\right) \cdot \left(\sqrt[3]{angle} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      7. cbrt-unprod1.3%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{+41}:\\ \;\;\;\;\left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{180}\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 4 \cdot 10^{+105}:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(-2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot {angle}^{3}\right) + 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+122}:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sqrt{{\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \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(\pi \cdot 0.005555555555555556\right)\right) \cdot {angle}^{0.6666666666666666}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 66.9% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\ t_1 := 2 \cdot \left(b + a\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;b \leq 3.9 \cdot 10^{-81}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(t_1 \cdot \sin \left({\left(\sqrt{t_0}\right)}^{2}\right)\right)\right) \cdot \cos \left(angle_m \cdot \frac{\pi}{180}\right)\\ \mathbf{elif}\;b \leq 6.9 \cdot 10^{+220}:\\ \;\;\;\;\left(\left(\sin t_0 \cdot t_1\right) \cdot \left(b - a\right)\right) \cdot \left|\cos \left(angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{angle_m}{180} \cdot \pi\right) \cdot \left(\left(b - a\right) \cdot \left(t_1 \cdot \sin \left(\frac{\sqrt{\pi}}{\frac{\frac{180}{angle_m}}{\sqrt{\pi}}}\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 (* PI (* angle_m 0.005555555555555556))) (t_1 (* 2.0 (+ b a))))
   (*
    angle_s
    (if (<= b 3.9e-81)
      (*
       (* (- b a) (* t_1 (sin (pow (sqrt t_0) 2.0))))
       (cos (* angle_m (/ PI 180.0))))
      (if (<= b 6.9e+220)
        (*
         (* (* (sin t_0) t_1) (- b a))
         (fabs (cos (* angle_m (* PI 0.005555555555555556)))))
        (*
         (cos (* (/ angle_m 180.0) PI))
         (*
          (- b a)
          (* t_1 (sin (/ (sqrt PI) (/ (/ 180.0 angle_m) (sqrt 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 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double t_1 = 2.0 * (b + a);
	double tmp;
	if (b <= 3.9e-81) {
		tmp = ((b - a) * (t_1 * sin(pow(sqrt(t_0), 2.0)))) * cos((angle_m * (((double) M_PI) / 180.0)));
	} else if (b <= 6.9e+220) {
		tmp = ((sin(t_0) * t_1) * (b - a)) * fabs(cos((angle_m * (((double) M_PI) * 0.005555555555555556))));
	} else {
		tmp = cos(((angle_m / 180.0) * ((double) M_PI))) * ((b - a) * (t_1 * sin((sqrt(((double) M_PI)) / ((180.0 / angle_m) / sqrt(((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 = Math.PI * (angle_m * 0.005555555555555556);
	double t_1 = 2.0 * (b + a);
	double tmp;
	if (b <= 3.9e-81) {
		tmp = ((b - a) * (t_1 * Math.sin(Math.pow(Math.sqrt(t_0), 2.0)))) * Math.cos((angle_m * (Math.PI / 180.0)));
	} else if (b <= 6.9e+220) {
		tmp = ((Math.sin(t_0) * t_1) * (b - a)) * Math.abs(Math.cos((angle_m * (Math.PI * 0.005555555555555556))));
	} else {
		tmp = Math.cos(((angle_m / 180.0) * Math.PI)) * ((b - a) * (t_1 * Math.sin((Math.sqrt(Math.PI) / ((180.0 / angle_m) / Math.sqrt(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 = math.pi * (angle_m * 0.005555555555555556)
	t_1 = 2.0 * (b + a)
	tmp = 0
	if b <= 3.9e-81:
		tmp = ((b - a) * (t_1 * math.sin(math.pow(math.sqrt(t_0), 2.0)))) * math.cos((angle_m * (math.pi / 180.0)))
	elif b <= 6.9e+220:
		tmp = ((math.sin(t_0) * t_1) * (b - a)) * math.fabs(math.cos((angle_m * (math.pi * 0.005555555555555556))))
	else:
		tmp = math.cos(((angle_m / 180.0) * math.pi)) * ((b - a) * (t_1 * math.sin((math.sqrt(math.pi) / ((180.0 / angle_m) / math.sqrt(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(pi * Float64(angle_m * 0.005555555555555556))
	t_1 = Float64(2.0 * Float64(b + a))
	tmp = 0.0
	if (b <= 3.9e-81)
		tmp = Float64(Float64(Float64(b - a) * Float64(t_1 * sin((sqrt(t_0) ^ 2.0)))) * cos(Float64(angle_m * Float64(pi / 180.0))));
	elseif (b <= 6.9e+220)
		tmp = Float64(Float64(Float64(sin(t_0) * t_1) * Float64(b - a)) * abs(cos(Float64(angle_m * Float64(pi * 0.005555555555555556)))));
	else
		tmp = Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * Float64(Float64(b - a) * Float64(t_1 * sin(Float64(sqrt(pi) / Float64(Float64(180.0 / angle_m) / sqrt(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 = pi * (angle_m * 0.005555555555555556);
	t_1 = 2.0 * (b + a);
	tmp = 0.0;
	if (b <= 3.9e-81)
		tmp = ((b - a) * (t_1 * sin((sqrt(t_0) ^ 2.0)))) * cos((angle_m * (pi / 180.0)));
	elseif (b <= 6.9e+220)
		tmp = ((sin(t_0) * t_1) * (b - a)) * abs(cos((angle_m * (pi * 0.005555555555555556))));
	else
		tmp = cos(((angle_m / 180.0) * pi)) * ((b - a) * (t_1 * sin((sqrt(pi) / ((180.0 / angle_m) / sqrt(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[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b, 3.9e-81], N[(N[(N[(b - a), $MachinePrecision] * N[(t$95$1 * N[Sin[N[Power[N[Sqrt[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.9e+220], N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Abs[N[Cos[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(t$95$1 * N[Sin[N[(N[Sqrt[Pi], $MachinePrecision] / N[(N[(180.0 / angle$95$m), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $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 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\
t_1 := 2 \cdot \left(b + a\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 3.9 \cdot 10^{-81}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(t_1 \cdot \sin \left({\left(\sqrt{t_0}\right)}^{2}\right)\right)\right) \cdot \cos \left(angle_m \cdot \frac{\pi}{180}\right)\\

\mathbf{elif}\;b \leq 6.9 \cdot 10^{+220}:\\
\;\;\;\;\left(\left(\sin t_0 \cdot t_1\right) \cdot \left(b - a\right)\right) \cdot \left|\cos \left(angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\cos \left(\frac{angle_m}{180} \cdot \pi\right) \cdot \left(\left(b - a\right) \cdot \left(t_1 \cdot \sin \left(\frac{\sqrt{\pi}}{\frac{\frac{180}{angle_m}}{\sqrt{\pi}}}\right)\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 3.89999999999999985e-81

    1. Initial program 63.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. add-sqr-sqrt35.4%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod34.8%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow234.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.89999999999999985e-81 < b < 6.9000000000000004e220

    1. Initial program 40.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. add-sqr-sqrt13.2%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod17.0%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow217.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \color{blue}{0.005555555555555556}\right) \]
      4. associate-*r*64.0%

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

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

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

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

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

        \[\leadsto \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \sqrt{\color{blue}{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}} \]
      2. rem-sqrt-square62.1%

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

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

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

        \[\leadsto \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \left|\cos \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right| \]
    14. Simplified62.1%

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

    if 6.9000000000000004e220 < b

    1. Initial program 32.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. add-sqr-sqrt16.1%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod21.6%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow221.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 66.9% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\ t_1 := 2 \cdot \left(b + a\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;b \leq 2 \cdot 10^{-81}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(t_1 \cdot \sin \left({\left(\sqrt{t_0}\right)}^{2}\right)\right)\right) \cdot \cos \left(angle_m \cdot \frac{\pi}{180}\right)\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{+220}:\\ \;\;\;\;\left(\left(\sin t_0 \cdot t_1\right) \cdot \left(b - a\right)\right) \cdot \left|\cos \left(angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{angle_m}{180} \cdot \pi\right) \cdot \left(\left(b - a\right) \cdot \left(t_1 \cdot \sin \left(\frac{1}{\frac{\frac{180}{\pi}}{angle_m}}\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 (* PI (* angle_m 0.005555555555555556))) (t_1 (* 2.0 (+ b a))))
   (*
    angle_s
    (if (<= b 2e-81)
      (*
       (* (- b a) (* t_1 (sin (pow (sqrt t_0) 2.0))))
       (cos (* angle_m (/ PI 180.0))))
      (if (<= b 1.8e+220)
        (*
         (* (* (sin t_0) t_1) (- b a))
         (fabs (cos (* angle_m (* PI 0.005555555555555556)))))
        (*
         (cos (* (/ angle_m 180.0) PI))
         (* (- b a) (* t_1 (sin (/ 1.0 (/ (/ 180.0 PI) angle_m)))))))))))
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 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double t_1 = 2.0 * (b + a);
	double tmp;
	if (b <= 2e-81) {
		tmp = ((b - a) * (t_1 * sin(pow(sqrt(t_0), 2.0)))) * cos((angle_m * (((double) M_PI) / 180.0)));
	} else if (b <= 1.8e+220) {
		tmp = ((sin(t_0) * t_1) * (b - a)) * fabs(cos((angle_m * (((double) M_PI) * 0.005555555555555556))));
	} else {
		tmp = cos(((angle_m / 180.0) * ((double) M_PI))) * ((b - a) * (t_1 * sin((1.0 / ((180.0 / ((double) M_PI)) / angle_m)))));
	}
	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.PI * (angle_m * 0.005555555555555556);
	double t_1 = 2.0 * (b + a);
	double tmp;
	if (b <= 2e-81) {
		tmp = ((b - a) * (t_1 * Math.sin(Math.pow(Math.sqrt(t_0), 2.0)))) * Math.cos((angle_m * (Math.PI / 180.0)));
	} else if (b <= 1.8e+220) {
		tmp = ((Math.sin(t_0) * t_1) * (b - a)) * Math.abs(Math.cos((angle_m * (Math.PI * 0.005555555555555556))));
	} else {
		tmp = Math.cos(((angle_m / 180.0) * Math.PI)) * ((b - a) * (t_1 * Math.sin((1.0 / ((180.0 / Math.PI) / angle_m)))));
	}
	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 = math.pi * (angle_m * 0.005555555555555556)
	t_1 = 2.0 * (b + a)
	tmp = 0
	if b <= 2e-81:
		tmp = ((b - a) * (t_1 * math.sin(math.pow(math.sqrt(t_0), 2.0)))) * math.cos((angle_m * (math.pi / 180.0)))
	elif b <= 1.8e+220:
		tmp = ((math.sin(t_0) * t_1) * (b - a)) * math.fabs(math.cos((angle_m * (math.pi * 0.005555555555555556))))
	else:
		tmp = math.cos(((angle_m / 180.0) * math.pi)) * ((b - a) * (t_1 * math.sin((1.0 / ((180.0 / math.pi) / angle_m)))))
	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(pi * Float64(angle_m * 0.005555555555555556))
	t_1 = Float64(2.0 * Float64(b + a))
	tmp = 0.0
	if (b <= 2e-81)
		tmp = Float64(Float64(Float64(b - a) * Float64(t_1 * sin((sqrt(t_0) ^ 2.0)))) * cos(Float64(angle_m * Float64(pi / 180.0))));
	elseif (b <= 1.8e+220)
		tmp = Float64(Float64(Float64(sin(t_0) * t_1) * Float64(b - a)) * abs(cos(Float64(angle_m * Float64(pi * 0.005555555555555556)))));
	else
		tmp = Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * Float64(Float64(b - a) * Float64(t_1 * sin(Float64(1.0 / Float64(Float64(180.0 / pi) / angle_m))))));
	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 = pi * (angle_m * 0.005555555555555556);
	t_1 = 2.0 * (b + a);
	tmp = 0.0;
	if (b <= 2e-81)
		tmp = ((b - a) * (t_1 * sin((sqrt(t_0) ^ 2.0)))) * cos((angle_m * (pi / 180.0)));
	elseif (b <= 1.8e+220)
		tmp = ((sin(t_0) * t_1) * (b - a)) * abs(cos((angle_m * (pi * 0.005555555555555556))));
	else
		tmp = cos(((angle_m / 180.0) * pi)) * ((b - a) * (t_1 * sin((1.0 / ((180.0 / pi) / angle_m)))));
	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[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b, 2e-81], N[(N[(N[(b - a), $MachinePrecision] * N[(t$95$1 * N[Sin[N[Power[N[Sqrt[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.8e+220], N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Abs[N[Cos[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(t$95$1 * N[Sin[N[(1.0 / N[(N[(180.0 / Pi), $MachinePrecision] / angle$95$m), $MachinePrecision]), $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 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\
t_1 := 2 \cdot \left(b + a\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 2 \cdot 10^{-81}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(t_1 \cdot \sin \left({\left(\sqrt{t_0}\right)}^{2}\right)\right)\right) \cdot \cos \left(angle_m \cdot \frac{\pi}{180}\right)\\

\mathbf{elif}\;b \leq 1.8 \cdot 10^{+220}:\\
\;\;\;\;\left(\left(\sin t_0 \cdot t_1\right) \cdot \left(b - a\right)\right) \cdot \left|\cos \left(angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right|\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 1.9999999999999999e-81

    1. Initial program 63.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. add-sqr-sqrt35.4%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod34.8%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow234.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e-81 < b < 1.80000000000000009e220

    1. Initial program 40.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. add-sqr-sqrt13.2%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod17.0%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow217.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \color{blue}{0.005555555555555556}\right) \]
      4. associate-*r*64.0%

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

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

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

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

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

        \[\leadsto \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \sqrt{\color{blue}{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}} \]
      2. rem-sqrt-square62.1%

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

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

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

        \[\leadsto \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \left|\cos \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right| \]
    14. Simplified62.1%

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

    if 1.80000000000000009e220 < b

    1. Initial program 32.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. add-sqr-sqrt16.1%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod21.6%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow221.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 64.6% 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 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\ t_1 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+27}:\\ \;\;\;\;\left(\left(t_1 \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle_m \cdot \frac{\pi}{180}\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+105}:\\ \;\;\;\;t_0 \cdot \left(-2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot {angle_m}^{3}\right) + 0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+133}:\\ \;\;\;\;t_0 \cdot \sqrt{{t_1}^{2}}\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+236}:\\ \;\;\;\;t_0 \cdot \sin \left(\frac{angle_m \cdot \pi}{180}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t_0 \cdot \sin \left(\frac{angle_m}{180} \cdot \pi\right)\right) \cdot \left(1 + \left(-1.54320987654321 \cdot 10^{-5} \cdot {angle_m}^{2}\right) \cdot {\pi}^{2}\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 (* (+ b a) (- b a))))
        (t_1 (sin (* PI (* angle_m 0.005555555555555556)))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 2e+27)
      (* (* (* t_1 (* 2.0 (+ b a))) (- b a)) (cos (* angle_m (/ PI 180.0))))
      (if (<= (/ angle_m 180.0) 4e+105)
        (*
         t_0
         (+
          (* -2.8577960676726107e-8 (* (pow PI 3.0) (pow angle_m 3.0)))
          (* 0.005555555555555556 (* angle_m PI))))
        (if (<= (/ angle_m 180.0) 2e+133)
          (* t_0 (sqrt (pow t_1 2.0)))
          (if (<= (/ angle_m 180.0) 2e+236)
            (* t_0 (sin (/ (* angle_m PI) 180.0)))
            (*
             (* t_0 (sin (* (/ angle_m 180.0) PI)))
             (+
              1.0
              (*
               (* -1.54320987654321e-5 (pow angle_m 2.0))
               (pow PI 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 = 2.0 * ((b + a) * (b - a));
	double t_1 = sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
	double tmp;
	if ((angle_m / 180.0) <= 2e+27) {
		tmp = ((t_1 * (2.0 * (b + a))) * (b - a)) * cos((angle_m * (((double) M_PI) / 180.0)));
	} else if ((angle_m / 180.0) <= 4e+105) {
		tmp = t_0 * ((-2.8577960676726107e-8 * (pow(((double) M_PI), 3.0) * pow(angle_m, 3.0))) + (0.005555555555555556 * (angle_m * ((double) M_PI))));
	} else if ((angle_m / 180.0) <= 2e+133) {
		tmp = t_0 * sqrt(pow(t_1, 2.0));
	} else if ((angle_m / 180.0) <= 2e+236) {
		tmp = t_0 * sin(((angle_m * ((double) M_PI)) / 180.0));
	} else {
		tmp = (t_0 * sin(((angle_m / 180.0) * ((double) M_PI)))) * (1.0 + ((-1.54320987654321e-5 * pow(angle_m, 2.0)) * pow(((double) M_PI), 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 = 2.0 * ((b + a) * (b - a));
	double t_1 = Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
	double tmp;
	if ((angle_m / 180.0) <= 2e+27) {
		tmp = ((t_1 * (2.0 * (b + a))) * (b - a)) * Math.cos((angle_m * (Math.PI / 180.0)));
	} else if ((angle_m / 180.0) <= 4e+105) {
		tmp = t_0 * ((-2.8577960676726107e-8 * (Math.pow(Math.PI, 3.0) * Math.pow(angle_m, 3.0))) + (0.005555555555555556 * (angle_m * Math.PI)));
	} else if ((angle_m / 180.0) <= 2e+133) {
		tmp = t_0 * Math.sqrt(Math.pow(t_1, 2.0));
	} else if ((angle_m / 180.0) <= 2e+236) {
		tmp = t_0 * Math.sin(((angle_m * Math.PI) / 180.0));
	} else {
		tmp = (t_0 * Math.sin(((angle_m / 180.0) * Math.PI))) * (1.0 + ((-1.54320987654321e-5 * Math.pow(angle_m, 2.0)) * Math.pow(Math.PI, 2.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 = 2.0 * ((b + a) * (b - a))
	t_1 = math.sin((math.pi * (angle_m * 0.005555555555555556)))
	tmp = 0
	if (angle_m / 180.0) <= 2e+27:
		tmp = ((t_1 * (2.0 * (b + a))) * (b - a)) * math.cos((angle_m * (math.pi / 180.0)))
	elif (angle_m / 180.0) <= 4e+105:
		tmp = t_0 * ((-2.8577960676726107e-8 * (math.pow(math.pi, 3.0) * math.pow(angle_m, 3.0))) + (0.005555555555555556 * (angle_m * math.pi)))
	elif (angle_m / 180.0) <= 2e+133:
		tmp = t_0 * math.sqrt(math.pow(t_1, 2.0))
	elif (angle_m / 180.0) <= 2e+236:
		tmp = t_0 * math.sin(((angle_m * math.pi) / 180.0))
	else:
		tmp = (t_0 * math.sin(((angle_m / 180.0) * math.pi))) * (1.0 + ((-1.54320987654321e-5 * math.pow(angle_m, 2.0)) * math.pow(math.pi, 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(2.0 * Float64(Float64(b + a) * Float64(b - a)))
	t_1 = sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e+27)
		tmp = Float64(Float64(Float64(t_1 * Float64(2.0 * Float64(b + a))) * Float64(b - a)) * cos(Float64(angle_m * Float64(pi / 180.0))));
	elseif (Float64(angle_m / 180.0) <= 4e+105)
		tmp = Float64(t_0 * Float64(Float64(-2.8577960676726107e-8 * Float64((pi ^ 3.0) * (angle_m ^ 3.0))) + Float64(0.005555555555555556 * Float64(angle_m * pi))));
	elseif (Float64(angle_m / 180.0) <= 2e+133)
		tmp = Float64(t_0 * sqrt((t_1 ^ 2.0)));
	elseif (Float64(angle_m / 180.0) <= 2e+236)
		tmp = Float64(t_0 * sin(Float64(Float64(angle_m * pi) / 180.0)));
	else
		tmp = Float64(Float64(t_0 * sin(Float64(Float64(angle_m / 180.0) * pi))) * Float64(1.0 + Float64(Float64(-1.54320987654321e-5 * (angle_m ^ 2.0)) * (pi ^ 2.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 = 2.0 * ((b + a) * (b - a));
	t_1 = sin((pi * (angle_m * 0.005555555555555556)));
	tmp = 0.0;
	if ((angle_m / 180.0) <= 2e+27)
		tmp = ((t_1 * (2.0 * (b + a))) * (b - a)) * cos((angle_m * (pi / 180.0)));
	elseif ((angle_m / 180.0) <= 4e+105)
		tmp = t_0 * ((-2.8577960676726107e-8 * ((pi ^ 3.0) * (angle_m ^ 3.0))) + (0.005555555555555556 * (angle_m * pi)));
	elseif ((angle_m / 180.0) <= 2e+133)
		tmp = t_0 * sqrt((t_1 ^ 2.0));
	elseif ((angle_m / 180.0) <= 2e+236)
		tmp = t_0 * sin(((angle_m * pi) / 180.0));
	else
		tmp = (t_0 * sin(((angle_m / 180.0) * pi))) * (1.0 + ((-1.54320987654321e-5 * (angle_m ^ 2.0)) * (pi ^ 2.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[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+27], N[(N[(N[(t$95$1 * N[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+105], N[(t$95$0 * N[(N[(-2.8577960676726107e-8 * N[(N[Power[Pi, 3.0], $MachinePrecision] * N[Power[angle$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+133], N[(t$95$0 * N[Sqrt[N[Power[t$95$1, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+236], N[(t$95$0 * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-1.54320987654321e-5 * N[Power[angle$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[Pi, 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 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_1 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+27}:\\
\;\;\;\;\left(\left(t_1 \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle_m \cdot \frac{\pi}{180}\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+105}:\\
\;\;\;\;t_0 \cdot \left(-2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot {angle_m}^{3}\right) + 0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+133}:\\
\;\;\;\;t_0 \cdot \sqrt{{t_1}^{2}}\\

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

\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \sin \left(\frac{angle_m}{180} \cdot \pi\right)\right) \cdot \left(1 + \left(-1.54320987654321 \cdot 10^{-5} \cdot {angle_m}^{2}\right) \cdot {\pi}^{2}\right)\\


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

    1. Initial program 64.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. add-sqr-sqrt32.4%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod31.1%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow231.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e27 < (/.f64 angle 180) < 3.9999999999999998e105

    1. Initial program 27.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. unpow227.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. unpow227.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-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. Taylor expanded in angle around 0 27.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 46.2%

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left({angle}^{3} \cdot {\pi}^{3}\right) + 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot 1 \]

    if 3.9999999999999998e105 < (/.f64 angle 180) < 2e133

    1. Initial program 52.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. unpow252.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. unpow252.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-squares52.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-rr52.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 24.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 \color{blue}{1} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt13.9%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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 1 \]
      2. sqrt-unprod50.5%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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 1 \]
      3. pow250.5%

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

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

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

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

    if 2e133 < (/.f64 angle 180) < 2.00000000000000011e236

    1. Initial program 17.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. unpow217.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. unpow217.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-squares17.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-rr17.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. associate-*r/23.9%

        \[\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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    6. Applied egg-rr23.9%

      \[\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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    7. Taylor expanded in angle around 0 47.6%

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

    if 2.00000000000000011e236 < (/.f64 angle 180)

    1. Initial program 25.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. unpow225.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. unpow225.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-squares25.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-rr25.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. Taylor expanded in angle around 0 35.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}{\left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*35.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 \left(1 + \color{blue}{\left(-1.54320987654321 \cdot 10^{-5} \cdot {angle}^{2}\right) \cdot {\pi}^{2}}\right) \]
    7. Simplified35.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}{\left(1 + \left(-1.54320987654321 \cdot 10^{-5} \cdot {angle}^{2}\right) \cdot {\pi}^{2}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification70.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{+27}:\\ \;\;\;\;\left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 4 \cdot 10^{+105}:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(-2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot {angle}^{3}\right) + 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+133}:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sqrt{{\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{2}}\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+236}:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \left(1 + \left(-1.54320987654321 \cdot 10^{-5} \cdot {angle}^{2}\right) \cdot {\pi}^{2}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 66.7% 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 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\ t_2 := t_1 \cdot \sin \left(\frac{angle_m \cdot \pi}{180}\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+23}:\\ \;\;\;\;\cos \left(angle_m \cdot \frac{\pi}{180}\right) \cdot \left(\left(b - a\right) \cdot \left(\left(2 \cdot \left(b + a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+133}:\\ \;\;\;\;\cos t_0 \cdot \left(t_1 \cdot \sin t_0\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+238}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \cos \left(\frac{\pi}{\frac{180}{angle_m}}\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 (* 2.0 (* (+ b a) (- b a))))
        (t_2 (* t_1 (sin (/ (* angle_m PI) 180.0)))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 5e+23)
      (*
       (cos (* angle_m (/ PI 180.0)))
       (*
        (- b a)
        (* (* 2.0 (+ b a)) (sin (* 0.005555555555555556 (* angle_m PI))))))
      (if (<= (/ angle_m 180.0) 2e+133)
        (* (cos t_0) (* t_1 (sin t_0)))
        (if (<= (/ angle_m 180.0) 2e+238)
          t_2
          (* t_2 (cos (/ PI (/ 180.0 angle_m))))))))))
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 = 2.0 * ((b + a) * (b - a));
	double t_2 = t_1 * sin(((angle_m * ((double) M_PI)) / 180.0));
	double tmp;
	if ((angle_m / 180.0) <= 5e+23) {
		tmp = cos((angle_m * (((double) M_PI) / 180.0))) * ((b - a) * ((2.0 * (b + a)) * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
	} else if ((angle_m / 180.0) <= 2e+133) {
		tmp = cos(t_0) * (t_1 * sin(t_0));
	} else if ((angle_m / 180.0) <= 2e+238) {
		tmp = t_2;
	} else {
		tmp = t_2 * cos((((double) M_PI) / (180.0 / angle_m)));
	}
	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 = 2.0 * ((b + a) * (b - a));
	double t_2 = t_1 * Math.sin(((angle_m * Math.PI) / 180.0));
	double tmp;
	if ((angle_m / 180.0) <= 5e+23) {
		tmp = Math.cos((angle_m * (Math.PI / 180.0))) * ((b - a) * ((2.0 * (b + a)) * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))));
	} else if ((angle_m / 180.0) <= 2e+133) {
		tmp = Math.cos(t_0) * (t_1 * Math.sin(t_0));
	} else if ((angle_m / 180.0) <= 2e+238) {
		tmp = t_2;
	} else {
		tmp = t_2 * Math.cos((Math.PI / (180.0 / angle_m)));
	}
	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 = 2.0 * ((b + a) * (b - a))
	t_2 = t_1 * math.sin(((angle_m * math.pi) / 180.0))
	tmp = 0
	if (angle_m / 180.0) <= 5e+23:
		tmp = math.cos((angle_m * (math.pi / 180.0))) * ((b - a) * ((2.0 * (b + a)) * math.sin((0.005555555555555556 * (angle_m * math.pi)))))
	elif (angle_m / 180.0) <= 2e+133:
		tmp = math.cos(t_0) * (t_1 * math.sin(t_0))
	elif (angle_m / 180.0) <= 2e+238:
		tmp = t_2
	else:
		tmp = t_2 * math.cos((math.pi / (180.0 / angle_m)))
	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 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a)))
	t_2 = Float64(t_1 * sin(Float64(Float64(angle_m * pi) / 180.0)))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e+23)
		tmp = Float64(cos(Float64(angle_m * Float64(pi / 180.0))) * Float64(Float64(b - a) * Float64(Float64(2.0 * Float64(b + a)) * sin(Float64(0.005555555555555556 * Float64(angle_m * pi))))));
	elseif (Float64(angle_m / 180.0) <= 2e+133)
		tmp = Float64(cos(t_0) * Float64(t_1 * sin(t_0)));
	elseif (Float64(angle_m / 180.0) <= 2e+238)
		tmp = t_2;
	else
		tmp = Float64(t_2 * cos(Float64(pi / Float64(180.0 / angle_m))));
	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 = 2.0 * ((b + a) * (b - a));
	t_2 = t_1 * sin(((angle_m * pi) / 180.0));
	tmp = 0.0;
	if ((angle_m / 180.0) <= 5e+23)
		tmp = cos((angle_m * (pi / 180.0))) * ((b - a) * ((2.0 * (b + a)) * sin((0.005555555555555556 * (angle_m * pi)))));
	elseif ((angle_m / 180.0) <= 2e+133)
		tmp = cos(t_0) * (t_1 * sin(t_0));
	elseif ((angle_m / 180.0) <= 2e+238)
		tmp = t_2;
	else
		tmp = t_2 * cos((pi / (180.0 / angle_m)));
	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[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+23], N[(N[Cos[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+133], N[(N[Cos[t$95$0], $MachinePrecision] * N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+238], t$95$2, N[(t$95$2 * N[Cos[N[(Pi / N[(180.0 / angle$95$m), $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 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_2 := t_1 \cdot \sin \left(\frac{angle_m \cdot \pi}{180}\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+23}:\\
\;\;\;\;\cos \left(angle_m \cdot \frac{\pi}{180}\right) \cdot \left(\left(b - a\right) \cdot \left(\left(2 \cdot \left(b + a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\right)\\

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

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

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


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

    1. Initial program 64.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. add-sqr-sqrt32.8%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod31.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999999e23 < (/.f64 angle 180) < 2e133

    1. Initial program 37.6%

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

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

        \[\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-squares40.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-rr40.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) \]

    if 2e133 < (/.f64 angle 180) < 2.0000000000000001e238

    1. Initial program 27.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. unpow227.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. unpow227.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-squares27.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-rr27.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. Step-by-step derivation
      1. associate-*r/27.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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    6. Applied egg-rr27.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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    7. Taylor expanded in angle around 0 47.9%

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

    if 2.0000000000000001e238 < (/.f64 angle 180)

    1. Initial program 13.6%

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

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

        \[\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-squares13.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-rr13.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. associate-*r/21.6%

        \[\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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    6. Applied egg-rr21.6%

      \[\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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    7. Step-by-step derivation
      1. associate-*r/21.3%

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

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

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

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

Alternative 11: 66.6% 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(b + a\right) \cdot \left(b - a\right)\\ t_1 := 2 \cdot t_0\\ t_2 := \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+15}:\\ \;\;\;\;\cos \left(\frac{angle_m}{180} \cdot \pi\right) \cdot \left(\left(b - a\right) \cdot \left(\left(2 \cdot \left(b + a\right)\right) \cdot t_2\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+108}:\\ \;\;\;\;t_1 \cdot t_2\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+133}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot t_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \sin \left(\frac{angle_m \cdot \pi}{180}\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 (* (+ b a) (- b a)))
        (t_1 (* 2.0 t_0))
        (t_2 (sin (* 0.005555555555555556 (* angle_m PI)))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 2e+15)
      (* (cos (* (/ angle_m 180.0) PI)) (* (- b a) (* (* 2.0 (+ b a)) t_2)))
      (if (<= (/ angle_m 180.0) 5e+108)
        (* t_1 t_2)
        (if (<= (/ angle_m 180.0) 2e+133)
          (* 0.011111111111111112 (* angle_m (* PI t_0)))
          (* t_1 (sin (/ (* angle_m PI) 180.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 = (b + a) * (b - a);
	double t_1 = 2.0 * t_0;
	double t_2 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	double tmp;
	if ((angle_m / 180.0) <= 2e+15) {
		tmp = cos(((angle_m / 180.0) * ((double) M_PI))) * ((b - a) * ((2.0 * (b + a)) * t_2));
	} else if ((angle_m / 180.0) <= 5e+108) {
		tmp = t_1 * t_2;
	} else if ((angle_m / 180.0) <= 2e+133) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * t_0));
	} else {
		tmp = t_1 * sin(((angle_m * ((double) M_PI)) / 180.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 = (b + a) * (b - a);
	double t_1 = 2.0 * t_0;
	double t_2 = Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
	double tmp;
	if ((angle_m / 180.0) <= 2e+15) {
		tmp = Math.cos(((angle_m / 180.0) * Math.PI)) * ((b - a) * ((2.0 * (b + a)) * t_2));
	} else if ((angle_m / 180.0) <= 5e+108) {
		tmp = t_1 * t_2;
	} else if ((angle_m / 180.0) <= 2e+133) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * t_0));
	} else {
		tmp = t_1 * Math.sin(((angle_m * Math.PI) / 180.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 = (b + a) * (b - a)
	t_1 = 2.0 * t_0
	t_2 = math.sin((0.005555555555555556 * (angle_m * math.pi)))
	tmp = 0
	if (angle_m / 180.0) <= 2e+15:
		tmp = math.cos(((angle_m / 180.0) * math.pi)) * ((b - a) * ((2.0 * (b + a)) * t_2))
	elif (angle_m / 180.0) <= 5e+108:
		tmp = t_1 * t_2
	elif (angle_m / 180.0) <= 2e+133:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * t_0))
	else:
		tmp = t_1 * math.sin(((angle_m * math.pi) / 180.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(b + a) * Float64(b - a))
	t_1 = Float64(2.0 * t_0)
	t_2 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e+15)
		tmp = Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * Float64(Float64(b - a) * Float64(Float64(2.0 * Float64(b + a)) * t_2)));
	elseif (Float64(angle_m / 180.0) <= 5e+108)
		tmp = Float64(t_1 * t_2);
	elseif (Float64(angle_m / 180.0) <= 2e+133)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_0)));
	else
		tmp = Float64(t_1 * sin(Float64(Float64(angle_m * pi) / 180.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 = (b + a) * (b - a);
	t_1 = 2.0 * t_0;
	t_2 = sin((0.005555555555555556 * (angle_m * pi)));
	tmp = 0.0;
	if ((angle_m / 180.0) <= 2e+15)
		tmp = cos(((angle_m / 180.0) * pi)) * ((b - a) * ((2.0 * (b + a)) * t_2));
	elseif ((angle_m / 180.0) <= 5e+108)
		tmp = t_1 * t_2;
	elseif ((angle_m / 180.0) <= 2e+133)
		tmp = 0.011111111111111112 * (angle_m * (pi * t_0));
	else
		tmp = t_1 * sin(((angle_m * pi) / 180.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[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+15], N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+108], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+133], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.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(b + a\right) \cdot \left(b - a\right)\\
t_1 := 2 \cdot t_0\\
t_2 := \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+15}:\\
\;\;\;\;\cos \left(\frac{angle_m}{180} \cdot \pi\right) \cdot \left(\left(b - a\right) \cdot \left(\left(2 \cdot \left(b + a\right)\right) \cdot t_2\right)\right)\\

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

\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+133}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot t_0\right)\right)\\

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


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

    1. Initial program 64.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. add-sqr-sqrt32.9%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod31.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e15 < (/.f64 angle 180) < 4.99999999999999991e108

    1. Initial program 30.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. unpow230.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. unpow230.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-squares34.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-rr34.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 26.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 32.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 1 \]

    if 4.99999999999999991e108 < (/.f64 angle 180) < 2e133

    1. Initial program 55.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. unpow255.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. unpow255.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-squares55.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-rr55.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 31.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 51.9%

      \[\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 \]

    if 2e133 < (/.f64 angle 180)

    1. Initial program 21.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. unpow221.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. unpow221.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-squares21.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-rr21.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. associate-*r/24.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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    6. Applied egg-rr24.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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    7. Taylor expanded in angle around 0 35.4%

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

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

Alternative 12: 66.6% 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(b + a\right) \cdot \left(b - a\right)\\ t_1 := 2 \cdot t_0\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 10^{+33}:\\ \;\;\;\;\left(\left(\sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\frac{angle_m}{180} \cdot \pi\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+108}:\\ \;\;\;\;t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+133}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot t_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \sin \left(\frac{angle_m \cdot \pi}{180}\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 (* (+ b a) (- b a))) (t_1 (* 2.0 t_0)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1e+33)
      (*
       (*
        (* (sin (* PI (* angle_m 0.005555555555555556))) (* 2.0 (+ b a)))
        (- b a))
       (cos (* (/ angle_m 180.0) PI)))
      (if (<= (/ angle_m 180.0) 5e+108)
        (* t_1 (sin (* 0.005555555555555556 (* angle_m PI))))
        (if (<= (/ angle_m 180.0) 2e+133)
          (* 0.011111111111111112 (* angle_m (* PI t_0)))
          (* t_1 (sin (/ (* angle_m PI) 180.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 = (b + a) * (b - a);
	double t_1 = 2.0 * t_0;
	double tmp;
	if ((angle_m / 180.0) <= 1e+33) {
		tmp = ((sin((((double) M_PI) * (angle_m * 0.005555555555555556))) * (2.0 * (b + a))) * (b - a)) * cos(((angle_m / 180.0) * ((double) M_PI)));
	} else if ((angle_m / 180.0) <= 5e+108) {
		tmp = t_1 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	} else if ((angle_m / 180.0) <= 2e+133) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * t_0));
	} else {
		tmp = t_1 * sin(((angle_m * ((double) M_PI)) / 180.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 = (b + a) * (b - a);
	double t_1 = 2.0 * t_0;
	double tmp;
	if ((angle_m / 180.0) <= 1e+33) {
		tmp = ((Math.sin((Math.PI * (angle_m * 0.005555555555555556))) * (2.0 * (b + a))) * (b - a)) * Math.cos(((angle_m / 180.0) * Math.PI));
	} else if ((angle_m / 180.0) <= 5e+108) {
		tmp = t_1 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
	} else if ((angle_m / 180.0) <= 2e+133) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * t_0));
	} else {
		tmp = t_1 * Math.sin(((angle_m * Math.PI) / 180.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 = (b + a) * (b - a)
	t_1 = 2.0 * t_0
	tmp = 0
	if (angle_m / 180.0) <= 1e+33:
		tmp = ((math.sin((math.pi * (angle_m * 0.005555555555555556))) * (2.0 * (b + a))) * (b - a)) * math.cos(((angle_m / 180.0) * math.pi))
	elif (angle_m / 180.0) <= 5e+108:
		tmp = t_1 * math.sin((0.005555555555555556 * (angle_m * math.pi)))
	elif (angle_m / 180.0) <= 2e+133:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * t_0))
	else:
		tmp = t_1 * math.sin(((angle_m * math.pi) / 180.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(b + a) * Float64(b - a))
	t_1 = Float64(2.0 * t_0)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1e+33)
		tmp = Float64(Float64(Float64(sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) * Float64(2.0 * Float64(b + a))) * Float64(b - a)) * cos(Float64(Float64(angle_m / 180.0) * pi)));
	elseif (Float64(angle_m / 180.0) <= 5e+108)
		tmp = Float64(t_1 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi))));
	elseif (Float64(angle_m / 180.0) <= 2e+133)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_0)));
	else
		tmp = Float64(t_1 * sin(Float64(Float64(angle_m * pi) / 180.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 = (b + a) * (b - a);
	t_1 = 2.0 * t_0;
	tmp = 0.0;
	if ((angle_m / 180.0) <= 1e+33)
		tmp = ((sin((pi * (angle_m * 0.005555555555555556))) * (2.0 * (b + a))) * (b - a)) * cos(((angle_m / 180.0) * pi));
	elseif ((angle_m / 180.0) <= 5e+108)
		tmp = t_1 * sin((0.005555555555555556 * (angle_m * pi)));
	elseif ((angle_m / 180.0) <= 2e+133)
		tmp = 0.011111111111111112 * (angle_m * (pi * t_0));
	else
		tmp = t_1 * sin(((angle_m * pi) / 180.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[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * t$95$0), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+33], N[(N[(N[(N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+108], N[(t$95$1 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+133], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.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(b + a\right) \cdot \left(b - a\right)\\
t_1 := 2 \cdot t_0\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{+33}:\\
\;\;\;\;\left(\left(\sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\frac{angle_m}{180} \cdot \pi\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+108}:\\
\;\;\;\;t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+133}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot t_0\right)\right)\\

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


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

    1. Initial program 64.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. add-sqr-sqrt32.2%

        \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod30.8%

        \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
      3. pow230.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999995e32 < (/.f64 angle 180) < 4.99999999999999991e108

    1. Initial program 26.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. unpow226.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. unpow226.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-squares31.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-rr31.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 25.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 \color{blue}{1} \]
    6. Taylor expanded in angle around 0 38.7%

      \[\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 1 \]

    if 4.99999999999999991e108 < (/.f64 angle 180) < 2e133

    1. Initial program 55.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. unpow255.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. unpow255.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-squares55.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-rr55.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 31.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 51.9%

      \[\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 \]

    if 2e133 < (/.f64 angle 180)

    1. Initial program 21.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. unpow221.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. unpow221.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-squares21.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-rr21.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. associate-*r/24.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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    6. Applied egg-rr24.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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    7. Taylor expanded in angle around 0 35.4%

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

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

Alternative 13: 56.1% accurate, 1.9× 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(b + a\right) \cdot \left(b - a\right)\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{+291}:\\ \;\;\;\;t_0 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \sin \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 (* (+ b a) (- b a)))))
   (*
    angle_s
    (if (<= (pow a 2.0) 2e+291)
      (* t_0 (sin (* 0.005555555555555556 (* angle_m PI))))
      (* 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 = 2.0 * ((b + a) * (b - a));
	double tmp;
	if (pow(a, 2.0) <= 2e+291) {
		tmp = t_0 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	} else {
		tmp = 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 = 2.0 * ((b + a) * (b - a));
	double tmp;
	if (Math.pow(a, 2.0) <= 2e+291) {
		tmp = t_0 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
	} else {
		tmp = 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 = 2.0 * ((b + a) * (b - a))
	tmp = 0
	if math.pow(a, 2.0) <= 2e+291:
		tmp = t_0 * math.sin((0.005555555555555556 * (angle_m * math.pi)))
	else:
		tmp = 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(2.0 * Float64(Float64(b + a) * Float64(b - a)))
	tmp = 0.0
	if ((a ^ 2.0) <= 2e+291)
		tmp = Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi))));
	else
		tmp = Float64(t_0 * 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)
	t_0 = 2.0 * ((b + a) * (b - a));
	tmp = 0.0;
	if ((a ^ 2.0) <= 2e+291)
		tmp = t_0 * sin((0.005555555555555556 * (angle_m * pi)));
	else
		tmp = 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[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 2e+291], N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 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)

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 a 2) < 1.9999999999999999e291

    1. Initial program 59.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. unpow259.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. unpow259.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.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-rr59.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.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 \color{blue}{1} \]
    6. Taylor expanded in angle around 0 59.0%

      \[\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 1 \]

    if 1.9999999999999999e291 < (pow.f64 a 2)

    1. Initial program 47.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. unpow247.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. unpow247.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.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} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.1%

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

Alternative 14: 67.0% accurate, 1.9× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \left(\left(\left(\sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle_m \cdot \frac{\pi}{180}\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
  (*
   (*
    (* (sin (* PI (* angle_m 0.005555555555555556))) (* 2.0 (+ b a)))
    (- b a))
   (cos (* angle_m (/ PI 180.0))))))
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 * (((sin((((double) M_PI) * (angle_m * 0.005555555555555556))) * (2.0 * (b + a))) * (b - a)) * cos((angle_m * (((double) M_PI) / 180.0))));
}
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 * (((Math.sin((Math.PI * (angle_m * 0.005555555555555556))) * (2.0 * (b + a))) * (b - a)) * Math.cos((angle_m * (Math.PI / 180.0))));
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (((math.sin((math.pi * (angle_m * 0.005555555555555556))) * (2.0 * (b + a))) * (b - a)) * math.cos((angle_m * (math.pi / 180.0))))
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(Float64(Float64(sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) * Float64(2.0 * Float64(b + a))) * Float64(b - a)) * cos(Float64(angle_m * Float64(pi / 180.0)))))
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (((sin((pi * (angle_m * 0.005555555555555556))) * (2.0 * (b + a))) * (b - a)) * cos((angle_m * (pi / 180.0))));
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[(N[(N[(N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m * N[(Pi / 180.0), $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(\left(\left(\sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle_m \cdot \frac{\pi}{180}\right)\right)
\end{array}
Derivation
  1. Initial program 56.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. add-sqr-sqrt28.9%

      \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod29.7%

      \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
    3. pow229.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 55.9% accurate, 3.6× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\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
  (*
   (* 2.0 (* (+ b a) (- 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) {
	return angle_s * ((2.0 * ((b + a) * (b - a))) * sin((0.005555555555555556 * (angle_m * ((double) M_PI)))));
}
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 * ((2.0 * ((b + a) * (b - a))) * Math.sin((0.005555555555555556 * (angle_m * Math.PI))));
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * ((2.0 * ((b + a) * (b - a))) * math.sin((0.005555555555555556 * (angle_m * math.pi))))
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * ((2.0 * ((b + a) * (b - a))) * sin((0.005555555555555556 * (angle_m * pi))));
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[(N[(2.0 * N[(N[(b + a), $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 \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)
\end{array}
Derivation
  1. Initial program 56.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. unpow256.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. unpow256.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-squares58.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-rr58.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 56.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 \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 1 \]
  7. Final simplification56.5%

    \[\leadsto \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \]
  8. Add Preprocessing

Alternative 16: 55.9% accurate, 3.6× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle_m}}\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 (* (* 2.0 (* (+ b a) (- b a))) (sin (/ PI (/ 180.0 angle_m))))))
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 * ((2.0 * ((b + a) * (b - a))) * sin((((double) M_PI) / (180.0 / angle_m))));
}
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 * ((2.0 * ((b + a) * (b - a))) * Math.sin((Math.PI / (180.0 / angle_m))));
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * ((2.0 * ((b + a) * (b - a))) * math.sin((math.pi / (180.0 / angle_m))))
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) * sin(Float64(pi / Float64(180.0 / angle_m)))))
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * ((2.0 * ((b + a) * (b - a))) * sin((pi / (180.0 / angle_m))));
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[(N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $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(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle_m}}\right)\right)
\end{array}
Derivation
  1. Initial program 56.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. unpow256.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. unpow256.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-squares58.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-rr58.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 56.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. Step-by-step derivation
    1. associate-*r/65.6%

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

      \[\leadsto \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \color{blue}{\left(\frac{\pi}{\frac{180}{angle}}\right)} \]
  7. Applied egg-rr57.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}{\frac{180}{angle}}\right)}\right) \cdot 1 \]
  8. Final simplification57.8%

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

Alternative 17: 65.5% accurate, 3.6× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \left(\left(\sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\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
  (*
   (* (sin (* PI (* angle_m 0.005555555555555556))) (* 2.0 (+ b a)))
   (- 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 * ((sin((((double) M_PI) * (angle_m * 0.005555555555555556))) * (2.0 * (b + a))) * (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 * ((Math.sin((Math.PI * (angle_m * 0.005555555555555556))) * (2.0 * (b + a))) * (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 * ((math.sin((math.pi * (angle_m * 0.005555555555555556))) * (2.0 * (b + a))) * (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(Float64(sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) * Float64(2.0 * Float64(b + a))) * 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 * ((sin((pi * (angle_m * 0.005555555555555556))) * (2.0 * (b + a))) * (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[(N[(N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle_s \cdot \left(\left(\sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)\right)
\end{array}
Derivation
  1. Initial program 56.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. add-sqr-sqrt28.9%

      \[\leadsto \color{blue}{\left(\sqrt{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\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. sqrt-unprod29.7%

      \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \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) \]
    3. pow229.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right) \]
  9. 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(b + a\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 (* (+ b a) (- 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) * ((b + a) * (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 * ((b + a) * (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 * ((b + a) * (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(b + a) * 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 * ((b + a) * (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[(b + a), $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(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 56.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. unpow256.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. unpow256.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-squares58.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-rr58.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 56.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 50.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 simplification50.7%

    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right) \]
  8. Add Preprocessing

Reproduce

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