ab-angle->ABCF B

Percentage Accurate: 54.4% → 57.9%
Time: 32.4s
Alternatives: 16
Speedup: 32.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 54.4% accurate, 1.0× speedup?

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

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

Alternative 1: 57.9% accurate, 0.8× speedup?

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

\mathbf{elif}\;{a}^{2} \leq 5 \cdot 10^{+218}:\\
\;\;\;\;\left(t_0 \cdot \left|\sin \left(angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right|\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle_m}}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \sin \left(\frac{\pi \cdot angle_m}{180}\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle_m}}\right)\\


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

    1. Initial program 63.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-115 < (pow.f64 a 2) < 4.99999999999999983e218

    1. Initial program 45.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999983e218 < (pow.f64 a 2)

    1. Initial program 42.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 57.4% accurate, 0.4× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \pi \cdot \frac{angle_m}{180}\\ t_1 := \sin t_0\\ t_2 := angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\ t_3 := \sqrt[3]{t_2}\\ t_4 := t_1 \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t_1\right) \cdot \cos t_0 \leq -\infty:\\ \;\;\;\;t_4 \cdot \cos \left({\left({\left({t_2}^{0.16666666666666666}\right)}^{2}\right)}^{2} \cdot t_3\right)\\ \mathbf{else}:\\ \;\;\;\;t_4 \cdot \cos \left(t_3 \cdot {\left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_3\right)\right)\right)}^{2}\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (/ angle_m 180.0)))
        (t_1 (sin t_0))
        (t_2 (* angle_m (* PI 0.005555555555555556)))
        (t_3 (cbrt t_2))
        (t_4 (* t_1 (* 2.0 (* (+ b a) (- b a))))))
   (*
    angle_s
    (if (<=
         (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_1) (cos t_0))
         (- INFINITY))
      (* t_4 (cos (* (pow (pow (pow t_2 0.16666666666666666) 2.0) 2.0) t_3)))
      (* t_4 (cos (* t_3 (pow (expm1 (log1p t_3)) 2.0))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m / 180.0);
	double t_1 = sin(t_0);
	double t_2 = angle_m * (((double) M_PI) * 0.005555555555555556);
	double t_3 = cbrt(t_2);
	double t_4 = t_1 * (2.0 * ((b + a) * (b - a)));
	double tmp;
	if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_1) * cos(t_0)) <= -((double) INFINITY)) {
		tmp = t_4 * cos((pow(pow(pow(t_2, 0.16666666666666666), 2.0), 2.0) * t_3));
	} else {
		tmp = t_4 * cos((t_3 * pow(expm1(log1p(t_3)), 2.0)));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = Math.PI * (angle_m / 180.0);
	double t_1 = Math.sin(t_0);
	double t_2 = angle_m * (Math.PI * 0.005555555555555556);
	double t_3 = Math.cbrt(t_2);
	double t_4 = t_1 * (2.0 * ((b + a) * (b - a)));
	double tmp;
	if ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_1) * Math.cos(t_0)) <= -Double.POSITIVE_INFINITY) {
		tmp = t_4 * Math.cos((Math.pow(Math.pow(Math.pow(t_2, 0.16666666666666666), 2.0), 2.0) * t_3));
	} else {
		tmp = t_4 * Math.cos((t_3 * Math.pow(Math.expm1(Math.log1p(t_3)), 2.0)));
	}
	return angle_s * tmp;
}
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(pi * Float64(angle_m / 180.0))
	t_1 = sin(t_0)
	t_2 = Float64(angle_m * Float64(pi * 0.005555555555555556))
	t_3 = cbrt(t_2)
	t_4 = Float64(t_1 * Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))))
	tmp = 0.0
	if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_1) * cos(t_0)) <= Float64(-Inf))
		tmp = Float64(t_4 * cos(Float64((((t_2 ^ 0.16666666666666666) ^ 2.0) ^ 2.0) * t_3)));
	else
		tmp = Float64(t_4 * cos(Float64(t_3 * (expm1(log1p(t_3)) ^ 2.0))));
	end
	return Float64(angle_s * tmp)
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[t$95$2, 1/3], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(t$95$4 * N[Cos[N[(N[Power[N[Power[N[Power[t$95$2, 0.16666666666666666], $MachinePrecision], 2.0], $MachinePrecision], 2.0], $MachinePrecision] * t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$4 * N[Cos[N[(t$95$3 * N[Power[N[(Exp[N[Log[1 + t$95$3], $MachinePrecision]] - 1), $MachinePrecision], 2.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 := \pi \cdot \frac{angle_m}{180}\\
t_1 := \sin t_0\\
t_2 := angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_3 := \sqrt[3]{t_2}\\
t_4 := t_1 \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t_1\right) \cdot \cos t_0 \leq -\infty:\\
\;\;\;\;t_4 \cdot \cos \left({\left({\left({t_2}^{0.16666666666666666}\right)}^{2}\right)}^{2} \cdot t_3\right)\\

\mathbf{else}:\\
\;\;\;\;t_4 \cdot \cos \left(t_3 \cdot {\left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_3\right)\right)\right)}^{2}\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) < -inf.0

    1. Initial program 47.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq -\infty:\\ \;\;\;\;\left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right) \cdot \cos \left({\left({\left({\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{0.16666666666666666}\right)}^{2}\right)}^{2} \cdot \sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right) \cdot \cos \left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot {\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)\right)}^{2}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 57.5% accurate, 0.4× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \pi \cdot \frac{angle_m}{180}\\ t_1 := \sin t_0\\ t_2 := angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\ t_3 := \sqrt[3]{t_2}\\ t_4 := t_1 \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t_1\right) \cdot \cos t_0 \leq -\infty:\\ \;\;\;\;t_4 \cdot \cos \left({\left({\left({t_2}^{0.16666666666666666}\right)}^{2}\right)}^{2} \cdot t_3\right)\\ \mathbf{else}:\\ \;\;\;\;t_4 \cdot \cos \left(t_3 \cdot {t_3}^{2}\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (/ angle_m 180.0)))
        (t_1 (sin t_0))
        (t_2 (* angle_m (* PI 0.005555555555555556)))
        (t_3 (cbrt t_2))
        (t_4 (* t_1 (* 2.0 (* (+ b a) (- b a))))))
   (*
    angle_s
    (if (<=
         (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_1) (cos t_0))
         (- INFINITY))
      (* t_4 (cos (* (pow (pow (pow t_2 0.16666666666666666) 2.0) 2.0) t_3)))
      (* t_4 (cos (* t_3 (pow t_3 2.0))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m / 180.0);
	double t_1 = sin(t_0);
	double t_2 = angle_m * (((double) M_PI) * 0.005555555555555556);
	double t_3 = cbrt(t_2);
	double t_4 = t_1 * (2.0 * ((b + a) * (b - a)));
	double tmp;
	if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_1) * cos(t_0)) <= -((double) INFINITY)) {
		tmp = t_4 * cos((pow(pow(pow(t_2, 0.16666666666666666), 2.0), 2.0) * t_3));
	} else {
		tmp = t_4 * cos((t_3 * pow(t_3, 2.0)));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = Math.PI * (angle_m / 180.0);
	double t_1 = Math.sin(t_0);
	double t_2 = angle_m * (Math.PI * 0.005555555555555556);
	double t_3 = Math.cbrt(t_2);
	double t_4 = t_1 * (2.0 * ((b + a) * (b - a)));
	double tmp;
	if ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_1) * Math.cos(t_0)) <= -Double.POSITIVE_INFINITY) {
		tmp = t_4 * Math.cos((Math.pow(Math.pow(Math.pow(t_2, 0.16666666666666666), 2.0), 2.0) * t_3));
	} else {
		tmp = t_4 * Math.cos((t_3 * Math.pow(t_3, 2.0)));
	}
	return angle_s * tmp;
}
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(pi * Float64(angle_m / 180.0))
	t_1 = sin(t_0)
	t_2 = Float64(angle_m * Float64(pi * 0.005555555555555556))
	t_3 = cbrt(t_2)
	t_4 = Float64(t_1 * Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))))
	tmp = 0.0
	if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_1) * cos(t_0)) <= Float64(-Inf))
		tmp = Float64(t_4 * cos(Float64((((t_2 ^ 0.16666666666666666) ^ 2.0) ^ 2.0) * t_3)));
	else
		tmp = Float64(t_4 * cos(Float64(t_3 * (t_3 ^ 2.0))));
	end
	return Float64(angle_s * tmp)
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[t$95$2, 1/3], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(t$95$4 * N[Cos[N[(N[Power[N[Power[N[Power[t$95$2, 0.16666666666666666], $MachinePrecision], 2.0], $MachinePrecision], 2.0], $MachinePrecision] * t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$4 * N[Cos[N[(t$95$3 * N[Power[t$95$3, 2.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 := \pi \cdot \frac{angle_m}{180}\\
t_1 := \sin t_0\\
t_2 := angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_3 := \sqrt[3]{t_2}\\
t_4 := t_1 \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t_1\right) \cdot \cos t_0 \leq -\infty:\\
\;\;\;\;t_4 \cdot \cos \left({\left({\left({t_2}^{0.16666666666666666}\right)}^{2}\right)}^{2} \cdot t_3\right)\\

\mathbf{else}:\\
\;\;\;\;t_4 \cdot \cos \left(t_3 \cdot {t_3}^{2}\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) < -inf.0

    1. Initial program 47.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq -\infty:\\ \;\;\;\;\left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right) \cdot \cos \left({\left({\left({\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{0.16666666666666666}\right)}^{2}\right)}^{2} \cdot \sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right) \cdot \cos \left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)} \cdot {\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{2}\right)\\ \end{array} \]
  5. Add Preprocessing

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

\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \sin \left(\frac{\pi \cdot angle_m}{180}\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle_m}}\right)\\


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

    1. Initial program 55.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999983e218 < (pow.f64 a 2)

    1. Initial program 42.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 57.5% accurate, 0.8× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+152}:\\ \;\;\;\;\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(t_0 \cdot \left|\sin \left(angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right|\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t_0 \cdot \sin \left(angle_m \cdot \frac{\pi}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)}\right)}^{3}\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* 2.0 (* (+ b a) (- b a)))))
   (*
    angle_s
    (if (<= (pow a 2.0) 5e+152)
      (*
       (cos (* PI (/ angle_m 180.0)))
       (* t_0 (fabs (sin (* angle_m (* PI 0.005555555555555556))))))
      (*
       (* t_0 (sin (* angle_m (/ PI 180.0))))
       (cos (pow (cbrt (* PI (* angle_m 0.005555555555555556))) 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 = 2.0 * ((b + a) * (b - a));
	double tmp;
	if (pow(a, 2.0) <= 5e+152) {
		tmp = cos((((double) M_PI) * (angle_m / 180.0))) * (t_0 * fabs(sin((angle_m * (((double) M_PI) * 0.005555555555555556)))));
	} else {
		tmp = (t_0 * sin((angle_m * (((double) M_PI) / 180.0)))) * cos(pow(cbrt((((double) M_PI) * (angle_m * 0.005555555555555556))), 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 = 2.0 * ((b + a) * (b - a));
	double tmp;
	if (Math.pow(a, 2.0) <= 5e+152) {
		tmp = Math.cos((Math.PI * (angle_m / 180.0))) * (t_0 * Math.abs(Math.sin((angle_m * (Math.PI * 0.005555555555555556)))));
	} else {
		tmp = (t_0 * Math.sin((angle_m * (Math.PI / 180.0)))) * Math.cos(Math.pow(Math.cbrt((Math.PI * (angle_m * 0.005555555555555556))), 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(2.0 * Float64(Float64(b + a) * Float64(b - a)))
	tmp = 0.0
	if ((a ^ 2.0) <= 5e+152)
		tmp = Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * Float64(t_0 * abs(sin(Float64(angle_m * Float64(pi * 0.005555555555555556))))));
	else
		tmp = Float64(Float64(t_0 * sin(Float64(angle_m * Float64(pi / 180.0)))) * cos((cbrt(Float64(pi * Float64(angle_m * 0.005555555555555556))) ^ 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[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+152], N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Abs[N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[Sin[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[Power[N[Power[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+152}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(t_0 \cdot \left|\sin \left(angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right|\right)\\

\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \sin \left(angle_m \cdot \frac{\pi}{180}\right)\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)}\right)}^{3}\right)\\


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

    1. Initial program 58.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5e152 < (pow.f64 a 2)

    1. Initial program 39.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 58.0% accurate, 0.8× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \left(\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(angle_m \cdot \frac{\pi}{180}\right)\right) \cdot \cos \left(\frac{{\left(\sqrt[3]{\pi}\right)}^{2}}{180} \cdot \frac{\sqrt[3]{\pi}}{\frac{1}{angle_m}}\right)\right) \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (*
   (* (* 2.0 (* (+ b a) (- b a))) (sin (* angle_m (/ PI 180.0))))
   (cos (* (/ (pow (cbrt PI) 2.0) 180.0) (/ (cbrt PI) (/ 1.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) {
	return angle_s * (((2.0 * ((b + a) * (b - a))) * sin((angle_m * (((double) M_PI) / 180.0)))) * cos(((pow(cbrt(((double) M_PI)), 2.0) / 180.0) * (cbrt(((double) M_PI)) / (1.0 / angle_m)))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (((2.0 * ((b + a) * (b - a))) * Math.sin((angle_m * (Math.PI / 180.0)))) * Math.cos(((Math.pow(Math.cbrt(Math.PI), 2.0) / 180.0) * (Math.cbrt(Math.PI) / (1.0 / angle_m)))));
}
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(Float64(Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) * sin(Float64(angle_m * Float64(pi / 180.0)))) * cos(Float64(Float64((cbrt(pi) ^ 2.0) / 180.0) * Float64(cbrt(pi) / Float64(1.0 / angle_m))))))
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[(N[(N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / 180.0), $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle_s \cdot \left(\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(angle_m \cdot \frac{\pi}{180}\right)\right) \cdot \cos \left(\frac{{\left(\sqrt[3]{\pi}\right)}^{2}}{180} \cdot \frac{\sqrt[3]{\pi}}{\frac{1}{angle_m}}\right)\right)
\end{array}
Derivation
  1. Initial program 50.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;{b}^{2} \leq 10^{+218}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(t_0 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 b 2) < 2.0000000000000001e-196

    1. Initial program 58.7%

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-196 < (pow.f64 b 2) < 1.00000000000000008e218

    1. Initial program 54.6%

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

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

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

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

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

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

    if 1.00000000000000008e218 < (pow.f64 b 2)

    1. Initial program 36.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(\sin t_1 \cdot t_0\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle_m}}\right)\\


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

    1. Initial program 57.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000001e172 < (pow.f64 a 2)

    1. Initial program 39.9%

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

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

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

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

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

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

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

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

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

Alternative 9: 57.2% accurate, 1.3× speedup?

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

\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 b 2) < 5.99999999999999972e227

    1. Initial program 56.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.99999999999999972e227 < (pow.f64 b 2)

    1. Initial program 36.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 57.8% accurate, 1.9× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \left(\left(\sin \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle_m}}\right)\right) \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (*
   (* (sin (* PI (/ angle_m 180.0))) (* 2.0 (* (+ b a) (- b a))))
   (cos (/ 1.0 (/ 180.0 (* PI angle_m)))))))
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 * ((sin((((double) M_PI) * (angle_m / 180.0))) * (2.0 * ((b + a) * (b - a)))) * cos((1.0 / (180.0 / (((double) M_PI) * angle_m)))));
}
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 * ((Math.sin((Math.PI * (angle_m / 180.0))) * (2.0 * ((b + a) * (b - a)))) * Math.cos((1.0 / (180.0 / (Math.PI * angle_m)))));
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * ((math.sin((math.pi * (angle_m / 180.0))) * (2.0 * ((b + a) * (b - a)))) * math.cos((1.0 / (180.0 / (math.pi * angle_m)))))
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(Float64(sin(Float64(pi * Float64(angle_m / 180.0))) * Float64(2.0 * Float64(Float64(b + a) * Float64(b - a)))) * cos(Float64(1.0 / Float64(180.0 / Float64(pi * angle_m))))))
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * ((sin((pi * (angle_m / 180.0))) * (2.0 * ((b + a) * (b - a)))) * cos((1.0 / (180.0 / (pi * angle_m)))));
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[(N[(N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(1.0 / N[(180.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle_s \cdot \left(\left(\sin \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle_m}}\right)\right)
\end{array}
Derivation
  1. Initial program 50.6%

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

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

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

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

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

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

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

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

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

Alternative 11: 58.0% accurate, 1.9× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \left(\left(\sin \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle_m}}\right)\right) \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (*
   (* (sin (* PI (/ angle_m 180.0))) (* 2.0 (* (+ b a) (- b a))))
   (cos (/ 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) {
	return angle_s * ((sin((((double) M_PI) * (angle_m / 180.0))) * (2.0 * ((b + a) * (b - a)))) * cos((((double) M_PI) / (180.0 / angle_m))));
}
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 * ((Math.sin((Math.PI * (angle_m / 180.0))) * (2.0 * ((b + a) * (b - a)))) * Math.cos((Math.PI / (180.0 / angle_m))));
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * ((math.sin((math.pi * (angle_m / 180.0))) * (2.0 * ((b + a) * (b - a)))) * math.cos((math.pi / (180.0 / angle_m))))
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(Float64(sin(Float64(pi * Float64(angle_m / 180.0))) * Float64(2.0 * Float64(Float64(b + a) * Float64(b - a)))) * cos(Float64(pi / Float64(180.0 / angle_m)))))
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * ((sin((pi * (angle_m / 180.0))) * (2.0 * ((b + a) * (b - a)))) * cos((pi / (180.0 / angle_m))));
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[(N[(N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi / N[(180.0 / angle$95$m), $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(\left(\sin \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle_m}}\right)\right)
\end{array}
Derivation
  1. Initial program 50.6%

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

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

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

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

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

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

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

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

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

Alternative 12: 56.3% accurate, 3.6× speedup?

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

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

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

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

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

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

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

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

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

Alternative 13: 54.7% accurate, 27.9× speedup?

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

\\
angle_s \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)\right)
\end{array}
Derivation
  1. Initial program 50.6%

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

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

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

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

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

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

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

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

Alternative 14: 54.7% accurate, 27.9× speedup?

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

\\
angle_s \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)
\end{array}
Derivation
  1. Initial program 50.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\\
angle_s \cdot \left(0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 50.6%

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

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

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

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

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

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

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

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

Alternative 16: 54.7% accurate, 32.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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