ab-angle->ABCF B

Percentage Accurate: 54.4% → 60.7%
Time: 17.1s
Alternatives: 17
Speedup: 23.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 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: 60.7% 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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\ t_1 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\ t_2 := \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\ t_3 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+16}:\\ \;\;\;\;t\_2 \cdot \left(2 \cdot \left({b}^{2} \cdot t\_0\right) + a \cdot \left(-2 \cdot \left(a \cdot t\_0\right) + 2 \cdot \left(t\_0 \cdot \left(b - b\right)\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+78}:\\ \;\;\;\;t\_2 \cdot \left(t\_1 \cdot \sin \left({\left({t\_3}^{0.16666666666666666}\right)}^{6}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2 \cdot \left(t\_1 \cdot \sin \left({\left(\sqrt[3]{t\_3}\right)}^{3}\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (sin (* 0.005555555555555556 (* angle_m PI))))
        (t_1 (* 2.0 (* (+ b a) (- b a))))
        (t_2 (cos (* PI (/ angle_m 180.0))))
        (t_3 (* PI (* angle_m 0.005555555555555556))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 5e+16)
      (*
       t_2
       (+
        (* 2.0 (* (pow b 2.0) t_0))
        (* a (+ (* -2.0 (* a t_0)) (* 2.0 (* t_0 (- b b)))))))
      (if (<= (/ angle_m 180.0) 1e+78)
        (* t_2 (* t_1 (sin (pow (pow t_3 0.16666666666666666) 6.0))))
        (* t_2 (* t_1 (sin (pow (cbrt t_3) 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 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	double t_1 = 2.0 * ((b + a) * (b - a));
	double t_2 = cos((((double) M_PI) * (angle_m / 180.0)));
	double t_3 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double tmp;
	if ((angle_m / 180.0) <= 5e+16) {
		tmp = t_2 * ((2.0 * (pow(b, 2.0) * t_0)) + (a * ((-2.0 * (a * t_0)) + (2.0 * (t_0 * (b - b))))));
	} else if ((angle_m / 180.0) <= 1e+78) {
		tmp = t_2 * (t_1 * sin(pow(pow(t_3, 0.16666666666666666), 6.0)));
	} else {
		tmp = t_2 * (t_1 * sin(pow(cbrt(t_3), 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 = Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
	double t_1 = 2.0 * ((b + a) * (b - a));
	double t_2 = Math.cos((Math.PI * (angle_m / 180.0)));
	double t_3 = Math.PI * (angle_m * 0.005555555555555556);
	double tmp;
	if ((angle_m / 180.0) <= 5e+16) {
		tmp = t_2 * ((2.0 * (Math.pow(b, 2.0) * t_0)) + (a * ((-2.0 * (a * t_0)) + (2.0 * (t_0 * (b - b))))));
	} else if ((angle_m / 180.0) <= 1e+78) {
		tmp = t_2 * (t_1 * Math.sin(Math.pow(Math.pow(t_3, 0.16666666666666666), 6.0)));
	} else {
		tmp = t_2 * (t_1 * Math.sin(Math.pow(Math.cbrt(t_3), 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 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))
	t_1 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a)))
	t_2 = cos(Float64(pi * Float64(angle_m / 180.0)))
	t_3 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e+16)
		tmp = Float64(t_2 * Float64(Float64(2.0 * Float64((b ^ 2.0) * t_0)) + Float64(a * Float64(Float64(-2.0 * Float64(a * t_0)) + Float64(2.0 * Float64(t_0 * Float64(b - b)))))));
	elseif (Float64(angle_m / 180.0) <= 1e+78)
		tmp = Float64(t_2 * Float64(t_1 * sin(((t_3 ^ 0.16666666666666666) ^ 6.0))));
	else
		tmp = Float64(t_2 * Float64(t_1 * sin((cbrt(t_3) ^ 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[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+16], N[(t$95$2 * N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-2.0 * N[(a * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$0 * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+78], N[(t$95$2 * N[(t$95$1 * N[Sin[N[Power[N[Power[t$95$3, 0.16666666666666666], $MachinePrecision], 6.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(t$95$1 * N[Sin[N[Power[N[Power[t$95$3, 1/3], $MachinePrecision], 3.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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
t_1 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_2 := \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
t_3 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+16}:\\
\;\;\;\;t\_2 \cdot \left(2 \cdot \left({b}^{2} \cdot t\_0\right) + a \cdot \left(-2 \cdot \left(a \cdot t\_0\right) + 2 \cdot \left(t\_0 \cdot \left(b - b\right)\right)\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+78}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot \sin \left({\left({t\_3}^{0.16666666666666666}\right)}^{6}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot \sin \left({\left(\sqrt[3]{t\_3}\right)}^{3}\right)\right)\\


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

    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-squares65.2%

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

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

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

    if 5e16 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000001e78

    1. Initial program 33.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. unpow233.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. unpow233.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-squares33.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-rr33.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. add-cube-cbrt15.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000001e78 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 32.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. unpow232.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. unpow232.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-squares32.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-rr32.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. Step-by-step derivation
      1. add-cube-cbrt30.3%

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

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

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

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

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

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

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

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

Alternative 2: 61.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -\infty:\\
\;\;\;\;\left(2 \cdot \left({b}^{2} \cdot \sin \left(angle\_m \cdot \left(\pi \cdot {\left(\sqrt[3]{0.005555555555555556}\right)}^{3}\right)\right)\right) + a \cdot \left(angle\_m \cdot \mathsf{fma}\left(-2, a \cdot \left(\pi \cdot 0.005555555555555556\right), 0\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\

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


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

    1. Initial program 56.8%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow256.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. unpow256.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-squares56.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 57.1%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares59.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-rr59.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. add-cube-cbrt60.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 60.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 := \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\ t_1 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\ t_2 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-48}:\\ \;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(angle\_m \cdot \pi\right)\right) + angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+78}:\\ \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \sin \left({\left({t\_2}^{0.16666666666666666}\right)}^{6}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \sin \left({\left(\sqrt[3]{t\_2}\right)}^{3}\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (cos (* PI (/ angle_m 180.0))))
        (t_1 (* 2.0 (* (+ b a) (- b a))))
        (t_2 (* PI (* angle_m 0.005555555555555556))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 4e-48)
      (*
       0.011111111111111112
       (+
        (* a (- (* angle_m (* PI (- b b))) (* a (* angle_m PI))))
        (* angle_m (* (pow b 2.0) PI))))
      (if (<= (/ angle_m 180.0) 1e+78)
        (* t_0 (* t_1 (sin (pow (pow t_2 0.16666666666666666) 6.0))))
        (* t_0 (* t_1 (sin (pow (cbrt t_2) 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 = cos((((double) M_PI) * (angle_m / 180.0)));
	double t_1 = 2.0 * ((b + a) * (b - a));
	double t_2 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double tmp;
	if ((angle_m / 180.0) <= 4e-48) {
		tmp = 0.011111111111111112 * ((a * ((angle_m * (((double) M_PI) * (b - b))) - (a * (angle_m * ((double) M_PI))))) + (angle_m * (pow(b, 2.0) * ((double) M_PI))));
	} else if ((angle_m / 180.0) <= 1e+78) {
		tmp = t_0 * (t_1 * sin(pow(pow(t_2, 0.16666666666666666), 6.0)));
	} else {
		tmp = t_0 * (t_1 * sin(pow(cbrt(t_2), 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 = Math.cos((Math.PI * (angle_m / 180.0)));
	double t_1 = 2.0 * ((b + a) * (b - a));
	double t_2 = Math.PI * (angle_m * 0.005555555555555556);
	double tmp;
	if ((angle_m / 180.0) <= 4e-48) {
		tmp = 0.011111111111111112 * ((a * ((angle_m * (Math.PI * (b - b))) - (a * (angle_m * Math.PI)))) + (angle_m * (Math.pow(b, 2.0) * Math.PI)));
	} else if ((angle_m / 180.0) <= 1e+78) {
		tmp = t_0 * (t_1 * Math.sin(Math.pow(Math.pow(t_2, 0.16666666666666666), 6.0)));
	} else {
		tmp = t_0 * (t_1 * Math.sin(Math.pow(Math.cbrt(t_2), 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 = cos(Float64(pi * Float64(angle_m / 180.0)))
	t_1 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a)))
	t_2 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 4e-48)
		tmp = Float64(0.011111111111111112 * Float64(Float64(a * Float64(Float64(angle_m * Float64(pi * Float64(b - b))) - Float64(a * Float64(angle_m * pi)))) + Float64(angle_m * Float64((b ^ 2.0) * pi))));
	elseif (Float64(angle_m / 180.0) <= 1e+78)
		tmp = Float64(t_0 * Float64(t_1 * sin(((t_2 ^ 0.16666666666666666) ^ 6.0))));
	else
		tmp = Float64(t_0 * Float64(t_1 * sin((cbrt(t_2) ^ 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[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e-48], N[(0.011111111111111112 * N[(N[(a * N[(N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+78], N[(t$95$0 * N[(t$95$1 * N[Sin[N[Power[N[Power[t$95$2, 0.16666666666666666], $MachinePrecision], 6.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(t$95$1 * N[Sin[N[Power[N[Power[t$95$2, 1/3], $MachinePrecision], 3.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 := \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
t_1 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_2 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-48}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(angle\_m \cdot \pi\right)\right) + angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+78}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \sin \left({\left({t\_2}^{0.16666666666666666}\right)}^{6}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \sin \left({\left(\sqrt[3]{t\_2}\right)}^{3}\right)\right)\\


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

    1. Initial program 62.0%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow262.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. unpow262.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-squares64.2%

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

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

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

    if 3.9999999999999999e-48 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000001e78

    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.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-rr58.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. add-cube-cbrt51.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000001e78 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 32.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. unpow232.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. unpow232.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-squares32.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-rr32.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. Step-by-step derivation
      1. add-cube-cbrt30.3%

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

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

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

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

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

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

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

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

Alternative 4: 60.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+183}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{t\_0}\right)}^{3}\right) \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;\sqrt{{\cos t\_0}^{2}} \cdot t\_1\\


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

    1. Initial program 61.8%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow261.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. unpow261.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-squares64.0%

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

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

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

    if 1e-58 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000009e183

    1. Initial program 49.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. unpow249.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. unpow249.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-squares49.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-rr49.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. add-cube-cbrt47.0%

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

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

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

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

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

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

    if 5.00000000000000009e183 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 33.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. unpow233.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. unpow233.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-squares33.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-rr33.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. add-sqr-sqrt16.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}{\left(\sqrt{\cos \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt{\cos \left(\pi \cdot \frac{angle}{180}\right)}\right)} \]
      2. sqrt-unprod44.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 \color{blue}{\sqrt{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)}} \]
      3. pow244.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 \sqrt{\color{blue}{{\cos \left(\pi \cdot \frac{angle}{180}\right)}^{2}}} \]
      4. div-inv44.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 \sqrt{{\cos \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right)}^{2}} \]
      5. metadata-eval44.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 \sqrt{{\cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right)}^{2}} \]
    6. Applied egg-rr44.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 \color{blue}{\sqrt{{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{2}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification59.7%

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


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

    1. Initial program 61.8%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow261.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. unpow261.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-squares64.0%

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

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

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

    if 1e-58 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000009e183

    1. Initial program 49.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. unpow249.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. unpow249.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-squares49.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-rr49.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. add-cube-cbrt47.0%

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

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

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

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

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

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

    if 5.00000000000000009e183 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 33.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. unpow233.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. unpow233.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-squares33.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-rr33.1%

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Taylor expanded in angle around 0 44.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} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification59.7%

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

Alternative 6: 60.8% accurate, 1.8× speedup?

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+166}:\\
\;\;\;\;\cos t\_0 \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


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

    1. Initial program 61.8%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow261.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. unpow261.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-squares64.0%

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

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

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

    if 1e-58 < (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999994e165

    1. Initial program 53.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. unpow253.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. unpow253.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-squares53.2%

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

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

    if 9.9999999999999994e165 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 29.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. unpow229.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. unpow229.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-squares29.8%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Taylor expanded in angle around 0 42.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 \color{blue}{1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification59.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{-58}:\\ \;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(angle \cdot \pi\right)\right) + angle \cdot \left({b}^{2} \cdot \pi\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+166}:\\ \;\;\;\;\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(\pi \cdot \frac{angle}{180}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 60.9% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 61.8%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow261.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. unpow261.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-squares64.0%

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

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

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

    if 1e-58 < (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999994e165

    1. Initial program 53.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. unpow253.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. unpow253.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-squares53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999994e165 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 29.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. unpow229.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. unpow229.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-squares29.8%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Taylor expanded in angle around 0 42.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 \color{blue}{1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification59.9%

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

Alternative 8: 59.9% accurate, 1.9× speedup?

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

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

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


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

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

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

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

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

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

    if 1.9999999999999999e267 < (pow.f64 a #s(literal 2 binary64))

    1. Initial program 46.4%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow246.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. unpow246.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-squares52.3%

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

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

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

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

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

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

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

Alternative 9: 59.1% accurate, 3.2× speedup?

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

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

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


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

    1. Initial program 61.8%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow261.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. unpow261.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-squares64.0%

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

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

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

    if 1e-58 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 43.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. unpow243.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. unpow243.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-squares43.8%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Taylor expanded in angle around 0 45.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} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.8%

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

Alternative 10: 45.7% accurate, 19.0× speedup?

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

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

\mathbf{elif}\;a \leq 6.5 \cdot 10^{+143}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a \cdot \left(\left(-b\right) - a\right)\right)\right)\right)\\

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


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

    1. Initial program 55.7%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow255.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. unpow255.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-squares57.4%

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

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

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

    if 9.2000000000000001e-57 < a < 6.4999999999999997e143

    1. Initial program 62.1%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow262.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. unpow262.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-squares62.1%

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

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

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

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

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

    if 6.4999999999999997e143 < a

    1. Initial program 60.8%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow260.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. unpow260.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-squares64.1%

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

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

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

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

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

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

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

Alternative 11: 56.9% accurate, 20.9× speedup?

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

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

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


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

    1. Initial program 56.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. unpow256.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. unpow256.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.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-rr58.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000005e149 < a

    1. Initial program 60.8%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow260.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. unpow260.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-squares64.1%

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

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

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

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

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

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

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

Alternative 12: 56.6% accurate, 23.3× speedup?

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

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

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


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

    1. Initial program 56.9%

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

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

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

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

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

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

    if 5.3999999999999997e130 < a

    1. Initial program 57.9%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow257.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. unpow257.9%

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

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

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

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

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

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

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

Alternative 13: 45.5% accurate, 26.2× speedup?

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

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

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


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

    1. Initial program 55.8%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow255.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. unpow255.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-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) \]
    5. Applied egg-rr53.0%

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

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

    if 3.4000000000000001e-34 < a

    1. Initial program 61.1%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow261.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. unpow261.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.0%

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

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

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

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

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

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

Alternative 14: 43.7% accurate, 26.2× speedup?

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

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


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

    1. Initial program 55.8%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow255.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. unpow255.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-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) \]
    5. Applied egg-rr53.0%

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

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

    if 5.1999999999999999e-34 < a

    1. Initial program 61.1%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow261.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. unpow261.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.0%

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

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

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

Alternative 15: 36.9% accurate, 26.2× speedup?

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

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

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


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

    1. Initial program 60.6%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow260.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. unpow260.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-squares62.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. Applied egg-rr55.6%

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

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

    if 7.39999999999999959e127 < angle

    1. Initial program 30.1%

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow230.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. unpow230.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-squares30.2%

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

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

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

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

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

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

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

Alternative 16: 21.1% accurate, 46.6× speedup?

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

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

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

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
  4. Step-by-step derivation
    1. unpow257.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. unpow257.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-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) \]
  5. Applied egg-rr52.7%

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

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

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

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

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

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

Alternative 17: 20.3% accurate, 46.6× speedup?

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

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

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

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
  4. Step-by-step derivation
    1. unpow257.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. unpow257.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-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) \]
  5. Applied egg-rr52.7%

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

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

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

Reproduce

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