ab-angle->ABCF B

Percentage Accurate: 54.4% → 66.0%
Time: 16.9s
Alternatives: 23
Speedup: 26.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 23 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: 54.4% accurate, 1.0× speedup?

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

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

Alternative 1: 66.0% accurate, 0.5× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ 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 := \sqrt{\log t\_0}\\ t_2 := \frac{angle\_m}{180} \cdot \pi\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 20000000000:\\ \;\;\;\;2 \cdot \left(\cos t\_0 \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\sin t\_0 \cdot \left(b\_m + a\_m\right)\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+106}:\\ \;\;\;\;\left({b\_m}^{2} - {a\_m}^{2}\right) \cdot \left|\sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right|\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+223}:\\ \;\;\;\;\cos \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(\left(2 \cdot \left(\left(b\_m - a\_m\right) \cdot \left(b\_m + a\_m\right)\right)\right) \cdot \sin \left({\left(e^{t\_1}\right)}^{t\_1}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(b\_m + a\_m\right) \cdot \left|b\_m - a\_m\right|\right)\right) \cdot \sin t\_2\right) \cdot \cos t\_2\\ \end{array} \end{array} \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
        (t_1 (sqrt (log t_0)))
        (t_2 (* (/ angle_m 180.0) PI)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 20000000000.0)
      (* 2.0 (* (cos t_0) (* (- b_m a_m) (* (sin t_0) (+ b_m a_m)))))
      (if (<= (/ angle_m 180.0) 4e+106)
        (*
         (- (pow b_m 2.0) (pow a_m 2.0))
         (fabs (sin (* PI (* angle_m 0.011111111111111112)))))
        (if (<= (/ angle_m 180.0) 5e+223)
          (*
           (cos (* 0.005555555555555556 (* angle_m PI)))
           (* (* 2.0 (* (- b_m a_m) (+ b_m a_m))) (sin (pow (exp t_1) t_1))))
          (*
           (* (* 2.0 (* (+ b_m a_m) (fabs (- b_m a_m)))) (sin t_2))
           (cos t_2))))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double t_1 = sqrt(log(t_0));
	double t_2 = (angle_m / 180.0) * ((double) M_PI);
	double tmp;
	if ((angle_m / 180.0) <= 20000000000.0) {
		tmp = 2.0 * (cos(t_0) * ((b_m - a_m) * (sin(t_0) * (b_m + a_m))));
	} else if ((angle_m / 180.0) <= 4e+106) {
		tmp = (pow(b_m, 2.0) - pow(a_m, 2.0)) * fabs(sin((((double) M_PI) * (angle_m * 0.011111111111111112))));
	} else if ((angle_m / 180.0) <= 5e+223) {
		tmp = cos((0.005555555555555556 * (angle_m * ((double) M_PI)))) * ((2.0 * ((b_m - a_m) * (b_m + a_m))) * sin(pow(exp(t_1), t_1)));
	} else {
		tmp = ((2.0 * ((b_m + a_m) * fabs((b_m - a_m)))) * sin(t_2)) * cos(t_2);
	}
	return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	double t_0 = Math.PI * (angle_m * 0.005555555555555556);
	double t_1 = Math.sqrt(Math.log(t_0));
	double t_2 = (angle_m / 180.0) * Math.PI;
	double tmp;
	if ((angle_m / 180.0) <= 20000000000.0) {
		tmp = 2.0 * (Math.cos(t_0) * ((b_m - a_m) * (Math.sin(t_0) * (b_m + a_m))));
	} else if ((angle_m / 180.0) <= 4e+106) {
		tmp = (Math.pow(b_m, 2.0) - Math.pow(a_m, 2.0)) * Math.abs(Math.sin((Math.PI * (angle_m * 0.011111111111111112))));
	} else if ((angle_m / 180.0) <= 5e+223) {
		tmp = Math.cos((0.005555555555555556 * (angle_m * Math.PI))) * ((2.0 * ((b_m - a_m) * (b_m + a_m))) * Math.sin(Math.pow(Math.exp(t_1), t_1)));
	} else {
		tmp = ((2.0 * ((b_m + a_m) * Math.abs((b_m - a_m)))) * Math.sin(t_2)) * Math.cos(t_2);
	}
	return angle_s * tmp;
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	t_0 = math.pi * (angle_m * 0.005555555555555556)
	t_1 = math.sqrt(math.log(t_0))
	t_2 = (angle_m / 180.0) * math.pi
	tmp = 0
	if (angle_m / 180.0) <= 20000000000.0:
		tmp = 2.0 * (math.cos(t_0) * ((b_m - a_m) * (math.sin(t_0) * (b_m + a_m))))
	elif (angle_m / 180.0) <= 4e+106:
		tmp = (math.pow(b_m, 2.0) - math.pow(a_m, 2.0)) * math.fabs(math.sin((math.pi * (angle_m * 0.011111111111111112))))
	elif (angle_m / 180.0) <= 5e+223:
		tmp = math.cos((0.005555555555555556 * (angle_m * math.pi))) * ((2.0 * ((b_m - a_m) * (b_m + a_m))) * math.sin(math.pow(math.exp(t_1), t_1)))
	else:
		tmp = ((2.0 * ((b_m + a_m) * math.fabs((b_m - a_m)))) * math.sin(t_2)) * math.cos(t_2)
	return angle_s * tmp
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	t_1 = sqrt(log(t_0))
	t_2 = Float64(Float64(angle_m / 180.0) * pi)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 20000000000.0)
		tmp = Float64(2.0 * Float64(cos(t_0) * Float64(Float64(b_m - a_m) * Float64(sin(t_0) * Float64(b_m + a_m)))));
	elseif (Float64(angle_m / 180.0) <= 4e+106)
		tmp = Float64(Float64((b_m ^ 2.0) - (a_m ^ 2.0)) * abs(sin(Float64(pi * Float64(angle_m * 0.011111111111111112)))));
	elseif (Float64(angle_m / 180.0) <= 5e+223)
		tmp = Float64(cos(Float64(0.005555555555555556 * Float64(angle_m * pi))) * Float64(Float64(2.0 * Float64(Float64(b_m - a_m) * Float64(b_m + a_m))) * sin((exp(t_1) ^ t_1))));
	else
		tmp = Float64(Float64(Float64(2.0 * Float64(Float64(b_m + a_m) * abs(Float64(b_m - a_m)))) * sin(t_2)) * cos(t_2));
	end
	return Float64(angle_s * tmp)
end
a_m = abs(a);
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a_m, b_m, angle_m)
	t_0 = pi * (angle_m * 0.005555555555555556);
	t_1 = sqrt(log(t_0));
	t_2 = (angle_m / 180.0) * pi;
	tmp = 0.0;
	if ((angle_m / 180.0) <= 20000000000.0)
		tmp = 2.0 * (cos(t_0) * ((b_m - a_m) * (sin(t_0) * (b_m + a_m))));
	elseif ((angle_m / 180.0) <= 4e+106)
		tmp = ((b_m ^ 2.0) - (a_m ^ 2.0)) * abs(sin((pi * (angle_m * 0.011111111111111112))));
	elseif ((angle_m / 180.0) <= 5e+223)
		tmp = cos((0.005555555555555556 * (angle_m * pi))) * ((2.0 * ((b_m - a_m) * (b_m + a_m))) * sin((exp(t_1) ^ t_1)));
	else
		tmp = ((2.0 * ((b_m + a_m) * abs((b_m - a_m)))) * sin(t_2)) * cos(t_2);
	end
	tmp_2 = angle_s * tmp;
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[Log[t$95$0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 20000000000.0], N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+106], N[(N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Abs[N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+223], N[(N[Cos[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(2.0 * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[Power[N[Exp[t$95$1], $MachinePrecision], t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[Abs[N[(b$95$m - a$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
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 := \sqrt{\log t\_0}\\
t_2 := \frac{angle\_m}{180} \cdot \pi\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 20000000000:\\
\;\;\;\;2 \cdot \left(\cos t\_0 \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\sin t\_0 \cdot \left(b\_m + a\_m\right)\right)\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+106}:\\
\;\;\;\;\left({b\_m}^{2} - {a\_m}^{2}\right) \cdot \left|\sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right|\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+223}:\\
\;\;\;\;\cos \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(\left(2 \cdot \left(\left(b\_m - a\_m\right) \cdot \left(b\_m + a\_m\right)\right)\right) \cdot \sin \left({\left(e^{t\_1}\right)}^{t\_1}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(2 \cdot \left(\left(b\_m + a\_m\right) \cdot \left|b\_m - a\_m\right|\right)\right) \cdot \sin t\_2\right) \cdot \cos t\_2\\


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

    1. Initial program 57.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \]
    8. Taylor expanded in angle around inf 63.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)} \]
    9. Step-by-step derivation
      1. *-commutative63.1%

        \[\leadsto 2 \cdot \left(\cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\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) \]
      2. *-commutative63.1%

        \[\leadsto 2 \cdot \left(\cos \left(\color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556\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) \]
      3. associate-*r*60.2%

        \[\leadsto 2 \cdot \left(\cos \color{blue}{\left(\pi \cdot \left(angle \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)\right) \]
      4. *-commutative60.2%

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

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

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

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

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

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

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

    if 2e10 < (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000036e106

    1. Initial program 17.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*17.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. *-commutative17.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*17.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. Simplified17.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. log1p-expm1-u17.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{{\left(\sqrt[3]{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}\right)}^{3}} \]
    9. Step-by-step derivation
      1. rem-cube-cbrt17.0%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)} \]
      2. add-sqr-sqrt13.6%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\left(\sqrt{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)} \cdot \sqrt{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}\right)} \]
      3. sqrt-unprod34.2%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\sqrt{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}} \]
      4. pow234.2%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \sqrt{\color{blue}{{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}^{2}}} \]
      5. associate-*l*34.2%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \sqrt{{\sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}}^{2}} \]
    10. Applied egg-rr34.2%

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

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \sqrt{\color{blue}{\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}} \]
      2. rem-sqrt-square34.2%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\left|\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right|} \]
    12. Simplified34.2%

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

    if 4.00000000000000036e106 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999985e223

    1. Initial program 26.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \]
    8. Step-by-step derivation
      1. rem-exp-log35.6%

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left({\left(e^{\sqrt{\log \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}}\right)}^{\left(\sqrt{\log \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}\right)}\right)}\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \]
      4. rem-exp-log51.7%

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

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

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

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

    1. Initial program 27.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 67.0% accurate, 0.4× speedup?

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

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


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

    1. Initial program 56.9%

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    9. Step-by-step derivation
      1. *-commutative62.7%

        \[\leadsto 2 \cdot \left(\cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\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) \]
      2. *-commutative62.7%

        \[\leadsto 2 \cdot \left(\cos \left(\color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556\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) \]
      3. associate-*r*59.8%

        \[\leadsto 2 \cdot \left(\cos \color{blue}{\left(\pi \cdot \left(angle \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)\right) \]
      4. *-commutative59.8%

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

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

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

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

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

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

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

    if 5e51 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 23.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \]
    8. Step-by-step derivation
      1. rem-exp-log31.4%

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(e^{{\left(\sqrt[3]{\log \color{blue}{\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}}\right)}^{2}}\right)}^{\left(\sqrt[3]{\log \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}\right)}\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \]
      6. rem-exp-log37.7%

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

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

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

Alternative 3: 67.3% accurate, 0.6× speedup?

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+83}:\\
\;\;\;\;\left(t\_3 \cdot \sin t\_0\right) \cdot \cos \left({\left({t\_1}^{3}\right)}^{0.3333333333333333}\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+146}:\\
\;\;\;\;\cos t\_1 \cdot \left(t\_3 \cdot \sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\cos t\_0 \cdot \mathsf{fma}\left(b\_m, 2 \cdot \left(b\_m \cdot \sin t\_1\right), \left({a\_m}^{2} \cdot -2\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right)\right)\\


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

    1. Initial program 57.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \]
    8. Taylor expanded in angle around inf 63.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)} \]
    9. Step-by-step derivation
      1. *-commutative63.3%

        \[\leadsto 2 \cdot \left(\cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\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) \]
      2. *-commutative63.3%

        \[\leadsto 2 \cdot \left(\cos \left(\color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556\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) \]
      3. associate-*r*60.4%

        \[\leadsto 2 \cdot \left(\cos \color{blue}{\left(\pi \cdot \left(angle \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)\right) \]
      4. *-commutative60.4%

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

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

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

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

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

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

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

    if 2e20 < (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000006e83

    1. Initial program 16.4%

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000006e83 < (/.f64 angle #s(literal 180 binary64)) < 1.99999999999999987e146

    1. Initial program 12.0%

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

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

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

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

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

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

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

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

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

    if 1.99999999999999987e146 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 31.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, 2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + 0\right)\right), \left(-2 \cdot {a}^{2}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    8. Step-by-step derivation
      1. add-sqr-sqrt44.4%

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

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

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

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

Alternative 4: 66.9% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+83}:\\
\;\;\;\;t\_3 \cdot \cos \left({\left({t\_0}^{3}\right)}^{0.3333333333333333}\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+139}:\\
\;\;\;\;\cos t\_0 \cdot \left(t\_2 \cdot \sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \cos \left(\frac{angle\_m \cdot \pi}{180}\right)\\


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

    1. Initial program 57.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \]
    8. Taylor expanded in angle around inf 63.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)} \]
    9. Step-by-step derivation
      1. *-commutative63.3%

        \[\leadsto 2 \cdot \left(\cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\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) \]
      2. *-commutative63.3%

        \[\leadsto 2 \cdot \left(\cos \left(\color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556\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) \]
      3. associate-*r*60.4%

        \[\leadsto 2 \cdot \left(\cos \color{blue}{\left(\pi \cdot \left(angle \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)\right) \]
      4. *-commutative60.4%

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

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

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

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

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

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

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

    if 2e20 < (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000006e83

    1. Initial program 16.4%

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000006e83 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000003e139

    1. Initial program 13.8%

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

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

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

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

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

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

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

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

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

    if 1.00000000000000003e139 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 29.1%

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

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

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

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

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

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

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

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

Alternative 5: 64.4% accurate, 1.0× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ 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 := \cos t\_1\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 20000000000:\\ \;\;\;\;2 \cdot \left(\cos t\_0 \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\sin t\_0 \cdot \left(b\_m + a\_m\right)\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+106}:\\ \;\;\;\;\left({b\_m}^{2} - {a\_m}^{2}\right) \cdot \left|\sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right|\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+229}:\\ \;\;\;\;t\_2 \cdot \left(\left(2 \cdot \left(a\_m \cdot \left(\left(-b\_m\right) - a\_m\right)\right)\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t\_0\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(b\_m + a\_m\right) \cdot \left|b\_m - a\_m\right|\right)\right) \cdot \sin t\_1\right) \cdot t\_2\\ \end{array} \end{array} \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
        (t_1 (* (/ angle_m 180.0) PI))
        (t_2 (cos t_1)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 20000000000.0)
      (* 2.0 (* (cos t_0) (* (- b_m a_m) (* (sin t_0) (+ b_m a_m)))))
      (if (<= (/ angle_m 180.0) 4e+106)
        (*
         (- (pow b_m 2.0) (pow a_m 2.0))
         (fabs (sin (* PI (* angle_m 0.011111111111111112)))))
        (if (<= (/ angle_m 180.0) 2e+229)
          (* t_2 (* (* 2.0 (* a_m (- (- b_m) a_m))) (sin (expm1 (log1p t_0)))))
          (*
           (* (* 2.0 (* (+ b_m a_m) (fabs (- b_m a_m)))) (sin t_1))
           t_2)))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, 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 = cos(t_1);
	double tmp;
	if ((angle_m / 180.0) <= 20000000000.0) {
		tmp = 2.0 * (cos(t_0) * ((b_m - a_m) * (sin(t_0) * (b_m + a_m))));
	} else if ((angle_m / 180.0) <= 4e+106) {
		tmp = (pow(b_m, 2.0) - pow(a_m, 2.0)) * fabs(sin((((double) M_PI) * (angle_m * 0.011111111111111112))));
	} else if ((angle_m / 180.0) <= 2e+229) {
		tmp = t_2 * ((2.0 * (a_m * (-b_m - a_m))) * sin(expm1(log1p(t_0))));
	} else {
		tmp = ((2.0 * ((b_m + a_m) * fabs((b_m - a_m)))) * sin(t_1)) * t_2;
	}
	return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	double t_0 = Math.PI * (angle_m * 0.005555555555555556);
	double t_1 = (angle_m / 180.0) * Math.PI;
	double t_2 = Math.cos(t_1);
	double tmp;
	if ((angle_m / 180.0) <= 20000000000.0) {
		tmp = 2.0 * (Math.cos(t_0) * ((b_m - a_m) * (Math.sin(t_0) * (b_m + a_m))));
	} else if ((angle_m / 180.0) <= 4e+106) {
		tmp = (Math.pow(b_m, 2.0) - Math.pow(a_m, 2.0)) * Math.abs(Math.sin((Math.PI * (angle_m * 0.011111111111111112))));
	} else if ((angle_m / 180.0) <= 2e+229) {
		tmp = t_2 * ((2.0 * (a_m * (-b_m - a_m))) * Math.sin(Math.expm1(Math.log1p(t_0))));
	} else {
		tmp = ((2.0 * ((b_m + a_m) * Math.abs((b_m - a_m)))) * Math.sin(t_1)) * t_2;
	}
	return angle_s * tmp;
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	t_0 = math.pi * (angle_m * 0.005555555555555556)
	t_1 = (angle_m / 180.0) * math.pi
	t_2 = math.cos(t_1)
	tmp = 0
	if (angle_m / 180.0) <= 20000000000.0:
		tmp = 2.0 * (math.cos(t_0) * ((b_m - a_m) * (math.sin(t_0) * (b_m + a_m))))
	elif (angle_m / 180.0) <= 4e+106:
		tmp = (math.pow(b_m, 2.0) - math.pow(a_m, 2.0)) * math.fabs(math.sin((math.pi * (angle_m * 0.011111111111111112))))
	elif (angle_m / 180.0) <= 2e+229:
		tmp = t_2 * ((2.0 * (a_m * (-b_m - a_m))) * math.sin(math.expm1(math.log1p(t_0))))
	else:
		tmp = ((2.0 * ((b_m + a_m) * math.fabs((b_m - a_m)))) * math.sin(t_1)) * t_2
	return angle_s * tmp
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	t_1 = Float64(Float64(angle_m / 180.0) * pi)
	t_2 = cos(t_1)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 20000000000.0)
		tmp = Float64(2.0 * Float64(cos(t_0) * Float64(Float64(b_m - a_m) * Float64(sin(t_0) * Float64(b_m + a_m)))));
	elseif (Float64(angle_m / 180.0) <= 4e+106)
		tmp = Float64(Float64((b_m ^ 2.0) - (a_m ^ 2.0)) * abs(sin(Float64(pi * Float64(angle_m * 0.011111111111111112)))));
	elseif (Float64(angle_m / 180.0) <= 2e+229)
		tmp = Float64(t_2 * Float64(Float64(2.0 * Float64(a_m * Float64(Float64(-b_m) - a_m))) * sin(expm1(log1p(t_0)))));
	else
		tmp = Float64(Float64(Float64(2.0 * Float64(Float64(b_m + a_m) * abs(Float64(b_m - a_m)))) * sin(t_1)) * t_2);
	end
	return Float64(angle_s * tmp)
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, 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[Cos[t$95$1], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 20000000000.0], N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+106], N[(N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Abs[N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+229], N[(t$95$2 * N[(N[(2.0 * N[(a$95$m * N[((-b$95$m) - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[Abs[N[(b$95$m - a$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
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 := \cos t\_1\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 20000000000:\\
\;\;\;\;2 \cdot \left(\cos t\_0 \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\sin t\_0 \cdot \left(b\_m + a\_m\right)\right)\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+106}:\\
\;\;\;\;\left({b\_m}^{2} - {a\_m}^{2}\right) \cdot \left|\sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right|\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+229}:\\
\;\;\;\;t\_2 \cdot \left(\left(2 \cdot \left(a\_m \cdot \left(\left(-b\_m\right) - a\_m\right)\right)\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t\_0\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(2 \cdot \left(\left(b\_m + a\_m\right) \cdot \left|b\_m - a\_m\right|\right)\right) \cdot \sin t\_1\right) \cdot t\_2\\


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

    1. Initial program 57.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \]
    8. Taylor expanded in angle around inf 63.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)} \]
    9. Step-by-step derivation
      1. *-commutative63.1%

        \[\leadsto 2 \cdot \left(\cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\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) \]
      2. *-commutative63.1%

        \[\leadsto 2 \cdot \left(\cos \left(\color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556\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) \]
      3. associate-*r*60.2%

        \[\leadsto 2 \cdot \left(\cos \color{blue}{\left(\pi \cdot \left(angle \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)\right) \]
      4. *-commutative60.2%

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

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

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

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

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

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

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

    if 2e10 < (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000036e106

    1. Initial program 17.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*17.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. *-commutative17.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*17.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. Simplified17.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. log1p-expm1-u17.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{{\left(\sqrt[3]{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}\right)}^{3}} \]
    9. Step-by-step derivation
      1. rem-cube-cbrt17.0%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)} \]
      2. add-sqr-sqrt13.6%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\left(\sqrt{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)} \cdot \sqrt{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}\right)} \]
      3. sqrt-unprod34.2%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\sqrt{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}} \]
      4. pow234.2%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \sqrt{\color{blue}{{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}^{2}}} \]
      5. associate-*l*34.2%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \sqrt{{\sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}}^{2}} \]
    10. Applied egg-rr34.2%

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

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \sqrt{\color{blue}{\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}} \]
      2. rem-sqrt-square34.2%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\left|\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right|} \]
    12. Simplified34.2%

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

    if 4.00000000000000036e106 < (/.f64 angle #s(literal 180 binary64)) < 2e229

    1. Initial program 25.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e229 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 29.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 66.1% accurate, 1.0× speedup?

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+105}:\\
\;\;\;\;\left({b\_m}^{2} - {a\_m}^{2}\right) \cdot \left|\sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left(\left(2 \cdot \left(\left(b\_m - a\_m\right) \cdot \left(b\_m + a\_m\right)\right)\right) \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle\_m \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\\


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

    1. Initial program 57.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \]
    8. Taylor expanded in angle around inf 63.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)} \]
    9. Step-by-step derivation
      1. *-commutative63.1%

        \[\leadsto 2 \cdot \left(\cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\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) \]
      2. *-commutative63.1%

        \[\leadsto 2 \cdot \left(\cos \left(\color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556\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) \]
      3. associate-*r*60.2%

        \[\leadsto 2 \cdot \left(\cos \color{blue}{\left(\pi \cdot \left(angle \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)\right) \]
      4. *-commutative60.2%

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

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

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

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

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

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

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

    if 2e10 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000046e105

    1. Initial program 17.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*17.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. *-commutative17.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*17.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. Simplified17.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. log1p-expm1-u17.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{{\left(\sqrt[3]{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}\right)}^{3}} \]
    9. Step-by-step derivation
      1. rem-cube-cbrt17.0%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)} \]
      2. add-sqr-sqrt13.6%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\left(\sqrt{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)} \cdot \sqrt{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}\right)} \]
      3. sqrt-unprod34.2%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\sqrt{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}} \]
      4. pow234.2%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \sqrt{\color{blue}{{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}^{2}}} \]
      5. associate-*l*34.2%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \sqrt{{\sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}}^{2}} \]
    10. Applied egg-rr34.2%

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

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \sqrt{\color{blue}{\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}} \]
      2. rem-sqrt-square34.2%

        \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\left|\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right|} \]
    12. Simplified34.2%

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

    if 5.00000000000000046e105 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 27.1%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 66.6% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 54.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. Taylor expanded in angle around 0 51.7%

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

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

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

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

      \[\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) \]
    6. Taylor expanded in angle around 0 55.7%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)} \]
      5. *-commutative69.9%

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

        \[\leadsto \left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \color{blue}{\left(a + b\right)}\right)\right) \cdot \left(b - a\right) \]
    8. Simplified69.9%

      \[\leadsto \color{blue}{\left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)} \]
    9. Taylor expanded in angle around 0 70.0%

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

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

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

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

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

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

    if 1.9999999999999999e-77 < (/.f64 angle #s(literal 180 binary64))

    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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow236.7%

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

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

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

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

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

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

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

Alternative 8: 67.5% accurate, 1.9× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ 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 \left(2 \cdot \left(\cos t\_0 \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\sin t\_0 \cdot \left(b\_m + a\_m\right)\right)\right)\right)\right) \end{array} \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (let* ((t_0 (* PI (* angle_m 0.005555555555555556))))
   (*
    angle_s
    (* 2.0 (* (cos t_0) (* (- b_m a_m) (* (sin t_0) (+ b_m a_m))))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	return angle_s * (2.0 * (cos(t_0) * ((b_m - a_m) * (sin(t_0) * (b_m + a_m)))));
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	double t_0 = Math.PI * (angle_m * 0.005555555555555556);
	return angle_s * (2.0 * (Math.cos(t_0) * ((b_m - a_m) * (Math.sin(t_0) * (b_m + a_m)))));
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	t_0 = math.pi * (angle_m * 0.005555555555555556)
	return angle_s * (2.0 * (math.cos(t_0) * ((b_m - a_m) * (math.sin(t_0) * (b_m + a_m)))))
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	return Float64(angle_s * Float64(2.0 * Float64(cos(t_0) * Float64(Float64(b_m - a_m) * Float64(sin(t_0) * Float64(b_m + a_m))))))
end
a_m = abs(a);
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a_m, b_m, angle_m)
	t_0 = pi * (angle_m * 0.005555555555555556);
	tmp = angle_s * (2.0 * (cos(t_0) * ((b_m - a_m) * (sin(t_0) * (b_m + a_m)))));
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
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 \left(2 \cdot \left(\cos t\_0 \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\sin t\_0 \cdot \left(b\_m + a\_m\right)\right)\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 49.1%

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

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

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

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

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

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

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

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

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

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

    \[\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)} \]
  9. Step-by-step derivation
    1. *-commutative54.0%

      \[\leadsto 2 \cdot \left(\cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\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) \]
    2. *-commutative54.0%

      \[\leadsto 2 \cdot \left(\cos \left(\color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556\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) \]
    3. associate-*r*52.1%

      \[\leadsto 2 \cdot \left(\cos \color{blue}{\left(\pi \cdot \left(angle \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)\right) \]
    4. *-commutative52.1%

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

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

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

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

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

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

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

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

Alternative 9: 65.4% accurate, 3.4× speedup?

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

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


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

    1. Initial program 54.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 52.4%

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

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

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

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

      \[\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) \]
    6. Taylor expanded in angle around 0 55.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)} \]
    9. Taylor expanded in angle around 0 68.2%

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

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

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

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

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

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

    if 4.0000000000000002e92 < (/.f64 angle #s(literal 180 binary64))

    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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow225.2%

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

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

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

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

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

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

Alternative 10: 62.2% accurate, 3.5× speedup?

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

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

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


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

    1. Initial program 54.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. Taylor expanded in angle around 0 52.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. unpow254.3%

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

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

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

      \[\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) \]
    6. Taylor expanded in angle around 0 55.6%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)} \]
      5. *-commutative67.9%

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

        \[\leadsto \left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \color{blue}{\left(a + b\right)}\right)\right) \cdot \left(b - a\right) \]
    8. Simplified67.9%

      \[\leadsto \color{blue}{\left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)} \]
    9. Taylor expanded in angle around 0 67.9%

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

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

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

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

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

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

    if 1.0000000000000001e97 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 25.4%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 63.5% accurate, 3.6× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 2 \cdot 10^{+109}:\\ \;\;\;\;\left(b\_m - a\_m\right) \cdot \left(angle\_m \cdot \left(\left(b\_m + a\_m\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(b\_m + a\_m\right) \cdot \left|b\_m - a\_m\right|\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= angle_m 2e+109)
    (* (- b_m a_m) (* angle_m (* (+ b_m a_m) (* PI 0.011111111111111112))))
    (*
     0.011111111111111112
     (* angle_m (* PI (* (+ b_m a_m) (fabs (- b_m a_m)))))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (angle_m <= 2e+109) {
		tmp = (b_m - a_m) * (angle_m * ((b_m + a_m) * (((double) M_PI) * 0.011111111111111112)));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * ((b_m + a_m) * fabs((b_m - a_m)))));
	}
	return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (angle_m <= 2e+109) {
		tmp = (b_m - a_m) * (angle_m * ((b_m + a_m) * (Math.PI * 0.011111111111111112)));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * ((b_m + a_m) * Math.abs((b_m - a_m)))));
	}
	return angle_s * tmp;
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	tmp = 0
	if angle_m <= 2e+109:
		tmp = (b_m - a_m) * (angle_m * ((b_m + a_m) * (math.pi * 0.011111111111111112)))
	else:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * ((b_m + a_m) * math.fabs((b_m - a_m)))))
	return angle_s * tmp
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0
	if (angle_m <= 2e+109)
		tmp = Float64(Float64(b_m - a_m) * Float64(angle_m * Float64(Float64(b_m + a_m) * Float64(pi * 0.011111111111111112))));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(b_m + a_m) * abs(Float64(b_m - a_m))))));
	end
	return Float64(angle_s * tmp)
end
a_m = abs(a);
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0;
	if (angle_m <= 2e+109)
		tmp = (b_m - a_m) * (angle_m * ((b_m + a_m) * (pi * 0.011111111111111112)));
	else
		tmp = 0.011111111111111112 * (angle_m * (pi * ((b_m + a_m) * abs((b_m - a_m)))));
	end
	tmp_2 = angle_s * tmp;
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 2e+109], N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(angle$95$m * N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[Abs[N[(b$95$m - a$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 1.99999999999999996e109

    1. Initial program 53.6%

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

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

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

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

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

      \[\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) \]
    6. Taylor expanded in angle around 0 54.9%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)} \]
      5. *-commutative67.0%

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

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

      \[\leadsto \color{blue}{\left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)} \]
    9. Taylor expanded in angle around 0 67.0%

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

        \[\leadsto \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)} \cdot \left(b - a\right) \]
      2. *-commutative67.0%

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

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

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

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

    if 1.99999999999999996e109 < angle

    1. Initial program 27.1%

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

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

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

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

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

      \[\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) \]
    6. Step-by-step derivation
      1. add-sqr-sqrt13.5%

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

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

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \color{blue}{\sqrt{{\left(b - a\right)}^{2}}}\right)\right)\right) \]
    8. Step-by-step derivation
      1. unpow227.6%

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

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

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

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

Alternative 12: 61.8% accurate, 23.3× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 2.2 \cdot 10^{+109}:\\ \;\;\;\;\left(b\_m - a\_m\right) \cdot \left(angle\_m \cdot \left(\left(b\_m + a\_m\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b\_m \cdot a\_m\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= angle_m 2.2e+109)
    (* (- b_m a_m) (* angle_m (* (+ b_m a_m) (* PI 0.011111111111111112))))
    (* 0.011111111111111112 (* angle_m (* PI (* b_m a_m)))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (angle_m <= 2.2e+109) {
		tmp = (b_m - a_m) * (angle_m * ((b_m + a_m) * (((double) M_PI) * 0.011111111111111112)));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b_m * a_m)));
	}
	return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (angle_m <= 2.2e+109) {
		tmp = (b_m - a_m) * (angle_m * ((b_m + a_m) * (Math.PI * 0.011111111111111112)));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b_m * a_m)));
	}
	return angle_s * tmp;
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	tmp = 0
	if angle_m <= 2.2e+109:
		tmp = (b_m - a_m) * (angle_m * ((b_m + a_m) * (math.pi * 0.011111111111111112)))
	else:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (b_m * a_m)))
	return angle_s * tmp
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0
	if (angle_m <= 2.2e+109)
		tmp = Float64(Float64(b_m - a_m) * Float64(angle_m * Float64(Float64(b_m + a_m) * Float64(pi * 0.011111111111111112))));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b_m * a_m))));
	end
	return Float64(angle_s * tmp)
end
a_m = abs(a);
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0;
	if (angle_m <= 2.2e+109)
		tmp = (b_m - a_m) * (angle_m * ((b_m + a_m) * (pi * 0.011111111111111112)));
	else
		tmp = 0.011111111111111112 * (angle_m * (pi * (b_m * a_m)));
	end
	tmp_2 = angle_s * tmp;
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 2.2e+109], N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(angle$95$m * N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b$95$m * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 2.1999999999999999e109

    1. Initial program 53.6%

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

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

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

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

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

      \[\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) \]
    6. Taylor expanded in angle around 0 54.9%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)} \]
      5. *-commutative67.0%

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

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

      \[\leadsto \color{blue}{\left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)} \]
    9. Taylor expanded in angle around 0 67.0%

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

        \[\leadsto \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)} \cdot \left(b - a\right) \]
      2. *-commutative67.0%

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

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

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

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

    if 2.1999999999999999e109 < angle

    1. Initial program 27.1%

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

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

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

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

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

      \[\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) \]
    6. Taylor expanded in b around 0 22.4%

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{a} \cdot \left(b - a\right)\right)\right)\right) \]
    7. Taylor expanded in a around 0 18.1%

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

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

Alternative 13: 61.8% accurate, 23.3× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 2.2 \cdot 10^{+109}:\\ \;\;\;\;\left(b\_m - a\_m\right) \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b\_m + a\_m\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b\_m \cdot a\_m\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= angle_m 2.2e+109)
    (* (- b_m a_m) (* 0.011111111111111112 (* angle_m (* PI (+ b_m a_m)))))
    (* 0.011111111111111112 (* angle_m (* PI (* b_m a_m)))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (angle_m <= 2.2e+109) {
		tmp = (b_m - a_m) * (0.011111111111111112 * (angle_m * (((double) M_PI) * (b_m + a_m))));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b_m * a_m)));
	}
	return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (angle_m <= 2.2e+109) {
		tmp = (b_m - a_m) * (0.011111111111111112 * (angle_m * (Math.PI * (b_m + a_m))));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b_m * a_m)));
	}
	return angle_s * tmp;
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	tmp = 0
	if angle_m <= 2.2e+109:
		tmp = (b_m - a_m) * (0.011111111111111112 * (angle_m * (math.pi * (b_m + a_m))))
	else:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (b_m * a_m)))
	return angle_s * tmp
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0
	if (angle_m <= 2.2e+109)
		tmp = Float64(Float64(b_m - a_m) * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b_m + a_m)))));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b_m * a_m))));
	end
	return Float64(angle_s * tmp)
end
a_m = abs(a);
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0;
	if (angle_m <= 2.2e+109)
		tmp = (b_m - a_m) * (0.011111111111111112 * (angle_m * (pi * (b_m + a_m))));
	else
		tmp = 0.011111111111111112 * (angle_m * (pi * (b_m * a_m)));
	end
	tmp_2 = angle_s * tmp;
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 2.2e+109], N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b$95$m * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 2.1999999999999999e109

    1. Initial program 53.6%

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

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

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

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

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

      \[\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) \]
    6. Taylor expanded in angle around 0 54.9%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)} \]
      5. *-commutative67.0%

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

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

      \[\leadsto \color{blue}{\left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)} \]
    9. Taylor expanded in angle around 0 67.0%

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

    if 2.1999999999999999e109 < angle

    1. Initial program 27.1%

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

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

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

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

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

      \[\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) \]
    6. Taylor expanded in b around 0 22.4%

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{a} \cdot \left(b - a\right)\right)\right)\right) \]
    7. Taylor expanded in a around 0 18.1%

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

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

Alternative 14: 59.0% accurate, 23.3× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b\_m \leq 7.2 \cdot 10^{+151}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(b\_m - a\_m\right) \cdot \left(b\_m + a\_m\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b\_m - a\_m\right) \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(angle\_m \cdot b\_m\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= b_m 7.2e+151)
    (* 0.011111111111111112 (* angle_m (* PI (* (- b_m a_m) (+ b_m a_m)))))
    (* (- b_m a_m) (* 0.011111111111111112 (* PI (* angle_m b_m)))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (b_m <= 7.2e+151) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * ((b_m - a_m) * (b_m + a_m))));
	} else {
		tmp = (b_m - a_m) * (0.011111111111111112 * (((double) M_PI) * (angle_m * b_m)));
	}
	return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (b_m <= 7.2e+151) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * ((b_m - a_m) * (b_m + a_m))));
	} else {
		tmp = (b_m - a_m) * (0.011111111111111112 * (Math.PI * (angle_m * b_m)));
	}
	return angle_s * tmp;
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	tmp = 0
	if b_m <= 7.2e+151:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * ((b_m - a_m) * (b_m + a_m))))
	else:
		tmp = (b_m - a_m) * (0.011111111111111112 * (math.pi * (angle_m * b_m)))
	return angle_s * tmp
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0
	if (b_m <= 7.2e+151)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(b_m - a_m) * Float64(b_m + a_m)))));
	else
		tmp = Float64(Float64(b_m - a_m) * Float64(0.011111111111111112 * Float64(pi * Float64(angle_m * b_m))));
	end
	return Float64(angle_s * tmp)
end
a_m = abs(a);
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0;
	if (b_m <= 7.2e+151)
		tmp = 0.011111111111111112 * (angle_m * (pi * ((b_m - a_m) * (b_m + a_m))));
	else
		tmp = (b_m - a_m) * (0.011111111111111112 * (pi * (angle_m * b_m)));
	end
	tmp_2 = angle_s * tmp;
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b$95$m, 7.2e+151], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(0.011111111111111112 * N[(Pi * N[(angle$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 7.20000000000000001e151

    1. Initial program 52.0%

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

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

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

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

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

      \[\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 7.20000000000000001e151 < b

    1. Initial program 31.9%

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

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

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

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

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

      \[\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) \]
    6. Taylor expanded in angle around 0 37.6%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right) \cdot \left(b - a\right)} \]
      5. *-commutative64.5%

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

        \[\leadsto \left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \color{blue}{\left(a + b\right)}\right)\right) \cdot \left(b - a\right) \]
    8. Simplified64.5%

      \[\leadsto \color{blue}{\left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)} \]
    9. Taylor expanded in a around 0 62.2%

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

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

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

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

Alternative 15: 54.4% accurate, 26.2× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b\_m \leq 3.5 \cdot 10^{+35}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b\_m + a\_m\right)\right) \cdot \left(angle\_m \cdot a\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b\_m - a\_m\right) \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(angle\_m \cdot b\_m\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= b_m 3.5e+35)
    (* -0.011111111111111112 (* (* PI (+ b_m a_m)) (* angle_m a_m)))
    (* (- b_m a_m) (* 0.011111111111111112 (* PI (* angle_m b_m)))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (b_m <= 3.5e+35) {
		tmp = -0.011111111111111112 * ((((double) M_PI) * (b_m + a_m)) * (angle_m * a_m));
	} else {
		tmp = (b_m - a_m) * (0.011111111111111112 * (((double) M_PI) * (angle_m * b_m)));
	}
	return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (b_m <= 3.5e+35) {
		tmp = -0.011111111111111112 * ((Math.PI * (b_m + a_m)) * (angle_m * a_m));
	} else {
		tmp = (b_m - a_m) * (0.011111111111111112 * (Math.PI * (angle_m * b_m)));
	}
	return angle_s * tmp;
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	tmp = 0
	if b_m <= 3.5e+35:
		tmp = -0.011111111111111112 * ((math.pi * (b_m + a_m)) * (angle_m * a_m))
	else:
		tmp = (b_m - a_m) * (0.011111111111111112 * (math.pi * (angle_m * b_m)))
	return angle_s * tmp
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0
	if (b_m <= 3.5e+35)
		tmp = Float64(-0.011111111111111112 * Float64(Float64(pi * Float64(b_m + a_m)) * Float64(angle_m * a_m)));
	else
		tmp = Float64(Float64(b_m - a_m) * Float64(0.011111111111111112 * Float64(pi * Float64(angle_m * b_m))));
	end
	return Float64(angle_s * tmp)
end
a_m = abs(a);
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0;
	if (b_m <= 3.5e+35)
		tmp = -0.011111111111111112 * ((pi * (b_m + a_m)) * (angle_m * a_m));
	else
		tmp = (b_m - a_m) * (0.011111111111111112 * (pi * (angle_m * b_m)));
	end
	tmp_2 = angle_s * tmp;
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b$95$m, 3.5e+35], N[(-0.011111111111111112 * N[(N[(Pi * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(0.011111111111111112 * N[(Pi * N[(angle$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 3.5000000000000001e35

    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. unpow253.3%

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

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

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

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

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

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

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

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

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

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

    if 3.5000000000000001e35 < b

    1. Initial program 35.4%

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

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

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

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

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

      \[\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) \]
    6. Taylor expanded in angle around 0 39.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)} \]
    9. Taylor expanded in a around 0 50.6%

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

        \[\leadsto \left(0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot b\right) \cdot \pi\right)}\right) \cdot \left(b - a\right) \]
    11. Simplified50.6%

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

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

Alternative 16: 54.4% accurate, 26.2× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b\_m \leq 1.55 \cdot 10^{+34}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b\_m + a\_m\right)\right) \cdot \left(angle\_m \cdot a\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b\_m - a\_m\right) \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot b\_m\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= b_m 1.55e+34)
    (* -0.011111111111111112 (* (* PI (+ b_m a_m)) (* angle_m a_m)))
    (* (- b_m a_m) (* 0.011111111111111112 (* angle_m (* PI b_m)))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (b_m <= 1.55e+34) {
		tmp = -0.011111111111111112 * ((((double) M_PI) * (b_m + a_m)) * (angle_m * a_m));
	} else {
		tmp = (b_m - a_m) * (0.011111111111111112 * (angle_m * (((double) M_PI) * b_m)));
	}
	return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (b_m <= 1.55e+34) {
		tmp = -0.011111111111111112 * ((Math.PI * (b_m + a_m)) * (angle_m * a_m));
	} else {
		tmp = (b_m - a_m) * (0.011111111111111112 * (angle_m * (Math.PI * b_m)));
	}
	return angle_s * tmp;
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	tmp = 0
	if b_m <= 1.55e+34:
		tmp = -0.011111111111111112 * ((math.pi * (b_m + a_m)) * (angle_m * a_m))
	else:
		tmp = (b_m - a_m) * (0.011111111111111112 * (angle_m * (math.pi * b_m)))
	return angle_s * tmp
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0
	if (b_m <= 1.55e+34)
		tmp = Float64(-0.011111111111111112 * Float64(Float64(pi * Float64(b_m + a_m)) * Float64(angle_m * a_m)));
	else
		tmp = Float64(Float64(b_m - a_m) * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * b_m))));
	end
	return Float64(angle_s * tmp)
end
a_m = abs(a);
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0;
	if (b_m <= 1.55e+34)
		tmp = -0.011111111111111112 * ((pi * (b_m + a_m)) * (angle_m * a_m));
	else
		tmp = (b_m - a_m) * (0.011111111111111112 * (angle_m * (pi * b_m)));
	end
	tmp_2 = angle_s * tmp;
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b$95$m, 1.55e+34], N[(-0.011111111111111112 * N[(N[(Pi * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.54999999999999989e34

    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. unpow253.3%

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

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

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

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

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

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

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

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

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

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

    if 1.54999999999999989e34 < b

    1. Initial program 35.4%

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

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

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

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

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

      \[\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) \]
    6. Taylor expanded in angle around 0 39.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)} \]
    9. Taylor expanded in a around 0 50.6%

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)} \cdot \left(b - a\right) \]
    10. Step-by-step derivation
      1. *-commutative50.6%

        \[\leadsto \left(0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\left(\pi \cdot b\right)}\right)\right) \cdot \left(b - a\right) \]
    11. Simplified50.6%

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

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

Alternative 17: 50.2% accurate, 26.2× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b\_m \leq 7.2 \cdot 10^{+33}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b\_m + a\_m\right)\right) \cdot \left(angle\_m \cdot a\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b\_m \cdot \left(b\_m - a\_m\right)\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= b_m 7.2e+33)
    (* -0.011111111111111112 (* (* PI (+ b_m a_m)) (* angle_m a_m)))
    (* 0.011111111111111112 (* angle_m (* PI (* b_m (- b_m a_m))))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (b_m <= 7.2e+33) {
		tmp = -0.011111111111111112 * ((((double) M_PI) * (b_m + a_m)) * (angle_m * a_m));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b_m * (b_m - a_m))));
	}
	return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (b_m <= 7.2e+33) {
		tmp = -0.011111111111111112 * ((Math.PI * (b_m + a_m)) * (angle_m * a_m));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b_m * (b_m - a_m))));
	}
	return angle_s * tmp;
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	tmp = 0
	if b_m <= 7.2e+33:
		tmp = -0.011111111111111112 * ((math.pi * (b_m + a_m)) * (angle_m * a_m))
	else:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (b_m * (b_m - a_m))))
	return angle_s * tmp
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0
	if (b_m <= 7.2e+33)
		tmp = Float64(-0.011111111111111112 * Float64(Float64(pi * Float64(b_m + a_m)) * Float64(angle_m * a_m)));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b_m * Float64(b_m - a_m)))));
	end
	return Float64(angle_s * tmp)
end
a_m = abs(a);
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0;
	if (b_m <= 7.2e+33)
		tmp = -0.011111111111111112 * ((pi * (b_m + a_m)) * (angle_m * a_m));
	else
		tmp = 0.011111111111111112 * (angle_m * (pi * (b_m * (b_m - a_m))));
	end
	tmp_2 = angle_s * tmp;
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b$95$m, 7.2e+33], N[(-0.011111111111111112 * N[(N[(Pi * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 7.2000000000000005e33

    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. unpow253.3%

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

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

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

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

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

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

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

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

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

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

    if 7.2000000000000005e33 < b

    1. Initial program 35.4%

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

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

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

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

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

      \[\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) \]
    6. Taylor expanded in b around inf 35.5%

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

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

Alternative 18: 40.4% accurate, 26.2× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 4.15 \cdot 10^{-178}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b\_m + a\_m\right)\right) \cdot \left(angle\_m \cdot a\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a\_m \cdot \left(b\_m - a\_m\right)\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= angle_m 4.15e-178)
    (* -0.011111111111111112 (* (* PI (+ b_m a_m)) (* angle_m a_m)))
    (* 0.011111111111111112 (* angle_m (* PI (* a_m (- b_m a_m))))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (angle_m <= 4.15e-178) {
		tmp = -0.011111111111111112 * ((((double) M_PI) * (b_m + a_m)) * (angle_m * a_m));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (a_m * (b_m - a_m))));
	}
	return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (angle_m <= 4.15e-178) {
		tmp = -0.011111111111111112 * ((Math.PI * (b_m + a_m)) * (angle_m * a_m));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (a_m * (b_m - a_m))));
	}
	return angle_s * tmp;
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	tmp = 0
	if angle_m <= 4.15e-178:
		tmp = -0.011111111111111112 * ((math.pi * (b_m + a_m)) * (angle_m * a_m))
	else:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (a_m * (b_m - a_m))))
	return angle_s * tmp
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0
	if (angle_m <= 4.15e-178)
		tmp = Float64(-0.011111111111111112 * Float64(Float64(pi * Float64(b_m + a_m)) * Float64(angle_m * a_m)));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a_m * Float64(b_m - a_m)))));
	end
	return Float64(angle_s * tmp)
end
a_m = abs(a);
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0;
	if (angle_m <= 4.15e-178)
		tmp = -0.011111111111111112 * ((pi * (b_m + a_m)) * (angle_m * a_m));
	else
		tmp = 0.011111111111111112 * (angle_m * (pi * (a_m * (b_m - a_m))));
	end
	tmp_2 = angle_s * tmp;
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 4.15e-178], N[(-0.011111111111111112 * N[(N[(Pi * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 4.15e-178

    1. Initial program 49.6%

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

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

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

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

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

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

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

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

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

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

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

    if 4.15e-178 < angle

    1. Initial program 48.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 46.8%

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

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

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

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

      \[\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) \]
    6. Taylor expanded in b around 0 37.2%

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

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

Alternative 19: 40.4% accurate, 26.2× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b\_m \leq 2.45 \cdot 10^{+232}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(a\_m \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b\_m + a\_m\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b\_m \cdot a\_m\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= b_m 2.45e+232)
    (* -0.011111111111111112 (* a_m (* angle_m (* PI (+ b_m a_m)))))
    (* 0.011111111111111112 (* angle_m (* PI (* b_m a_m)))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (b_m <= 2.45e+232) {
		tmp = -0.011111111111111112 * (a_m * (angle_m * (((double) M_PI) * (b_m + a_m))));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b_m * a_m)));
	}
	return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	double tmp;
	if (b_m <= 2.45e+232) {
		tmp = -0.011111111111111112 * (a_m * (angle_m * (Math.PI * (b_m + a_m))));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b_m * a_m)));
	}
	return angle_s * tmp;
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	tmp = 0
	if b_m <= 2.45e+232:
		tmp = -0.011111111111111112 * (a_m * (angle_m * (math.pi * (b_m + a_m))))
	else:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (b_m * a_m)))
	return angle_s * tmp
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0
	if (b_m <= 2.45e+232)
		tmp = Float64(-0.011111111111111112 * Float64(a_m * Float64(angle_m * Float64(pi * Float64(b_m + a_m)))));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b_m * a_m))));
	end
	return Float64(angle_s * tmp)
end
a_m = abs(a);
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a_m, b_m, angle_m)
	tmp = 0.0;
	if (b_m <= 2.45e+232)
		tmp = -0.011111111111111112 * (a_m * (angle_m * (pi * (b_m + a_m))));
	else
		tmp = 0.011111111111111112 * (angle_m * (pi * (b_m * a_m)));
	end
	tmp_2 = angle_s * tmp;
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b$95$m, 2.45e+232], N[(-0.011111111111111112 * N[(a$95$m * N[(angle$95$m * N[(Pi * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b$95$m * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 2.45e232

    1. Initial program 50.1%

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

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

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

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

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

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

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

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

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

    if 2.45e232 < b

    1. Initial program 35.9%

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

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

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

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

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

      \[\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) \]
    6. Taylor expanded in b around 0 22.9%

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{a} \cdot \left(b - a\right)\right)\right)\right) \]
    7. Taylor expanded in a around 0 28.4%

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

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

Alternative 20: 21.1% accurate, 46.6× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b\_m \cdot a\_m\right)\right)\right)\right) \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (* angle_s (* 0.011111111111111112 (* angle_m (* PI (* b_m a_m))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	return angle_s * (0.011111111111111112 * (angle_m * (((double) M_PI) * (b_m * a_m))));
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	return angle_s * (0.011111111111111112 * (angle_m * (Math.PI * (b_m * a_m))));
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	return angle_s * (0.011111111111111112 * (angle_m * (math.pi * (b_m * a_m))))
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b_m * a_m)))))
end
a_m = abs(a);
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a_m, b_m, angle_m)
	tmp = angle_s * (0.011111111111111112 * (angle_m * (pi * (b_m * a_m))));
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b$95$m * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b\_m \cdot a\_m\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 49.1%

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

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

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

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

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

    \[\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) \]
  6. Taylor expanded in b around 0 35.4%

    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{a} \cdot \left(b - a\right)\right)\right)\right) \]
  7. Taylor expanded in a around 0 20.0%

    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(a \cdot b\right)}\right)\right) \]
  8. Final simplification20.0%

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

Alternative 21: 21.1% accurate, 46.6× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ 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(a\_m \cdot \left(\pi \cdot b\_m\right)\right)\right)\right) \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (* angle_s (* 0.011111111111111112 (* angle_m (* a_m (* PI b_m))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	return angle_s * (0.011111111111111112 * (angle_m * (a_m * (((double) M_PI) * b_m))));
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	return angle_s * (0.011111111111111112 * (angle_m * (a_m * (Math.PI * b_m))));
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	return angle_s * (0.011111111111111112 * (angle_m * (a_m * (math.pi * b_m))))
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(a_m * Float64(pi * b_m)))))
end
a_m = abs(a);
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a_m, b_m, angle_m)
	tmp = angle_s * (0.011111111111111112 * (angle_m * (a_m * (pi * b_m))));
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(a$95$m * N[(Pi * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
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(a\_m \cdot \left(\pi \cdot b\_m\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 49.1%

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

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

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

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

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

    \[\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) \]
  6. Taylor expanded in b around 0 35.4%

    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{a} \cdot \left(b - a\right)\right)\right)\right) \]
  7. Taylor expanded in a around 0 20.0%

    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\left(a \cdot \left(b \cdot \pi\right)\right)}\right) \]
  8. Step-by-step derivation
    1. *-commutative20.0%

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

    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\left(a \cdot \left(\pi \cdot b\right)\right)}\right) \]
  10. Add Preprocessing

Alternative 22: 19.9% accurate, 46.6× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(0.011111111111111112 \cdot \left(a\_m \cdot \left(\pi \cdot \left(angle\_m \cdot b\_m\right)\right)\right)\right) \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (* angle_s (* 0.011111111111111112 (* a_m (* PI (* angle_m b_m))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	return angle_s * (0.011111111111111112 * (a_m * (((double) M_PI) * (angle_m * b_m))));
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	return angle_s * (0.011111111111111112 * (a_m * (Math.PI * (angle_m * b_m))));
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	return angle_s * (0.011111111111111112 * (a_m * (math.pi * (angle_m * b_m))))
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	return Float64(angle_s * Float64(0.011111111111111112 * Float64(a_m * Float64(pi * Float64(angle_m * b_m)))))
end
a_m = abs(a);
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a_m, b_m, angle_m)
	tmp = angle_s * (0.011111111111111112 * (a_m * (pi * (angle_m * b_m))));
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(a$95$m * N[(Pi * N[(angle$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(a\_m \cdot \left(\pi \cdot \left(angle\_m \cdot b\_m\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 49.1%

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

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

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

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

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

    \[\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) \]
  6. Taylor expanded in b around 0 35.4%

    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{a} \cdot \left(b - a\right)\right)\right)\right) \]
  7. Taylor expanded in a around 0 17.8%

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

      \[\leadsto 0.011111111111111112 \cdot \left(a \cdot \color{blue}{\left(\left(angle \cdot b\right) \cdot \pi\right)}\right) \]
  9. Simplified17.8%

    \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(a \cdot \left(\left(angle \cdot b\right) \cdot \pi\right)\right)} \]
  10. Final simplification17.8%

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

Alternative 23: 19.9% accurate, 46.6× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(0.011111111111111112 \cdot \left(a\_m \cdot \left(angle\_m \cdot \left(\pi \cdot b\_m\right)\right)\right)\right) \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (* angle_s (* 0.011111111111111112 (* a_m (* angle_m (* PI b_m))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	return angle_s * (0.011111111111111112 * (a_m * (angle_m * (((double) M_PI) * b_m))));
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
	return angle_s * (0.011111111111111112 * (a_m * (angle_m * (Math.PI * b_m))));
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	return angle_s * (0.011111111111111112 * (a_m * (angle_m * (math.pi * b_m))))
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	return Float64(angle_s * Float64(0.011111111111111112 * Float64(a_m * Float64(angle_m * Float64(pi * b_m)))))
end
a_m = abs(a);
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a_m, b_m, angle_m)
	tmp = angle_s * (0.011111111111111112 * (a_m * (angle_m * (pi * b_m))));
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(a$95$m * N[(angle$95$m * N[(Pi * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(a\_m \cdot \left(angle\_m \cdot \left(\pi \cdot b\_m\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 49.1%

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

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

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

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

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

    \[\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) \]
  6. Taylor expanded in b around 0 35.4%

    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{a} \cdot \left(b - a\right)\right)\right)\right) \]
  7. Taylor expanded in a around 0 17.8%

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)} \]
  8. Final simplification17.8%

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

Reproduce

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