ab-angle->ABCF B

Percentage Accurate: 53.6% → 67.6%
Time: 16.9s
Alternatives: 18
Speedup: 3.5×

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.6% accurate, 1.0× speedup?

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

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

Alternative 1: 67.6% accurate, 1.0× speedup?

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

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


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

    1. Initial program 62.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.9%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. add-cube-cbrt61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 27.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. Simplified42.4%

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

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

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

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

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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) \]
    6. Step-by-step derivation
      1. add-cube-cbrt32.7%

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

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

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

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

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

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

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

Alternative 2: 65.4% accurate, 0.7× speedup?

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-157}:\\
\;\;\;\;\left(a - b\right) \cdot \left(\left(a + b\right) \cdot \left(2 \cdot \sin t\_0\right)\right)\\

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


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

    1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 5.0000000000000002e-157

    1. Initial program 66.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. Simplified66.7%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. add-cube-cbrt66.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000002e-157 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 51.7%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. add-cube-cbrt53.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 67.4% accurate, 1.0× 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 5 \cdot 10^{+173}:\\ \;\;\;\;\cos \left(\left(angle\_m \cdot -0.005555555555555556\right) \cdot \pi\right) \cdot \left(\left(\left(2 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(-0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\right) \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(a - b\right)\right) \cdot \sin \left(angle\_m \cdot {\left(\sqrt[3]{-0.005555555555555556 \cdot \pi}\right)}^{3}\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= (/ angle_m 180.0) 5e+173)
    (*
     (cos (* (* angle_m -0.005555555555555556) PI))
     (*
      (*
       (* 2.0 (log1p (expm1 (sin (* -0.005555555555555556 (* angle_m PI))))))
       (+ a b))
      (- a b)))
    (*
     2.0
     (*
      (* (+ a b) (- a b))
      (sin (* angle_m (pow (cbrt (* -0.005555555555555556 PI)) 3.0))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if ((angle_m / 180.0) <= 5e+173) {
		tmp = cos(((angle_m * -0.005555555555555556) * ((double) M_PI))) * (((2.0 * log1p(expm1(sin((-0.005555555555555556 * (angle_m * ((double) M_PI))))))) * (a + b)) * (a - b));
	} else {
		tmp = 2.0 * (((a + b) * (a - b)) * sin((angle_m * pow(cbrt((-0.005555555555555556 * ((double) M_PI))), 3.0))));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if ((angle_m / 180.0) <= 5e+173) {
		tmp = Math.cos(((angle_m * -0.005555555555555556) * Math.PI)) * (((2.0 * Math.log1p(Math.expm1(Math.sin((-0.005555555555555556 * (angle_m * Math.PI)))))) * (a + b)) * (a - b));
	} else {
		tmp = 2.0 * (((a + b) * (a - b)) * Math.sin((angle_m * Math.pow(Math.cbrt((-0.005555555555555556 * Math.PI)), 3.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) <= 5e+173)
		tmp = Float64(cos(Float64(Float64(angle_m * -0.005555555555555556) * pi)) * Float64(Float64(Float64(2.0 * log1p(expm1(sin(Float64(-0.005555555555555556 * Float64(angle_m * pi)))))) * Float64(a + b)) * Float64(a - b)));
	else
		tmp = Float64(2.0 * Float64(Float64(Float64(a + b) * Float64(a - b)) * sin(Float64(angle_m * (cbrt(Float64(-0.005555555555555556 * pi)) ^ 3.0)))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+173], N[(N[Cos[N[(N[(angle$95$m * -0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(2.0 * N[Log[1 + N[(Exp[N[Sin[N[(-0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m * N[Power[N[Power[N[(-0.005555555555555556 * Pi), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


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

    1. Initial program 62.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.9%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. add-cube-cbrt61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000034e173 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 27.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. Simplified42.4%

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

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

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

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

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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) \]
    6. Step-by-step derivation
      1. add-cube-cbrt32.7%

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

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

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

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

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

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

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

Alternative 4: 65.7% accurate, 1.0× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \cos \left(\left(angle\_m \cdot -0.005555555555555556\right) \cdot \pi\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq 10^{-296}:\\ \;\;\;\;t\_0 \cdot \left(\left(a - b\right) \cdot \left(\left(2 \cdot a\right) \cdot \sin \left(angle\_m \cdot \left(-0.005555555555555556 \cdot \pi\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(\left(a - b\right) \cdot \left(2 \cdot \left(\sin \left(-0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right) \cdot b\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (cos (* (* angle_m -0.005555555555555556) PI))))
   (*
    angle_s
    (if (<= (- (pow b 2.0) (pow a 2.0)) 1e-296)
      (*
       t_0
       (*
        (- a b)
        (* (* 2.0 a) (sin (* angle_m (* -0.005555555555555556 PI))))))
      (*
       t_0
       (*
        (- a b)
        (* 2.0 (* (sin (* -0.005555555555555556 (* angle_m PI))) b))))))))
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 = cos(((angle_m * -0.005555555555555556) * ((double) M_PI)));
	double tmp;
	if ((pow(b, 2.0) - pow(a, 2.0)) <= 1e-296) {
		tmp = t_0 * ((a - b) * ((2.0 * a) * sin((angle_m * (-0.005555555555555556 * ((double) M_PI))))));
	} else {
		tmp = t_0 * ((a - b) * (2.0 * (sin((-0.005555555555555556 * (angle_m * ((double) M_PI)))) * b)));
	}
	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.cos(((angle_m * -0.005555555555555556) * Math.PI));
	double tmp;
	if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= 1e-296) {
		tmp = t_0 * ((a - b) * ((2.0 * a) * Math.sin((angle_m * (-0.005555555555555556 * Math.PI)))));
	} else {
		tmp = t_0 * ((a - b) * (2.0 * (Math.sin((-0.005555555555555556 * (angle_m * Math.PI))) * b)));
	}
	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.cos(((angle_m * -0.005555555555555556) * math.pi))
	tmp = 0
	if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= 1e-296:
		tmp = t_0 * ((a - b) * ((2.0 * a) * math.sin((angle_m * (-0.005555555555555556 * math.pi)))))
	else:
		tmp = t_0 * ((a - b) * (2.0 * (math.sin((-0.005555555555555556 * (angle_m * math.pi))) * b)))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = cos(Float64(Float64(angle_m * -0.005555555555555556) * pi))
	tmp = 0.0
	if (Float64((b ^ 2.0) - (a ^ 2.0)) <= 1e-296)
		tmp = Float64(t_0 * Float64(Float64(a - b) * Float64(Float64(2.0 * a) * sin(Float64(angle_m * Float64(-0.005555555555555556 * pi))))));
	else
		tmp = Float64(t_0 * Float64(Float64(a - b) * Float64(2.0 * Float64(sin(Float64(-0.005555555555555556 * Float64(angle_m * pi))) * b))));
	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 = cos(((angle_m * -0.005555555555555556) * pi));
	tmp = 0.0;
	if (((b ^ 2.0) - (a ^ 2.0)) <= 1e-296)
		tmp = t_0 * ((a - b) * ((2.0 * a) * sin((angle_m * (-0.005555555555555556 * pi)))));
	else
		tmp = t_0 * ((a - b) * (2.0 * (sin((-0.005555555555555556 * (angle_m * pi))) * b)));
	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[Cos[N[(N[(angle$95$m * -0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 1e-296], N[(t$95$0 * N[(N[(a - b), $MachinePrecision] * N[(N[(2.0 * a), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(-0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(a - b), $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(-0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * b), $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 := \cos \left(\left(angle\_m \cdot -0.005555555555555556\right) \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq 10^{-296}:\\
\;\;\;\;t\_0 \cdot \left(\left(a - b\right) \cdot \left(\left(2 \cdot a\right) \cdot \sin \left(angle\_m \cdot \left(-0.005555555555555556 \cdot \pi\right)\right)\right)\right)\\

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


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

    1. Initial program 67.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. Simplified66.6%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. add-cube-cbrt66.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e-296 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 52.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. Simplified54.6%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. add-cube-cbrt54.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 67.4% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 62.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.9%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. add-cube-cbrt61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000034e173 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 27.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. Simplified42.4%

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

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

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

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

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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) \]
    6. Step-by-step derivation
      1. add-cube-cbrt32.7%

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 62.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. Simplified62.5%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. add-cube-cbrt62.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000018e-11 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000003e159

    1. Initial program 61.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. Simplified57.9%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow257.9%

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

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

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

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

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

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

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

    if 5.00000000000000003e159 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 27.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. Simplified42.4%

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

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

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

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

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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) \]
    6. Step-by-step derivation
      1. add-sqr-sqrt0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 62.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. Simplified62.5%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. add-cube-cbrt62.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000018e-11 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000003e159

    1. Initial program 61.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. Simplified57.9%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow257.9%

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

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

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

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

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

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

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

    if 5.00000000000000003e159 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 27.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. Simplified42.4%

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

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

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

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

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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) \]
    6. Step-by-step derivation
      1. add-sqr-sqrt0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 68.0% accurate, 1.8× speedup?

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

\mathbf{else}:\\
\;\;\;\;\cos \left(angle\_m \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(\left(\left(a + b\right) \cdot \left(a - b\right)\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 (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000003e159

    1. Initial program 62.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.9%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. add-cube-cbrt61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000003e159 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 27.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. Simplified42.4%

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

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

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

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

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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) \]
    6. Step-by-step derivation
      1. add-sqr-sqrt0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 62.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. Simplified62.5%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. add-cube-cbrt62.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000018e-11 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 47.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. Simplified51.6%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow251.6%

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

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

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

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification71.9%

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

Alternative 10: 58.5% accurate, 1.9× speedup?

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

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


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

    1. Initial program 60.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. Simplified62.9%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow262.5%

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

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

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

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

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

    if 1.00000000000000002e100 < (pow.f64 a #s(literal 2 binary64))

    1. Initial program 56.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 64.9% 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 2.1 \cdot 10^{+60}:\\ \;\;\;\;\left(a - b\right) \cdot \left(\left(a + b\right) \cdot \left(2 \cdot \sin \left(\left(angle\_m \cdot -0.005555555555555556\right) \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle\_m \cdot -0.011111111111111112\right) \cdot \left(\left(a - b\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= angle_m 2.1e+60)
    (*
     (- a b)
     (* (+ a b) (* 2.0 (sin (* (* angle_m -0.005555555555555556) PI)))))
    (* (* angle_m -0.011111111111111112) (* (- a b) (* PI (+ a b)))))))
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 <= 2.1e+60) {
		tmp = (a - b) * ((a + b) * (2.0 * sin(((angle_m * -0.005555555555555556) * ((double) M_PI)))));
	} else {
		tmp = (angle_m * -0.011111111111111112) * ((a - b) * (((double) M_PI) * (a + b)));
	}
	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 <= 2.1e+60) {
		tmp = (a - b) * ((a + b) * (2.0 * Math.sin(((angle_m * -0.005555555555555556) * Math.PI))));
	} else {
		tmp = (angle_m * -0.011111111111111112) * ((a - b) * (Math.PI * (a + b)));
	}
	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 <= 2.1e+60:
		tmp = (a - b) * ((a + b) * (2.0 * math.sin(((angle_m * -0.005555555555555556) * math.pi))))
	else:
		tmp = (angle_m * -0.011111111111111112) * ((a - b) * (math.pi * (a + b)))
	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 <= 2.1e+60)
		tmp = Float64(Float64(a - b) * Float64(Float64(a + b) * Float64(2.0 * sin(Float64(Float64(angle_m * -0.005555555555555556) * pi)))));
	else
		tmp = Float64(Float64(angle_m * -0.011111111111111112) * Float64(Float64(a - b) * Float64(pi * Float64(a + b))));
	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 <= 2.1e+60)
		tmp = (a - b) * ((a + b) * (2.0 * sin(((angle_m * -0.005555555555555556) * pi))));
	else
		tmp = (angle_m * -0.011111111111111112) * ((a - b) * (pi * (a + b)));
	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, 2.1e+60], N[(N[(a - b), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(2.0 * N[Sin[N[(N[(angle$95$m * -0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * -0.011111111111111112), $MachinePrecision] * N[(N[(a - b), $MachinePrecision] * N[(Pi * N[(a + b), $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 2.1 \cdot 10^{+60}:\\
\;\;\;\;\left(a - b\right) \cdot \left(\left(a + b\right) \cdot \left(2 \cdot \sin \left(\left(angle\_m \cdot -0.005555555555555556\right) \cdot \pi\right)\right)\right)\\

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


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

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. add-cube-cbrt61.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.1000000000000001e60 < angle

    1. Initial program 43.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. Simplified50.3%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. add-cube-cbrt50.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 61.5%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares56.0%

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

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

    if 3.99999999999999969e274 < (pow.f64 a #s(literal 2 binary64))

    1. Initial program 52.3%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares66.0%

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

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

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

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

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

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

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

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

Alternative 13: 45.6% accurate, 26.2× 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}\;a \leq 1.6 \cdot 10^{+38}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b \cdot \left(b - a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(b - a\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= a 1.6e+38)
    (* 0.011111111111111112 (* angle_m (* PI (* b (- b a)))))
    (* 0.011111111111111112 (* a (* (* angle_m PI) (- b a)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (a <= 1.6e+38) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b * (b - a))));
	} else {
		tmp = 0.011111111111111112 * (a * ((angle_m * ((double) M_PI)) * (b - a)));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (a <= 1.6e+38) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b * (b - a))));
	} else {
		tmp = 0.011111111111111112 * (a * ((angle_m * Math.PI) * (b - a)));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if a <= 1.6e+38:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (b * (b - a))))
	else:
		tmp = 0.011111111111111112 * (a * ((angle_m * math.pi) * (b - a)))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (a <= 1.6e+38)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b * Float64(b - a)))));
	else
		tmp = Float64(0.011111111111111112 * Float64(a * Float64(Float64(angle_m * pi) * Float64(b - a))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (a <= 1.6e+38)
		tmp = 0.011111111111111112 * (angle_m * (pi * (b * (b - a))));
	else
		tmp = 0.011111111111111112 * (a * ((angle_m * pi) * (b - a)));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 1.6e+38], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(N[(angle$95$m * Pi), $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}\;a \leq 1.6 \cdot 10^{+38}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b \cdot \left(b - a\right)\right)\right)\right)\\

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


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

    1. Initial program 60.1%

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

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

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

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

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

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

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

    if 1.59999999999999993e38 < a

    1. Initial program 56.6%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares67.4%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)\right) \]
    5. Applied egg-rr67.4%

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

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

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

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

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

Alternative 14: 35.9% accurate, 27.9× speedup?

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

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

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


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

    1. Initial program 60.9%

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)\right) \]
    5. Applied egg-rr61.1%

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

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a \cdot \color{blue}{\left(-1 \cdot a\right)}\right)\right)\right) \]
    8. Step-by-step derivation
      1. neg-mul-143.5%

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

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

    if 4.5999999999999999e116 < b

    1. Initial program 51.7%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares44.4%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)\right) \]
    5. Applied egg-rr44.4%

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

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

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

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

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

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

Alternative 15: 41.7% accurate, 38.1× speedup?

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

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

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

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

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)\right) \]
  5. Applied egg-rr58.4%

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

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

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

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

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

Alternative 16: 21.8% accurate, 46.6× speedup?

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

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

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

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

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

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)\right) \]
  5. Applied egg-rr58.4%

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

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

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

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

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

Alternative 17: 20.5% accurate, 46.6× speedup?

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

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

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

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

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

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)\right) \]
  5. Applied egg-rr58.4%

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

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

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

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

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

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

Alternative 18: 20.5% accurate, 46.6× speedup?

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

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

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

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

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

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)\right) \]
  5. Applied egg-rr58.4%

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

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

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

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

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

Reproduce

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