ab-angle->ABCF B

Percentage Accurate: 53.8% → 67.3%
Time: 16.8s
Alternatives: 21
Speedup: 23.3×

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 21 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.8% 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: 67.3% 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 := \mathsf{fma}\left(\pi, angle\_m \cdot 0.005555555555555556, 1\right)\\ t_1 := \left(a + b\right) \cdot \left(b - a\right)\\ t_2 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\ t_3 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\ t_4 := \sin t\_3\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+36}:\\ \;\;\;\;\left(2 \cdot \mathsf{fma}\left(\cos t\_0, \cos 1, \sin t\_0 \cdot \sin 1\right)\right) \cdot \left(\left(t\_4 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+186}:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \left(\sqrt{{t\_4}^{2}} \cdot t\_2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left({\left(\sqrt[3]{t\_3}\right)}^{3}\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (fma PI (* angle_m 0.005555555555555556) 1.0))
        (t_1 (* (+ a b) (- b a)))
        (t_2 (cos (* (/ angle_m 180.0) PI)))
        (t_3 (* PI (* angle_m 0.005555555555555556)))
        (t_4 (sin t_3)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 2e+36)
      (*
       (* 2.0 (fma (cos t_0) (cos 1.0) (* (sin t_0) (sin 1.0))))
       (* (* t_4 (+ a b)) (- b a)))
      (if (<= (/ angle_m 180.0) 5e+186)
        (* t_1 (* 2.0 (* (sqrt (pow t_4 2.0)) t_2)))
        (* t_1 (* 2.0 (* t_2 (sin (pow (cbrt t_3) 3.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 = fma(((double) M_PI), (angle_m * 0.005555555555555556), 1.0);
	double t_1 = (a + b) * (b - a);
	double t_2 = cos(((angle_m / 180.0) * ((double) M_PI)));
	double t_3 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double t_4 = sin(t_3);
	double tmp;
	if ((angle_m / 180.0) <= 2e+36) {
		tmp = (2.0 * fma(cos(t_0), cos(1.0), (sin(t_0) * sin(1.0)))) * ((t_4 * (a + b)) * (b - a));
	} else if ((angle_m / 180.0) <= 5e+186) {
		tmp = t_1 * (2.0 * (sqrt(pow(t_4, 2.0)) * t_2));
	} else {
		tmp = t_1 * (2.0 * (t_2 * sin(pow(cbrt(t_3), 3.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 = fma(pi, Float64(angle_m * 0.005555555555555556), 1.0)
	t_1 = Float64(Float64(a + b) * Float64(b - a))
	t_2 = cos(Float64(Float64(angle_m / 180.0) * pi))
	t_3 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	t_4 = sin(t_3)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e+36)
		tmp = Float64(Float64(2.0 * fma(cos(t_0), cos(1.0), Float64(sin(t_0) * sin(1.0)))) * Float64(Float64(t_4 * Float64(a + b)) * Float64(b - a)));
	elseif (Float64(angle_m / 180.0) <= 5e+186)
		tmp = Float64(t_1 * Float64(2.0 * Float64(sqrt((t_4 ^ 2.0)) * t_2)));
	else
		tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * sin((cbrt(t_3) ^ 3.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] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sin[t$95$3], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+36], N[(N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[Cos[1.0], $MachinePrecision] + N[(N[Sin[t$95$0], $MachinePrecision] * N[Sin[1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$4 * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+186], N[(t$95$1 * N[(2.0 * N[(N[Sqrt[N[Power[t$95$4, 2.0], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[Sin[N[Power[N[Power[t$95$3, 1/3], $MachinePrecision], 3.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 := \mathsf{fma}\left(\pi, angle\_m \cdot 0.005555555555555556, 1\right)\\
t_1 := \left(a + b\right) \cdot \left(b - a\right)\\
t_2 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
t_3 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_4 := \sin t\_3\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+36}:\\
\;\;\;\;\left(2 \cdot \mathsf{fma}\left(\cos t\_0, \cos 1, \sin t\_0 \cdot \sin 1\right)\right) \cdot \left(\left(t\_4 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+186}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\sqrt{{t\_4}^{2}} \cdot t\_2\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left({\left(\sqrt[3]{t\_3}\right)}^{3}\right)\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000008e36

    1. Initial program 61.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. Step-by-step derivation
      1. associate-*l*61.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)} \]
    10. Step-by-step derivation
      1. metadata-eval73.6%

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \cos \left(e^{\mathsf{log1p}\left(\left(angle \cdot \color{blue}{0.005555555555555556}\right) \cdot \pi\right)} - 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      8. associate-*r*63.6%

        \[\leadsto \left(2 \cdot \cos \left(e^{\mathsf{log1p}\left(\color{blue}{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)} - 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      9. *-commutative63.6%

        \[\leadsto \left(2 \cdot \cos \left(e^{\mathsf{log1p}\left(angle \cdot \color{blue}{\left(\pi \cdot 0.005555555555555556\right)}\right)} - 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
    11. Applied egg-rr63.6%

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

        \[\leadsto \left(2 \cdot \cos \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
    13. Simplified64.1%

      \[\leadsto \left(2 \cdot \cos \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
    14. Step-by-step derivation
      1. expm1-undefine63.6%

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

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

        \[\leadsto \left(2 \cdot \left(\cos \left(e^{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}}\right) \cdot \cos 1 + \sin \left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right) \cdot \sin 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      4. log1p-undefine64.1%

        \[\leadsto \left(2 \cdot \left(\cos \left(e^{\color{blue}{\log \left(1 + \mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}}\right) \cdot \cos 1 + \sin \left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right) \cdot \sin 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      5. rem-exp-log63.6%

        \[\leadsto \left(2 \cdot \left(\cos \color{blue}{\left(1 + \mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)} \cdot \cos 1 + \sin \left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right) \cdot \sin 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      6. expm1-log1p-u63.6%

        \[\leadsto \left(2 \cdot \left(\cos \left(1 + \color{blue}{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right) \cdot \cos 1 + \sin \left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right) \cdot \sin 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      7. log1p-expm1-u63.6%

        \[\leadsto \left(2 \cdot \left(\cos \left(1 + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \cos 1 + \sin \left(e^{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}}\right) \cdot \sin 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      8. log1p-undefine63.6%

        \[\leadsto \left(2 \cdot \left(\cos \left(1 + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \cos 1 + \sin \left(e^{\color{blue}{\log \left(1 + \mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}}\right) \cdot \sin 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      9. rem-exp-log64.1%

        \[\leadsto \left(2 \cdot \left(\cos \left(1 + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \cos 1 + \sin \color{blue}{\left(1 + \mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)} \cdot \sin 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      10. expm1-log1p-u76.5%

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

      \[\leadsto \left(2 \cdot \color{blue}{\left(\cos \left(1 + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \cos 1 + \sin \left(1 + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin 1\right)}\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
    16. Step-by-step derivation
      1. fma-define76.4%

        \[\leadsto \left(2 \cdot \color{blue}{\mathsf{fma}\left(\cos \left(1 + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right), \cos 1, \sin \left(1 + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin 1\right)}\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      2. +-commutative76.4%

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

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

        \[\leadsto \left(2 \cdot \mathsf{fma}\left(\cos \left(\color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556 + 1\right), \cos 1, \sin \left(1 + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      5. associate-*r*76.4%

        \[\leadsto \left(2 \cdot \mathsf{fma}\left(\cos \left(\color{blue}{\pi \cdot \left(angle \cdot 0.005555555555555556\right)} + 1\right), \cos 1, \sin \left(1 + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      6. fma-define76.9%

        \[\leadsto \left(2 \cdot \mathsf{fma}\left(\cos \color{blue}{\left(\mathsf{fma}\left(\pi, angle \cdot 0.005555555555555556, 1\right)\right)}, \cos 1, \sin \left(1 + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      7. +-commutative76.9%

        \[\leadsto \left(2 \cdot \mathsf{fma}\left(\cos \left(\mathsf{fma}\left(\pi, angle \cdot 0.005555555555555556, 1\right)\right), \cos 1, \sin \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right) + 1\right)} \cdot \sin 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      8. associate-*r*77.7%

        \[\leadsto \left(2 \cdot \mathsf{fma}\left(\cos \left(\mathsf{fma}\left(\pi, angle \cdot 0.005555555555555556, 1\right)\right), \cos 1, \sin \left(\color{blue}{\left(angle \cdot \pi\right) \cdot 0.005555555555555556} + 1\right) \cdot \sin 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      9. *-commutative77.7%

        \[\leadsto \left(2 \cdot \mathsf{fma}\left(\cos \left(\mathsf{fma}\left(\pi, angle \cdot 0.005555555555555556, 1\right)\right), \cos 1, \sin \left(\color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556 + 1\right) \cdot \sin 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      10. associate-*r*78.8%

        \[\leadsto \left(2 \cdot \mathsf{fma}\left(\cos \left(\mathsf{fma}\left(\pi, angle \cdot 0.005555555555555556, 1\right)\right), \cos 1, \sin \left(\color{blue}{\pi \cdot \left(angle \cdot 0.005555555555555556\right)} + 1\right) \cdot \sin 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      11. fma-define78.8%

        \[\leadsto \left(2 \cdot \mathsf{fma}\left(\cos \left(\mathsf{fma}\left(\pi, angle \cdot 0.005555555555555556, 1\right)\right), \cos 1, \sin \color{blue}{\left(\mathsf{fma}\left(\pi, angle \cdot 0.005555555555555556, 1\right)\right)} \cdot \sin 1\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
    17. Simplified78.8%

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

    if 2.00000000000000008e36 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999954e186

    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. Step-by-step derivation
      1. associate-*l*26.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999954e186 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 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 := \left(a + b\right) \cdot \left(b - a\right)\\ t_2 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\ t_3 := \sin t\_0\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+98}:\\ \;\;\;\;\left(\left(t\_3 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos \left(\pi \cdot {\left({\left(angle\_m \cdot 0.005555555555555556\right)}^{3}\right)}^{0.3333333333333333}\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+186}:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \left(\sqrt{{t\_3}^{2}} \cdot t\_2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left({\left(\sqrt[3]{t\_0}\right)}^{3}\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
        (t_1 (* (+ a b) (- b a)))
        (t_2 (cos (* (/ angle_m 180.0) PI)))
        (t_3 (sin t_0)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 5e+98)
      (*
       (* (* t_3 (+ a b)) (- b a))
       (*
        2.0
        (cos
         (*
          PI
          (pow
           (pow (* angle_m 0.005555555555555556) 3.0)
           0.3333333333333333)))))
      (if (<= (/ angle_m 180.0) 5e+186)
        (* t_1 (* 2.0 (* (sqrt (pow t_3 2.0)) t_2)))
        (* t_1 (* 2.0 (* t_2 (sin (pow (cbrt t_0) 3.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 = (a + b) * (b - a);
	double t_2 = cos(((angle_m / 180.0) * ((double) M_PI)));
	double t_3 = sin(t_0);
	double tmp;
	if ((angle_m / 180.0) <= 5e+98) {
		tmp = ((t_3 * (a + b)) * (b - a)) * (2.0 * cos((((double) M_PI) * pow(pow((angle_m * 0.005555555555555556), 3.0), 0.3333333333333333))));
	} else if ((angle_m / 180.0) <= 5e+186) {
		tmp = t_1 * (2.0 * (sqrt(pow(t_3, 2.0)) * t_2));
	} else {
		tmp = t_1 * (2.0 * (t_2 * sin(pow(cbrt(t_0), 3.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 = (a + b) * (b - a);
	double t_2 = Math.cos(((angle_m / 180.0) * Math.PI));
	double t_3 = Math.sin(t_0);
	double tmp;
	if ((angle_m / 180.0) <= 5e+98) {
		tmp = ((t_3 * (a + b)) * (b - a)) * (2.0 * Math.cos((Math.PI * Math.pow(Math.pow((angle_m * 0.005555555555555556), 3.0), 0.3333333333333333))));
	} else if ((angle_m / 180.0) <= 5e+186) {
		tmp = t_1 * (2.0 * (Math.sqrt(Math.pow(t_3, 2.0)) * t_2));
	} else {
		tmp = t_1 * (2.0 * (t_2 * Math.sin(Math.pow(Math.cbrt(t_0), 3.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(a + b) * Float64(b - a))
	t_2 = cos(Float64(Float64(angle_m / 180.0) * pi))
	t_3 = sin(t_0)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e+98)
		tmp = Float64(Float64(Float64(t_3 * Float64(a + b)) * Float64(b - a)) * Float64(2.0 * cos(Float64(pi * ((Float64(angle_m * 0.005555555555555556) ^ 3.0) ^ 0.3333333333333333)))));
	elseif (Float64(angle_m / 180.0) <= 5e+186)
		tmp = Float64(t_1 * Float64(2.0 * Float64(sqrt((t_3 ^ 2.0)) * t_2)));
	else
		tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * sin((cbrt(t_0) ^ 3.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[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+98], N[(N[(N[(t$95$3 * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Cos[N[(Pi * N[Power[N[Power[N[(angle$95$m * 0.005555555555555556), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+186], N[(t$95$1 * N[(2.0 * N[(N[Sqrt[N[Power[t$95$3, 2.0], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[Sin[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.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 := \left(a + b\right) \cdot \left(b - a\right)\\
t_2 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
t_3 := \sin t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+98}:\\
\;\;\;\;\left(\left(t\_3 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos \left(\pi \cdot {\left({\left(angle\_m \cdot 0.005555555555555556\right)}^{3}\right)}^{0.3333333333333333}\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+186}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\sqrt{{t\_3}^{2}} \cdot t\_2\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left({\left(\sqrt[3]{t\_0}\right)}^{3}\right)\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 4.9999999999999998e98

    1. Initial program 58.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. Step-by-step derivation
      1. associate-*l*58.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \cos \left(\pi \cdot {\left({\left(angle \cdot \color{blue}{0.005555555555555556}\right)}^{3}\right)}^{0.3333333333333333}\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
    11. Applied egg-rr48.7%

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

    if 4.9999999999999998e98 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999954e186

    1. Initial program 26.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. Step-by-step derivation
      1. associate-*l*26.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999954e186 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 67.1% 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 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\ t_2 := \sin t\_0\\ t_3 := \left(a + b\right) \cdot \left(b - a\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\ \;\;\;\;\left(\left(t\_2 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos t\_0\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+186}:\\ \;\;\;\;t\_3 \cdot \left(2 \cdot \left(\sqrt{{t\_2}^{2}} \cdot t\_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_3 \cdot \left(2 \cdot \left(t\_1 \cdot \sin \left({\left(\sqrt[3]{t\_0}\right)}^{3}\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
        (t_1 (cos (* (/ angle_m 180.0) PI)))
        (t_2 (sin t_0))
        (t_3 (* (+ a b) (- b a))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 4e+20)
      (* (* (* t_2 (+ a b)) (- b a)) (* 2.0 (cos t_0)))
      (if (<= (/ angle_m 180.0) 5e+186)
        (* t_3 (* 2.0 (* (sqrt (pow t_2 2.0)) t_1)))
        (* t_3 (* 2.0 (* t_1 (sin (pow (cbrt t_0) 3.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 = cos(((angle_m / 180.0) * ((double) M_PI)));
	double t_2 = sin(t_0);
	double t_3 = (a + b) * (b - a);
	double tmp;
	if ((angle_m / 180.0) <= 4e+20) {
		tmp = ((t_2 * (a + b)) * (b - a)) * (2.0 * cos(t_0));
	} else if ((angle_m / 180.0) <= 5e+186) {
		tmp = t_3 * (2.0 * (sqrt(pow(t_2, 2.0)) * t_1));
	} else {
		tmp = t_3 * (2.0 * (t_1 * sin(pow(cbrt(t_0), 3.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 = Math.cos(((angle_m / 180.0) * Math.PI));
	double t_2 = Math.sin(t_0);
	double t_3 = (a + b) * (b - a);
	double tmp;
	if ((angle_m / 180.0) <= 4e+20) {
		tmp = ((t_2 * (a + b)) * (b - a)) * (2.0 * Math.cos(t_0));
	} else if ((angle_m / 180.0) <= 5e+186) {
		tmp = t_3 * (2.0 * (Math.sqrt(Math.pow(t_2, 2.0)) * t_1));
	} else {
		tmp = t_3 * (2.0 * (t_1 * Math.sin(Math.pow(Math.cbrt(t_0), 3.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 = cos(Float64(Float64(angle_m / 180.0) * pi))
	t_2 = sin(t_0)
	t_3 = Float64(Float64(a + b) * Float64(b - a))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 4e+20)
		tmp = Float64(Float64(Float64(t_2 * Float64(a + b)) * Float64(b - a)) * Float64(2.0 * cos(t_0)));
	elseif (Float64(angle_m / 180.0) <= 5e+186)
		tmp = Float64(t_3 * Float64(2.0 * Float64(sqrt((t_2 ^ 2.0)) * t_1)));
	else
		tmp = Float64(t_3 * Float64(2.0 * Float64(t_1 * sin((cbrt(t_0) ^ 3.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[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+20], N[(N[(N[(t$95$2 * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+186], N[(t$95$3 * N[(2.0 * N[(N[Sqrt[N[Power[t$95$2, 2.0], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[(2.0 * N[(t$95$1 * N[Sin[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.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 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
t_2 := \sin t\_0\\
t_3 := \left(a + b\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\
\;\;\;\;\left(\left(t\_2 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos t\_0\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+186}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(\sqrt{{t\_2}^{2}} \cdot t\_1\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(t\_1 \cdot \sin \left({\left(\sqrt[3]{t\_0}\right)}^{3}\right)\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 4e20

    1. Initial program 61.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. Step-by-step derivation
      1. associate-*l*61.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e20 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999954e186

    1. Initial program 25.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. Step-by-step derivation
      1. associate-*l*25.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999954e186 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 66.4% 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 := \left(a + b\right) \cdot \left(b - a\right)\\ t_2 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+24}:\\ \;\;\;\;\left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos \left(\pi \cdot \sqrt[3]{{\left(angle\_m \cdot 0.005555555555555556\right)}^{3}}\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+172}:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left({\left(\sqrt[3]{t\_0}\right)}^{3}\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
        (t_1 (* (+ a b) (- b a)))
        (t_2 (cos (* (/ angle_m 180.0) PI))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1e+24)
      (*
       (* (* (sin t_0) (+ a b)) (- b a))
       (* 2.0 (cos (* PI (cbrt (pow (* angle_m 0.005555555555555556) 3.0))))))
      (if (<= (/ angle_m 180.0) 2e+172)
        (* t_1 (* 2.0 (* t_2 (* angle_m (* PI 0.005555555555555556)))))
        (* t_1 (* 2.0 (* t_2 (sin (pow (cbrt t_0) 3.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 = (a + b) * (b - a);
	double t_2 = cos(((angle_m / 180.0) * ((double) M_PI)));
	double tmp;
	if ((angle_m / 180.0) <= 1e+24) {
		tmp = ((sin(t_0) * (a + b)) * (b - a)) * (2.0 * cos((((double) M_PI) * cbrt(pow((angle_m * 0.005555555555555556), 3.0)))));
	} else if ((angle_m / 180.0) <= 2e+172) {
		tmp = t_1 * (2.0 * (t_2 * (angle_m * (((double) M_PI) * 0.005555555555555556))));
	} else {
		tmp = t_1 * (2.0 * (t_2 * sin(pow(cbrt(t_0), 3.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 = (a + b) * (b - a);
	double t_2 = Math.cos(((angle_m / 180.0) * Math.PI));
	double tmp;
	if ((angle_m / 180.0) <= 1e+24) {
		tmp = ((Math.sin(t_0) * (a + b)) * (b - a)) * (2.0 * Math.cos((Math.PI * Math.cbrt(Math.pow((angle_m * 0.005555555555555556), 3.0)))));
	} else if ((angle_m / 180.0) <= 2e+172) {
		tmp = t_1 * (2.0 * (t_2 * (angle_m * (Math.PI * 0.005555555555555556))));
	} else {
		tmp = t_1 * (2.0 * (t_2 * Math.sin(Math.pow(Math.cbrt(t_0), 3.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(a + b) * Float64(b - a))
	t_2 = cos(Float64(Float64(angle_m / 180.0) * pi))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1e+24)
		tmp = Float64(Float64(Float64(sin(t_0) * Float64(a + b)) * Float64(b - a)) * Float64(2.0 * cos(Float64(pi * cbrt((Float64(angle_m * 0.005555555555555556) ^ 3.0))))));
	elseif (Float64(angle_m / 180.0) <= 2e+172)
		tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * Float64(angle_m * Float64(pi * 0.005555555555555556)))));
	else
		tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * sin((cbrt(t_0) ^ 3.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[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+24], N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Cos[N[(Pi * N[Power[N[Power[N[(angle$95$m * 0.005555555555555556), $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+172], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[Sin[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.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 := \left(a + b\right) \cdot \left(b - a\right)\\
t_2 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+24}:\\
\;\;\;\;\left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos \left(\pi \cdot \sqrt[3]{{\left(angle\_m \cdot 0.005555555555555556\right)}^{3}}\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+172}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left({\left(\sqrt[3]{t\_0}\right)}^{3}\right)\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999998e23

    1. Initial program 61.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. Step-by-step derivation
      1. associate-*l*61.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)} \]
    10. Step-by-step derivation
      1. metadata-eval74.4%

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

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

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

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

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

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

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

    if 9.9999999999999998e23 < (/.f64 angle #s(literal 180 binary64)) < 2.0000000000000002e172

    1. Initial program 26.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000002e172 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 22.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 66.1% 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)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+24}:\\ \;\;\;\;\left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos \left(\pi \cdot \sqrt[3]{{\left(angle\_m \cdot 0.005555555555555556\right)}^{3}}\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{+186}:\\ \;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \cos t\_0\right) \cdot \left(\left(b - a\right) \cdot \left(\left(a + b\right) \cdot \sin \left(\pi \cdot e^{\log \left(angle\_m \cdot 0.005555555555555556\right)}\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (* angle_m 0.005555555555555556))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1e+24)
      (*
       (* (* (sin t_0) (+ a b)) (- b a))
       (* 2.0 (cos (* PI (cbrt (pow (* angle_m 0.005555555555555556) 3.0))))))
      (if (<= (/ angle_m 180.0) 1.5e+186)
        (*
         (* (+ a b) (- b a))
         (*
          2.0
          (*
           (cos (* (/ angle_m 180.0) PI))
           (* angle_m (* PI 0.005555555555555556)))))
        (*
         (* 2.0 (cos t_0))
         (*
          (- b a)
          (*
           (+ a b)
           (sin (* PI (exp (log (* angle_m 0.005555555555555556)))))))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double tmp;
	if ((angle_m / 180.0) <= 1e+24) {
		tmp = ((sin(t_0) * (a + b)) * (b - a)) * (2.0 * cos((((double) M_PI) * cbrt(pow((angle_m * 0.005555555555555556), 3.0)))));
	} else if ((angle_m / 180.0) <= 1.5e+186) {
		tmp = ((a + b) * (b - a)) * (2.0 * (cos(((angle_m / 180.0) * ((double) M_PI))) * (angle_m * (((double) M_PI) * 0.005555555555555556))));
	} else {
		tmp = (2.0 * cos(t_0)) * ((b - a) * ((a + b) * sin((((double) M_PI) * exp(log((angle_m * 0.005555555555555556)))))));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = Math.PI * (angle_m * 0.005555555555555556);
	double tmp;
	if ((angle_m / 180.0) <= 1e+24) {
		tmp = ((Math.sin(t_0) * (a + b)) * (b - a)) * (2.0 * Math.cos((Math.PI * Math.cbrt(Math.pow((angle_m * 0.005555555555555556), 3.0)))));
	} else if ((angle_m / 180.0) <= 1.5e+186) {
		tmp = ((a + b) * (b - a)) * (2.0 * (Math.cos(((angle_m / 180.0) * Math.PI)) * (angle_m * (Math.PI * 0.005555555555555556))));
	} else {
		tmp = (2.0 * Math.cos(t_0)) * ((b - a) * ((a + b) * Math.sin((Math.PI * Math.exp(Math.log((angle_m * 0.005555555555555556)))))));
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1e+24)
		tmp = Float64(Float64(Float64(sin(t_0) * Float64(a + b)) * Float64(b - a)) * Float64(2.0 * cos(Float64(pi * cbrt((Float64(angle_m * 0.005555555555555556) ^ 3.0))))));
	elseif (Float64(angle_m / 180.0) <= 1.5e+186)
		tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * Float64(angle_m * Float64(pi * 0.005555555555555556)))));
	else
		tmp = Float64(Float64(2.0 * cos(t_0)) * Float64(Float64(b - a) * Float64(Float64(a + b) * sin(Float64(pi * exp(log(Float64(angle_m * 0.005555555555555556))))))));
	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]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+24], N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Cos[N[(Pi * N[Power[N[Power[N[(angle$95$m * 0.005555555555555556), $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1.5e+186], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[Sin[N[(Pi * N[Exp[N[Log[N[(angle$95$m * 0.005555555555555556), $MachinePrecision]], $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)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+24}:\\
\;\;\;\;\left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos \left(\pi \cdot \sqrt[3]{{\left(angle\_m \cdot 0.005555555555555556\right)}^{3}}\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{+186}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \cos t\_0\right) \cdot \left(\left(b - a\right) \cdot \left(\left(a + b\right) \cdot \sin \left(\pi \cdot e^{\log \left(angle\_m \cdot 0.005555555555555556\right)}\right)\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999998e23

    1. Initial program 61.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. Step-by-step derivation
      1. associate-*l*61.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)} \]
    10. Step-by-step derivation
      1. metadata-eval74.4%

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

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

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

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

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

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

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

    if 9.9999999999999998e23 < (/.f64 angle #s(literal 180 binary64)) < 1.49999999999999991e186

    1. Initial program 25.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. Step-by-step derivation
      1. associate-*l*25.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.49999999999999991e186 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 66.1% 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 \cos t\_0\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\ \;\;\;\;\left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot t\_1\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{+186}:\\ \;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(\left(b - a\right) \cdot \left(\left(a + b\right) \cdot \sin \left(\pi \cdot e^{\log \left(angle\_m \cdot 0.005555555555555556\right)}\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (* angle_m 0.005555555555555556))) (t_1 (* 2.0 (cos t_0))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 4e+20)
      (* (* (* (sin t_0) (+ a b)) (- b a)) t_1)
      (if (<= (/ angle_m 180.0) 1.5e+186)
        (*
         (* (+ a b) (- b a))
         (*
          2.0
          (*
           (cos (* (/ angle_m 180.0) PI))
           (* angle_m (* PI 0.005555555555555556)))))
        (*
         t_1
         (*
          (- b a)
          (*
           (+ a b)
           (sin (* PI (exp (log (* angle_m 0.005555555555555556)))))))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double t_1 = 2.0 * cos(t_0);
	double tmp;
	if ((angle_m / 180.0) <= 4e+20) {
		tmp = ((sin(t_0) * (a + b)) * (b - a)) * t_1;
	} else if ((angle_m / 180.0) <= 1.5e+186) {
		tmp = ((a + b) * (b - a)) * (2.0 * (cos(((angle_m / 180.0) * ((double) M_PI))) * (angle_m * (((double) M_PI) * 0.005555555555555556))));
	} else {
		tmp = t_1 * ((b - a) * ((a + b) * sin((((double) M_PI) * exp(log((angle_m * 0.005555555555555556)))))));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = Math.PI * (angle_m * 0.005555555555555556);
	double t_1 = 2.0 * Math.cos(t_0);
	double tmp;
	if ((angle_m / 180.0) <= 4e+20) {
		tmp = ((Math.sin(t_0) * (a + b)) * (b - a)) * t_1;
	} else if ((angle_m / 180.0) <= 1.5e+186) {
		tmp = ((a + b) * (b - a)) * (2.0 * (Math.cos(((angle_m / 180.0) * Math.PI)) * (angle_m * (Math.PI * 0.005555555555555556))));
	} else {
		tmp = t_1 * ((b - a) * ((a + b) * Math.sin((Math.PI * Math.exp(Math.log((angle_m * 0.005555555555555556)))))));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = math.pi * (angle_m * 0.005555555555555556)
	t_1 = 2.0 * math.cos(t_0)
	tmp = 0
	if (angle_m / 180.0) <= 4e+20:
		tmp = ((math.sin(t_0) * (a + b)) * (b - a)) * t_1
	elif (angle_m / 180.0) <= 1.5e+186:
		tmp = ((a + b) * (b - a)) * (2.0 * (math.cos(((angle_m / 180.0) * math.pi)) * (angle_m * (math.pi * 0.005555555555555556))))
	else:
		tmp = t_1 * ((b - a) * ((a + b) * math.sin((math.pi * math.exp(math.log((angle_m * 0.005555555555555556)))))))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	t_1 = Float64(2.0 * cos(t_0))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 4e+20)
		tmp = Float64(Float64(Float64(sin(t_0) * Float64(a + b)) * Float64(b - a)) * t_1);
	elseif (Float64(angle_m / 180.0) <= 1.5e+186)
		tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * Float64(angle_m * Float64(pi * 0.005555555555555556)))));
	else
		tmp = Float64(t_1 * Float64(Float64(b - a) * Float64(Float64(a + b) * sin(Float64(pi * exp(log(Float64(angle_m * 0.005555555555555556))))))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = pi * (angle_m * 0.005555555555555556);
	t_1 = 2.0 * cos(t_0);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 4e+20)
		tmp = ((sin(t_0) * (a + b)) * (b - a)) * t_1;
	elseif ((angle_m / 180.0) <= 1.5e+186)
		tmp = ((a + b) * (b - a)) * (2.0 * (cos(((angle_m / 180.0) * pi)) * (angle_m * (pi * 0.005555555555555556))));
	else
		tmp = t_1 * ((b - a) * ((a + b) * sin((pi * exp(log((angle_m * 0.005555555555555556)))))));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+20], N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1.5e+186], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(b - a), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[Sin[N[(Pi * N[Exp[N[Log[N[(angle$95$m * 0.005555555555555556), $MachinePrecision]], $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 \cos t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\
\;\;\;\;\left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot t\_1\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{+186}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(\left(b - a\right) \cdot \left(\left(a + b\right) \cdot \sin \left(\pi \cdot e^{\log \left(angle\_m \cdot 0.005555555555555556\right)}\right)\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 4e20

    1. Initial program 61.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. Step-by-step derivation
      1. associate-*l*61.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e20 < (/.f64 angle #s(literal 180 binary64)) < 1.49999999999999991e186

    1. Initial program 25.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. Step-by-step derivation
      1. associate-*l*25.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.49999999999999991e186 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 66.4% accurate, 1.3× 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 := \left(a + b\right) \cdot \left(b - a\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\ \;\;\;\;\left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos t\_0\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+166}:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \sin \left(\frac{angle\_m}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
        (t_1 (* (+ a b) (- b a))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 4e+20)
      (* (* (* (sin t_0) (+ a b)) (- b a)) (* 2.0 (cos t_0)))
      (if (<= (/ angle_m 180.0) 5e+166)
        (*
         t_1
         (*
          2.0
          (*
           (cos (* (/ angle_m 180.0) PI))
           (* angle_m (* PI 0.005555555555555556)))))
        (* t_1 (* 2.0 (sin (* (/ angle_m 180.0) (pow (sqrt 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 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double t_1 = (a + b) * (b - a);
	double tmp;
	if ((angle_m / 180.0) <= 4e+20) {
		tmp = ((sin(t_0) * (a + b)) * (b - a)) * (2.0 * cos(t_0));
	} else if ((angle_m / 180.0) <= 5e+166) {
		tmp = t_1 * (2.0 * (cos(((angle_m / 180.0) * ((double) M_PI))) * (angle_m * (((double) M_PI) * 0.005555555555555556))));
	} else {
		tmp = t_1 * (2.0 * sin(((angle_m / 180.0) * pow(sqrt(((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 = Math.PI * (angle_m * 0.005555555555555556);
	double t_1 = (a + b) * (b - a);
	double tmp;
	if ((angle_m / 180.0) <= 4e+20) {
		tmp = ((Math.sin(t_0) * (a + b)) * (b - a)) * (2.0 * Math.cos(t_0));
	} else if ((angle_m / 180.0) <= 5e+166) {
		tmp = t_1 * (2.0 * (Math.cos(((angle_m / 180.0) * Math.PI)) * (angle_m * (Math.PI * 0.005555555555555556))));
	} else {
		tmp = t_1 * (2.0 * Math.sin(((angle_m / 180.0) * Math.pow(Math.sqrt(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 = math.pi * (angle_m * 0.005555555555555556)
	t_1 = (a + b) * (b - a)
	tmp = 0
	if (angle_m / 180.0) <= 4e+20:
		tmp = ((math.sin(t_0) * (a + b)) * (b - a)) * (2.0 * math.cos(t_0))
	elif (angle_m / 180.0) <= 5e+166:
		tmp = t_1 * (2.0 * (math.cos(((angle_m / 180.0) * math.pi)) * (angle_m * (math.pi * 0.005555555555555556))))
	else:
		tmp = t_1 * (2.0 * math.sin(((angle_m / 180.0) * math.pow(math.sqrt(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(pi * Float64(angle_m * 0.005555555555555556))
	t_1 = Float64(Float64(a + b) * Float64(b - a))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 4e+20)
		tmp = Float64(Float64(Float64(sin(t_0) * Float64(a + b)) * Float64(b - a)) * Float64(2.0 * cos(t_0)));
	elseif (Float64(angle_m / 180.0) <= 5e+166)
		tmp = Float64(t_1 * Float64(2.0 * Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * Float64(angle_m * Float64(pi * 0.005555555555555556)))));
	else
		tmp = Float64(t_1 * Float64(2.0 * sin(Float64(Float64(angle_m / 180.0) * (sqrt(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 = pi * (angle_m * 0.005555555555555556);
	t_1 = (a + b) * (b - a);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 4e+20)
		tmp = ((sin(t_0) * (a + b)) * (b - a)) * (2.0 * cos(t_0));
	elseif ((angle_m / 180.0) <= 5e+166)
		tmp = t_1 * (2.0 * (cos(((angle_m / 180.0) * pi)) * (angle_m * (pi * 0.005555555555555556))));
	else
		tmp = t_1 * (2.0 * sin(((angle_m / 180.0) * (sqrt(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[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+20], N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+166], N[(t$95$1 * N[(2.0 * N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $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 := \left(a + b\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\
\;\;\;\;\left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos t\_0\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+166}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \sin \left(\frac{angle\_m}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 4e20

    1. Initial program 61.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. Step-by-step derivation
      1. associate-*l*61.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e20 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000002e166

    1. Initial program 24.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. Step-by-step derivation
      1. associate-*l*24.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000002e166 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 25.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 66.0% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := \frac{angle\_m}{180} \cdot \pi\\
t_2 := \left(a + b\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\
\;\;\;\;\left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos t\_0\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+222}:\\
\;\;\;\;t\_2 \cdot \left(2 \cdot \left(\cos t\_1 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(2 \cdot \sin t\_1\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 4e20

    1. Initial program 61.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. Step-by-step derivation
      1. associate-*l*61.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e20 < (/.f64 angle #s(literal 180 binary64)) < 2.0000000000000001e222

    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. Step-by-step derivation
      1. associate-*l*25.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e222 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.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. Step-by-step derivation
      1. associate-*l*24.9%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 62.1% accurate, 1.9× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{b}^{2} \leq 2 \cdot 10^{+303}:\\ \;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\left(b - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= (pow b 2.0) 2e+303)
    (* (* (+ a b) (- b a)) (sin (* angle_m (* PI 0.011111111111111112))))
    (* b (* (- b a) (sin (* 0.011111111111111112 (* angle_m PI))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (pow(b, 2.0) <= 2e+303) {
		tmp = ((a + b) * (b - a)) * sin((angle_m * (((double) M_PI) * 0.011111111111111112)));
	} else {
		tmp = b * ((b - a) * sin((0.011111111111111112 * (angle_m * ((double) M_PI)))));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (Math.pow(b, 2.0) <= 2e+303) {
		tmp = ((a + b) * (b - a)) * Math.sin((angle_m * (Math.PI * 0.011111111111111112)));
	} else {
		tmp = b * ((b - a) * Math.sin((0.011111111111111112 * (angle_m * Math.PI))));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if math.pow(b, 2.0) <= 2e+303:
		tmp = ((a + b) * (b - a)) * math.sin((angle_m * (math.pi * 0.011111111111111112)))
	else:
		tmp = b * ((b - a) * math.sin((0.011111111111111112 * (angle_m * math.pi))))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if ((b ^ 2.0) <= 2e+303)
		tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * sin(Float64(angle_m * Float64(pi * 0.011111111111111112))));
	else
		tmp = Float64(b * Float64(Float64(b - a) * sin(Float64(0.011111111111111112 * Float64(angle_m * pi)))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if ((b ^ 2.0) <= 2e+303)
		tmp = ((a + b) * (b - a)) * sin((angle_m * (pi * 0.011111111111111112)));
	else
		tmp = b * ((b - a) * sin((0.011111111111111112 * (angle_m * pi))));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 2e+303], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 2 \cdot 10^{+303}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\

\mathbf{else}:\\
\;\;\;\;b \cdot \left(\left(b - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 b #s(literal 2 binary64)) < 2e303

    1. Initial program 57.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. Step-by-step derivation
      1. associate-*l*57.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)} - 1\right)} \]
    11. Step-by-step derivation
      1. log1p-undefine25.5%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(e^{\color{blue}{\log \left(1 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}} - 1\right) \]
      2. rem-exp-log25.5%

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

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

        \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(\sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) + \left(1 - 1\right)\right)} \]
      5. metadata-eval55.0%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) + \color{blue}{0}\right) \]
      6. +-rgt-identity55.0%

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

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

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

        \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(2 \cdot \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right) \]
      10. count-256.3%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right) + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)} \]
      11. *-commutative56.3%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(angle \cdot \color{blue}{\left(0.005555555555555556 \cdot \pi\right)} + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \]
      12. *-commutative56.3%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right) + angle \cdot \color{blue}{\left(0.005555555555555556 \cdot \pi\right)}\right) \]
      13. distribute-lft-out56.3%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \color{blue}{\left(angle \cdot \left(0.005555555555555556 \cdot \pi + 0.005555555555555556 \cdot \pi\right)\right)} \]
      14. distribute-rgt-out56.3%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(angle \cdot \color{blue}{\left(\pi \cdot \left(0.005555555555555556 + 0.005555555555555556\right)\right)}\right) \]
      15. metadata-eval56.3%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot \color{blue}{0.011111111111111112}\right)\right) \]
    12. Simplified56.3%

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

    if 2e303 < (pow.f64 b #s(literal 2 binary64))

    1. Initial program 42.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left|b \cdot \left(b - a\right)\right|} \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
    12. Step-by-step derivation
      1. pow153.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\left(b \cdot \left(b - a\right)\right) \cdot \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}^{1}} \]
    14. Step-by-step derivation
      1. unpow155.4%

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

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

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

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

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right) \]
      6. count-265.8%

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

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{\left(angle \cdot \pi\right) \cdot 0.005555555555555556} + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \]
      8. *-commutative68.5%

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

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556 + \color{blue}{\left(angle \cdot \pi\right) \cdot 0.005555555555555556}\right)\right) \]
      10. *-commutative71.2%

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556 + \color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556\right)\right) \]
      11. distribute-lft-out71.2%

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(\left(\pi \cdot angle\right) \cdot \left(0.005555555555555556 + 0.005555555555555556\right)\right)}\right) \]
      12. metadata-eval71.2%

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \color{blue}{0.011111111111111112}\right)\right) \]
      13. *-commutative71.2%

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)}\right) \]
      14. *-commutative71.2%

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(0.011111111111111112 \cdot \color{blue}{\left(angle \cdot \pi\right)}\right)\right) \]
    15. Simplified71.2%

      \[\leadsto \color{blue}{b \cdot \left(\left(b - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.6%

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

Alternative 10: 66.0% accurate, 3.1× 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 := \left(a + b\right) \cdot \left(b - a\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\ \;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(2 \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+223}:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \left(\cos t\_0 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \sin t\_0\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (/ angle_m 180.0) PI)) (t_1 (* (+ a b) (- b a))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 4e+20)
      (*
       (+ a b)
       (* (- b a) (sin (* (* angle_m 0.005555555555555556) (* 2.0 PI)))))
      (if (<= (/ angle_m 180.0) 1e+223)
        (* t_1 (* 2.0 (* (cos t_0) (* angle_m (* PI 0.005555555555555556)))))
        (* t_1 (* 2.0 (sin t_0))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * ((double) M_PI);
	double t_1 = (a + b) * (b - a);
	double tmp;
	if ((angle_m / 180.0) <= 4e+20) {
		tmp = (a + b) * ((b - a) * sin(((angle_m * 0.005555555555555556) * (2.0 * ((double) M_PI)))));
	} else if ((angle_m / 180.0) <= 1e+223) {
		tmp = t_1 * (2.0 * (cos(t_0) * (angle_m * (((double) M_PI) * 0.005555555555555556))));
	} else {
		tmp = t_1 * (2.0 * sin(t_0));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * Math.PI;
	double t_1 = (a + b) * (b - a);
	double tmp;
	if ((angle_m / 180.0) <= 4e+20) {
		tmp = (a + b) * ((b - a) * Math.sin(((angle_m * 0.005555555555555556) * (2.0 * Math.PI))));
	} else if ((angle_m / 180.0) <= 1e+223) {
		tmp = t_1 * (2.0 * (Math.cos(t_0) * (angle_m * (Math.PI * 0.005555555555555556))));
	} else {
		tmp = t_1 * (2.0 * Math.sin(t_0));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = (angle_m / 180.0) * math.pi
	t_1 = (a + b) * (b - a)
	tmp = 0
	if (angle_m / 180.0) <= 4e+20:
		tmp = (a + b) * ((b - a) * math.sin(((angle_m * 0.005555555555555556) * (2.0 * math.pi))))
	elif (angle_m / 180.0) <= 1e+223:
		tmp = t_1 * (2.0 * (math.cos(t_0) * (angle_m * (math.pi * 0.005555555555555556))))
	else:
		tmp = t_1 * (2.0 * math.sin(t_0))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(Float64(angle_m / 180.0) * pi)
	t_1 = Float64(Float64(a + b) * Float64(b - a))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 4e+20)
		tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(Float64(angle_m * 0.005555555555555556) * Float64(2.0 * pi)))));
	elseif (Float64(angle_m / 180.0) <= 1e+223)
		tmp = Float64(t_1 * Float64(2.0 * Float64(cos(t_0) * Float64(angle_m * Float64(pi * 0.005555555555555556)))));
	else
		tmp = Float64(t_1 * Float64(2.0 * sin(t_0)));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = (angle_m / 180.0) * pi;
	t_1 = (a + b) * (b - a);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 4e+20)
		tmp = (a + b) * ((b - a) * sin(((angle_m * 0.005555555555555556) * (2.0 * pi))));
	elseif ((angle_m / 180.0) <= 1e+223)
		tmp = t_1 * (2.0 * (cos(t_0) * (angle_m * (pi * 0.005555555555555556))));
	else
		tmp = t_1 * (2.0 * sin(t_0));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+20], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[(2.0 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+223], N[(t$95$1 * N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \frac{angle\_m}{180} \cdot \pi\\
t_1 := \left(a + b\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(2 \cdot \pi\right)\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+223}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\cos t\_0 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \sin t\_0\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 4e20

    1. Initial program 61.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. Step-by-step derivation
      1. associate-*l*61.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e20 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000005e223

    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. Step-by-step derivation
      1. associate-*l*25.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000005e223 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.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. Step-by-step derivation
      1. associate-*l*24.9%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 67.3% accurate, 3.4× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\ \;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(2 \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= (/ angle_m 180.0) 4e+20)
    (*
     (+ a b)
     (* (- b a) (sin (* (* angle_m 0.005555555555555556) (* 2.0 PI)))))
    (* (* (+ a b) (- b a)) (* 2.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 tmp;
	if ((angle_m / 180.0) <= 4e+20) {
		tmp = (a + b) * ((b - a) * sin(((angle_m * 0.005555555555555556) * (2.0 * ((double) M_PI)))));
	} else {
		tmp = ((a + b) * (b - a)) * (2.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 tmp;
	if ((angle_m / 180.0) <= 4e+20) {
		tmp = (a + b) * ((b - a) * Math.sin(((angle_m * 0.005555555555555556) * (2.0 * Math.PI))));
	} else {
		tmp = ((a + b) * (b - a)) * (2.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):
	tmp = 0
	if (angle_m / 180.0) <= 4e+20:
		tmp = (a + b) * ((b - a) * math.sin(((angle_m * 0.005555555555555556) * (2.0 * math.pi))))
	else:
		tmp = ((a + b) * (b - a)) * (2.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)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 4e+20)
		tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(Float64(angle_m * 0.005555555555555556) * Float64(2.0 * pi)))));
	else
		tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.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)
	tmp = 0.0;
	if ((angle_m / 180.0) <= 4e+20)
		tmp = (a + b) * ((b - a) * sin(((angle_m * 0.005555555555555556) * (2.0 * pi))));
	else
		tmp = ((a + b) * (b - a)) * (2.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_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+20], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[(2.0 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(2 \cdot \pi\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)\\


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

    1. Initial program 61.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. Step-by-step derivation
      1. associate-*l*61.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e20 < (/.f64 angle #s(literal 180 binary64))

    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. Step-by-step derivation
      1. associate-*l*25.1%

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

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

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

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

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

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

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

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

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

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

Alternative 12: 67.4% accurate, 3.4× speedup?

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

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(2 \cdot \pi\right)\right)\right)\\

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


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

    1. Initial program 61.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. Step-by-step derivation
      1. associate-*l*61.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e20 < (/.f64 angle #s(literal 180 binary64))

    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. Step-by-step derivation
      1. associate-*l*25.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 59.2% accurate, 3.5× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b \leq 6.8 \cdot 10^{+99}:\\ \;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot t\_0\\ \mathbf{elif}\;b \leq 1.3 \cdot 10^{+155}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\left(b - a\right) \cdot t\_0\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (sin (* 0.011111111111111112 (* angle_m PI)))))
   (*
    angle_s
    (if (<= b 6.8e+99)
      (* (* (+ a b) (- b a)) t_0)
      (if (<= b 1.3e+155)
        (* 0.011111111111111112 (* (* angle_m b) (* PI (- b a))))
        (* b (* (- b a) 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 = sin((0.011111111111111112 * (angle_m * ((double) M_PI))));
	double tmp;
	if (b <= 6.8e+99) {
		tmp = ((a + b) * (b - a)) * t_0;
	} else if (b <= 1.3e+155) {
		tmp = 0.011111111111111112 * ((angle_m * b) * (((double) M_PI) * (b - a)));
	} else {
		tmp = b * ((b - a) * 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.sin((0.011111111111111112 * (angle_m * Math.PI)));
	double tmp;
	if (b <= 6.8e+99) {
		tmp = ((a + b) * (b - a)) * t_0;
	} else if (b <= 1.3e+155) {
		tmp = 0.011111111111111112 * ((angle_m * b) * (Math.PI * (b - a)));
	} else {
		tmp = b * ((b - a) * t_0);
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = math.sin((0.011111111111111112 * (angle_m * math.pi)))
	tmp = 0
	if b <= 6.8e+99:
		tmp = ((a + b) * (b - a)) * t_0
	elif b <= 1.3e+155:
		tmp = 0.011111111111111112 * ((angle_m * b) * (math.pi * (b - a)))
	else:
		tmp = b * ((b - a) * 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 = sin(Float64(0.011111111111111112 * Float64(angle_m * pi)))
	tmp = 0.0
	if (b <= 6.8e+99)
		tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * t_0);
	elseif (b <= 1.3e+155)
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * b) * Float64(pi * Float64(b - a))));
	else
		tmp = Float64(b * Float64(Float64(b - a) * t_0));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = sin((0.011111111111111112 * (angle_m * pi)));
	tmp = 0.0;
	if (b <= 6.8e+99)
		tmp = ((a + b) * (b - a)) * t_0;
	elseif (b <= 1.3e+155)
		tmp = 0.011111111111111112 * ((angle_m * b) * (pi * (b - a)));
	else
		tmp = b * ((b - a) * t_0);
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b, 6.8e+99], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[b, 1.3e+155], N[(0.011111111111111112 * N[(N[(angle$95$m * b), $MachinePrecision] * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(b - a), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 6.8 \cdot 10^{+99}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot t\_0\\

\mathbf{elif}\;b \leq 1.3 \cdot 10^{+155}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;b \cdot \left(\left(b - a\right) \cdot t\_0\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 6.79999999999999968e99

    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. Step-by-step derivation
      1. associate-*l*57.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\color{blue}{\left(angle \cdot \pi\right) \cdot 0.005555555555555556} + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \]
      9. *-commutative58.3%

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556 + \color{blue}{\left(angle \cdot \pi\right) \cdot 0.005555555555555556}\right) \]
      11. *-commutative58.4%

        \[\leadsto \left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556 + \color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556\right) \]
      12. distribute-lft-out58.4%

        \[\leadsto \left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \color{blue}{\left(\left(\pi \cdot angle\right) \cdot \left(0.005555555555555556 + 0.005555555555555556\right)\right)} \]
      13. metadata-eval58.4%

        \[\leadsto \left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \color{blue}{0.011111111111111112}\right) \]
      14. *-commutative58.4%

        \[\leadsto \left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \color{blue}{\left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)} \]
      15. *-commutative58.4%

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

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

    if 6.79999999999999968e99 < b < 1.3000000000000001e155

    1. Initial program 38.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. Step-by-step derivation
      1. associate-*l*38.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*47.0%

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

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

    if 1.3000000000000001e155 < b

    1. Initial program 36.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left|b \cdot \left(b - a\right)\right|} \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
    12. Step-by-step derivation
      1. pow149.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right)\right) \]
      4. *-commutative67.5%

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

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right) \]
      6. count-264.9%

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

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{\left(angle \cdot \pi\right) \cdot 0.005555555555555556} + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \]
      8. *-commutative64.9%

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

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556 + \color{blue}{\left(angle \cdot \pi\right) \cdot 0.005555555555555556}\right)\right) \]
      10. *-commutative67.5%

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556 + \color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556\right)\right) \]
      11. distribute-lft-out67.5%

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(\left(\pi \cdot angle\right) \cdot \left(0.005555555555555556 + 0.005555555555555556\right)\right)}\right) \]
      12. metadata-eval67.5%

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \color{blue}{0.011111111111111112}\right)\right) \]
      13. *-commutative67.5%

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)}\right) \]
      14. *-commutative67.5%

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(0.011111111111111112 \cdot \color{blue}{\left(angle \cdot \pi\right)}\right)\right) \]
    15. Simplified67.5%

      \[\leadsto \color{blue}{b \cdot \left(\left(b - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 14: 56.4% accurate, 3.6× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b \leq 1.02 \cdot 10^{+155}:\\ \;\;\;\;angle\_m \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\left(b - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= b 1.02e+155)
    (* angle_m (* (* (+ a b) (- b a)) (* PI 0.011111111111111112)))
    (* b (* (- b a) (sin (* 0.011111111111111112 (* angle_m PI))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (b <= 1.02e+155) {
		tmp = angle_m * (((a + b) * (b - a)) * (((double) M_PI) * 0.011111111111111112));
	} else {
		tmp = b * ((b - a) * sin((0.011111111111111112 * (angle_m * ((double) M_PI)))));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (b <= 1.02e+155) {
		tmp = angle_m * (((a + b) * (b - a)) * (Math.PI * 0.011111111111111112));
	} else {
		tmp = b * ((b - a) * Math.sin((0.011111111111111112 * (angle_m * Math.PI))));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if b <= 1.02e+155:
		tmp = angle_m * (((a + b) * (b - a)) * (math.pi * 0.011111111111111112))
	else:
		tmp = b * ((b - a) * math.sin((0.011111111111111112 * (angle_m * math.pi))))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (b <= 1.02e+155)
		tmp = Float64(angle_m * Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(pi * 0.011111111111111112)));
	else
		tmp = Float64(b * Float64(Float64(b - a) * sin(Float64(0.011111111111111112 * Float64(angle_m * pi)))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (b <= 1.02e+155)
		tmp = angle_m * (((a + b) * (b - a)) * (pi * 0.011111111111111112));
	else
		tmp = b * ((b - a) * sin((0.011111111111111112 * (angle_m * pi))));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 1.02e+155], N[(angle$95$m * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 1.02 \cdot 10^{+155}:\\
\;\;\;\;angle\_m \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\

\mathbf{else}:\\
\;\;\;\;b \cdot \left(\left(b - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.02e155

    1. Initial program 56.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right)} \]
    8. Step-by-step derivation
      1. fma-define36.1%

        \[\leadsto angle \cdot \color{blue}{\mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right), 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right)} \]
      2. +-commutative36.1%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right), 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right) \]
      3. *-commutative36.1%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \color{blue}{\left(\left(b - a\right) \cdot \left(b + a\right)\right)}, 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right) \]
      4. +-commutative36.1%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(b - a\right) \cdot \color{blue}{\left(a + b\right)}\right), 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-out36.1%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right), 2 \cdot \left({angle}^{2} \cdot \color{blue}{\left(\left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \left(-8.573388203017833 \cdot 10^{-8} + -2.8577960676726107 \cdot 10^{-8}\right)\right)}\right)\right) \]
    9. Simplified36.1%

      \[\leadsto \color{blue}{angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right), 2 \cdot \left({angle}^{2} \cdot \left(\left({\pi}^{3} \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot -1.1431184270690443 \cdot 10^{-7}\right)\right)\right)} \]
    10. Taylor expanded in angle around 0 54.9%

      \[\leadsto angle \cdot \color{blue}{\left(0.011111111111111112 \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*55.0%

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

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

    if 1.02e155 < b

    1. Initial program 36.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left|b \cdot \left(b - a\right)\right|} \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
    12. Step-by-step derivation
      1. pow149.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}\right)\right) \]
      4. *-commutative67.5%

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

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right) \]
      6. count-264.9%

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

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{\left(angle \cdot \pi\right) \cdot 0.005555555555555556} + angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \]
      8. *-commutative64.9%

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

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556 + \color{blue}{\left(angle \cdot \pi\right) \cdot 0.005555555555555556}\right)\right) \]
      10. *-commutative67.5%

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556 + \color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556\right)\right) \]
      11. distribute-lft-out67.5%

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(\left(\pi \cdot angle\right) \cdot \left(0.005555555555555556 + 0.005555555555555556\right)\right)}\right) \]
      12. metadata-eval67.5%

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot \color{blue}{0.011111111111111112}\right)\right) \]
      13. *-commutative67.5%

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)}\right) \]
      14. *-commutative67.5%

        \[\leadsto b \cdot \left(\left(b - a\right) \cdot \sin \left(0.011111111111111112 \cdot \color{blue}{\left(angle \cdot \pi\right)}\right)\right) \]
    15. Simplified67.5%

      \[\leadsto \color{blue}{b \cdot \left(\left(b - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.9%

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

Alternative 15: 65.8% accurate, 3.6× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(2 \cdot \left(\left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (*
   2.0
   (* (* (sin (* PI (* angle_m 0.005555555555555556))) (+ a b)) (- b a)))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (2.0 * ((sin((((double) M_PI) * (angle_m * 0.005555555555555556))) * (a + b)) * (b - a)));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (2.0 * ((Math.sin((Math.PI * (angle_m * 0.005555555555555556))) * (a + b)) * (b - a)));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (2.0 * ((math.sin((math.pi * (angle_m * 0.005555555555555556))) * (a + b)) * (b - a)))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(2.0 * Float64(Float64(sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) * Float64(a + b)) * Float64(b - a))))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (2.0 * ((sin((pi * (angle_m * 0.005555555555555556))) * (a + b)) * (b - a)));
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(2.0 * N[(N[(N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \left(2 \cdot \left(\left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.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. Step-by-step derivation
    1. associate-*l*53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 56.1% accurate, 23.3× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b \leq 2.9 \cdot 10^{+149}:\\ \;\;\;\;angle\_m \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= b 2.9e+149)
    (* angle_m (* (* (+ a b) (- b a)) (* PI 0.011111111111111112)))
    (* 0.011111111111111112 (* (* angle_m b) (* PI (- b a)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (b <= 2.9e+149) {
		tmp = angle_m * (((a + b) * (b - a)) * (((double) M_PI) * 0.011111111111111112));
	} else {
		tmp = 0.011111111111111112 * ((angle_m * b) * (((double) M_PI) * (b - a)));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (b <= 2.9e+149) {
		tmp = angle_m * (((a + b) * (b - a)) * (Math.PI * 0.011111111111111112));
	} else {
		tmp = 0.011111111111111112 * ((angle_m * b) * (Math.PI * (b - a)));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if b <= 2.9e+149:
		tmp = angle_m * (((a + b) * (b - a)) * (math.pi * 0.011111111111111112))
	else:
		tmp = 0.011111111111111112 * ((angle_m * b) * (math.pi * (b - a)))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (b <= 2.9e+149)
		tmp = Float64(angle_m * Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(pi * 0.011111111111111112)));
	else
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * b) * Float64(pi * Float64(b - a))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (b <= 2.9e+149)
		tmp = angle_m * (((a + b) * (b - a)) * (pi * 0.011111111111111112));
	else
		tmp = 0.011111111111111112 * ((angle_m * b) * (pi * (b - a)));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 2.9e+149], N[(angle$95$m * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle$95$m * b), $MachinePrecision] * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 2.9 \cdot 10^{+149}:\\
\;\;\;\;angle\_m \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\

\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 2.9000000000000002e149

    1. Initial program 56.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right)} \]
    8. Step-by-step derivation
      1. fma-define36.4%

        \[\leadsto angle \cdot \color{blue}{\mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right), 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right)} \]
      2. +-commutative36.4%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right), 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right) \]
      3. *-commutative36.4%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \color{blue}{\left(\left(b - a\right) \cdot \left(b + a\right)\right)}, 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right) \]
      4. +-commutative36.4%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(b - a\right) \cdot \color{blue}{\left(a + b\right)}\right), 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-out36.4%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right), 2 \cdot \left({angle}^{2} \cdot \color{blue}{\left(\left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \left(-8.573388203017833 \cdot 10^{-8} + -2.8577960676726107 \cdot 10^{-8}\right)\right)}\right)\right) \]
    9. Simplified36.4%

      \[\leadsto \color{blue}{angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right), 2 \cdot \left({angle}^{2} \cdot \left(\left({\pi}^{3} \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot -1.1431184270690443 \cdot 10^{-7}\right)\right)\right)} \]
    10. Taylor expanded in angle around 0 55.3%

      \[\leadsto angle \cdot \color{blue}{\left(0.011111111111111112 \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*55.4%

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

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

    if 2.9000000000000002e149 < b

    1. Initial program 35.1%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*68.7%

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

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

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

Alternative 17: 55.8% accurate, 23.3× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b \leq 2.5 \cdot 10^{+117}:\\ \;\;\;\;angle\_m \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= b 2.5e+117)
    (* angle_m (* 0.011111111111111112 (* PI (* (+ a b) (- b a)))))
    (* 0.011111111111111112 (* (* angle_m b) (* PI (- b a)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (b <= 2.5e+117) {
		tmp = angle_m * (0.011111111111111112 * (((double) M_PI) * ((a + b) * (b - a))));
	} else {
		tmp = 0.011111111111111112 * ((angle_m * b) * (((double) M_PI) * (b - a)));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (b <= 2.5e+117) {
		tmp = angle_m * (0.011111111111111112 * (Math.PI * ((a + b) * (b - a))));
	} else {
		tmp = 0.011111111111111112 * ((angle_m * b) * (Math.PI * (b - a)));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if b <= 2.5e+117:
		tmp = angle_m * (0.011111111111111112 * (math.pi * ((a + b) * (b - a))))
	else:
		tmp = 0.011111111111111112 * ((angle_m * b) * (math.pi * (b - a)))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (b <= 2.5e+117)
		tmp = Float64(angle_m * Float64(0.011111111111111112 * Float64(pi * Float64(Float64(a + b) * Float64(b - a)))));
	else
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * b) * Float64(pi * Float64(b - a))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (b <= 2.5e+117)
		tmp = angle_m * (0.011111111111111112 * (pi * ((a + b) * (b - a))));
	else
		tmp = 0.011111111111111112 * ((angle_m * b) * (pi * (b - a)));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 2.5e+117], N[(angle$95$m * N[(0.011111111111111112 * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle$95$m * b), $MachinePrecision] * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 2.5 \cdot 10^{+117}:\\
\;\;\;\;angle\_m \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 2.49999999999999992e117

    1. Initial program 57.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. Step-by-step derivation
      1. associate-*l*57.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right)} \]
    8. Step-by-step derivation
      1. fma-define36.9%

        \[\leadsto angle \cdot \color{blue}{\mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right), 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right)} \]
      2. +-commutative36.9%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right), 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right) \]
      3. *-commutative36.9%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \color{blue}{\left(\left(b - a\right) \cdot \left(b + a\right)\right)}, 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right) \]
      4. +-commutative36.9%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(b - a\right) \cdot \color{blue}{\left(a + b\right)}\right), 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-out36.9%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right), 2 \cdot \left({angle}^{2} \cdot \color{blue}{\left(\left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \left(-8.573388203017833 \cdot 10^{-8} + -2.8577960676726107 \cdot 10^{-8}\right)\right)}\right)\right) \]
    9. Simplified36.9%

      \[\leadsto \color{blue}{angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right), 2 \cdot \left({angle}^{2} \cdot \left(\left({\pi}^{3} \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot -1.1431184270690443 \cdot 10^{-7}\right)\right)\right)} \]
    10. Taylor expanded in angle around 0 56.2%

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

    if 2.49999999999999992e117 < b

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*62.4%

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

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

Alternative 18: 55.8% accurate, 23.3× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b \leq 4.1 \cdot 10^{+117}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= b 4.1e+117)
    (* 0.011111111111111112 (* angle_m (* PI (* (+ a b) (- b a)))))
    (* 0.011111111111111112 (* (* angle_m b) (* PI (- b a)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (b <= 4.1e+117) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * ((a + b) * (b - a))));
	} else {
		tmp = 0.011111111111111112 * ((angle_m * b) * (((double) M_PI) * (b - a)));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (b <= 4.1e+117) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * ((a + b) * (b - a))));
	} else {
		tmp = 0.011111111111111112 * ((angle_m * b) * (Math.PI * (b - a)));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if b <= 4.1e+117:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * ((a + b) * (b - a))))
	else:
		tmp = 0.011111111111111112 * ((angle_m * b) * (math.pi * (b - a)))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (b <= 4.1e+117)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(a + b) * Float64(b - a)))));
	else
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * b) * Float64(pi * Float64(b - a))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (b <= 4.1e+117)
		tmp = 0.011111111111111112 * (angle_m * (pi * ((a + b) * (b - a))));
	else
		tmp = 0.011111111111111112 * ((angle_m * b) * (pi * (b - a)));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 4.1e+117], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle$95$m * b), $MachinePrecision] * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 4.1 \cdot 10^{+117}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 4.0999999999999999e117

    1. Initial program 57.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. Taylor expanded in angle around 0 55.2%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow257.5%

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

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

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

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

    if 4.0999999999999999e117 < b

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*62.4%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(\left(angle \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.1%

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

Alternative 19: 40.3% accurate, 38.1× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* 0.011111111111111112 (* (* angle_m b) (* PI (- b a))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * ((angle_m * b) * (((double) M_PI) * (b - a))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * ((angle_m * b) * (Math.PI * (b - a))));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (0.011111111111111112 * ((angle_m * b) * (math.pi * (b - a))))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(0.011111111111111112 * Float64(Float64(angle_m * b) * Float64(pi * Float64(b - a)))))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (0.011111111111111112 * ((angle_m * b) * (pi * (b - a))));
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(N[(angle$95$m * b), $MachinePrecision] * N[(Pi * N[(b - a), $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(\left(angle\_m \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.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. Step-by-step derivation
    1. associate-*l*53.3%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]
  9. Step-by-step derivation
    1. associate-*r*42.7%

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

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(\left(angle \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)} \]
  11. Add Preprocessing

Alternative 20: 37.3% accurate, 38.1× 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(b \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* 0.011111111111111112 (* angle_m (* b (* PI (- b a)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (angle_m * (b * (((double) M_PI) * (b - a)))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (angle_m * (b * (Math.PI * (b - a)))));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (0.011111111111111112 * (angle_m * (b * (math.pi * (b - a)))))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(b * Float64(pi * Float64(b - a))))))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (0.011111111111111112 * (angle_m * (b * (pi * (b - a)))));
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(b * N[(Pi * 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(b \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.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. Step-by-step derivation
    1. associate-*l*53.3%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)} \]
  9. Add Preprocessing

Alternative 21: 13.5% accurate, 419.0× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot 0 \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m) :precision binary64 (* angle_s 0.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 * 0.0;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0d0, angle)
real(8) function code(angle_s, a, b, angle_m)
    real(8), intent (in) :: angle_s
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle_m
    code = angle_s * 0.0d0
end function
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.0;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * 0.0
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * 0.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 * 0.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 * 0.0), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot 0
\end{array}
Derivation
  1. Initial program 53.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. expm1-log1p-u36.4%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\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)\right)\right)} \]
    2. expm1-undefine23.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\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)\right)} - 1} \]
  4. Applied egg-rr22.9%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)} - 1} \]
  5. Taylor expanded in angle around 0 11.8%

    \[\leadsto \color{blue}{1} - 1 \]
  6. Step-by-step derivation
    1. metadata-eval11.8%

      \[\leadsto \color{blue}{0} \]
  7. Applied egg-rr11.8%

    \[\leadsto \color{blue}{0} \]
  8. Add Preprocessing

Reproduce

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