ab-angle->ABCF B

Percentage Accurate: 53.4% → 65.8%
Time: 34.5s
Alternatives: 22
Speedup: 32.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 53.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: 65.8% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+121}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(\sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right) \cdot \log \left(e^{\cos t\_0}\right)\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+171}:\\
\;\;\;\;\left(\left(2 \cdot t\_3\right) \cdot t\_2\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(t\_2 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t\_0\right)\right)\right)\right)\right)\\


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

    1. Initial program 62.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. unpow262.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. unpow262.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-squares65.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-rr65.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 a around 0 67.7%

      \[\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) \]
    6. Step-by-step derivation
      1. +-commutative67.7%

        \[\leadsto \color{blue}{\left(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) + 2 \cdot \left({b}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. associate-*r*67.7%

        \[\leadsto \left(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) + \color{blue}{\left(2 \cdot {b}^{2}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. associate-*r*69.7%

        \[\leadsto \left(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) + \left(2 \cdot {b}^{2}\right) \cdot \sin \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      4. *-commutative69.7%

        \[\leadsto \left(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) + \left(2 \cdot {b}^{2}\right) \cdot \sin \left(\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      5. *-commutative69.7%

        \[\leadsto \left(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) + \left(2 \cdot {b}^{2}\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      6. associate-*r*69.7%

        \[\leadsto \left(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) + \color{blue}{2 \cdot \left({b}^{2} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      7. fma-define69.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, -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), 2 \cdot \left({b}^{2} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    7. Simplified68.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, -2 \cdot \left(a \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right), 2 \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot {b}^{2}\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    8. Step-by-step derivation
      1. add-sqr-sqrt47.0%

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

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

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

    if 9.99999999999999997e-74 < (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000007e121

    1. Initial program 64.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000007e121 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000004e171

    1. Initial program 17.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. unpow217.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. unpow217.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-squares17.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-rr17.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-sqr-sqrt14.7%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 34.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(\sqrt[3]{{\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{3}} \cdot \cos \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}\right)\right) \]
    11. Step-by-step derivation
      1. rem-cbrt-cube48.1%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(\sqrt{\color{blue}{{\left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot 1\right)}^{2}}} \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right) \]
      10. *-rgt-identity46.1%

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

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

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

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

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

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

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

Alternative 2: 65.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;-2 \cdot \left({a}^{2} \cdot t\_3\right) + b \cdot \left(2 \cdot \left(b \cdot t\_3\right) + 2 \cdot \left(t\_3 \cdot \left(a - a\right)\right)\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 4.0000000000000003e97

    1. Initial program 65.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. unpow265.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. unpow265.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-squares65.5%

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

      \[\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 4.0000000000000003e97 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < +inf.0

    1. Initial program 48.4%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) + b \cdot \left(2 \cdot \left(b \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(a + -1 \cdot a\right)\right)\right)} \]

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 66.0% accurate, 0.3× 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 := \sin t\_0\\ t_2 := \frac{angle\_m}{180} \cdot \pi\\ t_3 := \cos t\_2\\ t_4 := t\_3 \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_2\right)\\ t_5 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_4 \leq 5 \cdot 10^{+223}:\\ \;\;\;\;t\_3 \cdot \mathsf{fma}\left(a, -2 \cdot \left(a \cdot t\_1\right), 2 \cdot \left(t\_1 \cdot {b}^{2}\right)\right)\\ \mathbf{elif}\;t\_4 \leq \infty:\\ \;\;\;\;-2 \cdot \left({a}^{2} \cdot t\_5\right) + b \cdot \left(2 \cdot \left(b \cdot t\_5\right) + 2 \cdot \left(t\_5 \cdot \left(a - a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_0}\right)}^{2}\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 (* PI (* angle_m 0.005555555555555556)))
        (t_1 (sin t_0))
        (t_2 (* (/ angle_m 180.0) PI))
        (t_3 (cos t_2))
        (t_4 (* t_3 (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_2))))
        (t_5 (sin (* 0.005555555555555556 (* angle_m PI)))))
   (*
    angle_s
    (if (<= t_4 5e+223)
      (* t_3 (fma a (* -2.0 (* a t_1)) (* 2.0 (* t_1 (pow b 2.0)))))
      (if (<= t_4 INFINITY)
        (+
         (* -2.0 (* (pow a 2.0) t_5))
         (* b (+ (* 2.0 (* b t_5)) (* 2.0 (* t_5 (- a a))))))
        (* (* (+ a b) (- b a)) (* 2.0 (sin (pow (sqrt t_0) 2.0)))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double t_1 = sin(t_0);
	double t_2 = (angle_m / 180.0) * ((double) M_PI);
	double t_3 = cos(t_2);
	double t_4 = t_3 * ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_2));
	double t_5 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	double tmp;
	if (t_4 <= 5e+223) {
		tmp = t_3 * fma(a, (-2.0 * (a * t_1)), (2.0 * (t_1 * pow(b, 2.0))));
	} else if (t_4 <= ((double) INFINITY)) {
		tmp = (-2.0 * (pow(a, 2.0) * t_5)) + (b * ((2.0 * (b * t_5)) + (2.0 * (t_5 * (a - a)))));
	} else {
		tmp = ((a + b) * (b - a)) * (2.0 * sin(pow(sqrt(t_0), 2.0)));
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	t_1 = sin(t_0)
	t_2 = Float64(Float64(angle_m / 180.0) * pi)
	t_3 = cos(t_2)
	t_4 = Float64(t_3 * Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_2)))
	t_5 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))
	tmp = 0.0
	if (t_4 <= 5e+223)
		tmp = Float64(t_3 * fma(a, Float64(-2.0 * Float64(a * t_1)), Float64(2.0 * Float64(t_1 * (b ^ 2.0)))));
	elseif (t_4 <= Inf)
		tmp = Float64(Float64(-2.0 * Float64((a ^ 2.0) * t_5)) + Float64(b * Float64(Float64(2.0 * Float64(b * t_5)) + Float64(2.0 * Float64(t_5 * Float64(a - a))))));
	else
		tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * sin((sqrt(t_0) ^ 2.0))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$4, 5e+223], N[(t$95$3 * N[(a * N[(-2.0 * N[(a * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$1 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(N[(-2.0 * N[(N[Power[a, 2.0], $MachinePrecision] * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(b * N[(N[(2.0 * N[(b * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$5 * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[Power[N[Sqrt[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := \sin t\_0\\
t_2 := \frac{angle\_m}{180} \cdot \pi\\
t_3 := \cos t\_2\\
t_4 := t\_3 \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_2\right)\\
t_5 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_4 \leq 5 \cdot 10^{+223}:\\
\;\;\;\;t\_3 \cdot \mathsf{fma}\left(a, -2 \cdot \left(a \cdot t\_1\right), 2 \cdot \left(t\_1 \cdot {b}^{2}\right)\right)\\

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;-2 \cdot \left({a}^{2} \cdot t\_5\right) + b \cdot \left(2 \cdot \left(b \cdot t\_5\right) + 2 \cdot \left(t\_5 \cdot \left(a - a\right)\right)\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 4.99999999999999985e223

    1. Initial program 64.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. unpow264.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. unpow264.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-squares64.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-rr64.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 a around 0 68.0%

      \[\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) \]
    6. Step-by-step derivation
      1. +-commutative68.0%

        \[\leadsto \color{blue}{\left(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) + 2 \cdot \left({b}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. associate-*r*68.0%

        \[\leadsto \left(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) + \color{blue}{\left(2 \cdot {b}^{2}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. associate-*r*68.2%

        \[\leadsto \left(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) + \left(2 \cdot {b}^{2}\right) \cdot \sin \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      4. *-commutative68.2%

        \[\leadsto \left(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) + \left(2 \cdot {b}^{2}\right) \cdot \sin \left(\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      5. *-commutative68.2%

        \[\leadsto \left(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) + \left(2 \cdot {b}^{2}\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      6. associate-*r*68.2%

        \[\leadsto \left(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) + \color{blue}{2 \cdot \left({b}^{2} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      7. fma-define68.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, -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), 2 \cdot \left({b}^{2} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    7. Simplified67.9%

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

    if 4.99999999999999985e223 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < +inf.0

    1. Initial program 47.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) + b \cdot \left(2 \cdot \left(b \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(a + -1 \cdot a\right)\right)\right)} \]

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 64.8% accurate, 0.3× 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 := \frac{angle\_m}{180} \cdot \pi\\ t_2 := \cos t\_1 \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_1\right)\\ t_3 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\ t_4 := \sin t\_3\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq 2 \cdot 10^{-186}:\\ \;\;\;\;\mathsf{fma}\left(a, -2 \cdot \left(a \cdot t\_4\right), 2 \cdot \left(t\_4 \cdot {b}^{2}\right)\right)\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;-2 \cdot \left({a}^{2} \cdot t\_0\right) + b \cdot \left(2 \cdot \left(b \cdot t\_0\right) + 2 \cdot \left(t\_0 \cdot \left(a - a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_3}\right)}^{2}\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 (* (/ angle_m 180.0) PI))
        (t_2 (* (cos t_1) (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_1))))
        (t_3 (* PI (* angle_m 0.005555555555555556)))
        (t_4 (sin t_3)))
   (*
    angle_s
    (if (<= t_2 2e-186)
      (fma a (* -2.0 (* a t_4)) (* 2.0 (* t_4 (pow b 2.0))))
      (if (<= t_2 INFINITY)
        (+
         (* -2.0 (* (pow a 2.0) t_0))
         (* b (+ (* 2.0 (* b t_0)) (* 2.0 (* t_0 (- a a))))))
        (* (* (+ a b) (- b a)) (* 2.0 (sin (pow (sqrt t_3) 2.0)))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	double t_1 = (angle_m / 180.0) * ((double) M_PI);
	double t_2 = cos(t_1) * ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_1));
	double t_3 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double t_4 = sin(t_3);
	double tmp;
	if (t_2 <= 2e-186) {
		tmp = fma(a, (-2.0 * (a * t_4)), (2.0 * (t_4 * pow(b, 2.0))));
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = (-2.0 * (pow(a, 2.0) * t_0)) + (b * ((2.0 * (b * t_0)) + (2.0 * (t_0 * (a - a)))));
	} else {
		tmp = ((a + b) * (b - a)) * (2.0 * sin(pow(sqrt(t_3), 2.0)));
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))
	t_1 = Float64(Float64(angle_m / 180.0) * pi)
	t_2 = Float64(cos(t_1) * Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_1)))
	t_3 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	t_4 = sin(t_3)
	tmp = 0.0
	if (t_2 <= 2e-186)
		tmp = fma(a, Float64(-2.0 * Float64(a * t_4)), Float64(2.0 * Float64(t_4 * (b ^ 2.0))));
	elseif (t_2 <= Inf)
		tmp = Float64(Float64(-2.0 * Float64((a ^ 2.0) * t_0)) + Float64(b * Float64(Float64(2.0 * Float64(b * t_0)) + Float64(2.0 * Float64(t_0 * Float64(a - a))))));
	else
		tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * sin((sqrt(t_3) ^ 2.0))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sin[t$95$3], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, 2e-186], N[(a * N[(-2.0 * N[(a * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$4 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(-2.0 * N[(N[Power[a, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(b * N[(N[(2.0 * N[(b * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$0 * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[Power[N[Sqrt[t$95$3], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
t_1 := \frac{angle\_m}{180} \cdot \pi\\
t_2 := \cos t\_1 \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_1\right)\\
t_3 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_4 := \sin t\_3\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq 2 \cdot 10^{-186}:\\
\;\;\;\;\mathsf{fma}\left(a, -2 \cdot \left(a \cdot t\_4\right), 2 \cdot \left(t\_4 \cdot {b}^{2}\right)\right)\\

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;-2 \cdot \left({a}^{2} \cdot t\_0\right) + b \cdot \left(2 \cdot \left(b \cdot t\_0\right) + 2 \cdot \left(t\_0 \cdot \left(a - a\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_3}\right)}^{2}\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 1.9999999999999998e-186

    1. Initial program 65.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. unpow265.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. unpow265.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-squares65.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-rr65.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. Taylor expanded in a around 0 70.2%

      \[\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) \]
    6. Step-by-step derivation
      1. +-commutative70.2%

        \[\leadsto \color{blue}{\left(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) + 2 \cdot \left({b}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. associate-*r*70.2%

        \[\leadsto \left(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) + \color{blue}{\left(2 \cdot {b}^{2}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. associate-*r*70.3%

        \[\leadsto \left(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) + \left(2 \cdot {b}^{2}\right) \cdot \sin \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      4. *-commutative70.3%

        \[\leadsto \left(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) + \left(2 \cdot {b}^{2}\right) \cdot \sin \left(\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      5. *-commutative70.3%

        \[\leadsto \left(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) + \left(2 \cdot {b}^{2}\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      6. associate-*r*70.3%

        \[\leadsto \left(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) + \color{blue}{2 \cdot \left({b}^{2} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      7. fma-define70.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, -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), 2 \cdot \left({b}^{2} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    7. Simplified70.1%

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

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

    if 1.9999999999999998e-186 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < +inf.0

    1. Initial program 55.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) + b \cdot \left(2 \cdot \left(b \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(a + -1 \cdot a\right)\right)\right)} \]

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 66.1% accurate, 0.4× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\ t_1 := {b}^{2} - {a}^{2}\\ t_2 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\ t_3 := \sin t\_2\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+200}:\\ \;\;\;\;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)\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \mathsf{fma}\left(b, t\_3 \cdot \left(2 \cdot b\right), t\_3 \cdot \left(-2 \cdot {a}^{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_2}\right)}^{2}\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 (- (pow b 2.0) (pow a 2.0)))
        (t_2 (* PI (* angle_m 0.005555555555555556)))
        (t_3 (sin t_2)))
   (*
    angle_s
    (if (<= t_1 -2e+200)
      (+
       (* 2.0 (* (pow b 2.0) t_0))
       (* a (+ (* -2.0 (* a t_0)) (* 2.0 (* t_0 (- b b))))))
      (if (<= t_1 INFINITY)
        (*
         (cos (* (/ angle_m 180.0) PI))
         (fma b (* t_3 (* 2.0 b)) (* t_3 (* -2.0 (pow a 2.0)))))
        (* (* (+ a b) (- b a)) (* 2.0 (sin (pow (sqrt t_2) 2.0)))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	double t_1 = pow(b, 2.0) - pow(a, 2.0);
	double t_2 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double t_3 = sin(t_2);
	double tmp;
	if (t_1 <= -2e+200) {
		tmp = (2.0 * (pow(b, 2.0) * t_0)) + (a * ((-2.0 * (a * t_0)) + (2.0 * (t_0 * (b - b)))));
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = cos(((angle_m / 180.0) * ((double) M_PI))) * fma(b, (t_3 * (2.0 * b)), (t_3 * (-2.0 * pow(a, 2.0))));
	} else {
		tmp = ((a + b) * (b - a)) * (2.0 * sin(pow(sqrt(t_2), 2.0)));
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))
	t_1 = Float64((b ^ 2.0) - (a ^ 2.0))
	t_2 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	t_3 = sin(t_2)
	tmp = 0.0
	if (t_1 <= -2e+200)
		tmp = 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 (t_1 <= Inf)
		tmp = Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * fma(b, Float64(t_3 * Float64(2.0 * b)), Float64(t_3 * Float64(-2.0 * (a ^ 2.0)))));
	else
		tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * sin((sqrt(t_2) ^ 2.0))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$2], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, -2e+200], 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], If[LessEqual[t$95$1, Infinity], N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(b * N[(t$95$3 * N[(2.0 * b), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(-2.0 * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[Power[N[Sqrt[t$95$2], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
t_1 := {b}^{2} - {a}^{2}\\
t_2 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_3 := \sin t\_2\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+200}:\\
\;\;\;\;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)\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \mathsf{fma}\left(b, t\_3 \cdot \left(2 \cdot b\right), t\_3 \cdot \left(-2 \cdot {a}^{2}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_2}\right)}^{2}\right)\right)\\


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

    1. Initial program 50.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{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)} \]

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

    1. Initial program 64.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. unpow264.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. unpow264.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-squares64.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-rr64.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. Taylor expanded in b around 0 68.0%

      \[\leadsto \color{blue}{\left(-2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) + b \cdot \left(2 \cdot \left(b \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(a + -1 \cdot a\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    6. Step-by-step derivation
      1. +-commutative68.0%

        \[\leadsto \color{blue}{\left(b \cdot \left(2 \cdot \left(b \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(a + -1 \cdot a\right)\right)\right) + -2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. fma-define68.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, 2 \cdot \left(b \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(a + -1 \cdot a\right)\right), -2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    7. Simplified68.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, \left(2 \cdot b\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right), \left(-2 \cdot {a}^{2}\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\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 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 64.0% accurate, 0.4× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\ t_1 := {b}^{2} - {a}^{2}\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+279}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+277}:\\ \;\;\;\;t\_1 \cdot \sin \left(2 \cdot t\_0\right)\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) + b \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot b\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_0}\right)}^{2}\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 (* PI (* angle_m 0.005555555555555556)))
        (t_1 (- (pow b 2.0) (pow a 2.0))))
   (*
    angle_s
    (if (<= t_1 -5e+279)
      (+
       (* 0.011111111111111112 (* angle_m (* PI (pow b 2.0))))
       (*
        a
        (+
         (* -0.011111111111111112 (* a (* angle_m PI)))
         (* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
      (if (<= t_1 1e+277)
        (* t_1 (sin (* 2.0 t_0)))
        (if (<= t_1 INFINITY)
          (+
           (* -0.011111111111111112 (* (pow a 2.0) (* angle_m PI)))
           (*
            b
            (+
             (* 0.011111111111111112 (* angle_m (* PI b)))
             (* 0.011111111111111112 (* angle_m (* PI (- a a)))))))
          (* (* (+ a b) (- b a)) (* 2.0 (sin (pow (sqrt t_0) 2.0))))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double t_1 = pow(b, 2.0) - pow(a, 2.0);
	double tmp;
	if (t_1 <= -5e+279) {
		tmp = (0.011111111111111112 * (angle_m * (((double) M_PI) * pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
	} else if (t_1 <= 1e+277) {
		tmp = t_1 * sin((2.0 * t_0));
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = (-0.011111111111111112 * (pow(a, 2.0) * (angle_m * ((double) M_PI)))) + (b * ((0.011111111111111112 * (angle_m * (((double) M_PI) * b))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (a - a))))));
	} else {
		tmp = ((a + b) * (b - a)) * (2.0 * sin(pow(sqrt(t_0), 2.0)));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = Math.PI * (angle_m * 0.005555555555555556);
	double t_1 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
	double tmp;
	if (t_1 <= -5e+279) {
		tmp = (0.011111111111111112 * (angle_m * (Math.PI * Math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
	} else if (t_1 <= 1e+277) {
		tmp = t_1 * Math.sin((2.0 * t_0));
	} else if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = (-0.011111111111111112 * (Math.pow(a, 2.0) * (angle_m * Math.PI))) + (b * ((0.011111111111111112 * (angle_m * (Math.PI * b))) + (0.011111111111111112 * (angle_m * (Math.PI * (a - a))))));
	} else {
		tmp = ((a + b) * (b - a)) * (2.0 * Math.sin(Math.pow(Math.sqrt(t_0), 2.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 = math.pow(b, 2.0) - math.pow(a, 2.0)
	tmp = 0
	if t_1 <= -5e+279:
		tmp = (0.011111111111111112 * (angle_m * (math.pi * math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (b - b))))))
	elif t_1 <= 1e+277:
		tmp = t_1 * math.sin((2.0 * t_0))
	elif t_1 <= math.inf:
		tmp = (-0.011111111111111112 * (math.pow(a, 2.0) * (angle_m * math.pi))) + (b * ((0.011111111111111112 * (angle_m * (math.pi * b))) + (0.011111111111111112 * (angle_m * (math.pi * (a - a))))))
	else:
		tmp = ((a + b) * (b - a)) * (2.0 * math.sin(math.pow(math.sqrt(t_0), 2.0)))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	t_1 = Float64((b ^ 2.0) - (a ^ 2.0))
	tmp = 0.0
	if (t_1 <= -5e+279)
		tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * (b ^ 2.0)))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b)))))));
	elseif (t_1 <= 1e+277)
		tmp = Float64(t_1 * sin(Float64(2.0 * t_0)));
	elseif (t_1 <= Inf)
		tmp = Float64(Float64(-0.011111111111111112 * Float64((a ^ 2.0) * Float64(angle_m * pi))) + Float64(b * Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * b))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a - a)))))));
	else
		tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * sin((sqrt(t_0) ^ 2.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 ^ 2.0) - (a ^ 2.0);
	tmp = 0.0;
	if (t_1 <= -5e+279)
		tmp = (0.011111111111111112 * (angle_m * (pi * (b ^ 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * pi))) + (0.011111111111111112 * (angle_m * (pi * (b - b))))));
	elseif (t_1 <= 1e+277)
		tmp = t_1 * sin((2.0 * t_0));
	elseif (t_1 <= Inf)
		tmp = (-0.011111111111111112 * ((a ^ 2.0) * (angle_m * pi))) + (b * ((0.011111111111111112 * (angle_m * (pi * b))) + (0.011111111111111112 * (angle_m * (pi * (a - a))))));
	else
		tmp = ((a + b) * (b - a)) * (2.0 * sin((sqrt(t_0) ^ 2.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[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, -5e+279], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+277], N[(t$95$1 * N[Sin[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(-0.011111111111111112 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[Power[N[Sqrt[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{elif}\;t\_1 \leq 10^{+277}:\\
\;\;\;\;t\_1 \cdot \sin \left(2 \cdot t\_0\right)\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) + b \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot b\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\

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


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

    1. Initial program 45.3%

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000002e279 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1e277

    1. Initial program 66.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 60.4%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 63.5% 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)\\ t_1 := \sin t\_0\\ t_2 := {b}^{2} - {a}^{2}\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+281}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(-2, t\_1 \cdot {a}^{2}, b \cdot \left(t\_1 \cdot \left(2 \cdot b\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_0}\right)}^{2}\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 (* PI (* angle_m 0.005555555555555556)))
        (t_1 (sin t_0))
        (t_2 (- (pow b 2.0) (pow a 2.0))))
   (*
    angle_s
    (if (<= t_2 -5e+281)
      (+
       (* 0.011111111111111112 (* angle_m (* PI (pow b 2.0))))
       (*
        a
        (+
         (* -0.011111111111111112 (* a (* angle_m PI)))
         (* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
      (if (<= t_2 INFINITY)
        (fma -2.0 (* t_1 (pow a 2.0)) (* b (* t_1 (* 2.0 b))))
        (* (* (+ a b) (- b a)) (* 2.0 (sin (pow (sqrt t_0) 2.0)))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double t_1 = sin(t_0);
	double t_2 = pow(b, 2.0) - pow(a, 2.0);
	double tmp;
	if (t_2 <= -5e+281) {
		tmp = (0.011111111111111112 * (angle_m * (((double) M_PI) * pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = fma(-2.0, (t_1 * pow(a, 2.0)), (b * (t_1 * (2.0 * b))));
	} else {
		tmp = ((a + b) * (b - a)) * (2.0 * sin(pow(sqrt(t_0), 2.0)));
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	t_1 = sin(t_0)
	t_2 = Float64((b ^ 2.0) - (a ^ 2.0))
	tmp = 0.0
	if (t_2 <= -5e+281)
		tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * (b ^ 2.0)))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b)))))));
	elseif (t_2 <= Inf)
		tmp = fma(-2.0, Float64(t_1 * (a ^ 2.0)), Float64(b * Float64(t_1 * Float64(2.0 * b))));
	else
		tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * sin((sqrt(t_0) ^ 2.0))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, -5e+281], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(-2.0 * N[(t$95$1 * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] + N[(b * N[(t$95$1 * N[(2.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[Power[N[Sqrt[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-2, t\_1 \cdot {a}^{2}, b \cdot \left(t\_1 \cdot \left(2 \cdot b\right)\right)\right)\\

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


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

    1. Initial program 46.2%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 64.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) + b \cdot \left(2 \cdot \left(b \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(a + -1 \cdot a\right)\right)\right)} \]
    9. Step-by-step derivation
      1. fma-define67.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-2, {a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), b \cdot \left(2 \cdot \left(b \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(a + -1 \cdot a\right)\right)\right)\right)} \]
      2. *-commutative67.3%

        \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)}, b \cdot \left(2 \cdot \left(b \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(a + -1 \cdot a\right)\right)\right)\right) \]
      3. *-commutative67.3%

        \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \sin \left(\color{blue}{\left(\pi \cdot angle\right)} \cdot 0.005555555555555556\right), b \cdot \left(2 \cdot \left(b \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(a + -1 \cdot a\right)\right)\right)\right) \]
      4. associate-*r*67.3%

        \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}, b \cdot \left(2 \cdot \left(b \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(a + -1 \cdot a\right)\right)\right)\right) \]
      5. *-commutative67.3%

        \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \sin \left(\pi \cdot \color{blue}{\left(0.005555555555555556 \cdot angle\right)}\right), b \cdot \left(2 \cdot \left(b \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(a + -1 \cdot a\right)\right)\right)\right) \]
    10. Simplified66.8%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 62.9% accurate, 0.6× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := {b}^{2} - {a}^{2}\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -1 \cdot 10^{+305}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+260} \lor \neg \left(t\_0 \leq \infty\right):\\ \;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) + b \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot b\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (- (pow b 2.0) (pow a 2.0))))
   (*
    angle_s
    (if (<= t_0 -1e+305)
      (+
       (* 0.011111111111111112 (* angle_m (* PI (pow b 2.0))))
       (*
        a
        (+
         (* -0.011111111111111112 (* a (* angle_m PI)))
         (* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
      (if (or (<= t_0 2e+260) (not (<= t_0 INFINITY)))
        (* (* (+ a b) (- b a)) (* 2.0 (sin (* (/ angle_m 180.0) PI))))
        (+
         (* -0.011111111111111112 (* (pow a 2.0) (* angle_m PI)))
         (*
          b
          (+
           (* 0.011111111111111112 (* angle_m (* PI b)))
           (* 0.011111111111111112 (* angle_m (* PI (- a a))))))))))))
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 = pow(b, 2.0) - pow(a, 2.0);
	double tmp;
	if (t_0 <= -1e+305) {
		tmp = (0.011111111111111112 * (angle_m * (((double) M_PI) * pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
	} else if ((t_0 <= 2e+260) || !(t_0 <= ((double) INFINITY))) {
		tmp = ((a + b) * (b - a)) * (2.0 * sin(((angle_m / 180.0) * ((double) M_PI))));
	} else {
		tmp = (-0.011111111111111112 * (pow(a, 2.0) * (angle_m * ((double) M_PI)))) + (b * ((0.011111111111111112 * (angle_m * (((double) M_PI) * b))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (a - 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 t_0 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
	double tmp;
	if (t_0 <= -1e+305) {
		tmp = (0.011111111111111112 * (angle_m * (Math.PI * Math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
	} else if ((t_0 <= 2e+260) || !(t_0 <= Double.POSITIVE_INFINITY)) {
		tmp = ((a + b) * (b - a)) * (2.0 * Math.sin(((angle_m / 180.0) * Math.PI)));
	} else {
		tmp = (-0.011111111111111112 * (Math.pow(a, 2.0) * (angle_m * Math.PI))) + (b * ((0.011111111111111112 * (angle_m * (Math.PI * b))) + (0.011111111111111112 * (angle_m * (Math.PI * (a - 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):
	t_0 = math.pow(b, 2.0) - math.pow(a, 2.0)
	tmp = 0
	if t_0 <= -1e+305:
		tmp = (0.011111111111111112 * (angle_m * (math.pi * math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (b - b))))))
	elif (t_0 <= 2e+260) or not (t_0 <= math.inf):
		tmp = ((a + b) * (b - a)) * (2.0 * math.sin(((angle_m / 180.0) * math.pi)))
	else:
		tmp = (-0.011111111111111112 * (math.pow(a, 2.0) * (angle_m * math.pi))) + (b * ((0.011111111111111112 * (angle_m * (math.pi * b))) + (0.011111111111111112 * (angle_m * (math.pi * (a - a))))))
	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((b ^ 2.0) - (a ^ 2.0))
	tmp = 0.0
	if (t_0 <= -1e+305)
		tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * (b ^ 2.0)))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b)))))));
	elseif ((t_0 <= 2e+260) || !(t_0 <= Inf))
		tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * sin(Float64(Float64(angle_m / 180.0) * pi))));
	else
		tmp = Float64(Float64(-0.011111111111111112 * Float64((a ^ 2.0) * Float64(angle_m * pi))) + Float64(b * Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * b))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a - 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)
	t_0 = (b ^ 2.0) - (a ^ 2.0);
	tmp = 0.0;
	if (t_0 <= -1e+305)
		tmp = (0.011111111111111112 * (angle_m * (pi * (b ^ 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * pi))) + (0.011111111111111112 * (angle_m * (pi * (b - b))))));
	elseif ((t_0 <= 2e+260) || ~((t_0 <= Inf)))
		tmp = ((a + b) * (b - a)) * (2.0 * sin(((angle_m / 180.0) * pi)));
	else
		tmp = (-0.011111111111111112 * ((a ^ 2.0) * (angle_m * pi))) + (b * ((0.011111111111111112 * (angle_m * (pi * b))) + (0.011111111111111112 * (angle_m * (pi * (a - 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_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, -1e+305], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$0, 2e+260], N[Not[LessEqual[t$95$0, Infinity]], $MachinePrecision]], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.011111111111111112 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+260} \lor \neg \left(t\_0 \leq \infty\right):\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)\\

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


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

    1. Initial program 41.2%

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999994e304 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000013e260 or +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 60.4%

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

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

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

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

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

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

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

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

    1. Initial program 60.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 64.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 10^{+277}:\\
\;\;\;\;2 \cdot \left(\left(t\_0 \cdot \sin t\_2\right) \cdot \cos t\_2\right)\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) + b \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot b\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\

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


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

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

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

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

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

      \[\leadsto \color{blue}{\left({b}^{2} - {a}^{2}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)} \]
    4. Add Preprocessing
    5. 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-squares46.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) \]
    6. Applied egg-rr46.4%

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

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

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

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

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

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

    if -1.99999999999999992e275 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1e277

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 60.4%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

Alternative 10: 60.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_0 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -2 \cdot 10^{-51}:\\
\;\;\;\;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)\\

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


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

    1. Initial program 52.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{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)} \]

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

    1. Initial program 59.7%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 60.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(b - a\right)\\
t_1 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_2 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
t_3 := \sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-46}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_1}\right)}^{2}\right)\right)\\


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

    1. Initial program 63.7%

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000002e-46 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e121

    1. Initial program 59.6%

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

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

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

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

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

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

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

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

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

    if 1.00000000000000004e121 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999899e164

    1. Initial program 17.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. unpow217.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. unpow217.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-squares17.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-rr17.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-sqr-sqrt14.7%

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

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

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

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

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

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

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

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

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

    if 9.99999999999999899e164 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000003e230

    1. Initial program 45.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000003e230 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 27.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 60.1% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+121}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\\

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+230}:\\
\;\;\;\;t\_2 \cdot \left(t\_3 \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_1}\right)}^{2}\right)\right)\\


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

    1. Initial program 63.7%

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000002e-46 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e121

    1. Initial program 59.6%

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

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

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

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

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

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

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

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

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

    if 1.00000000000000004e121 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000017e169

    1. Initial program 16.7%

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

        \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    4. Applied egg-rr16.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. Step-by-step derivation
      1. add-sqr-sqrt13.8%

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000017e169 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000003e230

    1. Initial program 50.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. unpow250.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. unpow250.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-squares50.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-rr50.0%

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

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

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

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

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

    if 5.0000000000000003e230 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 27.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 60.1% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+121}:\\
\;\;\;\;t\_0 \cdot \left(\sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right) \cdot t\_3\right)\\

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

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

\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_1}\right)}^{2}\right)\right)\\


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

    1. Initial program 63.7%

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000002e-46 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e121

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

        \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    4. Applied egg-rr62.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. Step-by-step derivation
      1. add-cbrt-cube62.4%

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

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

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

    if 1.00000000000000004e121 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000017e169

    1. Initial program 16.7%

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

        \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    4. Applied egg-rr16.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. Step-by-step derivation
      1. add-sqr-sqrt13.8%

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000017e169 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000003e230

    1. Initial program 50.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. unpow250.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. unpow250.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-squares50.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-rr50.0%

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

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

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

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

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

    if 5.0000000000000003e230 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 27.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\\
\begin{array}{l}
t_0 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
t_1 := \left(a + b\right) \cdot \left(b - a\right)\\
t_2 := 2 \cdot t\_1\\
t_3 := \sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\\
t_4 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-46}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+121}:\\
\;\;\;\;t\_0 \cdot \left(t\_3 \cdot t\_2\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+165}:\\
\;\;\;\;t\_0 \cdot \left(t\_2 \cdot \left|\sin t\_4\right|\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+242}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot t\_3\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_4}\right)}^{2}\right)\right)\\


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

    1. Initial program 63.7%

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000002e-46 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e121

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

        \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    4. Applied egg-rr62.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. Step-by-step derivation
      1. add-cbrt-cube62.4%

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

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

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

    if 1.00000000000000004e121 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999899e164

    1. Initial program 17.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. unpow217.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. unpow217.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-squares17.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-rr17.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-sqr-sqrt14.7%

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

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

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

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

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

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

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

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

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

    if 9.99999999999999899e164 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000005e242

    1. Initial program 36.0%

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000005e242 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 31.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 60.1% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+121}:\\
\;\;\;\;t\_2 \cdot \cos \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;\cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot t\_2\\


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

    1. Initial program 62.5%

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999997e-74 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e121

    1. Initial program 66.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. unpow266.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. unpow266.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-squares68.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-rr68.6%

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Taylor expanded in angle around inf 62.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}{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative62.9%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)} \]
      2. associate-*r*65.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(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)} \]
    7. Simplified65.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}{\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)} \]

    if 1.00000000000000004e121 < (/.f64 angle #s(literal 180 binary64)) < 1e164

    1. Initial program 17.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. unpow217.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. unpow217.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-squares17.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-rr17.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 54.6%

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

    if 1e164 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 33.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. unpow233.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. unpow233.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-squares37.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-rr37.0%

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

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

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

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

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

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

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

Alternative 16: 55.5% accurate, 1.9× speedup?

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

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot t\_0\right)\\


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

    1. Initial program 62.6%

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

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

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

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

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

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

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

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

    if 9.9999999999999998e-13 < (pow.f64 b #s(literal 2 binary64))

    1. Initial program 51.8%

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

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

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

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

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

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

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

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

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

Alternative 17: 58.3% accurate, 2.9× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \left(a + b\right) \cdot \left(b - a\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-73}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right) + a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+69}:\\ \;\;\;\;\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot t\_0\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+99} \lor \neg \left(\frac{angle\_m}{180} \leq 3 \cdot 10^{+280}\right):\\ \;\;\;\;-1 + \left(1 + t\_0 \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t\_0 \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (+ a b) (- b a))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1e-73)
      (*
       0.011111111111111112
       (+
        (* angle_m (* PI (pow b 2.0)))
        (* a (- (* angle_m (* PI (- b b))) (* a (* angle_m PI))))))
      (if (<= (/ angle_m 180.0) 4e+69)
        (*
         (cos (* (/ angle_m 180.0) PI))
         (* 0.011111111111111112 (* angle_m (* PI t_0))))
        (if (or (<= (/ angle_m 180.0) 2e+99)
                (not (<= (/ angle_m 180.0) 3e+280)))
          (+
           -1.0
           (+ 1.0 (* t_0 (sin (* (* angle_m PI) 0.011111111111111112)))))
          (* 2.0 (* t_0 (sin (* 0.005555555555555556 (* angle_m PI)))))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (a + b) * (b - a);
	double tmp;
	if ((angle_m / 180.0) <= 1e-73) {
		tmp = 0.011111111111111112 * ((angle_m * (((double) M_PI) * pow(b, 2.0))) + (a * ((angle_m * (((double) M_PI) * (b - b))) - (a * (angle_m * ((double) M_PI))))));
	} else if ((angle_m / 180.0) <= 4e+69) {
		tmp = cos(((angle_m / 180.0) * ((double) M_PI))) * (0.011111111111111112 * (angle_m * (((double) M_PI) * t_0)));
	} else if (((angle_m / 180.0) <= 2e+99) || !((angle_m / 180.0) <= 3e+280)) {
		tmp = -1.0 + (1.0 + (t_0 * sin(((angle_m * ((double) M_PI)) * 0.011111111111111112))));
	} else {
		tmp = 2.0 * (t_0 * sin((0.005555555555555556 * (angle_m * ((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 t_0 = (a + b) * (b - a);
	double tmp;
	if ((angle_m / 180.0) <= 1e-73) {
		tmp = 0.011111111111111112 * ((angle_m * (Math.PI * Math.pow(b, 2.0))) + (a * ((angle_m * (Math.PI * (b - b))) - (a * (angle_m * Math.PI)))));
	} else if ((angle_m / 180.0) <= 4e+69) {
		tmp = Math.cos(((angle_m / 180.0) * Math.PI)) * (0.011111111111111112 * (angle_m * (Math.PI * t_0)));
	} else if (((angle_m / 180.0) <= 2e+99) || !((angle_m / 180.0) <= 3e+280)) {
		tmp = -1.0 + (1.0 + (t_0 * Math.sin(((angle_m * Math.PI) * 0.011111111111111112))));
	} else {
		tmp = 2.0 * (t_0 * Math.sin((0.005555555555555556 * (angle_m * 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):
	t_0 = (a + b) * (b - a)
	tmp = 0
	if (angle_m / 180.0) <= 1e-73:
		tmp = 0.011111111111111112 * ((angle_m * (math.pi * math.pow(b, 2.0))) + (a * ((angle_m * (math.pi * (b - b))) - (a * (angle_m * math.pi)))))
	elif (angle_m / 180.0) <= 4e+69:
		tmp = math.cos(((angle_m / 180.0) * math.pi)) * (0.011111111111111112 * (angle_m * (math.pi * t_0)))
	elif ((angle_m / 180.0) <= 2e+99) or not ((angle_m / 180.0) <= 3e+280):
		tmp = -1.0 + (1.0 + (t_0 * math.sin(((angle_m * math.pi) * 0.011111111111111112))))
	else:
		tmp = 2.0 * (t_0 * math.sin((0.005555555555555556 * (angle_m * math.pi))))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(Float64(a + b) * Float64(b - a))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1e-73)
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64(pi * (b ^ 2.0))) + Float64(a * Float64(Float64(angle_m * Float64(pi * Float64(b - b))) - Float64(a * Float64(angle_m * pi))))));
	elseif (Float64(angle_m / 180.0) <= 4e+69)
		tmp = Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_0))));
	elseif ((Float64(angle_m / 180.0) <= 2e+99) || !(Float64(angle_m / 180.0) <= 3e+280))
		tmp = Float64(-1.0 + Float64(1.0 + Float64(t_0 * sin(Float64(Float64(angle_m * pi) * 0.011111111111111112)))));
	else
		tmp = Float64(2.0 * Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(angle_m * 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)
	t_0 = (a + b) * (b - a);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 1e-73)
		tmp = 0.011111111111111112 * ((angle_m * (pi * (b ^ 2.0))) + (a * ((angle_m * (pi * (b - b))) - (a * (angle_m * pi)))));
	elseif ((angle_m / 180.0) <= 4e+69)
		tmp = cos(((angle_m / 180.0) * pi)) * (0.011111111111111112 * (angle_m * (pi * t_0)));
	elseif (((angle_m / 180.0) <= 2e+99) || ~(((angle_m / 180.0) <= 3e+280)))
		tmp = -1.0 + (1.0 + (t_0 * sin(((angle_m * pi) * 0.011111111111111112))));
	else
		tmp = 2.0 * (t_0 * sin((0.005555555555555556 * (angle_m * 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_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-73], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 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]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+69], N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+99], N[Not[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 3e+280]], $MachinePrecision]], N[(-1.0 + N[(1.0 + N[(t$95$0 * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+69}:\\
\;\;\;\;\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot t\_0\right)\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+99} \lor \neg \left(\frac{angle\_m}{180} \leq 3 \cdot 10^{+280}\right):\\
\;\;\;\;-1 + \left(1 + t\_0 \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\\

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


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

    1. Initial program 62.5%

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

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

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

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

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

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

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

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

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

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

      \[\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 9.99999999999999997e-74 < (/.f64 angle #s(literal 180 binary64)) < 4.0000000000000003e69

    1. Initial program 63.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. unpow263.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. unpow263.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-squares66.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-rr66.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 68.3%

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

    if 4.0000000000000003e69 < (/.f64 angle #s(literal 180 binary64)) < 1.9999999999999999e99 or 3.0000000000000001e280 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 52.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(1 + \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) - 1} \]
    8. Step-by-step derivation
      1. unpow252.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. unpow252.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-squares52.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) \]
    9. Applied egg-rr51.9%

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

    if 1.9999999999999999e99 < (/.f64 angle #s(literal 180 binary64)) < 3.0000000000000001e280

    1. Initial program 30.5%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{-73}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot {b}^{2}\right) + a \cdot \left(angle \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(angle \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 4 \cdot 10^{+69}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+99} \lor \neg \left(\frac{angle}{180} \leq 3 \cdot 10^{+280}\right):\\ \;\;\;\;-1 + \left(1 + \left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 56.0% accurate, 3.2× speedup?

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

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

\mathbf{elif}\;b \leq 4 \cdot 10^{+201}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\cos t\_2 \cdot t\_0\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \sin t\_2\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 5.20000000000000019e-6

    1. Initial program 59.2%

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

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

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

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

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

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

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

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

    if 5.20000000000000019e-6 < b < 4.00000000000000015e201

    1. Initial program 54.5%

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

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

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

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

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

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

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

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

    if 4.00000000000000015e201 < b

    1. Initial program 45.7%

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

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

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

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

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

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

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

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

Alternative 19: 57.8% accurate, 3.2× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;-1 + \left(1 + t\_0 \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\\


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

    1. Initial program 62.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999945e65 < (/.f64 angle #s(literal 180 binary64)) < 3.0000000000000001e280

    1. Initial program 34.6%

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

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

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

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

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

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

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

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

    if 3.0000000000000001e280 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 41.6%

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

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

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

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

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

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

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

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

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

Alternative 20: 55.9% accurate, 3.2× speedup?

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

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

\mathbf{elif}\;b \leq 2.5 \cdot 10^{+202}:\\
\;\;\;\;\cos t\_0 \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot t\_1\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \sin t\_0\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 2.7500000000000001e-5

    1. Initial program 59.2%

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

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

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

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

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

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

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

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

    if 2.7500000000000001e-5 < b < 2.5e202

    1. Initial program 54.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. unpow254.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. unpow254.5%

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

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

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

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

    if 2.5e202 < b

    1. Initial program 45.7%

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

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

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

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

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

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

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

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

Alternative 21: 53.8% accurate, 27.9× speedup?

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

\\
angle\_s \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 57.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 22: 53.7% accurate, 32.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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