ab-angle->ABCF B

Percentage Accurate: 54.0% → 57.3%
Time: 31.2s
Alternatives: 12
Speedup: 3.6×

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 12 alternatives:

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

Initial Program: 54.0% accurate, 1.0× speedup?

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

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

Alternative 1: 57.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\
t_1 := 2 \cdot \left(\left(a_m + b\right) \cdot \left(b - a_m\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;a_m \leq 3.6 \cdot 10^{+66}:\\
\;\;\;\;\left(t_1 \cdot \sin \left(\frac{\pi}{\frac{180}{angle_m}}\right)\right) \cdot \cos \left({\left(\sqrt[3]{t_0}\right)}^{3}\right)\\

\mathbf{elif}\;a_m \leq 2 \cdot 10^{+219}:\\
\;\;\;\;t_1 \cdot \sin t_0\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 3.6e66

    1. Initial program 53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6e66 < a < 1.99999999999999993e219

    1. Initial program 35.3%

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999993e219 < a

    1. Initial program 43.7%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 57.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_0 := \mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)\\
t_1 := 2 \cdot \left(\left(a_m + b\right) \cdot \left(b - a_m\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 10^{+280}:\\
\;\;\;\;\left(t_1 \cdot \sin \left(\pi \cdot \frac{angle_m}{180}\right)\right) \cdot \cos t_0\\

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


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

    1. Initial program 55.9%

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

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

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

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

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

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

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

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

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

    if 1e280 < (pow.f64 b 2)

    1. Initial program 36.1%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \]
    9. Taylor expanded in angle around inf 55.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 57.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;a_m \leq 1.5 \cdot 10^{+60}:\\
\;\;\;\;\left(t_1 \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\right) \cdot \cos \left(\left(\pi \cdot angle_m\right) \cdot -0.005555555555555556\right)\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin t_0\\


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

    1. Initial program 51.6%

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

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

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

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

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

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

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

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

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

    if 2.95e-189 < a < 1.4999999999999999e60

    1. Initial program 60.1%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \]
    9. Taylor expanded in angle around inf 53.4%

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right) \cdot \color{blue}{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \]
    10. Step-by-step derivation
      1. *-commutative53.4%

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

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

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

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

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

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

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

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

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

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

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

    if 1.4999999999999999e60 < a

    1. Initial program 38.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 57.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\
t_1 := 2 \cdot \left(\left(a_m + b\right) \cdot \left(b - a_m\right)\right)\\
t_2 := t_1 \cdot \sin \left(\pi \cdot \frac{angle_m}{180}\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;a_m \leq 2.8 \cdot 10^{+59}:\\
\;\;\;\;t_2 \cdot \cos \left(\frac{angle_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\\

\mathbf{elif}\;a_m \leq 5 \cdot 10^{+225}:\\
\;\;\;\;t_1 \cdot \sin t_0\\

\mathbf{else}:\\
\;\;\;\;t_2 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 2.7999999999999998e59

    1. Initial program 53.5%

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

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

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

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

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

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

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

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

    if 2.7999999999999998e59 < a < 4.99999999999999981e225

    1. Initial program 35.4%

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999981e225 < a

    1. Initial program 43.7%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 57.1% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 58.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999972e118 < (pow.f64 a 2)

    1. Initial program 39.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 57.1% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 58.3%

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

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

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

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

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

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

    if 5.00000000000000019e120 < (pow.f64 a 2)

    1. Initial program 39.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 57.1% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 58.2%

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

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

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

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

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

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

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

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

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

    if 9.99999999999999948e123 < (pow.f64 a 2)

    1. Initial program 39.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 57.2% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

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

    if 5.00000000000000019e120 < (pow.f64 a 2)

    1. Initial program 39.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 55.9% accurate, 3.6× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 10: 56.0% accurate, 3.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 53.9% accurate, 27.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 53.9% accurate, 32.2× speedup?

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

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

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

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

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

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

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

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

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

Reproduce

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