ab-angle->ABCF B

Percentage Accurate: 53.8% → 67.1%
Time: 15.8s
Alternatives: 15
Speedup: 3.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 53.8% accurate, 1.0× speedup?

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

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

Alternative 1: 67.1% accurate, 1.0× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \left(b\_m + a\_m\right) \cdot \left(a\_m - b\_m\right)\\ t_1 := angle\_m \cdot \left(-0.005555555555555556 \cdot \pi\right)\\ t_2 := \cos \left(angle\_m \cdot \frac{\pi}{-180}\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+16}:\\ \;\;\;\;\left(\cos t\_1 \cdot 2\right) \cdot \left(\left(\sin t\_1 \cdot \left(b\_m + a\_m\right)\right) \cdot \left(a\_m - b\_m\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+111}:\\ \;\;\;\;\cos \left(angle\_m \cdot \left(e^{\mathsf{log1p}\left(-0.005555555555555556 \cdot \pi\right)} + -1\right)\right) \cdot \left(2 \cdot \left(\sin \left(\frac{angle\_m \cdot \pi}{180}\right) \cdot t\_0\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+230}:\\ \;\;\;\;t\_2 \cdot \left(2 \cdot \left(t\_0 \cdot \sin \left(\frac{angle\_m \cdot \pi}{-180}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2 \cdot \left(2 \cdot \left(t\_0 \cdot \sin \left(\frac{1}{\frac{180}{angle\_m \cdot \pi}}\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
 :precision binary64
 (let* ((t_0 (* (+ b_m a_m) (- a_m b_m)))
        (t_1 (* angle_m (* -0.005555555555555556 PI)))
        (t_2 (cos (* angle_m (/ PI -180.0)))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 4e+16)
      (* (* (cos t_1) 2.0) (* (* (sin t_1) (+ b_m a_m)) (- a_m b_m)))
      (if (<= (/ angle_m 180.0) 2e+111)
        (*
         (cos (* angle_m (+ (exp (log1p (* -0.005555555555555556 PI))) -1.0)))
         (* 2.0 (* (sin (/ (* angle_m PI) 180.0)) t_0)))
        (if (<= (/ angle_m 180.0) 2e+230)
          (* t_2 (* 2.0 (* t_0 (sin (/ (* angle_m PI) -180.0)))))
          (* t_2 (* 2.0 (* t_0 (sin (/ 1.0 (/ 180.0 (* angle_m PI)))))))))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
	double t_0 = (b_m + a_m) * (a_m - b_m);
	double t_1 = angle_m * (-0.005555555555555556 * ((double) M_PI));
	double t_2 = cos((angle_m * (((double) M_PI) / -180.0)));
	double tmp;
	if ((angle_m / 180.0) <= 4e+16) {
		tmp = (cos(t_1) * 2.0) * ((sin(t_1) * (b_m + a_m)) * (a_m - b_m));
	} else if ((angle_m / 180.0) <= 2e+111) {
		tmp = cos((angle_m * (exp(log1p((-0.005555555555555556 * ((double) M_PI)))) + -1.0))) * (2.0 * (sin(((angle_m * ((double) M_PI)) / 180.0)) * t_0));
	} else if ((angle_m / 180.0) <= 2e+230) {
		tmp = t_2 * (2.0 * (t_0 * sin(((angle_m * ((double) M_PI)) / -180.0))));
	} else {
		tmp = t_2 * (2.0 * (t_0 * sin((1.0 / (180.0 / (angle_m * ((double) M_PI)))))));
	}
	return angle_s * tmp;
}
a_m = Math.abs(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_m, double b_m, double angle_m) {
	double t_0 = (b_m + a_m) * (a_m - b_m);
	double t_1 = angle_m * (-0.005555555555555556 * Math.PI);
	double t_2 = Math.cos((angle_m * (Math.PI / -180.0)));
	double tmp;
	if ((angle_m / 180.0) <= 4e+16) {
		tmp = (Math.cos(t_1) * 2.0) * ((Math.sin(t_1) * (b_m + a_m)) * (a_m - b_m));
	} else if ((angle_m / 180.0) <= 2e+111) {
		tmp = Math.cos((angle_m * (Math.exp(Math.log1p((-0.005555555555555556 * Math.PI))) + -1.0))) * (2.0 * (Math.sin(((angle_m * Math.PI) / 180.0)) * t_0));
	} else if ((angle_m / 180.0) <= 2e+230) {
		tmp = t_2 * (2.0 * (t_0 * Math.sin(((angle_m * Math.PI) / -180.0))));
	} else {
		tmp = t_2 * (2.0 * (t_0 * Math.sin((1.0 / (180.0 / (angle_m * Math.PI))))));
	}
	return angle_s * tmp;
}
a_m = math.fabs(a)
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b_m, angle_m):
	t_0 = (b_m + a_m) * (a_m - b_m)
	t_1 = angle_m * (-0.005555555555555556 * math.pi)
	t_2 = math.cos((angle_m * (math.pi / -180.0)))
	tmp = 0
	if (angle_m / 180.0) <= 4e+16:
		tmp = (math.cos(t_1) * 2.0) * ((math.sin(t_1) * (b_m + a_m)) * (a_m - b_m))
	elif (angle_m / 180.0) <= 2e+111:
		tmp = math.cos((angle_m * (math.exp(math.log1p((-0.005555555555555556 * math.pi))) + -1.0))) * (2.0 * (math.sin(((angle_m * math.pi) / 180.0)) * t_0))
	elif (angle_m / 180.0) <= 2e+230:
		tmp = t_2 * (2.0 * (t_0 * math.sin(((angle_m * math.pi) / -180.0))))
	else:
		tmp = t_2 * (2.0 * (t_0 * math.sin((1.0 / (180.0 / (angle_m * math.pi))))))
	return angle_s * tmp
a_m = abs(a)
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b_m, angle_m)
	t_0 = Float64(Float64(b_m + a_m) * Float64(a_m - b_m))
	t_1 = Float64(angle_m * Float64(-0.005555555555555556 * pi))
	t_2 = cos(Float64(angle_m * Float64(pi / -180.0)))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 4e+16)
		tmp = Float64(Float64(cos(t_1) * 2.0) * Float64(Float64(sin(t_1) * Float64(b_m + a_m)) * Float64(a_m - b_m)));
	elseif (Float64(angle_m / 180.0) <= 2e+111)
		tmp = Float64(cos(Float64(angle_m * Float64(exp(log1p(Float64(-0.005555555555555556 * pi))) + -1.0))) * Float64(2.0 * Float64(sin(Float64(Float64(angle_m * pi) / 180.0)) * t_0)));
	elseif (Float64(angle_m / 180.0) <= 2e+230)
		tmp = Float64(t_2 * Float64(2.0 * Float64(t_0 * sin(Float64(Float64(angle_m * pi) / -180.0)))));
	else
		tmp = Float64(t_2 * Float64(2.0 * Float64(t_0 * sin(Float64(1.0 / Float64(180.0 / Float64(angle_m * pi)))))));
	end
	return Float64(angle_s * tmp)
end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(a$95$m - b$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(angle$95$m * N[(-0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+16], N[(N[(N[Cos[t$95$1], $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[(N[Sin[t$95$1], $MachinePrecision] * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(a$95$m - b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+111], N[(N[Cos[N[(angle$95$m * N[(N[Exp[N[Log[1 + N[(-0.005555555555555556 * Pi), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+230], N[(t$95$2 * N[(2.0 * N[(t$95$0 * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(2.0 * N[(t$95$0 * N[Sin[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+111}:\\
\;\;\;\;\cos \left(angle\_m \cdot \left(e^{\mathsf{log1p}\left(-0.005555555555555556 \cdot \pi\right)} + -1\right)\right) \cdot \left(2 \cdot \left(\sin \left(\frac{angle\_m \cdot \pi}{180}\right) \cdot t\_0\right)\right)\\

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

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


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

    1. Initial program 62.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e16 < (/.f64 angle #s(literal 180 binary64)) < 1.99999999999999991e111

    1. Initial program 18.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. Simplified20.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999991e111 < (/.f64 angle #s(literal 180 binary64)) < 2.0000000000000002e230

    1. Initial program 48.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. Simplified43.5%

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

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

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

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

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

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

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

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

    1. Initial program 27.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 64.9% accurate, 0.5× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\cos t\_0 \cdot t\_2\\


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

    1. Initial program 49.1%

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

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

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

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

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

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

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

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

    if -5.00000000000000031e289 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.0000000000000001e270

    1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 44.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(b \cdot \left(angle \cdot \left(b \cdot \pi\right) + angle \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right)} \]
      4. distribute-lft-out76.8%

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi + \color{blue}{\left(a + -1 \cdot a\right) \cdot \pi}\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      6. distribute-rgt1-in76.8%

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi + \color{blue}{0} \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      9. distribute-rgt-out76.8%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 3: 64.7% accurate, 0.5× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\cos t\_0 \cdot t\_2\\


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

    1. Initial program 53.6%

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

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

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

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

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

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

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

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

    if -5e228 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 5.00000000000000031e289

    1. Initial program 64.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. Simplified64.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 46.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(b \cdot \left(angle \cdot \left(b \cdot \pi\right) + angle \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right)} \]
      4. distribute-lft-out82.3%

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi + \color{blue}{\left(a + -1 \cdot a\right) \cdot \pi}\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      6. distribute-rgt1-in82.3%

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi + \color{blue}{0} \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      9. distribute-rgt-out82.3%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 4: 64.9% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+289}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(t\_0 \cdot \sin \left(-0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(t\_0 \cdot \sin t\_2\right)\right)\\


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

    1. Initial program 49.1%

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

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

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

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

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

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

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

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

    if -5.00000000000000031e289 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 5.00000000000000031e289

    1. Initial program 65.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. Simplified65.6%

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

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

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

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

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

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

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

    1. Initial program 46.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(b \cdot \left(angle \cdot \left(b \cdot \pi\right) + angle \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right)} \]
      4. distribute-lft-out82.3%

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi + \color{blue}{\left(a + -1 \cdot a\right) \cdot \pi}\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      6. distribute-rgt1-in82.3%

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi + \color{blue}{0} \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      9. distribute-rgt-out82.3%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 5: 64.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+289}:\\
\;\;\;\;t\_2 \cdot \left(2 \cdot \left(t\_0 \cdot \sin \left(-0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\\

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

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


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

    1. Initial program 49.1%

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

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

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

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

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

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

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

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

    if -5.00000000000000031e289 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 5.00000000000000031e289

    1. Initial program 65.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. Simplified65.6%

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

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

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

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

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

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

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

    1. Initial program 46.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(b \cdot \left(angle \cdot \left(b \cdot \pi\right) + angle \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right)} \]
      4. distribute-lft-out82.3%

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi + \color{blue}{\left(a + -1 \cdot a\right) \cdot \pi}\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      6. distribute-rgt1-in82.3%

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi + \color{blue}{0} \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      9. distribute-rgt-out82.3%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

Alternative 6: 63.7% accurate, 0.6× speedup?

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

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

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

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

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


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

    1. Initial program 48.2%

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

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

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

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

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

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

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

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

    if -4.0000000000000001e297 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 5.00000000000000031e289

    1. Initial program 65.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. Simplified65.6%

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

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

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

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

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

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

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

    1. Initial program 46.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(b \cdot \left(angle \cdot \left(b \cdot \pi\right) + angle \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right)} \]
      4. distribute-lft-out82.3%

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi + \color{blue}{\left(a + -1 \cdot a\right) \cdot \pi}\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      6. distribute-rgt1-in82.3%

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi + \color{blue}{0} \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      9. distribute-rgt-out82.3%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

Alternative 7: 67.1% accurate, 1.7× speedup?

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

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

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

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

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


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

    1. Initial program 62.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e16 < (/.f64 angle #s(literal 180 binary64)) < 1.99999999999999991e111

    1. Initial program 18.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. Simplified20.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999991e111 < (/.f64 angle #s(literal 180 binary64)) < 2.0000000000000002e230

    1. Initial program 48.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. Simplified43.5%

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

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

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

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

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

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

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

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

    1. Initial program 27.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 58.4% accurate, 3.4× speedup?

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

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if angle < 6.9999999999999998e26

    1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(b \cdot \left(angle \cdot \left(b \cdot \pi\right) + angle \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right)} \]
      4. distribute-lft-out69.3%

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi + \color{blue}{\left(a + -1 \cdot a\right) \cdot \pi}\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      6. distribute-rgt1-in69.3%

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi + \color{blue}{0} \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      9. distribute-rgt-out69.3%

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

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

    if 6.9999999999999998e26 < angle < 1.4000000000000001e267

    1. Initial program 35.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. Simplified36.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4000000000000001e267 < angle

    1. Initial program 13.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. Simplified16.3%

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

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

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

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

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

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

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

Alternative 9: 60.4% accurate, 3.5× speedup?

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

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

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


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

    1. Initial program 56.9%

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

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

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

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

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

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

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

    if 5.5e148 < a

    1. Initial program 43.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 58.4% accurate, 3.5× speedup?

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

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

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


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

    1. Initial program 61.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. Simplified61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000007e294 < (pow.f64 a #s(literal 2 binary64))

    1. Initial program 37.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\left(0.011111111111111112 \cdot angle\right) \cdot \color{blue}{\left(\left(\pi \cdot a\right) \cdot \left(b - a\right)\right)}\right)}^{1} \]
    8. Applied egg-rr52.7%

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

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

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

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

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

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

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

Alternative 11: 53.4% accurate, 26.2× speedup?

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

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

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


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

    1. Initial program 57.0%

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

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

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

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

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

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

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

    if 4.30000000000000001e-11 < a

    1. Initial program 50.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\left(0.011111111111111112 \cdot angle\right) \cdot \color{blue}{\left(\left(\pi \cdot a\right) \cdot \left(b - a\right)\right)}\right)}^{1} \]
    8. Applied egg-rr51.9%

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

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

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

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

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

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

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

Alternative 12: 53.4% accurate, 26.2× speedup?

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

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

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


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

    1. Initial program 57.0%

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

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

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

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

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

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

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

    if 8.99999999999999959e-7 < a

    1. Initial program 50.4%

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

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

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

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

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

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

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

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

Alternative 13: 41.9% accurate, 38.1× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 14: 20.0% accurate, 46.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 19.1% accurate, 46.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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