ab-angle->ABCF B

Percentage Accurate: 53.9% → 68.0%
Time: 37.7s
Alternatives: 18
Speedup: 27.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 53.9% 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: 68.0% accurate, 0.8× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(t\_1 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t\_0\right)\right)\right)\right)\right)\right)\\


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

    1. Initial program 57.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. Simplified56.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000017e218 < (pow.f64 a 2)

    1. Initial program 40.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. Simplified44.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 67.8% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 57.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. Simplified56.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000017e218 < (pow.f64 a 2)

    1. Initial program 40.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. Simplified44.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 67.8% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 57.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. Simplified56.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000017e218 < (pow.f64 a 2)

    1. Initial program 40.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. Simplified44.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 66.2% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 a 2) < 4.99999999999999989e-114

    1. Initial program 57.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999989e-114 < (pow.f64 a 2)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 68.3% accurate, 1.8× speedup?

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

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle 180) < 2.0000000000000001e-13

    1. Initial program 60.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. Simplified61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-13 < (/.f64 angle 180) < 5.00000000000000025e95

    1. Initial program 44.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. Simplified40.7%

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

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

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

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

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

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

    if 5.00000000000000025e95 < (/.f64 angle 180)

    1. Initial program 23.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. Simplified24.3%

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

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

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

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

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

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

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

Alternative 6: 68.1% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+96}:\\
\;\;\;\;2 \cdot \left(\cos t\_0 \cdot \left(\sin t\_0 \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle 180) < 1.00000000000000001e-50

    1. Initial program 59.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. Simplified60.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000001e-50 < (/.f64 angle 180) < 4.0000000000000002e96

    1. Initial program 55.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. Simplified56.5%

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

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

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

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

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

    if 4.0000000000000002e96 < (/.f64 angle 180)

    1. Initial program 23.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. Simplified24.3%

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

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

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

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

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

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

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

Alternative 7: 68.1% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+95}:\\
\;\;\;\;2 \cdot \left(t\_0 \cdot \left(\sin \left(\frac{angle\_m \cdot \pi}{180}\right) \cdot \cos \left(\frac{angle\_m \cdot \pi}{-180}\right)\right)\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle 180) < 9.99999999999999999e-15

    1. Initial program 60.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. Simplified61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999999e-15 < (/.f64 angle 180) < 5.00000000000000025e95

    1. Initial program 46.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. Simplified43.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000025e95 < (/.f64 angle 180)

    1. Initial program 23.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. Simplified24.3%

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

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

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

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

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

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

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

Alternative 8: 54.9% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 3.2000000000000001e-57

    1. Initial program 50.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. Simplified50.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2000000000000001e-57 < a

    1. Initial program 55.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. Simplified58.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 54.8% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.40000000000000006e-57

    1. Initial program 50.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. Simplified50.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.40000000000000006e-57 < a

    1. Initial program 55.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. Simplified58.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 68.0% accurate, 1.9× speedup?

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

\\
angle\_s \cdot \left(2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\cos \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(\frac{angle\_m \cdot \pi}{180}\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 51.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. Simplified52.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 67.1% accurate, 3.4× speedup?

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

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

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


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

    1. Initial program 61.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. Simplified62.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 500 < (/.f64 angle 180)

    1. Initial program 27.5%

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

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

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

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

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

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

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

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

Alternative 12: 66.6% accurate, 3.5× speedup?

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

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

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


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

    1. Initial program 61.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. Simplified62.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 205000 < angle

    1. Initial program 27.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 66.7% accurate, 3.6× speedup?

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

\\
angle\_s \cdot \left(2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\frac{angle\_m \cdot \pi}{180}\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 51.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. Simplified52.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 54.7% accurate, 27.9× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(2 \cdot \left(0.005555555555555556 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right) \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (* 2.0 (* 0.005555555555555556 (* angle_m (* PI (* (+ a b) (- b a))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (2.0 * (0.005555555555555556 * (angle_m * (((double) M_PI) * ((a + b) * (b - a))))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (2.0 * (0.005555555555555556 * (angle_m * (Math.PI * ((a + b) * (b - a))))));
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (2.0 * (0.005555555555555556 * (angle_m * (math.pi * ((a + b) * (b - a))))))
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(2.0 * Float64(0.005555555555555556 * Float64(angle_m * Float64(pi * Float64(Float64(a + b) * Float64(b - a)))))))
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (2.0 * (0.005555555555555556 * (angle_m * (pi * ((a + b) * (b - a))))));
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(2.0 * N[(0.005555555555555556 * N[(angle$95$m * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \left(2 \cdot \left(0.005555555555555556 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 51.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. Simplified52.7%

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

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

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

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

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

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

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

Alternative 15: 54.8% accurate, 27.9× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(2 \cdot \left(0.005555555555555556 \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right) \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (* 2.0 (* 0.005555555555555556 (* (* angle_m PI) (* (+ a b) (- b a)))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (2.0 * (0.005555555555555556 * ((angle_m * ((double) M_PI)) * ((a + b) * (b - a)))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (2.0 * (0.005555555555555556 * ((angle_m * Math.PI) * ((a + b) * (b - a)))));
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (2.0 * (0.005555555555555556 * ((angle_m * math.pi) * ((a + b) * (b - a)))))
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(2.0 * Float64(0.005555555555555556 * Float64(Float64(angle_m * pi) * Float64(Float64(a + b) * Float64(b - a))))))
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (2.0 * (0.005555555555555556 * ((angle_m * pi) * ((a + b) * (b - a)))));
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(2.0 * N[(0.005555555555555556 * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \left(2 \cdot \left(0.005555555555555556 \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 51.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. Simplified52.7%

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

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

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

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

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

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

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

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

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

Alternative 16: 63.1% accurate, 27.9× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(2 \cdot \left(\left(a + b\right) \cdot \left(0.005555555555555556 \cdot \left(angle\_m \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\right)\right)\right) \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (* 2.0 (* (+ a b) (* 0.005555555555555556 (* angle_m (* (- b a) PI)))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (2.0 * ((a + b) * (0.005555555555555556 * (angle_m * ((b - a) * ((double) M_PI))))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (2.0 * ((a + b) * (0.005555555555555556 * (angle_m * ((b - a) * Math.PI)))));
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (2.0 * ((a + b) * (0.005555555555555556 * (angle_m * ((b - a) * math.pi)))))
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(2.0 * Float64(Float64(a + b) * Float64(0.005555555555555556 * Float64(angle_m * Float64(Float64(b - a) * pi))))))
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (2.0 * ((a + b) * (0.005555555555555556 * (angle_m * ((b - a) * pi)))));
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(0.005555555555555556 * N[(angle$95$m * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \left(2 \cdot \left(\left(a + b\right) \cdot \left(0.005555555555555556 \cdot \left(angle\_m \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 51.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. Simplified52.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 63.0% accurate, 27.9× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(2 \cdot \left(\left(a + b\right) \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\right)\right) \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (* 2.0 (* (+ a b) (* (* angle_m 0.005555555555555556) (* (- b a) PI))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * ((double) M_PI)))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * Math.PI))));
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * math.pi))))
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(angle_m * 0.005555555555555556) * Float64(Float64(b - a) * pi)))))
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * pi))));
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \left(2 \cdot \left(\left(a + b\right) \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 51.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. Simplified52.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 13.9% accurate, 59.9× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(2 \cdot \left(\left(a + b\right) \cdot 0\right)\right) \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* 2.0 (* (+ a b) 0.0))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (2.0 * ((a + b) * 0.0));
}
angle_m = abs(angle)
angle_s = copysign(1.0d0, angle)
real(8) function code(angle_s, a, b, angle_m)
    real(8), intent (in) :: angle_s
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle_m
    code = angle_s * (2.0d0 * ((a + b) * 0.0d0))
end function
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (2.0 * ((a + b) * 0.0));
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (2.0 * ((a + b) * 0.0))
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(2.0 * Float64(Float64(a + b) * 0.0)))
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (2.0 * ((a + b) * 0.0));
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(2.0 * N[(N[(a + b), $MachinePrecision] * 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \left(2 \cdot \left(\left(a + b\right) \cdot 0\right)\right)
\end{array}
Derivation
  1. Initial program 51.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. Simplified52.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto 2 \cdot \left(\left(a + b\right) \cdot \color{blue}{\frac{\left({b}^{3} - {a}^{3}\right) \cdot \left(\sin \left(\left(angle \cdot \pi\right) \cdot 0\right) + \sin \left(\left(angle \cdot \pi\right) \cdot 0\right)\right)}{\mathsf{fma}\left(b, b, a \cdot \left(b + a\right)\right) \cdot 2}}\right) \]
  13. Step-by-step derivation
    1. *-commutative5.5%

      \[\leadsto 2 \cdot \left(\left(a + b\right) \cdot \frac{\color{blue}{\left(\sin \left(\left(angle \cdot \pi\right) \cdot 0\right) + \sin \left(\left(angle \cdot \pi\right) \cdot 0\right)\right) \cdot \left({b}^{3} - {a}^{3}\right)}}{\mathsf{fma}\left(b, b, a \cdot \left(b + a\right)\right) \cdot 2}\right) \]
    2. associate-/l*5.5%

      \[\leadsto 2 \cdot \left(\left(a + b\right) \cdot \color{blue}{\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot 0\right) + \sin \left(\left(angle \cdot \pi\right) \cdot 0\right)\right) \cdot \frac{{b}^{3} - {a}^{3}}{\mathsf{fma}\left(b, b, a \cdot \left(b + a\right)\right) \cdot 2}\right)}\right) \]
    3. count-25.5%

      \[\leadsto 2 \cdot \left(\left(a + b\right) \cdot \left(\color{blue}{\left(2 \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0\right)\right)} \cdot \frac{{b}^{3} - {a}^{3}}{\mathsf{fma}\left(b, b, a \cdot \left(b + a\right)\right) \cdot 2}\right)\right) \]
    4. *-commutative5.5%

      \[\leadsto 2 \cdot \left(\left(a + b\right) \cdot \left(\color{blue}{\left(\sin \left(\left(angle \cdot \pi\right) \cdot 0\right) \cdot 2\right)} \cdot \frac{{b}^{3} - {a}^{3}}{\mathsf{fma}\left(b, b, a \cdot \left(b + a\right)\right) \cdot 2}\right)\right) \]
    5. mul0-rgt5.5%

      \[\leadsto 2 \cdot \left(\left(a + b\right) \cdot \left(\left(\sin \color{blue}{0} \cdot 2\right) \cdot \frac{{b}^{3} - {a}^{3}}{\mathsf{fma}\left(b, b, a \cdot \left(b + a\right)\right) \cdot 2}\right)\right) \]
    6. sin-05.5%

      \[\leadsto 2 \cdot \left(\left(a + b\right) \cdot \left(\left(\color{blue}{0} \cdot 2\right) \cdot \frac{{b}^{3} - {a}^{3}}{\mathsf{fma}\left(b, b, a \cdot \left(b + a\right)\right) \cdot 2}\right)\right) \]
    7. metadata-eval5.5%

      \[\leadsto 2 \cdot \left(\left(a + b\right) \cdot \left(\color{blue}{0} \cdot \frac{{b}^{3} - {a}^{3}}{\mathsf{fma}\left(b, b, a \cdot \left(b + a\right)\right) \cdot 2}\right)\right) \]
    8. mul0-lft10.8%

      \[\leadsto 2 \cdot \left(\left(a + b\right) \cdot \color{blue}{0}\right) \]
  14. Simplified10.8%

    \[\leadsto 2 \cdot \left(\left(a + b\right) \cdot \color{blue}{0}\right) \]
  15. Final simplification10.8%

    \[\leadsto 2 \cdot \left(\left(a + b\right) \cdot 0\right) \]
  16. Add Preprocessing

Reproduce

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