ab-angle->ABCF B

Percentage Accurate: 54.2% → 65.0%
Time: 33.4s
Alternatives: 7
Speedup: 27.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 7 alternatives:

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

Initial Program: 54.2% 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.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 3 \cdot 10^{+123}:\\
\;\;\;\;2 \cdot \left(t\_2 \cdot t\_4\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+173}:\\
\;\;\;\;2 \cdot \left(t\_4 \cdot \sin \left({\left(\sqrt{\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)}\right)}^{2}\right)\right)\\

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+271}:\\
\;\;\;\;2 \cdot \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\cos t\_1\right)\right) \cdot \left(t\_4 \cdot \sin \left({\left(\sqrt[3]{angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-33 < (/.f64 angle 180) < 3.00000000000000008e123

    1. Initial program 45.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. Simplified47.0%

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

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

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

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

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

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

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

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

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

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

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

    if 3.00000000000000008e123 < (/.f64 angle 180) < 2e173

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e173 < (/.f64 angle 180) < 9.99999999999999907e214

    1. Initial program 31.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. pow131.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999907e214 < (/.f64 angle 180) < 5.0000000000000003e271

    1. Initial program 21.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. Simplified30.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\cos \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)\right)\right) \cdot \left(\sin \left(angle \cdot \sqrt{\left(\pi \cdot \pi\right) \cdot \color{blue}{3.08641975308642 \cdot 10^{-5}}}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      9. metadata-eval35.8%

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

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

        \[\leadsto 2 \cdot \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\cos \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)\right)\right) \cdot \left(\sin \left(angle \cdot \color{blue}{\left(\sqrt{\pi \cdot 0.005555555555555556} \cdot \sqrt{\pi \cdot 0.005555555555555556}\right)}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      12. add-sqr-sqrt35.8%

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

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

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

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

    if 5.0000000000000003e271 < (/.f64 angle 180)

    1. Initial program 17.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. Simplified17.4%

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

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

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

Alternative 2: 64.9% accurate, 0.9× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ 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 := \cos t\_0\\ t_2 := \sin t\_0\\ t_3 := \pi \cdot \left(angle\_m \cdot \left(b\_m - a\right)\right)\\ t_4 := \left(a - b\_m\right) \cdot \left(b\_m + a\right)\\ t_5 := 2 \cdot \left(t\_2 \cdot t\_4\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{-33}:\\ \;\;\;\;2 \cdot \left(\left(b\_m \cdot t\_3 + a \cdot t\_3\right) \cdot 0.005555555555555556\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 3 \cdot 10^{+123}:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+173}:\\ \;\;\;\;2 \cdot \left(t\_4 \cdot \sin \left({\left(\sqrt{\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)}\right)}^{2}\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+248}:\\ \;\;\;\;2 \cdot \left(t\_2 \cdot \left(\left({b\_m}^{2} - {a}^{2}\right) \cdot t\_1\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+259}:\\ \;\;\;\;2 \cdot \left(\sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \left({b\_m}^{2} \cdot t\_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_5\\ \end{array} \end{array} \end{array} \]
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b_m angle_m)
 :precision binary64
 (let* ((t_0 (* PI (* angle_m -0.005555555555555556)))
        (t_1 (cos t_0))
        (t_2 (sin t_0))
        (t_3 (* PI (* angle_m (- b_m a))))
        (t_4 (* (- a b_m) (+ b_m a)))
        (t_5 (* 2.0 (* t_2 t_4))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 2e-33)
      (* 2.0 (* (+ (* b_m t_3) (* a t_3)) 0.005555555555555556))
      (if (<= (/ angle_m 180.0) 3e+123)
        t_5
        (if (<= (/ angle_m 180.0) 2e+173)
          (*
           2.0
           (*
            t_4
            (sin (pow (sqrt (* PI (* angle_m 0.005555555555555556))) 2.0))))
          (if (<= (/ angle_m 180.0) 1e+248)
            (* 2.0 (* t_2 (* (- (pow b_m 2.0) (pow a 2.0)) t_1)))
            (if (<= (/ angle_m 180.0) 5e+259)
              (*
               2.0
               (*
                (sin (* angle_m (* PI 0.005555555555555556)))
                (* (pow b_m 2.0) t_1)))
              t_5))))))))
b_m = fabs(b);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m * -0.005555555555555556);
	double t_1 = cos(t_0);
	double t_2 = sin(t_0);
	double t_3 = ((double) M_PI) * (angle_m * (b_m - a));
	double t_4 = (a - b_m) * (b_m + a);
	double t_5 = 2.0 * (t_2 * t_4);
	double tmp;
	if ((angle_m / 180.0) <= 2e-33) {
		tmp = 2.0 * (((b_m * t_3) + (a * t_3)) * 0.005555555555555556);
	} else if ((angle_m / 180.0) <= 3e+123) {
		tmp = t_5;
	} else if ((angle_m / 180.0) <= 2e+173) {
		tmp = 2.0 * (t_4 * sin(pow(sqrt((((double) M_PI) * (angle_m * 0.005555555555555556))), 2.0)));
	} else if ((angle_m / 180.0) <= 1e+248) {
		tmp = 2.0 * (t_2 * ((pow(b_m, 2.0) - pow(a, 2.0)) * t_1));
	} else if ((angle_m / 180.0) <= 5e+259) {
		tmp = 2.0 * (sin((angle_m * (((double) M_PI) * 0.005555555555555556))) * (pow(b_m, 2.0) * t_1));
	} else {
		tmp = t_5;
	}
	return angle_s * tmp;
}
b_m = Math.abs(b);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
	double t_0 = Math.PI * (angle_m * -0.005555555555555556);
	double t_1 = Math.cos(t_0);
	double t_2 = Math.sin(t_0);
	double t_3 = Math.PI * (angle_m * (b_m - a));
	double t_4 = (a - b_m) * (b_m + a);
	double t_5 = 2.0 * (t_2 * t_4);
	double tmp;
	if ((angle_m / 180.0) <= 2e-33) {
		tmp = 2.0 * (((b_m * t_3) + (a * t_3)) * 0.005555555555555556);
	} else if ((angle_m / 180.0) <= 3e+123) {
		tmp = t_5;
	} else if ((angle_m / 180.0) <= 2e+173) {
		tmp = 2.0 * (t_4 * Math.sin(Math.pow(Math.sqrt((Math.PI * (angle_m * 0.005555555555555556))), 2.0)));
	} else if ((angle_m / 180.0) <= 1e+248) {
		tmp = 2.0 * (t_2 * ((Math.pow(b_m, 2.0) - Math.pow(a, 2.0)) * t_1));
	} else if ((angle_m / 180.0) <= 5e+259) {
		tmp = 2.0 * (Math.sin((angle_m * (Math.PI * 0.005555555555555556))) * (Math.pow(b_m, 2.0) * t_1));
	} else {
		tmp = t_5;
	}
	return angle_s * tmp;
}
b_m = math.fabs(b)
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b_m, angle_m):
	t_0 = math.pi * (angle_m * -0.005555555555555556)
	t_1 = math.cos(t_0)
	t_2 = math.sin(t_0)
	t_3 = math.pi * (angle_m * (b_m - a))
	t_4 = (a - b_m) * (b_m + a)
	t_5 = 2.0 * (t_2 * t_4)
	tmp = 0
	if (angle_m / 180.0) <= 2e-33:
		tmp = 2.0 * (((b_m * t_3) + (a * t_3)) * 0.005555555555555556)
	elif (angle_m / 180.0) <= 3e+123:
		tmp = t_5
	elif (angle_m / 180.0) <= 2e+173:
		tmp = 2.0 * (t_4 * math.sin(math.pow(math.sqrt((math.pi * (angle_m * 0.005555555555555556))), 2.0)))
	elif (angle_m / 180.0) <= 1e+248:
		tmp = 2.0 * (t_2 * ((math.pow(b_m, 2.0) - math.pow(a, 2.0)) * t_1))
	elif (angle_m / 180.0) <= 5e+259:
		tmp = 2.0 * (math.sin((angle_m * (math.pi * 0.005555555555555556))) * (math.pow(b_m, 2.0) * t_1))
	else:
		tmp = t_5
	return angle_s * tmp
b_m = abs(b)
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b_m, angle_m)
	t_0 = Float64(pi * Float64(angle_m * -0.005555555555555556))
	t_1 = cos(t_0)
	t_2 = sin(t_0)
	t_3 = Float64(pi * Float64(angle_m * Float64(b_m - a)))
	t_4 = Float64(Float64(a - b_m) * Float64(b_m + a))
	t_5 = Float64(2.0 * Float64(t_2 * t_4))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e-33)
		tmp = Float64(2.0 * Float64(Float64(Float64(b_m * t_3) + Float64(a * t_3)) * 0.005555555555555556));
	elseif (Float64(angle_m / 180.0) <= 3e+123)
		tmp = t_5;
	elseif (Float64(angle_m / 180.0) <= 2e+173)
		tmp = Float64(2.0 * Float64(t_4 * sin((sqrt(Float64(pi * Float64(angle_m * 0.005555555555555556))) ^ 2.0))));
	elseif (Float64(angle_m / 180.0) <= 1e+248)
		tmp = Float64(2.0 * Float64(t_2 * Float64(Float64((b_m ^ 2.0) - (a ^ 2.0)) * t_1)));
	elseif (Float64(angle_m / 180.0) <= 5e+259)
		tmp = Float64(2.0 * Float64(sin(Float64(angle_m * Float64(pi * 0.005555555555555556))) * Float64((b_m ^ 2.0) * t_1)));
	else
		tmp = t_5;
	end
	return Float64(angle_s * tmp)
end
b_m = abs(b);
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b_m, angle_m)
	t_0 = pi * (angle_m * -0.005555555555555556);
	t_1 = cos(t_0);
	t_2 = sin(t_0);
	t_3 = pi * (angle_m * (b_m - a));
	t_4 = (a - b_m) * (b_m + a);
	t_5 = 2.0 * (t_2 * t_4);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 2e-33)
		tmp = 2.0 * (((b_m * t_3) + (a * t_3)) * 0.005555555555555556);
	elseif ((angle_m / 180.0) <= 3e+123)
		tmp = t_5;
	elseif ((angle_m / 180.0) <= 2e+173)
		tmp = 2.0 * (t_4 * sin((sqrt((pi * (angle_m * 0.005555555555555556))) ^ 2.0)));
	elseif ((angle_m / 180.0) <= 1e+248)
		tmp = 2.0 * (t_2 * (((b_m ^ 2.0) - (a ^ 2.0)) * t_1));
	elseif ((angle_m / 180.0) <= 5e+259)
		tmp = 2.0 * (sin((angle_m * (pi * 0.005555555555555556))) * ((b_m ^ 2.0) * t_1));
	else
		tmp = t_5;
	end
	tmp_2 = angle_s * tmp;
end
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(Pi * N[(angle$95$m * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(a - b$95$m), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(2.0 * N[(t$95$2 * t$95$4), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-33], N[(2.0 * N[(N[(N[(b$95$m * t$95$3), $MachinePrecision] + N[(a * t$95$3), $MachinePrecision]), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 3e+123], t$95$5, If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+173], N[(2.0 * N[(t$95$4 * N[Sin[N[Power[N[Sqrt[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+248], N[(2.0 * N[(t$95$2 * N[(N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+259], N[(2.0 * N[(N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[b$95$m, 2.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$5]]]]]), $MachinePrecision]]]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
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 := \cos t\_0\\
t_2 := \sin t\_0\\
t_3 := \pi \cdot \left(angle\_m \cdot \left(b\_m - a\right)\right)\\
t_4 := \left(a - b\_m\right) \cdot \left(b\_m + a\right)\\
t_5 := 2 \cdot \left(t\_2 \cdot t\_4\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{-33}:\\
\;\;\;\;2 \cdot \left(\left(b\_m \cdot t\_3 + a \cdot t\_3\right) \cdot 0.005555555555555556\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 3 \cdot 10^{+123}:\\
\;\;\;\;t\_5\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+173}:\\
\;\;\;\;2 \cdot \left(t\_4 \cdot \sin \left({\left(\sqrt{\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)}\right)}^{2}\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+248}:\\
\;\;\;\;2 \cdot \left(t\_2 \cdot \left(\left({b\_m}^{2} - {a}^{2}\right) \cdot t\_1\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+259}:\\
\;\;\;\;2 \cdot \left(\sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \left({b\_m}^{2} \cdot t\_1\right)\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-33 < (/.f64 angle 180) < 3.00000000000000008e123 or 5.00000000000000033e259 < (/.f64 angle 180)

    1. Initial program 39.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. Simplified44.3%

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

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

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

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

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

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

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

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

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

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

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

    if 3.00000000000000008e123 < (/.f64 angle 180) < 2e173

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e173 < (/.f64 angle 180) < 1.00000000000000005e248

    1. Initial program 27.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\sin \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right) \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \cos \left(\color{blue}{\left(\pi \cdot angle\right)} \cdot -0.005555555555555556\right)\right)\right) \]
      11. associate-*l*47.3%

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

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

    if 1.00000000000000005e248 < (/.f64 angle 180) < 5.00000000000000033e259

    1. Initial program 24.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. Simplified17.6%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)} \cdot \left({b}^{2} \cdot \cos \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\right) \]
      6. associate-*l*51.2%

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

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

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

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

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

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

Alternative 3: 58.0% accurate, 1.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b\_m \cdot t\_0 + a \cdot t\_0\right) \cdot 0.005555555555555556\right)\\


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

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

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

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

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

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

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

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

    if 1.9999999999999999e105 < (pow.f64 b 2)

    1. Initial program 50.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. Simplified53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 58.1% accurate, 1.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b\_m \cdot t\_0 + a \cdot t\_0\right) \cdot 0.005555555555555556\right)\\


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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e105 < (pow.f64 b 2)

    1. Initial program 50.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. Simplified53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 57.4% accurate, 18.2× speedup?

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

\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot \left(b\_m - a\right)\right)\\
angle\_s \cdot \left(2 \cdot \left(\left(b\_m \cdot t\_0 + a \cdot t\_0\right) \cdot 0.005555555555555556\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 53.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. Simplified53.7%

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

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

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

      \[\leadsto 2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right)\right) \]
    3. difference-of-squares53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 54.2% accurate, 27.9× speedup?

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

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

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

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

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

      \[\leadsto 2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right)\right) \]
    3. difference-of-squares53.3%

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

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

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

Alternative 7: 54.2% accurate, 27.9× speedup?

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

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

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

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

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

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

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

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

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

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

Reproduce

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