ab-angle->ABCF B

Percentage Accurate: 54.6% → 65.3%
Time: 36.8s
Alternatives: 12
Speedup: 32.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 54.6% accurate, 1.0× speedup?

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

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

Alternative 1: 65.3% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 50.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*50.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. *-commutative50.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*50.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. Simplified50.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. unpow250.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. unpow250.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-squares55.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) \]
    6. Applied egg-rr55.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. Taylor expanded in angle around 0 59.1%

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

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

    if 2.0999999999999998e-230 < a < 8.50000000000000028e250

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*53.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. *-commutative53.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*53.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. Simplified53.3%

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

        \[\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. pow353.0%

        \[\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-sin53.0%

        \[\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*53.0%

        \[\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-inv53.9%

        \[\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-eval53.9%

        \[\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-rr53.9%

      \[\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-rr66.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. +-commutative66.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*67.2%

        \[\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. Simplified67.2%

      \[\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-sqrt30.5%

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

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

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

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

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

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

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

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

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

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

    if 8.50000000000000028e250 < a

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*53.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. *-commutative53.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*53.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. Simplified53.3%

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

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

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

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

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

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

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

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

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

Alternative 2: 65.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;a\_m \leq 6.5 \cdot 10^{+250}:\\
\;\;\;\;\left(b - a\_m\right) \cdot \left(\left(a\_m + b\right) \cdot \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right)\\

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


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

    1. Initial program 53.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*53.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. *-commutative53.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*53.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. Simplified53.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. unpow253.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. unpow253.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-squares56.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) \]
    6. Applied egg-rr56.0%

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

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

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

    if 2.9000000000000001e34 < a < 6.5000000000000004e250

    1. Initial program 45.0%

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

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

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

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

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

        \[\leadsto \left(\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. unpow245.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-squares51.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) \]
    6. Applied egg-rr51.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)} \]
      9. add-exp-log67.6%

        \[\leadsto \color{blue}{e^{\log \left(a + b\right)}} \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right) \]
      10. add-exp-log32.3%

        \[\leadsto e^{\log \left(a + b\right)} \cdot \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)}} \]
      11. prod-exp32.1%

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

        \[\leadsto e^{\log \color{blue}{\left(b + a\right)} + \log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)} \]
      13. *-commutative32.1%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \pi\right)}\right)} \]
      14. *-commutative32.1%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \left(\color{blue}{\left(angle \cdot 0.011111111111111112\right)} \cdot \pi\right)\right)} \]
      15. associate-*l*32.1%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)}\right)} \]
    10. Applied egg-rr32.1%

      \[\leadsto \color{blue}{e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)}} \]
    11. Step-by-step derivation
      1. +-commutative32.1%

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

        \[\leadsto \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)}} \]
      3. rem-exp-log67.6%

        \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)} \]
      4. rem-exp-log82.9%

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

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

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

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

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

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

    if 6.5000000000000004e250 < a

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*53.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. *-commutative53.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*53.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. Simplified53.3%

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

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

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

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

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

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

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

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

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

Alternative 3: 66.4% accurate, 1.2× speedup?

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

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

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

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

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


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

    1. Initial program 60.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*60.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. *-commutative60.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*60.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. Simplified60.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)} \]
      9. add-exp-log40.5%

        \[\leadsto \color{blue}{e^{\log \left(a + b\right)}} \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right) \]
      10. add-exp-log20.9%

        \[\leadsto e^{\log \left(a + b\right)} \cdot \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)}} \]
      11. prod-exp20.8%

        \[\leadsto \color{blue}{e^{\log \left(a + b\right) + \log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)}} \]
      12. +-commutative20.8%

        \[\leadsto e^{\log \color{blue}{\left(b + a\right)} + \log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)} \]
      13. *-commutative20.8%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \pi\right)}\right)} \]
      14. *-commutative20.8%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \left(\color{blue}{\left(angle \cdot 0.011111111111111112\right)} \cdot \pi\right)\right)} \]
      15. associate-*l*20.8%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)}\right)} \]
    10. Applied egg-rr20.8%

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)}} \]
      3. rem-exp-log40.5%

        \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)} \]
      4. rem-exp-log75.9%

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

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

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

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

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

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

    if 9.9999999999999998e-17 < (/.f64 angle #s(literal 180 binary64)) < 2e94

    1. Initial program 34.6%

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

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

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

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

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

        \[\leadsto \left(\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. unpow234.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-squares34.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) \]
    6. Applied egg-rr34.6%

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

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

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

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

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

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

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

    if 2e94 < (/.f64 angle #s(literal 180 binary64)) < 1e115

    1. Initial program 47.1%

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

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

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

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

    1. Initial program 21.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 66.1% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 60.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*60.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. *-commutative60.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*60.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. Simplified60.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)} \]
      9. add-exp-log40.5%

        \[\leadsto \color{blue}{e^{\log \left(a + b\right)}} \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right) \]
      10. add-exp-log20.9%

        \[\leadsto e^{\log \left(a + b\right)} \cdot \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)}} \]
      11. prod-exp20.8%

        \[\leadsto \color{blue}{e^{\log \left(a + b\right) + \log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)}} \]
      12. +-commutative20.8%

        \[\leadsto e^{\log \color{blue}{\left(b + a\right)} + \log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)} \]
      13. *-commutative20.8%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \pi\right)}\right)} \]
      14. *-commutative20.8%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \left(\color{blue}{\left(angle \cdot 0.011111111111111112\right)} \cdot \pi\right)\right)} \]
      15. associate-*l*20.8%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)}\right)} \]
    10. Applied egg-rr20.8%

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)}} \]
      3. rem-exp-log40.5%

        \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)} \]
      4. rem-exp-log75.9%

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

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

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

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

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

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

    if 9.9999999999999998e-17 < (/.f64 angle #s(literal 180 binary64)) < 1e115

    1. Initial program 37.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*37.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. *-commutative37.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*37.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. Simplified37.2%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 21.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*21.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. *-commutative21.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*21.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. Simplified21.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. unpow221.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. unpow221.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-squares25.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-rr25.7%

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

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

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

Alternative 5: 66.0% accurate, 1.8× speedup?

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

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

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

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

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


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

    1. Initial program 60.4%

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

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

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

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

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

        \[\leadsto \left(\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.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-squares65.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-rr65.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 68.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(a + b\right)}} \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right) \]
      10. add-exp-log20.5%

        \[\leadsto e^{\log \left(a + b\right)} \cdot \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)}} \]
      11. prod-exp20.5%

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

        \[\leadsto e^{\log \color{blue}{\left(b + a\right)} + \log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)} \]
      13. *-commutative20.5%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \pi\right)}\right)} \]
      14. *-commutative20.5%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \left(\color{blue}{\left(angle \cdot 0.011111111111111112\right)} \cdot \pi\right)\right)} \]
      15. associate-*l*20.5%

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

      \[\leadsto \color{blue}{e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)}} \]
    11. Step-by-step derivation
      1. +-commutative20.5%

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

        \[\leadsto \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)}} \]
      3. rem-exp-log40.2%

        \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)} \]
      4. rem-exp-log75.7%

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

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

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

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

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

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

    if 1.00000000000000007e-17 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999991e66

    1. Initial program 44.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*44.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. *-commutative44.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*44.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. Simplified44.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. unpow244.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. unpow244.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-squares44.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-rr44.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 41.0%

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

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

    if 4.99999999999999991e66 < (/.f64 angle #s(literal 180 binary64)) < 1e113

    1. Initial program 22.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*22.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. *-commutative22.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*22.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. Simplified22.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. unpow222.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. unpow222.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-squares22.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) \]
    6. Applied egg-rr22.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 22.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*22.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. *-commutative22.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*22.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. Simplified22.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. unpow222.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. unpow222.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-squares27.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) \]
    6. Applied egg-rr27.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. Taylor expanded in angle around 0 34.9%

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

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

Alternative 6: 63.6% accurate, 3.5× speedup?

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

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

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


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

    1. Initial program 51.8%

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

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

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

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

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

        \[\leadsto \left(\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. unpow251.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-squares55.2%

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

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

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

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

    if 1.24999999999999997e-114 < a

    1. Initial program 52.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*52.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. *-commutative52.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*52.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. Simplified52.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)} \]
      9. add-exp-log64.5%

        \[\leadsto \color{blue}{e^{\log \left(a + b\right)}} \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right) \]
      10. add-exp-log33.3%

        \[\leadsto e^{\log \left(a + b\right)} \cdot \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)}} \]
      11. prod-exp33.2%

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

        \[\leadsto e^{\log \color{blue}{\left(b + a\right)} + \log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)} \]
      13. *-commutative33.2%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \pi\right)}\right)} \]
      14. *-commutative33.2%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \left(\color{blue}{\left(angle \cdot 0.011111111111111112\right)} \cdot \pi\right)\right)} \]
      15. associate-*l*33.2%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)}\right)} \]
    10. Applied egg-rr33.2%

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)}} \]
      3. rem-exp-log64.5%

        \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)} \]
      4. rem-exp-log74.7%

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

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

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

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

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

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

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

Alternative 7: 64.4% accurate, 20.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 8.9999999999999995e-15

    1. Initial program 60.4%

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

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

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

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

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

        \[\leadsto \left(\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.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-squares65.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-rr65.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 68.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(a + b\right)}} \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right) \]
      10. add-exp-log20.5%

        \[\leadsto e^{\log \left(a + b\right)} \cdot \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)}} \]
      11. prod-exp20.5%

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

        \[\leadsto e^{\log \color{blue}{\left(b + a\right)} + \log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)} \]
      13. *-commutative20.5%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \pi\right)}\right)} \]
      14. *-commutative20.5%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \left(\color{blue}{\left(angle \cdot 0.011111111111111112\right)} \cdot \pi\right)\right)} \]
      15. associate-*l*20.5%

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

      \[\leadsto \color{blue}{e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)}} \]
    11. Step-by-step derivation
      1. +-commutative20.5%

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

        \[\leadsto \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)}} \]
      3. rem-exp-log40.2%

        \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)} \]
      4. rem-exp-log75.7%

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

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

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

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

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

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

    if 8.9999999999999995e-15 < angle

    1. Initial program 28.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*28.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. *-commutative28.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*28.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. Simplified28.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. unpow228.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. unpow228.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-squares31.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) \]
    6. Applied egg-rr31.0%

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

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

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

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

Alternative 8: 64.3% accurate, 20.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 4.00000000000000009e-46

    1. Initial program 59.7%

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

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

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

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

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

        \[\leadsto \left(\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. unpow259.7%

        \[\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-squares64.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-rr64.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)} \]
      9. add-exp-log40.5%

        \[\leadsto \color{blue}{e^{\log \left(a + b\right)}} \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right) \]
      10. add-exp-log20.6%

        \[\leadsto e^{\log \left(a + b\right)} \cdot \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)}} \]
      11. prod-exp20.6%

        \[\leadsto \color{blue}{e^{\log \left(a + b\right) + \log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)}} \]
      12. +-commutative20.6%

        \[\leadsto e^{\log \color{blue}{\left(b + a\right)} + \log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)} \]
      13. *-commutative20.6%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \pi\right)}\right)} \]
      14. *-commutative20.6%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \left(\color{blue}{\left(angle \cdot 0.011111111111111112\right)} \cdot \pi\right)\right)} \]
      15. associate-*l*20.6%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)}\right)} \]
    10. Applied egg-rr20.6%

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

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

        \[\leadsto \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)}} \]
      3. rem-exp-log40.5%

        \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)} \]
      4. rem-exp-log74.9%

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

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

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

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

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

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

    if 4.00000000000000009e-46 < angle

    1. Initial program 32.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*32.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. *-commutative32.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*32.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. Simplified32.5%

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

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

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

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

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

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

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

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

Alternative 9: 64.2% accurate, 20.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 4.99999999999999997e-56

    1. Initial program 59.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*59.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. *-commutative59.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*59.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. Simplified59.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. unpow259.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. unpow259.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-squares64.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) \]
    6. Applied egg-rr64.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. Taylor expanded in angle around 0 67.6%

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

      \[\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)} \]
    9. Step-by-step derivation
      1. *-commutative65.1%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(a + b\right)}} \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right) \]
      10. add-exp-log20.2%

        \[\leadsto e^{\log \left(a + b\right)} \cdot \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)}} \]
      11. prod-exp20.2%

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

        \[\leadsto e^{\log \color{blue}{\left(b + a\right)} + \log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)} \]
      13. *-commutative20.2%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \pi\right)}\right)} \]
      14. *-commutative20.2%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \left(\color{blue}{\left(angle \cdot 0.011111111111111112\right)} \cdot \pi\right)\right)} \]
      15. associate-*l*20.2%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)}\right)} \]
    10. Applied egg-rr20.2%

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

        \[\leadsto e^{\color{blue}{\log \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right) + \log \left(b + a\right)}} \]
      2. exp-sum20.2%

        \[\leadsto \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)}} \]
      3. rem-exp-log40.2%

        \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)} \]
      4. rem-exp-log74.8%

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

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

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

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

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

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

    if 4.99999999999999997e-56 < angle

    1. Initial program 33.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*33.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. *-commutative33.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*33.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. Simplified33.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. unpow233.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. unpow233.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-squares37.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) \]
    6. Applied egg-rr37.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. Taylor expanded in angle around 0 40.5%

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

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

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

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

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

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

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

Alternative 10: 64.4% accurate, 23.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 4.10000000000000036e-15

    1. Initial program 60.4%

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

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

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

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

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

        \[\leadsto \left(\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.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-squares65.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-rr65.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 68.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\log \left(a + b\right)}} \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right) \]
      10. add-exp-log20.5%

        \[\leadsto e^{\log \left(a + b\right)} \cdot \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)}} \]
      11. prod-exp20.5%

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

        \[\leadsto e^{\log \color{blue}{\left(b + a\right)} + \log \left(\left(b - a\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)\right)} \]
      13. *-commutative20.5%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \pi\right)}\right)} \]
      14. *-commutative20.5%

        \[\leadsto e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \left(\color{blue}{\left(angle \cdot 0.011111111111111112\right)} \cdot \pi\right)\right)} \]
      15. associate-*l*20.5%

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

      \[\leadsto \color{blue}{e^{\log \left(b + a\right) + \log \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)}} \]
    11. Step-by-step derivation
      1. +-commutative20.5%

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

        \[\leadsto \color{blue}{e^{\log \left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)}} \]
      3. rem-exp-log40.2%

        \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\right)} \cdot e^{\log \left(b + a\right)} \]
      4. rem-exp-log75.7%

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

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

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

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

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

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

    if 4.10000000000000036e-15 < angle

    1. Initial program 28.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*28.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. *-commutative28.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*28.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. Simplified28.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. unpow228.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. unpow228.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-squares31.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) \]
    6. Applied egg-rr31.0%

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

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*30.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. +-commutative30.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. difference-of-squares27.8%

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \]
      10. difference-of-squares30.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) \]
      11. *-commutative30.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) \]
      12. +-commutative30.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. Simplified30.8%

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

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

Alternative 11: 54.9% accurate, 32.2× speedup?

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

\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(a\_m + b\right) \cdot \left(b - a\_m\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 51.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*51.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. *-commutative51.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*51.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. Simplified51.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. unpow251.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. unpow251.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-squares56.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-rr56.7%

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

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

    \[\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)} \]
  9. Final simplification57.1%

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

Alternative 12: 55.0% accurate, 32.2× speedup?

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

\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(\left(a\_m + b\right) \cdot \left(b - a\_m\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 51.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*51.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. *-commutative51.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*51.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. Simplified51.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. unpow251.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. unpow251.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-squares56.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-rr56.7%

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

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

    \[\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)} \]
  9. Step-by-step derivation
    1. associate-*r*57.1%

      \[\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. +-commutative57.1%

      \[\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. difference-of-squares53.1%

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

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

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

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

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

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

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

      \[\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) \]
    11. *-commutative57.1%

      \[\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) \]
    12. +-commutative57.1%

      \[\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. Simplified57.1%

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

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

Reproduce

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