ab-angle->ABCF B

Percentage Accurate: 54.0% → 67.1%
Time: 21.6s
Alternatives: 15
Speedup: 23.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 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: 67.1% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+176}:\\
\;\;\;\;{\left(t\_2 \cdot \left|\sqrt[3]{\left(b\_m - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)}\right|\right)}^{3}\\

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


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

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt[3]{a + b} \cdot \sqrt[3]{\left(b - a\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}}\right)}^{3} \]
    9. Simplified81.5%

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

    if 9.99999999999999914e28 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000002e141

    1. Initial program 24.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000002e141 < (/.f64 angle #s(literal 180 binary64)) < 1e176

    1. Initial program 18.1%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\sqrt[3]{b + a} \cdot \sqrt[3]{\left(b - a\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}\right)}}^{3} \]
    8. Step-by-step derivation
      1. +-commutative21.6%

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

        \[\leadsto {\left(\sqrt[3]{a + b} \cdot \sqrt[3]{\left(b - a\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}}\right)}^{3} \]
    9. Simplified18.1%

      \[\leadsto {\color{blue}{\left(\sqrt[3]{a + b} \cdot \sqrt[3]{\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}\right)}}^{3} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt5.4%

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

        \[\leadsto {\left(\sqrt[3]{a + b} \cdot \color{blue}{\sqrt{\sqrt[3]{\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)} \cdot \sqrt[3]{\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}}}\right)}^{3} \]
      3. pow234.7%

        \[\leadsto {\left(\sqrt[3]{a + b} \cdot \sqrt{\color{blue}{{\left(\sqrt[3]{\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}\right)}^{2}}}\right)}^{3} \]
    11. Applied egg-rr34.7%

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

        \[\leadsto {\left(\sqrt[3]{a + b} \cdot \sqrt{\color{blue}{\sqrt[3]{\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)} \cdot \sqrt[3]{\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}}}\right)}^{3} \]
      2. rem-sqrt-square34.7%

        \[\leadsto {\left(\sqrt[3]{a + b} \cdot \color{blue}{\left|\sqrt[3]{\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}\right|}\right)}^{3} \]
      3. *-commutative34.7%

        \[\leadsto {\left(\sqrt[3]{a + b} \cdot \left|\sqrt[3]{\color{blue}{\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot \left(b - a\right)}}\right|\right)}^{3} \]
      4. *-commutative34.7%

        \[\leadsto {\left(\sqrt[3]{a + b} \cdot \left|\sqrt[3]{\sin \color{blue}{\left(\left(angle \cdot 0.011111111111111112\right) \cdot \pi\right)} \cdot \left(b - a\right)}\right|\right)}^{3} \]
      5. *-commutative34.7%

        \[\leadsto {\left(\sqrt[3]{a + b} \cdot \left|\sqrt[3]{\sin \left(\color{blue}{\left(0.011111111111111112 \cdot angle\right)} \cdot \pi\right) \cdot \left(b - a\right)}\right|\right)}^{3} \]
      6. associate-*r*37.1%

        \[\leadsto {\left(\sqrt[3]{a + b} \cdot \left|\sqrt[3]{\sin \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)} \cdot \left(b - a\right)}\right|\right)}^{3} \]
    13. Simplified37.1%

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

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

    1. Initial program 21.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 67.0% accurate, 0.9× speedup?

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

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

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+176}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \sqrt{{\left(\left(b\_m - a\right) \cdot \left(\left(a + b\_m\right) \cdot \pi\right)\right)}^{2}}\right)\\

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


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

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt[3]{a + b} \cdot \sqrt[3]{\left(b - a\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}}\right)}^{3} \]
    9. Simplified81.5%

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

    if 9.99999999999999914e28 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000002e141

    1. Initial program 24.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000002e141 < (/.f64 angle #s(literal 180 binary64)) < 1e176

    1. Initial program 18.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \sqrt{{\color{blue}{\left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}}^{2}}\right) \]
    9. Applied egg-rr27.0%

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

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

    1. Initial program 21.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 66.3% accurate, 1.0× speedup?

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

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+29}:\\
\;\;\;\;{\left(\sqrt[3]{a + b\_m} \cdot \sqrt[3]{\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)}\right)}^{3}\\

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

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


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

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt[3]{a + b} \cdot \sqrt[3]{\left(b - a\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}}\right)}^{3} \]
    9. Simplified81.5%

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

    if 9.99999999999999914e28 < (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000003e141

    1. Initial program 24.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000003e141 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 20.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left({\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
    9. Step-by-step derivation
      1. unpow1/323.9%

        \[\leadsto \color{blue}{\sqrt[3]{{\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}^{3}}} \]
      2. rem-cbrt-cube24.8%

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

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

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

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

        \[\leadsto \sqrt{{\left(\sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)} \cdot \left({b}^{2} - {a}^{2}\right)\right)}^{2}} \]
    10. Applied egg-rr32.5%

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

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

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

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

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

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

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

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

Alternative 4: 67.3% accurate, 1.0× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot {\left(\sqrt[3]{a + b\_m} \cdot \sqrt[3]{\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)}\right)}^{3} \end{array} \]
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
 :precision binary64
 (*
  angle_s
  (pow
   (*
    (cbrt (+ a b_m))
    (cbrt (* (- b_m a) (sin (* PI (* angle_m 0.011111111111111112))))))
   3.0)))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
	return angle_s * pow((cbrt((a + b_m)) * cbrt(((b_m - a) * sin((((double) M_PI) * (angle_m * 0.011111111111111112)))))), 3.0);
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
	return angle_s * Math.pow((Math.cbrt((a + b_m)) * Math.cbrt(((b_m - a) * Math.sin((Math.PI * (angle_m * 0.011111111111111112)))))), 3.0);
}
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b_m, angle_m)
	return Float64(angle_s * (Float64(cbrt(Float64(a + b_m)) * cbrt(Float64(Float64(b_m - a) * sin(Float64(pi * Float64(angle_m * 0.011111111111111112)))))) ^ 3.0))
end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[Power[N[(N[Power[N[(a + b$95$m), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot {\left(\sqrt[3]{a + b\_m} \cdot \sqrt[3]{\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)}\right)}^{3}
\end{array}
Derivation
  1. Initial program 60.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\sqrt[3]{a + b} \cdot \sqrt[3]{\left(b - a\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}}\right)}^{3} \]
  9. Simplified71.3%

    \[\leadsto {\color{blue}{\left(\sqrt[3]{a + b} \cdot \sqrt[3]{\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}\right)}}^{3} \]
  10. Add Preprocessing

Alternative 5: 66.8% accurate, 1.8× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \cos t\_1\right) \cdot \left(\sin t\_1 \cdot \left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right)\right)\\


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

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999999e-79 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 38.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 66.6% accurate, 1.8× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos t\_1 \cdot \left(\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \sin t\_1\right)\right)\\


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

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999999e-79 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 38.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 63.3% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e5 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 30.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 64.5% accurate, 3.4× speedup?

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

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

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


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

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999999e-79 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 38.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 63.0% accurate, 3.6× speedup?

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

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

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


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

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.18e8 < angle

    1. Initial program 30.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \sqrt{\color{blue}{\left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)}}\right) \]
      2. rem-sqrt-square30.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 57.1% accurate, 20.0× speedup?

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

\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(b\_m \cdot t\_0 + a \cdot t\_0\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 60.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \left(\pi \cdot \left(b - a\right)\right)\right) \cdot b + \left(angle \cdot \left(\pi \cdot \left(b - a\right)\right)\right) \cdot a\right)} \]
  13. Final simplification62.5%

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

Alternative 11: 58.2% accurate, 23.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.35000000000000003e154

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right)} \]
    8. Step-by-step derivation
      1. fma-define42.4%

        \[\leadsto angle \cdot \color{blue}{\mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right), 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right)} \]
      2. associate-*r*42.4%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right), \color{blue}{\left(2 \cdot {angle}^{2}\right) \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \]
      3. distribute-rgt-out42.4%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right), \left(2 \cdot {angle}^{2}\right) \cdot \color{blue}{\left(\left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \left(-8.573388203017833 \cdot 10^{-8} + -2.8577960676726107 \cdot 10^{-8}\right)\right)}\right) \]
      4. associate-*r*42.4%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right), \left(2 \cdot {angle}^{2}\right) \cdot \left(\color{blue}{\left(\left({\pi}^{3} \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)} \cdot \left(-8.573388203017833 \cdot 10^{-8} + -2.8577960676726107 \cdot 10^{-8}\right)\right)\right) \]
      5. metadata-eval42.4%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right), \left(2 \cdot {angle}^{2}\right) \cdot \left(\left(\left({\pi}^{3} \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{-1.1431184270690443 \cdot 10^{-7}}\right)\right) \]
    9. Simplified42.4%

      \[\leadsto \color{blue}{angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right), \left(2 \cdot {angle}^{2}\right) \cdot \left(\left(\left({\pi}^{3} \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot -1.1431184270690443 \cdot 10^{-7}\right)\right)} \]
    10. Taylor expanded in angle around 0 58.0%

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

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

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

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

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

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

    if 1.35000000000000003e154 < b

    1. Initial program 44.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 58.2% accurate, 23.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 3.1000000000000002e151

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right)} \]
    8. Step-by-step derivation
      1. fma-define42.4%

        \[\leadsto angle \cdot \color{blue}{\mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right), 2 \cdot \left({angle}^{2} \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right)} \]
      2. associate-*r*42.4%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right), \color{blue}{\left(2 \cdot {angle}^{2}\right) \cdot \left(-8.573388203017833 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) + -2.8577960676726107 \cdot 10^{-8} \cdot \left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \]
      3. distribute-rgt-out42.4%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right), \left(2 \cdot {angle}^{2}\right) \cdot \color{blue}{\left(\left({\pi}^{3} \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \left(-8.573388203017833 \cdot 10^{-8} + -2.8577960676726107 \cdot 10^{-8}\right)\right)}\right) \]
      4. associate-*r*42.4%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right), \left(2 \cdot {angle}^{2}\right) \cdot \left(\color{blue}{\left(\left({\pi}^{3} \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)} \cdot \left(-8.573388203017833 \cdot 10^{-8} + -2.8577960676726107 \cdot 10^{-8}\right)\right)\right) \]
      5. metadata-eval42.4%

        \[\leadsto angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right), \left(2 \cdot {angle}^{2}\right) \cdot \left(\left(\left({\pi}^{3} \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{-1.1431184270690443 \cdot 10^{-7}}\right)\right) \]
    9. Simplified42.4%

      \[\leadsto \color{blue}{angle \cdot \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right), \left(2 \cdot {angle}^{2}\right) \cdot \left(\left(\left({\pi}^{3} \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot -1.1431184270690443 \cdot 10^{-7}\right)\right)} \]
    10. Taylor expanded in angle around 0 58.0%

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

    if 3.1000000000000002e151 < b

    1. Initial program 44.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 57.9% accurate, 23.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 2.50000000000000013e141

    1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.50000000000000013e141 < b

    1. Initial program 49.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 58.0% accurate, 23.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.30000000000000001e145

    1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

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

    if 1.30000000000000001e145 < b

    1. Initial program 48.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 39.0% accurate, 46.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot b\right) \cdot \left(\pi \cdot \left(b + 0\right)\right)\right)} \]
  13. Final simplification40.0%

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

Reproduce

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