ab-angle->ABCF B

Percentage Accurate: 54.0% → 67.2%
Time: 16.7s
Alternatives: 22
Speedup: 23.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

Alternative 1: 67.2% 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 := \frac{angle\_m}{180} \cdot \pi\\ t_1 := \sin t\_0\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+24}:\\ \;\;\;\;2 \cdot \left(\left(\left(\sin \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(a\_m + b\_m\right)\right) \cdot \left(b\_m - a\_m\right)\right) \cdot \cos \left(angle\_m \cdot e^{\log \left(0.005555555555555556 \cdot \pi\right)}\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+194}:\\ \;\;\;\;\left(2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left|b\_m - a\_m\right|\right)\right) \cdot \left(\cos t\_0 \cdot t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right) \cdot \left(t\_1 \cdot \cos \left(\frac{1}{\frac{180}{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 (* (/ angle_m 180.0) PI)) (t_1 (sin t_0)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 5e+24)
      (*
       2.0
       (*
        (*
         (* (sin (* angle_m (* 0.005555555555555556 PI))) (+ a_m b_m))
         (- b_m a_m))
        (cos (* angle_m (exp (log (* 0.005555555555555556 PI)))))))
      (if (<= (/ angle_m 180.0) 5e+194)
        (* (* 2.0 (* (+ a_m b_m) (fabs (- b_m a_m)))) (* (cos t_0) t_1))
        (*
         (* 2.0 (* (+ a_m b_m) (- b_m a_m)))
         (* t_1 (cos (/ 1.0 (/ 180.0 (* 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 = (angle_m / 180.0) * ((double) M_PI);
	double t_1 = sin(t_0);
	double tmp;
	if ((angle_m / 180.0) <= 5e+24) {
		tmp = 2.0 * (((sin((angle_m * (0.005555555555555556 * ((double) M_PI)))) * (a_m + b_m)) * (b_m - a_m)) * cos((angle_m * exp(log((0.005555555555555556 * ((double) M_PI)))))));
	} else if ((angle_m / 180.0) <= 5e+194) {
		tmp = (2.0 * ((a_m + b_m) * fabs((b_m - a_m)))) * (cos(t_0) * t_1);
	} else {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (t_1 * cos((1.0 / (180.0 / (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 = (angle_m / 180.0) * Math.PI;
	double t_1 = Math.sin(t_0);
	double tmp;
	if ((angle_m / 180.0) <= 5e+24) {
		tmp = 2.0 * (((Math.sin((angle_m * (0.005555555555555556 * Math.PI))) * (a_m + b_m)) * (b_m - a_m)) * Math.cos((angle_m * Math.exp(Math.log((0.005555555555555556 * Math.PI))))));
	} else if ((angle_m / 180.0) <= 5e+194) {
		tmp = (2.0 * ((a_m + b_m) * Math.abs((b_m - a_m)))) * (Math.cos(t_0) * t_1);
	} else {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (t_1 * Math.cos((1.0 / (180.0 / (angle_m * 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):
	t_0 = (angle_m / 180.0) * math.pi
	t_1 = math.sin(t_0)
	tmp = 0
	if (angle_m / 180.0) <= 5e+24:
		tmp = 2.0 * (((math.sin((angle_m * (0.005555555555555556 * math.pi))) * (a_m + b_m)) * (b_m - a_m)) * math.cos((angle_m * math.exp(math.log((0.005555555555555556 * math.pi))))))
	elif (angle_m / 180.0) <= 5e+194:
		tmp = (2.0 * ((a_m + b_m) * math.fabs((b_m - a_m)))) * (math.cos(t_0) * t_1)
	else:
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (t_1 * math.cos((1.0 / (180.0 / (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(Float64(angle_m / 180.0) * pi)
	t_1 = sin(t_0)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e+24)
		tmp = Float64(2.0 * Float64(Float64(Float64(sin(Float64(angle_m * Float64(0.005555555555555556 * pi))) * Float64(a_m + b_m)) * Float64(b_m - a_m)) * cos(Float64(angle_m * exp(log(Float64(0.005555555555555556 * pi)))))));
	elseif (Float64(angle_m / 180.0) <= 5e+194)
		tmp = Float64(Float64(2.0 * Float64(Float64(a_m + b_m) * abs(Float64(b_m - a_m)))) * Float64(cos(t_0) * t_1));
	else
		tmp = Float64(Float64(2.0 * Float64(Float64(a_m + b_m) * Float64(b_m - a_m))) * Float64(t_1 * cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * 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)
	t_0 = (angle_m / 180.0) * pi;
	t_1 = sin(t_0);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 5e+24)
		tmp = 2.0 * (((sin((angle_m * (0.005555555555555556 * pi))) * (a_m + b_m)) * (b_m - a_m)) * cos((angle_m * exp(log((0.005555555555555556 * pi))))));
	elseif ((angle_m / 180.0) <= 5e+194)
		tmp = (2.0 * ((a_m + b_m) * abs((b_m - a_m)))) * (cos(t_0) * t_1);
	else
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (t_1 * cos((1.0 / (180.0 / (angle_m * 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_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+24], N[(2.0 * N[(N[(N[(N[Sin[N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a$95$m + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m * N[Exp[N[Log[N[(0.005555555555555556 * Pi), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+194], N[(N[(2.0 * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[Abs[N[(b$95$m - a$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $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 := \sin t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+24}:\\
\;\;\;\;2 \cdot \left(\left(\left(\sin \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(a\_m + b\_m\right)\right) \cdot \left(b\_m - a\_m\right)\right) \cdot \cos \left(angle\_m \cdot e^{\log \left(0.005555555555555556 \cdot \pi\right)}\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+194}:\\
\;\;\;\;\left(2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left|b\_m - a\_m\right|\right)\right) \cdot \left(\cos t\_0 \cdot t\_1\right)\\

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


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

    1. Initial program 58.0%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow258.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000045e24 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999989e194

    1. Initial program 26.5%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow226.5%

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999989e194 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.4%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow224.4%

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

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

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

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

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

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

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

Alternative 2: 66.7% accurate, 0.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 10^{+100}:\\ \;\;\;\;2 \cdot \left(\cos \left(angle\_m \cdot \log \left({\left(e^{0.005555555555555556}\right)}^{\pi}\right)\right) \cdot \left(\left(\sin \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(a\_m + b\_m\right)\right) \cdot \left(b\_m - a\_m\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right) \cdot \left(\sin \left({\left(\sqrt[3]{\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)}\right)}^{3}\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot \pi\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+100)
    (*
     2.0
     (*
      (cos (* angle_m (log (pow (exp 0.005555555555555556) PI))))
      (*
       (* (sin (* angle_m (* 0.005555555555555556 PI))) (+ a_m b_m))
       (- b_m a_m))))
    (*
     (* 2.0 (* (+ a_m b_m) (- b_m a_m)))
     (*
      (sin (pow (cbrt (* PI (* angle_m 0.005555555555555556))) 3.0))
      (cos (* (/ 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) <= 1e+100) {
		tmp = 2.0 * (cos((angle_m * log(pow(exp(0.005555555555555556), ((double) M_PI))))) * ((sin((angle_m * (0.005555555555555556 * ((double) M_PI)))) * (a_m + b_m)) * (b_m - a_m)));
	} else {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (sin(pow(cbrt((((double) M_PI) * (angle_m * 0.005555555555555556))), 3.0)) * cos(((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) <= 1e+100) {
		tmp = 2.0 * (Math.cos((angle_m * Math.log(Math.pow(Math.exp(0.005555555555555556), Math.PI)))) * ((Math.sin((angle_m * (0.005555555555555556 * Math.PI))) * (a_m + b_m)) * (b_m - a_m)));
	} else {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (Math.sin(Math.pow(Math.cbrt((Math.PI * (angle_m * 0.005555555555555556))), 3.0)) * Math.cos(((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) <= 1e+100)
		tmp = Float64(2.0 * Float64(cos(Float64(angle_m * log((exp(0.005555555555555556) ^ pi)))) * Float64(Float64(sin(Float64(angle_m * Float64(0.005555555555555556 * pi))) * Float64(a_m + b_m)) * Float64(b_m - a_m))));
	else
		tmp = Float64(Float64(2.0 * Float64(Float64(a_m + b_m) * Float64(b_m - a_m))) * Float64(sin((cbrt(Float64(pi * Float64(angle_m * 0.005555555555555556))) ^ 3.0)) * cos(Float64(Float64(angle_m / 180.0) * 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_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+100], N[(2.0 * N[(N[Cos[N[(angle$95$m * N[Log[N[Power[N[Exp[0.005555555555555556], $MachinePrecision], Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sin[N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a$95$m + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[Power[N[Power[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * 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)

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

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


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

    1. Initial program 55.9%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow255.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000002e100 < (/.f64 angle #s(literal 180 binary64))

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow225.6%

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

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

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

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

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

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

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

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

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

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

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

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

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+79}:\\
\;\;\;\;2 \cdot \left(\left(\left(\sin \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(a\_m + b\_m\right)\right) \cdot \left(b\_m - a\_m\right)\right) \cdot \cos \left(angle\_m \cdot \left(e^{\mathsf{log1p}\left(0.005555555555555556 \cdot \pi\right)} + -1\right)\right)\right)\\

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


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

    1. Initial program 56.7%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow256.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999993e79 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.2%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow224.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 56.8%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow256.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999976e67 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 26.6%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow226.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 66.8% 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) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+67}:\\ \;\;\;\;2 \cdot \left(\cos \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\left(a\_m + b\_m\right) \cdot \sin \left(angle\_m \cdot e^{\log \left(0.005555555555555556 \cdot \pi\right)}\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right) \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \sin \left(\frac{1}{\frac{180}{angle\_m \cdot \pi}}\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) 5e+67)
    (*
     2.0
     (*
      (cos (* angle_m (* 0.005555555555555556 PI)))
      (*
       (- b_m a_m)
       (*
        (+ a_m b_m)
        (sin (* angle_m (exp (log (* 0.005555555555555556 PI)))))))))
    (*
     (* 2.0 (* (+ a_m b_m) (- b_m a_m)))
     (*
      (cos (* (/ angle_m 180.0) PI))
      (sin (/ 1.0 (/ 180.0 (* 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 tmp;
	if ((angle_m / 180.0) <= 5e+67) {
		tmp = 2.0 * (cos((angle_m * (0.005555555555555556 * ((double) M_PI)))) * ((b_m - a_m) * ((a_m + b_m) * sin((angle_m * exp(log((0.005555555555555556 * ((double) M_PI)))))))));
	} else {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (cos(((angle_m / 180.0) * ((double) M_PI))) * sin((1.0 / (180.0 / (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 tmp;
	if ((angle_m / 180.0) <= 5e+67) {
		tmp = 2.0 * (Math.cos((angle_m * (0.005555555555555556 * Math.PI))) * ((b_m - a_m) * ((a_m + b_m) * Math.sin((angle_m * Math.exp(Math.log((0.005555555555555556 * Math.PI))))))));
	} else {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (Math.cos(((angle_m / 180.0) * Math.PI)) * Math.sin((1.0 / (180.0 / (angle_m * 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) <= 5e+67:
		tmp = 2.0 * (math.cos((angle_m * (0.005555555555555556 * math.pi))) * ((b_m - a_m) * ((a_m + b_m) * math.sin((angle_m * math.exp(math.log((0.005555555555555556 * math.pi))))))))
	else:
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (math.cos(((angle_m / 180.0) * math.pi)) * math.sin((1.0 / (180.0 / (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)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e+67)
		tmp = Float64(2.0 * Float64(cos(Float64(angle_m * Float64(0.005555555555555556 * pi))) * Float64(Float64(b_m - a_m) * Float64(Float64(a_m + b_m) * sin(Float64(angle_m * exp(log(Float64(0.005555555555555556 * pi)))))))));
	else
		tmp = Float64(Float64(2.0 * Float64(Float64(a_m + b_m) * Float64(b_m - a_m))) * Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * sin(Float64(1.0 / Float64(180.0 / Float64(angle_m * 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) <= 5e+67)
		tmp = 2.0 * (cos((angle_m * (0.005555555555555556 * pi))) * ((b_m - a_m) * ((a_m + b_m) * sin((angle_m * exp(log((0.005555555555555556 * pi))))))));
	else
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (cos(((angle_m / 180.0) * pi)) * sin((1.0 / (180.0 / (angle_m * 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], 5e+67], N[(2.0 * N[(N[Cos[N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[Sin[N[(angle$95$m * N[Exp[N[Log[N[(0.005555555555555556 * Pi), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $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}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+67}:\\
\;\;\;\;2 \cdot \left(\cos \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\left(a\_m + b\_m\right) \cdot \sin \left(angle\_m \cdot e^{\log \left(0.005555555555555556 \cdot \pi\right)}\right)\right)\right)\right)\\

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


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

    1. Initial program 56.8%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow256.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999976e67 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 26.6%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow226.6%

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

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

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

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

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

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

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

Alternative 6: 67.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) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+67}:\\ \;\;\;\;2 \cdot \left(\cos \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\left(a\_m + b\_m\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right) \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \sin \left(\frac{1}{\frac{180}{angle\_m \cdot \pi}}\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) 5e+67)
    (*
     2.0
     (*
      (cos (* angle_m (* 0.005555555555555556 PI)))
      (*
       (- b_m a_m)
       (*
        (+ a_m b_m)
        (sin (expm1 (log1p (* PI (* angle_m 0.005555555555555556)))))))))
    (*
     (* 2.0 (* (+ a_m b_m) (- b_m a_m)))
     (*
      (cos (* (/ angle_m 180.0) PI))
      (sin (/ 1.0 (/ 180.0 (* 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 tmp;
	if ((angle_m / 180.0) <= 5e+67) {
		tmp = 2.0 * (cos((angle_m * (0.005555555555555556 * ((double) M_PI)))) * ((b_m - a_m) * ((a_m + b_m) * sin(expm1(log1p((((double) M_PI) * (angle_m * 0.005555555555555556))))))));
	} else {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (cos(((angle_m / 180.0) * ((double) M_PI))) * sin((1.0 / (180.0 / (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 tmp;
	if ((angle_m / 180.0) <= 5e+67) {
		tmp = 2.0 * (Math.cos((angle_m * (0.005555555555555556 * Math.PI))) * ((b_m - a_m) * ((a_m + b_m) * Math.sin(Math.expm1(Math.log1p((Math.PI * (angle_m * 0.005555555555555556))))))));
	} else {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (Math.cos(((angle_m / 180.0) * Math.PI)) * Math.sin((1.0 / (180.0 / (angle_m * 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) <= 5e+67:
		tmp = 2.0 * (math.cos((angle_m * (0.005555555555555556 * math.pi))) * ((b_m - a_m) * ((a_m + b_m) * math.sin(math.expm1(math.log1p((math.pi * (angle_m * 0.005555555555555556))))))))
	else:
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (math.cos(((angle_m / 180.0) * math.pi)) * math.sin((1.0 / (180.0 / (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)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e+67)
		tmp = Float64(2.0 * Float64(cos(Float64(angle_m * Float64(0.005555555555555556 * pi))) * Float64(Float64(b_m - a_m) * Float64(Float64(a_m + b_m) * sin(expm1(log1p(Float64(pi * Float64(angle_m * 0.005555555555555556)))))))));
	else
		tmp = Float64(Float64(2.0 * Float64(Float64(a_m + b_m) * Float64(b_m - a_m))) * Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * sin(Float64(1.0 / Float64(180.0 / 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_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+67], N[(2.0 * N[(N[Cos[N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[Sin[N[(Exp[N[Log[1 + N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $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}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+67}:\\
\;\;\;\;2 \cdot \left(\cos \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\left(a\_m + b\_m\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)\right)\\

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


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

    1. Initial program 56.8%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow256.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999976e67 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 26.6%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow226.6%

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

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

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

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

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

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

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

Alternative 7: 67.2% accurate, 1.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) \\ \begin{array}{l} t_0 := angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\\ t_1 := \frac{angle\_m}{180} \cdot \pi\\ t_2 := \sin t\_1\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 20000000000000:\\ \;\;\;\;2 \cdot \left(\left(\left(\sin t\_0 \cdot \left(a\_m + b\_m\right)\right) \cdot \left(b\_m - a\_m\right)\right) \cdot \cos t\_0\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+194}:\\ \;\;\;\;\left(2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left|b\_m - a\_m\right|\right)\right) \cdot \left(\cos t\_1 \cdot t\_2\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right) \cdot \left(t\_2 \cdot \cos \left(\frac{1}{\frac{180}{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 (* angle_m (* 0.005555555555555556 PI)))
        (t_1 (* (/ angle_m 180.0) PI))
        (t_2 (sin t_1)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 20000000000000.0)
      (* 2.0 (* (* (* (sin t_0) (+ a_m b_m)) (- b_m a_m)) (cos t_0)))
      (if (<= (/ angle_m 180.0) 5e+194)
        (* (* 2.0 (* (+ a_m b_m) (fabs (- b_m a_m)))) (* (cos t_1) t_2))
        (*
         (* 2.0 (* (+ a_m b_m) (- b_m a_m)))
         (* t_2 (cos (/ 1.0 (/ 180.0 (* 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 = angle_m * (0.005555555555555556 * ((double) M_PI));
	double t_1 = (angle_m / 180.0) * ((double) M_PI);
	double t_2 = sin(t_1);
	double tmp;
	if ((angle_m / 180.0) <= 20000000000000.0) {
		tmp = 2.0 * (((sin(t_0) * (a_m + b_m)) * (b_m - a_m)) * cos(t_0));
	} else if ((angle_m / 180.0) <= 5e+194) {
		tmp = (2.0 * ((a_m + b_m) * fabs((b_m - a_m)))) * (cos(t_1) * t_2);
	} else {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (t_2 * cos((1.0 / (180.0 / (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 = angle_m * (0.005555555555555556 * Math.PI);
	double t_1 = (angle_m / 180.0) * Math.PI;
	double t_2 = Math.sin(t_1);
	double tmp;
	if ((angle_m / 180.0) <= 20000000000000.0) {
		tmp = 2.0 * (((Math.sin(t_0) * (a_m + b_m)) * (b_m - a_m)) * Math.cos(t_0));
	} else if ((angle_m / 180.0) <= 5e+194) {
		tmp = (2.0 * ((a_m + b_m) * Math.abs((b_m - a_m)))) * (Math.cos(t_1) * t_2);
	} else {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (t_2 * Math.cos((1.0 / (180.0 / (angle_m * 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):
	t_0 = angle_m * (0.005555555555555556 * math.pi)
	t_1 = (angle_m / 180.0) * math.pi
	t_2 = math.sin(t_1)
	tmp = 0
	if (angle_m / 180.0) <= 20000000000000.0:
		tmp = 2.0 * (((math.sin(t_0) * (a_m + b_m)) * (b_m - a_m)) * math.cos(t_0))
	elif (angle_m / 180.0) <= 5e+194:
		tmp = (2.0 * ((a_m + b_m) * math.fabs((b_m - a_m)))) * (math.cos(t_1) * t_2)
	else:
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (t_2 * math.cos((1.0 / (180.0 / (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(angle_m * Float64(0.005555555555555556 * pi))
	t_1 = Float64(Float64(angle_m / 180.0) * pi)
	t_2 = sin(t_1)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 20000000000000.0)
		tmp = Float64(2.0 * Float64(Float64(Float64(sin(t_0) * Float64(a_m + b_m)) * Float64(b_m - a_m)) * cos(t_0)));
	elseif (Float64(angle_m / 180.0) <= 5e+194)
		tmp = Float64(Float64(2.0 * Float64(Float64(a_m + b_m) * abs(Float64(b_m - a_m)))) * Float64(cos(t_1) * t_2));
	else
		tmp = Float64(Float64(2.0 * Float64(Float64(a_m + b_m) * Float64(b_m - a_m))) * Float64(t_2 * cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * 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)
	t_0 = angle_m * (0.005555555555555556 * pi);
	t_1 = (angle_m / 180.0) * pi;
	t_2 = sin(t_1);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 20000000000000.0)
		tmp = 2.0 * (((sin(t_0) * (a_m + b_m)) * (b_m - a_m)) * cos(t_0));
	elseif ((angle_m / 180.0) <= 5e+194)
		tmp = (2.0 * ((a_m + b_m) * abs((b_m - a_m)))) * (cos(t_1) * t_2);
	else
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (t_2 * cos((1.0 / (180.0 / (angle_m * 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_] := Block[{t$95$0 = N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 20000000000000.0], N[(2.0 * N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a$95$m + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+194], N[(N[(2.0 * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[Abs[N[(b$95$m - a$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[t$95$1], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 * N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $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 := angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\\
t_1 := \frac{angle\_m}{180} \cdot \pi\\
t_2 := \sin t\_1\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 20000000000000:\\
\;\;\;\;2 \cdot \left(\left(\left(\sin t\_0 \cdot \left(a\_m + b\_m\right)\right) \cdot \left(b\_m - a\_m\right)\right) \cdot \cos t\_0\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+194}:\\
\;\;\;\;\left(2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left|b\_m - a\_m\right|\right)\right) \cdot \left(\cos t\_1 \cdot t\_2\right)\\

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


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

    1. Initial program 58.8%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow258.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e13 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999989e194

    1. Initial program 24.8%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow224.8%

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999989e194 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.4%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow224.4%

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

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

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

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right) \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \sin \left(\frac{1}{\frac{180}{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)) < 2e65

    1. Initial program 56.8%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow256.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 26.6%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow226.6%

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

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

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

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right) \cdot \left(\sin \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \cos \left(\frac{1}{\frac{180}{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)) < 2e143

    1. Initial program 55.3%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow255.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 22.8%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow222.8%

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

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

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

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

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

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

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

Alternative 10: 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 := angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\\ angle\_s \cdot \left(2 \cdot \left(\left(\left(\sin t\_0 \cdot \left(a\_m + b\_m\right)\right) \cdot \left(b\_m - a\_m\right)\right) \cdot \cos t\_0\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 (* angle_m (* 0.005555555555555556 PI))))
   (*
    angle_s
    (* 2.0 (* (* (* (sin t_0) (+ a_m b_m)) (- b_m a_m)) (cos t_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 * (0.005555555555555556 * ((double) M_PI));
	return angle_s * (2.0 * (((sin(t_0) * (a_m + b_m)) * (b_m - a_m)) * cos(t_0)));
}
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 = angle_m * (0.005555555555555556 * Math.PI);
	return angle_s * (2.0 * (((Math.sin(t_0) * (a_m + b_m)) * (b_m - a_m)) * Math.cos(t_0)));
}
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 = angle_m * (0.005555555555555556 * math.pi)
	return angle_s * (2.0 * (((math.sin(t_0) * (a_m + b_m)) * (b_m - a_m)) * math.cos(t_0)))
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(angle_m * Float64(0.005555555555555556 * pi))
	return Float64(angle_s * Float64(2.0 * Float64(Float64(Float64(sin(t_0) * Float64(a_m + b_m)) * Float64(b_m - a_m)) * cos(t_0))))
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 = angle_m * (0.005555555555555556 * pi);
	tmp = angle_s * (2.0 * (((sin(t_0) * (a_m + b_m)) * (b_m - a_m)) * cos(t_0)));
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[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * N[(2.0 * N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a$95$m + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$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 := angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\\
angle\_s \cdot \left(2 \cdot \left(\left(\left(\sin t\_0 \cdot \left(a\_m + b\_m\right)\right) \cdot \left(b\_m - a\_m\right)\right) \cdot \cos t\_0\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 51.7%

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

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

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

      \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow251.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 66.0% accurate, 3.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}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+49}:\\ \;\;\;\;2 \cdot \left(\cos \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(0.005555555555555556 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right) \cdot \frac{\sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)}{2}\\ \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) 5e+49)
    (*
     2.0
     (*
      (cos (* angle_m (* 0.005555555555555556 PI)))
      (* (- b_m a_m) (* 0.005555555555555556 (* (+ a_m b_m) (* angle_m PI))))))
    (*
     (* 2.0 (* (+ a_m b_m) (- b_m a_m)))
     (/ (sin (* PI (* angle_m 0.011111111111111112))) 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 tmp;
	if ((angle_m / 180.0) <= 5e+49) {
		tmp = 2.0 * (cos((angle_m * (0.005555555555555556 * ((double) M_PI)))) * ((b_m - a_m) * (0.005555555555555556 * ((a_m + b_m) * (angle_m * ((double) M_PI))))));
	} else {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (sin((((double) M_PI) * (angle_m * 0.011111111111111112))) / 2.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) <= 5e+49) {
		tmp = 2.0 * (Math.cos((angle_m * (0.005555555555555556 * Math.PI))) * ((b_m - a_m) * (0.005555555555555556 * ((a_m + b_m) * (angle_m * Math.PI)))));
	} else {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (Math.sin((Math.PI * (angle_m * 0.011111111111111112))) / 2.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) <= 5e+49:
		tmp = 2.0 * (math.cos((angle_m * (0.005555555555555556 * math.pi))) * ((b_m - a_m) * (0.005555555555555556 * ((a_m + b_m) * (angle_m * math.pi)))))
	else:
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (math.sin((math.pi * (angle_m * 0.011111111111111112))) / 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)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e+49)
		tmp = Float64(2.0 * Float64(cos(Float64(angle_m * Float64(0.005555555555555556 * pi))) * Float64(Float64(b_m - a_m) * Float64(0.005555555555555556 * Float64(Float64(a_m + b_m) * Float64(angle_m * pi))))));
	else
		tmp = Float64(Float64(2.0 * Float64(Float64(a_m + b_m) * Float64(b_m - a_m))) * Float64(sin(Float64(pi * Float64(angle_m * 0.011111111111111112))) / 2.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) <= 5e+49)
		tmp = 2.0 * (cos((angle_m * (0.005555555555555556 * pi))) * ((b_m - a_m) * (0.005555555555555556 * ((a_m + b_m) * (angle_m * pi)))));
	else
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (sin((pi * (angle_m * 0.011111111111111112))) / 2.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], 5e+49], N[(2.0 * N[(N[Cos[N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(0.005555555555555556 * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / 2.0), $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 5 \cdot 10^{+49}:\\
\;\;\;\;2 \cdot \left(\cos \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(0.005555555555555556 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\right)\\

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


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

    1. Initial program 57.2%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow257.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000004e49 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 25.8%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow225.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\frac{\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}{2}} \]
    9. Step-by-step derivation
      1. sin-036.4%

        \[\leadsto \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{\color{blue}{0} + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}{2} \]
      2. +-lft-identity36.4%

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

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

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

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

Alternative 12: 66.1% 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 5 \cdot 10^{+117}:\\ \;\;\;\;2 \cdot \left(\left(\sin \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(a\_m + b\_m\right)\right) \cdot \left(b\_m - a\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right) \cdot \frac{\sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)}{2}\\ \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) 5e+117)
    (*
     2.0
     (*
      (* (sin (* angle_m (* 0.005555555555555556 PI))) (+ a_m b_m))
      (- b_m a_m)))
    (*
     (* 2.0 (* (+ a_m b_m) (- b_m a_m)))
     (/ (sin (* PI (* angle_m 0.011111111111111112))) 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 tmp;
	if ((angle_m / 180.0) <= 5e+117) {
		tmp = 2.0 * ((sin((angle_m * (0.005555555555555556 * ((double) M_PI)))) * (a_m + b_m)) * (b_m - a_m));
	} else {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (sin((((double) M_PI) * (angle_m * 0.011111111111111112))) / 2.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) <= 5e+117) {
		tmp = 2.0 * ((Math.sin((angle_m * (0.005555555555555556 * Math.PI))) * (a_m + b_m)) * (b_m - a_m));
	} else {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (Math.sin((Math.PI * (angle_m * 0.011111111111111112))) / 2.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) <= 5e+117:
		tmp = 2.0 * ((math.sin((angle_m * (0.005555555555555556 * math.pi))) * (a_m + b_m)) * (b_m - a_m))
	else:
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (math.sin((math.pi * (angle_m * 0.011111111111111112))) / 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)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e+117)
		tmp = Float64(2.0 * Float64(Float64(sin(Float64(angle_m * Float64(0.005555555555555556 * pi))) * Float64(a_m + b_m)) * Float64(b_m - a_m)));
	else
		tmp = Float64(Float64(2.0 * Float64(Float64(a_m + b_m) * Float64(b_m - a_m))) * Float64(sin(Float64(pi * Float64(angle_m * 0.011111111111111112))) / 2.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) <= 5e+117)
		tmp = 2.0 * ((sin((angle_m * (0.005555555555555556 * pi))) * (a_m + b_m)) * (b_m - a_m));
	else
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (sin((pi * (angle_m * 0.011111111111111112))) / 2.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], 5e+117], N[(2.0 * N[(N[(N[Sin[N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a$95$m + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / 2.0), $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 5 \cdot 10^{+117}:\\
\;\;\;\;2 \cdot \left(\left(\sin \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(a\_m + b\_m\right)\right) \cdot \left(b\_m - a\_m\right)\right)\\

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


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

    1. Initial program 55.4%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow255.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999983e117 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 25.1%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow225.1%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\frac{\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}{2}} \]
    9. Step-by-step derivation
      1. sin-036.6%

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

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

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

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

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

Alternative 13: 66.1% 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 5 \cdot 10^{+117}:\\ \;\;\;\;2 \cdot \left(\left(\sin \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(a\_m + b\_m\right)\right) \cdot \left(b\_m - a\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right) \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\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) 5e+117)
    (*
     2.0
     (*
      (* (sin (* angle_m (* 0.005555555555555556 PI))) (+ a_m b_m))
      (- b_m a_m)))
    (*
     (* (+ a_m b_m) (- b_m a_m))
     (sin (* PI (* angle_m 0.011111111111111112)))))))
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) <= 5e+117) {
		tmp = 2.0 * ((sin((angle_m * (0.005555555555555556 * ((double) M_PI)))) * (a_m + b_m)) * (b_m - a_m));
	} else {
		tmp = ((a_m + b_m) * (b_m - a_m)) * sin((((double) M_PI) * (angle_m * 0.011111111111111112)));
	}
	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) <= 5e+117) {
		tmp = 2.0 * ((Math.sin((angle_m * (0.005555555555555556 * Math.PI))) * (a_m + b_m)) * (b_m - a_m));
	} else {
		tmp = ((a_m + b_m) * (b_m - a_m)) * Math.sin((Math.PI * (angle_m * 0.011111111111111112)));
	}
	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) <= 5e+117:
		tmp = 2.0 * ((math.sin((angle_m * (0.005555555555555556 * math.pi))) * (a_m + b_m)) * (b_m - a_m))
	else:
		tmp = ((a_m + b_m) * (b_m - a_m)) * math.sin((math.pi * (angle_m * 0.011111111111111112)))
	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) <= 5e+117)
		tmp = Float64(2.0 * Float64(Float64(sin(Float64(angle_m * Float64(0.005555555555555556 * pi))) * Float64(a_m + b_m)) * Float64(b_m - a_m)));
	else
		tmp = Float64(Float64(Float64(a_m + b_m) * Float64(b_m - a_m)) * sin(Float64(pi * Float64(angle_m * 0.011111111111111112))));
	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) <= 5e+117)
		tmp = 2.0 * ((sin((angle_m * (0.005555555555555556 * pi))) * (a_m + b_m)) * (b_m - a_m));
	else
		tmp = ((a_m + b_m) * (b_m - a_m)) * sin((pi * (angle_m * 0.011111111111111112)));
	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], 5e+117], N[(2.0 * N[(N[(N[Sin[N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a$95$m + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $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 5 \cdot 10^{+117}:\\
\;\;\;\;2 \cdot \left(\left(\sin \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(a\_m + b\_m\right)\right) \cdot \left(b\_m - a\_m\right)\right)\\

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


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

    1. Initial program 55.4%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow255.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999983e117 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 25.1%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow225.1%

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

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

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

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

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

      \[\leadsto \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{{\left(\sqrt[3]{\left(\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right) \cdot 0.5}\right)}^{3}} \]
    9. Taylor expanded in angle around inf 36.6%

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

        \[\leadsto \color{blue}{\left(2 \cdot {\left(\sqrt[3]{0.5}\right)}^{3}\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)} \]
      2. rem-cube-cbrt36.6%

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

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

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

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

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

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

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

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

Alternative 14: 58.6% 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}\;{a\_m}^{2} \leq 2 \cdot 10^{+282}:\\ \;\;\;\;\left(2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right) \cdot \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(angle\_m \cdot \pi\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 (<= (pow a_m 2.0) 2e+282)
    (*
     (* 2.0 (* (+ a_m b_m) (- b_m a_m)))
     (* 0.005555555555555556 (* angle_m PI)))
    (* (* a_m 0.011111111111111112) (* (- b_m a_m) (* 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 tmp;
	if (pow(a_m, 2.0) <= 2e+282) {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (0.005555555555555556 * (angle_m * ((double) M_PI)));
	} else {
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (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 tmp;
	if (Math.pow(a_m, 2.0) <= 2e+282) {
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (0.005555555555555556 * (angle_m * Math.PI));
	} else {
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (angle_m * 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 math.pow(a_m, 2.0) <= 2e+282:
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (0.005555555555555556 * (angle_m * math.pi))
	else:
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (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)
	tmp = 0.0
	if ((a_m ^ 2.0) <= 2e+282)
		tmp = Float64(Float64(2.0 * Float64(Float64(a_m + b_m) * Float64(b_m - a_m))) * Float64(0.005555555555555556 * Float64(angle_m * pi)));
	else
		tmp = Float64(Float64(a_m * 0.011111111111111112) * Float64(Float64(b_m - a_m) * Float64(angle_m * 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 ((a_m ^ 2.0) <= 2e+282)
		tmp = (2.0 * ((a_m + b_m) * (b_m - a_m))) * (0.005555555555555556 * (angle_m * pi));
	else
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (angle_m * 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[Power[a$95$m, 2.0], $MachinePrecision], 2e+282], N[(N[(2.0 * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(angle$95$m * 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}\;{a\_m}^{2} \leq 2 \cdot 10^{+282}:\\
\;\;\;\;\left(2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right) \cdot \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\

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


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

    1. Initial program 60.6%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow260.6%

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

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

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

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

    if 2.00000000000000007e282 < (pow.f64 a #s(literal 2 binary64))

    1. Initial program 35.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*35.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)} \]
    3. Simplified35.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)} \]
    4. Add Preprocessing
    5. Taylor expanded in angle around 0 38.0%

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow235.0%

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

        \[\leadsto \left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    7. Applied egg-rr58.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) \]
    8. Taylor expanded in b around 0 53.8%

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

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

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

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

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

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

Alternative 15: 62.1% 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}\;a\_m \leq 2.25 \cdot 10^{+153}:\\ \;\;\;\;\left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right) \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(angle\_m \cdot \pi\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 (<= a_m 2.25e+153)
    (*
     (* (+ a_m b_m) (- b_m a_m))
     (sin (* PI (* angle_m 0.011111111111111112))))
    (* (* a_m 0.011111111111111112) (* (- b_m a_m) (* 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 tmp;
	if (a_m <= 2.25e+153) {
		tmp = ((a_m + b_m) * (b_m - a_m)) * sin((((double) M_PI) * (angle_m * 0.011111111111111112)));
	} else {
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (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 tmp;
	if (a_m <= 2.25e+153) {
		tmp = ((a_m + b_m) * (b_m - a_m)) * Math.sin((Math.PI * (angle_m * 0.011111111111111112)));
	} else {
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (angle_m * 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 a_m <= 2.25e+153:
		tmp = ((a_m + b_m) * (b_m - a_m)) * math.sin((math.pi * (angle_m * 0.011111111111111112)))
	else:
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (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)
	tmp = 0.0
	if (a_m <= 2.25e+153)
		tmp = Float64(Float64(Float64(a_m + b_m) * Float64(b_m - a_m)) * sin(Float64(pi * Float64(angle_m * 0.011111111111111112))));
	else
		tmp = Float64(Float64(a_m * 0.011111111111111112) * Float64(Float64(b_m - a_m) * Float64(angle_m * 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 (a_m <= 2.25e+153)
		tmp = ((a_m + b_m) * (b_m - a_m)) * sin((pi * (angle_m * 0.011111111111111112)));
	else
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (angle_m * 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[a$95$m, 2.25e+153], N[(N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(angle$95$m * 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}\;a\_m \leq 2.25 \cdot 10^{+153}:\\
\;\;\;\;\left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right) \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.25e153

    1. Initial program 55.9%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow255.9%

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

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

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

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

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

      \[\leadsto \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{{\left(\sqrt[3]{\left(\sin 0 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right) \cdot 0.5}\right)}^{3}} \]
    9. Taylor expanded in angle around inf 60.2%

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

        \[\leadsto \color{blue}{\left(2 \cdot {\left(\sqrt[3]{0.5}\right)}^{3}\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)} \]
      2. rem-cube-cbrt60.6%

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

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

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

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

        \[\leadsto 1 \cdot \left(\sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \]
      7. *-commutative60.8%

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

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

    if 2.25e153 < a

    1. Initial program 31.2%

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

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow231.2%

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

        \[\leadsto \left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    7. Applied egg-rr47.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) \]
    8. Taylor expanded in b around 0 47.7%

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

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

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

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

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

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

Alternative 16: 58.7% 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}\;a\_m \leq 2.9 \cdot 10^{+143}:\\ \;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\pi \cdot \left(a\_m + b\_m\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(angle\_m \cdot \pi\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 (<= a_m 2.9e+143)
    (* (* angle_m 0.011111111111111112) (* (- b_m a_m) (* PI (+ a_m b_m))))
    (* (* a_m 0.011111111111111112) (* (- b_m a_m) (* 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 tmp;
	if (a_m <= 2.9e+143) {
		tmp = (angle_m * 0.011111111111111112) * ((b_m - a_m) * (((double) M_PI) * (a_m + b_m)));
	} else {
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (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 tmp;
	if (a_m <= 2.9e+143) {
		tmp = (angle_m * 0.011111111111111112) * ((b_m - a_m) * (Math.PI * (a_m + b_m)));
	} else {
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (angle_m * 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 a_m <= 2.9e+143:
		tmp = (angle_m * 0.011111111111111112) * ((b_m - a_m) * (math.pi * (a_m + b_m)))
	else:
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (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)
	tmp = 0.0
	if (a_m <= 2.9e+143)
		tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(Float64(b_m - a_m) * Float64(pi * Float64(a_m + b_m))));
	else
		tmp = Float64(Float64(a_m * 0.011111111111111112) * Float64(Float64(b_m - a_m) * Float64(angle_m * 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 (a_m <= 2.9e+143)
		tmp = (angle_m * 0.011111111111111112) * ((b_m - a_m) * (pi * (a_m + b_m)));
	else
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (angle_m * 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[a$95$m, 2.9e+143], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(Pi * N[(a$95$m + b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(angle$95$m * 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}\;a\_m \leq 2.9 \cdot 10^{+143}:\\
\;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\pi \cdot \left(a\_m + b\_m\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.8999999999999998e143

    1. Initial program 55.7%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow255.8%

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

        \[\leadsto \left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    7. Applied egg-rr57.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) \]
    8. Taylor expanded in angle around 0 57.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)} \]
    9. Step-by-step derivation
      1. associate-*r*57.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*57.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)} \]
    10. Simplified57.7%

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

    if 2.8999999999999998e143 < a

    1. Initial program 32.8%

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

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow232.8%

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

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

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

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

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

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

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

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

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

Alternative 17: 58.7% 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}\;a\_m \leq 3.1 \cdot 10^{+143}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(angle\_m \cdot \pi\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 (<= a_m 3.1e+143)
    (* 0.011111111111111112 (* angle_m (* PI (* (+ a_m b_m) (- b_m a_m)))))
    (* (* a_m 0.011111111111111112) (* (- b_m a_m) (* 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 tmp;
	if (a_m <= 3.1e+143) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * ((a_m + b_m) * (b_m - a_m))));
	} else {
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (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 tmp;
	if (a_m <= 3.1e+143) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * ((a_m + b_m) * (b_m - a_m))));
	} else {
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (angle_m * 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 a_m <= 3.1e+143:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * ((a_m + b_m) * (b_m - a_m))))
	else:
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (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)
	tmp = 0.0
	if (a_m <= 3.1e+143)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(a_m + b_m) * Float64(b_m - a_m)))));
	else
		tmp = Float64(Float64(a_m * 0.011111111111111112) * Float64(Float64(b_m - a_m) * Float64(angle_m * 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 (a_m <= 3.1e+143)
		tmp = 0.011111111111111112 * (angle_m * (pi * ((a_m + b_m) * (b_m - a_m))));
	else
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (angle_m * 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[a$95$m, 3.1e+143], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(angle$95$m * 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}\;a\_m \leq 3.1 \cdot 10^{+143}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 3.0999999999999999e143

    1. Initial program 55.7%

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow255.8%

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

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

    if 3.0999999999999999e143 < a

    1. Initial program 32.8%

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

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow232.8%

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

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

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

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

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

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

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

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

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

Alternative 18: 51.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 3 \cdot 10^{+36}:\\ \;\;\;\;\left(a\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(angle\_m \cdot \pi\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 3e+36)
    (* (* a_m 0.011111111111111112) (* (- b_m a_m) (* angle_m PI)))
    (* 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 <= 3e+36) {
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (angle_m * ((double) M_PI)));
	} 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 <= 3e+36) {
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (angle_m * Math.PI));
	} 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 <= 3e+36:
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (angle_m * math.pi))
	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 <= 3e+36)
		tmp = Float64(Float64(a_m * 0.011111111111111112) * Float64(Float64(b_m - a_m) * Float64(angle_m * pi)));
	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 <= 3e+36)
		tmp = (a_m * 0.011111111111111112) * ((b_m - a_m) * (angle_m * pi));
	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, 3e+36], N[(N[(a$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(angle$95$m * Pi), $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 3 \cdot 10^{+36}:\\
\;\;\;\;\left(a\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(angle\_m \cdot \pi\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 < 3e36

    1. Initial program 56.3%

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

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow256.3%

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

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

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

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

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

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

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

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

    if 3e36 < b

    1. Initial program 38.3%

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

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow238.3%

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

        \[\leadsto \left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    7. Applied egg-rr53.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) \]
    8. Taylor expanded in b around inf 45.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 3 \cdot 10^{+36}:\\ \;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \pi\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 19: 51.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 2.2 \cdot 10^{+36}:\\ \;\;\;\;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 \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 2.2e+36)
    (* 0.011111111111111112 (* a_m (* angle_m (* PI (- b_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 <= 2.2e+36) {
		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 * (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.2e+36) {
		tmp = 0.011111111111111112 * (a_m * (angle_m * (Math.PI * (b_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 <= 2.2e+36:
		tmp = 0.011111111111111112 * (a_m * (angle_m * (math.pi * (b_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 <= 2.2e+36)
		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 * 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.2e+36)
		tmp = 0.011111111111111112 * (a_m * (angle_m * (pi * (b_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, 2.2e+36], 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 * 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 2.2 \cdot 10^{+36}:\\
\;\;\;\;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 \left(b\_m - a\_m\right)\right)\right)\right)\\


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

    1. Initial program 56.3%

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

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow256.3%

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

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

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

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

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

    if 2.2e36 < b

    1. Initial program 38.3%

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

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

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

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

        \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow238.3%

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

        \[\leadsto \left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    7. Applied egg-rr53.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) \]
    8. Taylor expanded in b around inf 45.7%

      \[\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. Add Preprocessing

Alternative 20: 42.4% accurate, 38.1× 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 \left(b\_m - a\_m\right)\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)))))))
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)))));
}
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)))));
}
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)))))
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 * 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 * (a_m * (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[(a$95$m * N[(angle$95$m * N[(Pi * 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 \left(0.011111111111111112 \cdot \left(a\_m \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b\_m - a\_m\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 51.7%

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

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

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

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

      \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow251.7%

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

      \[\leadsto \left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
  7. 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) \]
  8. Taylor expanded in b around 0 39.9%

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

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

Alternative 21: 21.0% 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 51.7%

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

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

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

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

      \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow251.7%

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

      \[\leadsto \left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
  7. 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) \]
  8. Taylor expanded in b around 0 39.9%

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

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

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

    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\left(a \cdot \left(\pi \cdot b\right)\right)}\right) \]
  12. 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(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 51.7%

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

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

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

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

      \[\leadsto \left(2 \cdot \left(\color{blue}{b \cdot b} - {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. unpow251.7%

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

      \[\leadsto \left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
  7. 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) \]
  8. Taylor expanded in b around 0 39.9%

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

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

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

Reproduce

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