ab-angle->ABCF B

Percentage Accurate: 54.4% → 68.3%
Time: 42.2s
Alternatives: 15
Speedup: 5.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 54.4% 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: 68.3% accurate, 1.2× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} \mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+301}:\\ \;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\cos \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (if (<= (pow a 2.0) 5e+301)
   (*
    2.0
    (*
     (+ a b)
     (*
      (- b a)
      (*
       (cos (* angle (* PI -0.005555555555555556)))
       (sin (* (* angle PI) 0.005555555555555556))))))
   (*
    2.0
    (* (+ a b) (* (- b a) (sin (* PI (* angle 0.005555555555555556))))))))
b = abs(b);
double code(double a, double b, double angle) {
	double tmp;
	if (pow(a, 2.0) <= 5e+301) {
		tmp = 2.0 * ((a + b) * ((b - a) * (cos((angle * (((double) M_PI) * -0.005555555555555556))) * sin(((angle * ((double) M_PI)) * 0.005555555555555556)))));
	} else {
		tmp = 2.0 * ((a + b) * ((b - a) * sin((((double) M_PI) * (angle * 0.005555555555555556)))));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double tmp;
	if (Math.pow(a, 2.0) <= 5e+301) {
		tmp = 2.0 * ((a + b) * ((b - a) * (Math.cos((angle * (Math.PI * -0.005555555555555556))) * Math.sin(((angle * Math.PI) * 0.005555555555555556)))));
	} else {
		tmp = 2.0 * ((a + b) * ((b - a) * Math.sin((Math.PI * (angle * 0.005555555555555556)))));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	tmp = 0
	if math.pow(a, 2.0) <= 5e+301:
		tmp = 2.0 * ((a + b) * ((b - a) * (math.cos((angle * (math.pi * -0.005555555555555556))) * math.sin(((angle * math.pi) * 0.005555555555555556)))))
	else:
		tmp = 2.0 * ((a + b) * ((b - a) * math.sin((math.pi * (angle * 0.005555555555555556)))))
	return tmp
b = abs(b)
function code(a, b, angle)
	tmp = 0.0
	if ((a ^ 2.0) <= 5e+301)
		tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(cos(Float64(angle * Float64(pi * -0.005555555555555556))) * sin(Float64(Float64(angle * pi) * 0.005555555555555556))))));
	else
		tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(pi * Float64(angle * 0.005555555555555556))))));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if ((a ^ 2.0) <= 5e+301)
		tmp = 2.0 * ((a + b) * ((b - a) * (cos((angle * (pi * -0.005555555555555556))) * sin(((angle * pi) * 0.005555555555555556)))));
	else
		tmp = 2.0 * ((a + b) * ((b - a) * sin((pi * (angle * 0.005555555555555556)))));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+301], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(angle * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+301}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\cos \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)\right)\right)\right)\\

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


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

    1. Initial program 64.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*64.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. associate-*l*64.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000004e301 < (pow.f64 a 2)

    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. associate-*l*32.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 67.4% accurate, 1.0× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq \infty:\\ \;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\cos \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (if (<= (- (pow b 2.0) (pow a 2.0)) INFINITY)
   (*
    2.0
    (*
     (+ a b)
     (*
      (- b a)
      (*
       (cos (* angle (* PI -0.005555555555555556)))
       (sin (* PI (* angle 0.005555555555555556)))))))
   (*
    -0.011111111111111112
    (*
     angle
     (*
      PI
      (* (cos (* -0.005555555555555556 (* angle PI))) (* (+ a b) (- a b))))))))
b = abs(b);
double code(double a, double b, double angle) {
	double tmp;
	if ((pow(b, 2.0) - pow(a, 2.0)) <= ((double) INFINITY)) {
		tmp = 2.0 * ((a + b) * ((b - a) * (cos((angle * (((double) M_PI) * -0.005555555555555556))) * sin((((double) M_PI) * (angle * 0.005555555555555556))))));
	} else {
		tmp = -0.011111111111111112 * (angle * (((double) M_PI) * (cos((-0.005555555555555556 * (angle * ((double) M_PI)))) * ((a + b) * (a - b)))));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double tmp;
	if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= Double.POSITIVE_INFINITY) {
		tmp = 2.0 * ((a + b) * ((b - a) * (Math.cos((angle * (Math.PI * -0.005555555555555556))) * Math.sin((Math.PI * (angle * 0.005555555555555556))))));
	} else {
		tmp = -0.011111111111111112 * (angle * (Math.PI * (Math.cos((-0.005555555555555556 * (angle * Math.PI))) * ((a + b) * (a - b)))));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	tmp = 0
	if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= math.inf:
		tmp = 2.0 * ((a + b) * ((b - a) * (math.cos((angle * (math.pi * -0.005555555555555556))) * math.sin((math.pi * (angle * 0.005555555555555556))))))
	else:
		tmp = -0.011111111111111112 * (angle * (math.pi * (math.cos((-0.005555555555555556 * (angle * math.pi))) * ((a + b) * (a - b)))))
	return tmp
b = abs(b)
function code(a, b, angle)
	tmp = 0.0
	if (Float64((b ^ 2.0) - (a ^ 2.0)) <= Inf)
		tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(cos(Float64(angle * Float64(pi * -0.005555555555555556))) * sin(Float64(pi * Float64(angle * 0.005555555555555556)))))));
	else
		tmp = Float64(-0.011111111111111112 * Float64(angle * Float64(pi * Float64(cos(Float64(-0.005555555555555556 * Float64(angle * pi))) * Float64(Float64(a + b) * Float64(a - b))))));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (((b ^ 2.0) - (a ^ 2.0)) <= Inf)
		tmp = 2.0 * ((a + b) * ((b - a) * (cos((angle * (pi * -0.005555555555555556))) * sin((pi * (angle * 0.005555555555555556))))));
	else
		tmp = -0.011111111111111112 * (angle * (pi * (cos((-0.005555555555555556 * (angle * pi))) * ((a + b) * (a - b)))));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(angle * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(angle * N[(Pi * N[(N[Cos[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq \infty:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\cos \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < +inf.0

    1. Initial program 60.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*60.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. associate-*l*60.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if +inf.0 < (-.f64 (pow.f64 b 2) (pow.f64 a 2))

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq \infty:\\ \;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\cos \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)\right)\\ \end{array} \]

Alternative 3: 67.2% accurate, 1.2× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} t_0 := \cos \left(angle \cdot \frac{\pi}{-180}\right)\\ \mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-33}:\\ \;\;\;\;\left(2 \cdot \left|\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right|\right) \cdot \left(\left(\left(a + b\right) \cdot \left(a - b\right)\right) \cdot t_0\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-82}:\\ \;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot t_0\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (cos (* angle (/ PI -180.0)))))
   (if (<= (/ angle 180.0) -5e-33)
     (*
      (* 2.0 (fabs (sin (* -0.005555555555555556 (* angle PI)))))
      (* (* (+ a b) (- a b)) t_0))
     (if (<= (/ angle 180.0) 2e-82)
       (*
        2.0
        (* (+ a b) (* (- b a) (sin (* PI (* angle 0.005555555555555556))))))
       (* 2.0 (* (* (+ a b) (- b a)) (* (sin (* PI (/ angle 180.0))) t_0)))))))
b = abs(b);
double code(double a, double b, double angle) {
	double t_0 = cos((angle * (((double) M_PI) / -180.0)));
	double tmp;
	if ((angle / 180.0) <= -5e-33) {
		tmp = (2.0 * fabs(sin((-0.005555555555555556 * (angle * ((double) M_PI)))))) * (((a + b) * (a - b)) * t_0);
	} else if ((angle / 180.0) <= 2e-82) {
		tmp = 2.0 * ((a + b) * ((b - a) * sin((((double) M_PI) * (angle * 0.005555555555555556)))));
	} else {
		tmp = 2.0 * (((a + b) * (b - a)) * (sin((((double) M_PI) * (angle / 180.0))) * t_0));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double t_0 = Math.cos((angle * (Math.PI / -180.0)));
	double tmp;
	if ((angle / 180.0) <= -5e-33) {
		tmp = (2.0 * Math.abs(Math.sin((-0.005555555555555556 * (angle * Math.PI))))) * (((a + b) * (a - b)) * t_0);
	} else if ((angle / 180.0) <= 2e-82) {
		tmp = 2.0 * ((a + b) * ((b - a) * Math.sin((Math.PI * (angle * 0.005555555555555556)))));
	} else {
		tmp = 2.0 * (((a + b) * (b - a)) * (Math.sin((Math.PI * (angle / 180.0))) * t_0));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	t_0 = math.cos((angle * (math.pi / -180.0)))
	tmp = 0
	if (angle / 180.0) <= -5e-33:
		tmp = (2.0 * math.fabs(math.sin((-0.005555555555555556 * (angle * math.pi))))) * (((a + b) * (a - b)) * t_0)
	elif (angle / 180.0) <= 2e-82:
		tmp = 2.0 * ((a + b) * ((b - a) * math.sin((math.pi * (angle * 0.005555555555555556)))))
	else:
		tmp = 2.0 * (((a + b) * (b - a)) * (math.sin((math.pi * (angle / 180.0))) * t_0))
	return tmp
b = abs(b)
function code(a, b, angle)
	t_0 = cos(Float64(angle * Float64(pi / -180.0)))
	tmp = 0.0
	if (Float64(angle / 180.0) <= -5e-33)
		tmp = Float64(Float64(2.0 * abs(sin(Float64(-0.005555555555555556 * Float64(angle * pi))))) * Float64(Float64(Float64(a + b) * Float64(a - b)) * t_0));
	elseif (Float64(angle / 180.0) <= 2e-82)
		tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(pi * Float64(angle * 0.005555555555555556))))));
	else
		tmp = Float64(2.0 * Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(sin(Float64(pi * Float64(angle / 180.0))) * t_0)));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	t_0 = cos((angle * (pi / -180.0)));
	tmp = 0.0;
	if ((angle / 180.0) <= -5e-33)
		tmp = (2.0 * abs(sin((-0.005555555555555556 * (angle * pi))))) * (((a + b) * (a - b)) * t_0);
	elseif ((angle / 180.0) <= 2e-82)
		tmp = 2.0 * ((a + b) * ((b - a) * sin((pi * (angle * 0.005555555555555556)))));
	else
		tmp = 2.0 * (((a + b) * (b - a)) * (sin((pi * (angle / 180.0))) * t_0));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e-33], N[(N[(2.0 * N[Abs[N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-82], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \cos \left(angle \cdot \frac{\pi}{-180}\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-33}:\\
\;\;\;\;\left(2 \cdot \left|\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right|\right) \cdot \left(\left(\left(a + b\right) \cdot \left(a - b\right)\right) \cdot t_0\right)\\

\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-82}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\

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


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

    1. Initial program 46.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. Simplified48.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000028e-33 < (/.f64 angle 180) < 2e-82

    1. Initial program 69.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*69.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. associate-*l*69.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-82 < (/.f64 angle 180)

    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. associate-*l*44.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 67.2% accurate, 1.4× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} t_0 := \cos \left(angle \cdot \frac{\pi}{-180}\right)\\ \mathbf{if}\;\frac{angle}{180} \leq -4 \cdot 10^{+232}:\\ \;\;\;\;\left(\left(\left(a + b\right) \cdot \left(a - b\right)\right) \cdot t_0\right) \cdot \left(2 \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-82}:\\ \;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot t_0\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (cos (* angle (/ PI -180.0)))))
   (if (<= (/ angle 180.0) -4e+232)
     (*
      (* (* (+ a b) (- a b)) t_0)
      (* 2.0 (sin (* -0.005555555555555556 (* angle PI)))))
     (if (<= (/ angle 180.0) 2e-82)
       (*
        2.0
        (* (+ a b) (* (- b a) (sin (* PI (* angle 0.005555555555555556))))))
       (* 2.0 (* (* (+ a b) (- b a)) (* (sin (* PI (/ angle 180.0))) t_0)))))))
b = abs(b);
double code(double a, double b, double angle) {
	double t_0 = cos((angle * (((double) M_PI) / -180.0)));
	double tmp;
	if ((angle / 180.0) <= -4e+232) {
		tmp = (((a + b) * (a - b)) * t_0) * (2.0 * sin((-0.005555555555555556 * (angle * ((double) M_PI)))));
	} else if ((angle / 180.0) <= 2e-82) {
		tmp = 2.0 * ((a + b) * ((b - a) * sin((((double) M_PI) * (angle * 0.005555555555555556)))));
	} else {
		tmp = 2.0 * (((a + b) * (b - a)) * (sin((((double) M_PI) * (angle / 180.0))) * t_0));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double t_0 = Math.cos((angle * (Math.PI / -180.0)));
	double tmp;
	if ((angle / 180.0) <= -4e+232) {
		tmp = (((a + b) * (a - b)) * t_0) * (2.0 * Math.sin((-0.005555555555555556 * (angle * Math.PI))));
	} else if ((angle / 180.0) <= 2e-82) {
		tmp = 2.0 * ((a + b) * ((b - a) * Math.sin((Math.PI * (angle * 0.005555555555555556)))));
	} else {
		tmp = 2.0 * (((a + b) * (b - a)) * (Math.sin((Math.PI * (angle / 180.0))) * t_0));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	t_0 = math.cos((angle * (math.pi / -180.0)))
	tmp = 0
	if (angle / 180.0) <= -4e+232:
		tmp = (((a + b) * (a - b)) * t_0) * (2.0 * math.sin((-0.005555555555555556 * (angle * math.pi))))
	elif (angle / 180.0) <= 2e-82:
		tmp = 2.0 * ((a + b) * ((b - a) * math.sin((math.pi * (angle * 0.005555555555555556)))))
	else:
		tmp = 2.0 * (((a + b) * (b - a)) * (math.sin((math.pi * (angle / 180.0))) * t_0))
	return tmp
b = abs(b)
function code(a, b, angle)
	t_0 = cos(Float64(angle * Float64(pi / -180.0)))
	tmp = 0.0
	if (Float64(angle / 180.0) <= -4e+232)
		tmp = Float64(Float64(Float64(Float64(a + b) * Float64(a - b)) * t_0) * Float64(2.0 * sin(Float64(-0.005555555555555556 * Float64(angle * pi)))));
	elseif (Float64(angle / 180.0) <= 2e-82)
		tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(pi * Float64(angle * 0.005555555555555556))))));
	else
		tmp = Float64(2.0 * Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(sin(Float64(pi * Float64(angle / 180.0))) * t_0)));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	t_0 = cos((angle * (pi / -180.0)));
	tmp = 0.0;
	if ((angle / 180.0) <= -4e+232)
		tmp = (((a + b) * (a - b)) * t_0) * (2.0 * sin((-0.005555555555555556 * (angle * pi))));
	elseif ((angle / 180.0) <= 2e-82)
		tmp = 2.0 * ((a + b) * ((b - a) * sin((pi * (angle * 0.005555555555555556)))));
	else
		tmp = 2.0 * (((a + b) * (b - a)) * (sin((pi * (angle / 180.0))) * t_0));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -4e+232], N[(N[(N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(2.0 * N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-82], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \cos \left(angle \cdot \frac{\pi}{-180}\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -4 \cdot 10^{+232}:\\
\;\;\;\;\left(\left(\left(a + b\right) \cdot \left(a - b\right)\right) \cdot t_0\right) \cdot \left(2 \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\

\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-82}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle 180) < -4.00000000000000023e232

    1. Initial program 46.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. Simplified46.0%

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

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

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

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

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

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

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

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

    if -4.00000000000000023e232 < (/.f64 angle 180) < 2e-82

    1. Initial program 62.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-82 < (/.f64 angle 180)

    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. associate-*l*44.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -4 \cdot 10^{+232}:\\ \;\;\;\;\left(\left(\left(a + b\right) \cdot \left(a - b\right)\right) \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right) \cdot \left(2 \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-82}:\\ \;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)\right)\\ \end{array} \]

Alternative 5: 67.2% accurate, 1.5× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-82}:\\ \;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (if (<= (/ angle 180.0) 2e-82)
   (* 2.0 (* (+ a b) (* (- b a) (sin (* PI (* angle 0.005555555555555556))))))
   (*
    2.0
    (*
     (* (+ a b) (- b a))
     (*
      (sin (* PI (/ angle 180.0)))
      (cos (* PI (* angle -0.005555555555555556))))))))
b = abs(b);
double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= 2e-82) {
		tmp = 2.0 * ((a + b) * ((b - a) * sin((((double) M_PI) * (angle * 0.005555555555555556)))));
	} else {
		tmp = 2.0 * (((a + b) * (b - a)) * (sin((((double) M_PI) * (angle / 180.0))) * cos((((double) M_PI) * (angle * -0.005555555555555556)))));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= 2e-82) {
		tmp = 2.0 * ((a + b) * ((b - a) * Math.sin((Math.PI * (angle * 0.005555555555555556)))));
	} else {
		tmp = 2.0 * (((a + b) * (b - a)) * (Math.sin((Math.PI * (angle / 180.0))) * Math.cos((Math.PI * (angle * -0.005555555555555556)))));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	tmp = 0
	if (angle / 180.0) <= 2e-82:
		tmp = 2.0 * ((a + b) * ((b - a) * math.sin((math.pi * (angle * 0.005555555555555556)))))
	else:
		tmp = 2.0 * (((a + b) * (b - a)) * (math.sin((math.pi * (angle / 180.0))) * math.cos((math.pi * (angle * -0.005555555555555556)))))
	return tmp
b = abs(b)
function code(a, b, angle)
	tmp = 0.0
	if (Float64(angle / 180.0) <= 2e-82)
		tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(pi * Float64(angle * 0.005555555555555556))))));
	else
		tmp = Float64(2.0 * Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(sin(Float64(pi * Float64(angle / 180.0))) * cos(Float64(pi * Float64(angle * -0.005555555555555556))))));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if ((angle / 180.0) <= 2e-82)
		tmp = 2.0 * ((a + b) * ((b - a) * sin((pi * (angle * 0.005555555555555556)))));
	else
		tmp = 2.0 * (((a + b) * (b - a)) * (sin((pi * (angle / 180.0))) * cos((pi * (angle * -0.005555555555555556)))));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-82], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(Pi * N[(angle * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-82}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\

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


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

    1. Initial program 60.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*60.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. associate-*l*60.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-82 < (/.f64 angle 180)

    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. associate-*l*44.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 67.2% accurate, 1.5× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-82}:\\ \;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (if (<= (/ angle 180.0) 2e-82)
   (* 2.0 (* (+ a b) (* (- b a) (sin (* PI (* angle 0.005555555555555556))))))
   (*
    2.0
    (*
     (* (+ a b) (- b a))
     (* (sin (* PI (/ angle 180.0))) (cos (* angle (/ PI -180.0))))))))
b = abs(b);
double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= 2e-82) {
		tmp = 2.0 * ((a + b) * ((b - a) * sin((((double) M_PI) * (angle * 0.005555555555555556)))));
	} else {
		tmp = 2.0 * (((a + b) * (b - a)) * (sin((((double) M_PI) * (angle / 180.0))) * cos((angle * (((double) M_PI) / -180.0)))));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= 2e-82) {
		tmp = 2.0 * ((a + b) * ((b - a) * Math.sin((Math.PI * (angle * 0.005555555555555556)))));
	} else {
		tmp = 2.0 * (((a + b) * (b - a)) * (Math.sin((Math.PI * (angle / 180.0))) * Math.cos((angle * (Math.PI / -180.0)))));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	tmp = 0
	if (angle / 180.0) <= 2e-82:
		tmp = 2.0 * ((a + b) * ((b - a) * math.sin((math.pi * (angle * 0.005555555555555556)))))
	else:
		tmp = 2.0 * (((a + b) * (b - a)) * (math.sin((math.pi * (angle / 180.0))) * math.cos((angle * (math.pi / -180.0)))))
	return tmp
b = abs(b)
function code(a, b, angle)
	tmp = 0.0
	if (Float64(angle / 180.0) <= 2e-82)
		tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(pi * Float64(angle * 0.005555555555555556))))));
	else
		tmp = Float64(2.0 * Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(sin(Float64(pi * Float64(angle / 180.0))) * cos(Float64(angle * Float64(pi / -180.0))))));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if ((angle / 180.0) <= 2e-82)
		tmp = 2.0 * ((a + b) * ((b - a) * sin((pi * (angle * 0.005555555555555556)))));
	else
		tmp = 2.0 * (((a + b) * (b - a)) * (sin((pi * (angle / 180.0))) * cos((angle * (pi / -180.0)))));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-82], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-82}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\

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


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

    1. Initial program 60.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*60.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. associate-*l*60.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-82 < (/.f64 angle 180)

    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. associate-*l*44.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 65.5% accurate, 1.9× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-5}:\\ \;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+110}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(angle \cdot \left(a - b\right)\right) \cdot \left(\left(a + b\right) \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({a}^{2} - {b}^{2}\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (if (<= (/ angle 180.0) -5e-5)
   (* 2.0 (* (* (+ a b) (- b a)) (sin (* PI (/ angle 180.0)))))
   (if (<= (/ angle 180.0) 5e+110)
     (* -0.011111111111111112 (* (* angle (- a b)) (* (+ a b) PI)))
     (* 0.011111111111111112 (* angle (* PI (- (pow a 2.0) (pow b 2.0))))))))
b = abs(b);
double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= -5e-5) {
		tmp = 2.0 * (((a + b) * (b - a)) * sin((((double) M_PI) * (angle / 180.0))));
	} else if ((angle / 180.0) <= 5e+110) {
		tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * ((double) M_PI)));
	} else {
		tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (pow(a, 2.0) - pow(b, 2.0))));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= -5e-5) {
		tmp = 2.0 * (((a + b) * (b - a)) * Math.sin((Math.PI * (angle / 180.0))));
	} else if ((angle / 180.0) <= 5e+110) {
		tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * Math.PI));
	} else {
		tmp = 0.011111111111111112 * (angle * (Math.PI * (Math.pow(a, 2.0) - Math.pow(b, 2.0))));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	tmp = 0
	if (angle / 180.0) <= -5e-5:
		tmp = 2.0 * (((a + b) * (b - a)) * math.sin((math.pi * (angle / 180.0))))
	elif (angle / 180.0) <= 5e+110:
		tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * math.pi))
	else:
		tmp = 0.011111111111111112 * (angle * (math.pi * (math.pow(a, 2.0) - math.pow(b, 2.0))))
	return tmp
b = abs(b)
function code(a, b, angle)
	tmp = 0.0
	if (Float64(angle / 180.0) <= -5e-5)
		tmp = Float64(2.0 * Float64(Float64(Float64(a + b) * Float64(b - a)) * sin(Float64(pi * Float64(angle / 180.0)))));
	elseif (Float64(angle / 180.0) <= 5e+110)
		tmp = Float64(-0.011111111111111112 * Float64(Float64(angle * Float64(a - b)) * Float64(Float64(a + b) * pi)));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64((a ^ 2.0) - (b ^ 2.0)))));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if ((angle / 180.0) <= -5e-5)
		tmp = 2.0 * (((a + b) * (b - a)) * sin((pi * (angle / 180.0))));
	elseif ((angle / 180.0) <= 5e+110)
		tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * pi));
	else
		tmp = 0.011111111111111112 * (angle * (pi * ((a ^ 2.0) - (b ^ 2.0))));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e-5], N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+110], N[(-0.011111111111111112 * N[(N[(angle * N[(a - b), $MachinePrecision]), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[Power[a, 2.0], $MachinePrecision] - N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-5}:\\
\;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\\

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

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


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

    1. Initial program 40.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*40.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. associate-*l*40.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000024e-5 < (/.f64 angle 180) < 4.99999999999999978e110

    1. Initial program 67.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. Simplified68.2%

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

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

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

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

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

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

        \[\leadsto -0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)\right)} \]
      2. expm1-udef33.7%

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

        \[\leadsto -0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(angle \cdot \color{blue}{\left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)}\right)} - 1\right) \]
    7. Applied egg-rr33.7%

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

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

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

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

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

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

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

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

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

    if 4.99999999999999978e110 < (/.f64 angle 180)

    1. Initial program 36.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. Simplified40.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\log \left(2 \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left({a}^{2} - {b}^{2}\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}} \]
    5. Taylor expanded in angle around 0 34.0%

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

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

Alternative 8: 66.0% accurate, 2.8× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-5}:\\ \;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+112}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(angle \cdot \left(a - b\right)\right) \cdot \left(\left(a + b\right) \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left|-0.011111111111111112 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right|\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (if (<= (/ angle 180.0) -5e-5)
   (* 2.0 (* (* (+ a b) (- b a)) (sin (* PI (/ angle 180.0)))))
   (if (<= (/ angle 180.0) 2e+112)
     (* -0.011111111111111112 (* (* angle (- a b)) (* (+ a b) PI)))
     (fabs (* -0.011111111111111112 (* (* angle PI) (* (+ a b) (- a b))))))))
b = abs(b);
double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= -5e-5) {
		tmp = 2.0 * (((a + b) * (b - a)) * sin((((double) M_PI) * (angle / 180.0))));
	} else if ((angle / 180.0) <= 2e+112) {
		tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * ((double) M_PI)));
	} else {
		tmp = fabs((-0.011111111111111112 * ((angle * ((double) M_PI)) * ((a + b) * (a - b)))));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= -5e-5) {
		tmp = 2.0 * (((a + b) * (b - a)) * Math.sin((Math.PI * (angle / 180.0))));
	} else if ((angle / 180.0) <= 2e+112) {
		tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * Math.PI));
	} else {
		tmp = Math.abs((-0.011111111111111112 * ((angle * Math.PI) * ((a + b) * (a - b)))));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	tmp = 0
	if (angle / 180.0) <= -5e-5:
		tmp = 2.0 * (((a + b) * (b - a)) * math.sin((math.pi * (angle / 180.0))))
	elif (angle / 180.0) <= 2e+112:
		tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * math.pi))
	else:
		tmp = math.fabs((-0.011111111111111112 * ((angle * math.pi) * ((a + b) * (a - b)))))
	return tmp
b = abs(b)
function code(a, b, angle)
	tmp = 0.0
	if (Float64(angle / 180.0) <= -5e-5)
		tmp = Float64(2.0 * Float64(Float64(Float64(a + b) * Float64(b - a)) * sin(Float64(pi * Float64(angle / 180.0)))));
	elseif (Float64(angle / 180.0) <= 2e+112)
		tmp = Float64(-0.011111111111111112 * Float64(Float64(angle * Float64(a - b)) * Float64(Float64(a + b) * pi)));
	else
		tmp = abs(Float64(-0.011111111111111112 * Float64(Float64(angle * pi) * Float64(Float64(a + b) * Float64(a - b)))));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if ((angle / 180.0) <= -5e-5)
		tmp = 2.0 * (((a + b) * (b - a)) * sin((pi * (angle / 180.0))));
	elseif ((angle / 180.0) <= 2e+112)
		tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * pi));
	else
		tmp = abs((-0.011111111111111112 * ((angle * pi) * ((a + b) * (a - b)))));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e-5], N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+112], N[(-0.011111111111111112 * N[(N[(angle * N[(a - b), $MachinePrecision]), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(-0.011111111111111112 * N[(N[(angle * Pi), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-5}:\\
\;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\\

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

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


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

    1. Initial program 40.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*40.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. associate-*l*40.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000024e-5 < (/.f64 angle 180) < 1.9999999999999999e112

    1. Initial program 66.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. Simplified67.7%

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

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

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

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

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

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

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

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

        \[\leadsto -0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(angle \cdot \color{blue}{\left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)}\right)} - 1\right) \]
    7. Applied egg-rr33.5%

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

        \[\leadsto -0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)\right)\right)} \]
      2. expm1-log1p75.7%

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

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

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

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

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

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

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

    if 1.9999999999999999e112 < (/.f64 angle 180)

    1. Initial program 37.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. Simplified41.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 55.3% accurate, 2.9× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} t_0 := \left(a + b\right) \cdot \left(a - b\right)\\ t_1 := \left(angle \cdot \pi\right) \cdot t_0\\ \mathbf{if}\;angle \leq -3.9 \cdot 10^{+19}:\\ \;\;\;\;-0.011111111111111112 \cdot \left|t_1\right|\\ \mathbf{elif}\;angle \leq 2.7 \cdot 10^{+116}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot t_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left|-0.011111111111111112 \cdot t_1\right|\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (+ a b) (- a b))) (t_1 (* (* angle PI) t_0)))
   (if (<= angle -3.9e+19)
     (* -0.011111111111111112 (fabs t_1))
     (if (<= angle 2.7e+116)
       (* -0.011111111111111112 (* angle (* PI t_0)))
       (fabs (* -0.011111111111111112 t_1))))))
b = abs(b);
double code(double a, double b, double angle) {
	double t_0 = (a + b) * (a - b);
	double t_1 = (angle * ((double) M_PI)) * t_0;
	double tmp;
	if (angle <= -3.9e+19) {
		tmp = -0.011111111111111112 * fabs(t_1);
	} else if (angle <= 2.7e+116) {
		tmp = -0.011111111111111112 * (angle * (((double) M_PI) * t_0));
	} else {
		tmp = fabs((-0.011111111111111112 * t_1));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double t_0 = (a + b) * (a - b);
	double t_1 = (angle * Math.PI) * t_0;
	double tmp;
	if (angle <= -3.9e+19) {
		tmp = -0.011111111111111112 * Math.abs(t_1);
	} else if (angle <= 2.7e+116) {
		tmp = -0.011111111111111112 * (angle * (Math.PI * t_0));
	} else {
		tmp = Math.abs((-0.011111111111111112 * t_1));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	t_0 = (a + b) * (a - b)
	t_1 = (angle * math.pi) * t_0
	tmp = 0
	if angle <= -3.9e+19:
		tmp = -0.011111111111111112 * math.fabs(t_1)
	elif angle <= 2.7e+116:
		tmp = -0.011111111111111112 * (angle * (math.pi * t_0))
	else:
		tmp = math.fabs((-0.011111111111111112 * t_1))
	return tmp
b = abs(b)
function code(a, b, angle)
	t_0 = Float64(Float64(a + b) * Float64(a - b))
	t_1 = Float64(Float64(angle * pi) * t_0)
	tmp = 0.0
	if (angle <= -3.9e+19)
		tmp = Float64(-0.011111111111111112 * abs(t_1));
	elseif (angle <= 2.7e+116)
		tmp = Float64(-0.011111111111111112 * Float64(angle * Float64(pi * t_0)));
	else
		tmp = abs(Float64(-0.011111111111111112 * t_1));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	t_0 = (a + b) * (a - b);
	t_1 = (angle * pi) * t_0;
	tmp = 0.0;
	if (angle <= -3.9e+19)
		tmp = -0.011111111111111112 * abs(t_1);
	elseif (angle <= 2.7e+116)
		tmp = -0.011111111111111112 * (angle * (pi * t_0));
	else
		tmp = abs((-0.011111111111111112 * t_1));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle * Pi), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[angle, -3.9e+19], N[(-0.011111111111111112 * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 2.7e+116], N[(-0.011111111111111112 * N[(angle * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(-0.011111111111111112 * t$95$1), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(a - b\right)\\
t_1 := \left(angle \cdot \pi\right) \cdot t_0\\
\mathbf{if}\;angle \leq -3.9 \cdot 10^{+19}:\\
\;\;\;\;-0.011111111111111112 \cdot \left|t_1\right|\\

\mathbf{elif}\;angle \leq 2.7 \cdot 10^{+116}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot t_0\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left|-0.011111111111111112 \cdot t_1\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if angle < -3.9e19

    1. Initial program 36.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. Simplified38.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.9e19 < angle < 2.7e116

    1. Initial program 67.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. Simplified68.5%

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

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

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

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

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

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

    if 2.7e116 < angle

    1. Initial program 37.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. Simplified41.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;angle \leq -3.9 \cdot 10^{+19}:\\ \;\;\;\;-0.011111111111111112 \cdot \left|\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right|\\ \mathbf{elif}\;angle \leq 2.7 \cdot 10^{+116}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left|-0.011111111111111112 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right|\\ \end{array} \]

Alternative 10: 65.3% accurate, 2.9× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} t_0 := \left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\\ \mathbf{if}\;angle \leq -3.9 \cdot 10^{+19}:\\ \;\;\;\;-0.011111111111111112 \cdot \left|t_0\right|\\ \mathbf{elif}\;angle \leq 2.7 \cdot 10^{+116}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(angle \cdot \left(a - b\right)\right) \cdot \left(\left(a + b\right) \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left|-0.011111111111111112 \cdot t_0\right|\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (* angle PI) (* (+ a b) (- a b)))))
   (if (<= angle -3.9e+19)
     (* -0.011111111111111112 (fabs t_0))
     (if (<= angle 2.7e+116)
       (* -0.011111111111111112 (* (* angle (- a b)) (* (+ a b) PI)))
       (fabs (* -0.011111111111111112 t_0))))))
b = abs(b);
double code(double a, double b, double angle) {
	double t_0 = (angle * ((double) M_PI)) * ((a + b) * (a - b));
	double tmp;
	if (angle <= -3.9e+19) {
		tmp = -0.011111111111111112 * fabs(t_0);
	} else if (angle <= 2.7e+116) {
		tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * ((double) M_PI)));
	} else {
		tmp = fabs((-0.011111111111111112 * t_0));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double t_0 = (angle * Math.PI) * ((a + b) * (a - b));
	double tmp;
	if (angle <= -3.9e+19) {
		tmp = -0.011111111111111112 * Math.abs(t_0);
	} else if (angle <= 2.7e+116) {
		tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * Math.PI));
	} else {
		tmp = Math.abs((-0.011111111111111112 * t_0));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	t_0 = (angle * math.pi) * ((a + b) * (a - b))
	tmp = 0
	if angle <= -3.9e+19:
		tmp = -0.011111111111111112 * math.fabs(t_0)
	elif angle <= 2.7e+116:
		tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * math.pi))
	else:
		tmp = math.fabs((-0.011111111111111112 * t_0))
	return tmp
b = abs(b)
function code(a, b, angle)
	t_0 = Float64(Float64(angle * pi) * Float64(Float64(a + b) * Float64(a - b)))
	tmp = 0.0
	if (angle <= -3.9e+19)
		tmp = Float64(-0.011111111111111112 * abs(t_0));
	elseif (angle <= 2.7e+116)
		tmp = Float64(-0.011111111111111112 * Float64(Float64(angle * Float64(a - b)) * Float64(Float64(a + b) * pi)));
	else
		tmp = abs(Float64(-0.011111111111111112 * t_0));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	t_0 = (angle * pi) * ((a + b) * (a - b));
	tmp = 0.0;
	if (angle <= -3.9e+19)
		tmp = -0.011111111111111112 * abs(t_0);
	elseif (angle <= 2.7e+116)
		tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * pi));
	else
		tmp = abs((-0.011111111111111112 * t_0));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle * Pi), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[angle, -3.9e+19], N[(-0.011111111111111112 * N[Abs[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 2.7e+116], N[(-0.011111111111111112 * N[(N[(angle * N[(a - b), $MachinePrecision]), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(-0.011111111111111112 * t$95$0), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\\
\mathbf{if}\;angle \leq -3.9 \cdot 10^{+19}:\\
\;\;\;\;-0.011111111111111112 \cdot \left|t_0\right|\\

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

\mathbf{else}:\\
\;\;\;\;\left|-0.011111111111111112 \cdot t_0\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if angle < -3.9e19

    1. Initial program 36.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. Simplified38.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.9e19 < angle < 2.7e116

    1. Initial program 67.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. Simplified68.5%

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

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

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

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

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

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

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

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

        \[\leadsto -0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(angle \cdot \color{blue}{\left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)}\right)} - 1\right) \]
    7. Applied egg-rr33.5%

      \[\leadsto -0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)\right)} - 1\right)} \]
    8. Step-by-step derivation
      1. expm1-def56.4%

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

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

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

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

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

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

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

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

    if 2.7e116 < angle

    1. Initial program 37.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. Simplified41.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;angle \leq -3.9 \cdot 10^{+19}:\\ \;\;\;\;-0.011111111111111112 \cdot \left|\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right|\\ \mathbf{elif}\;angle \leq 2.7 \cdot 10^{+116}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(angle \cdot \left(a - b\right)\right) \cdot \left(\left(a + b\right) \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left|-0.011111111111111112 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right|\\ \end{array} \]

Alternative 11: 55.2% accurate, 2.9× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} t_0 := \left(a + b\right) \cdot \left(a - b\right)\\ \mathbf{if}\;angle \leq 2.7 \cdot 10^{+116}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot t_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left|-0.011111111111111112 \cdot \left(\left(angle \cdot \pi\right) \cdot t_0\right)\right|\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (+ a b) (- a b))))
   (if (<= angle 2.7e+116)
     (* -0.011111111111111112 (* angle (* PI t_0)))
     (fabs (* -0.011111111111111112 (* (* angle PI) t_0))))))
b = abs(b);
double code(double a, double b, double angle) {
	double t_0 = (a + b) * (a - b);
	double tmp;
	if (angle <= 2.7e+116) {
		tmp = -0.011111111111111112 * (angle * (((double) M_PI) * t_0));
	} else {
		tmp = fabs((-0.011111111111111112 * ((angle * ((double) M_PI)) * t_0)));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double t_0 = (a + b) * (a - b);
	double tmp;
	if (angle <= 2.7e+116) {
		tmp = -0.011111111111111112 * (angle * (Math.PI * t_0));
	} else {
		tmp = Math.abs((-0.011111111111111112 * ((angle * Math.PI) * t_0)));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	t_0 = (a + b) * (a - b)
	tmp = 0
	if angle <= 2.7e+116:
		tmp = -0.011111111111111112 * (angle * (math.pi * t_0))
	else:
		tmp = math.fabs((-0.011111111111111112 * ((angle * math.pi) * t_0)))
	return tmp
b = abs(b)
function code(a, b, angle)
	t_0 = Float64(Float64(a + b) * Float64(a - b))
	tmp = 0.0
	if (angle <= 2.7e+116)
		tmp = Float64(-0.011111111111111112 * Float64(angle * Float64(pi * t_0)));
	else
		tmp = abs(Float64(-0.011111111111111112 * Float64(Float64(angle * pi) * t_0)));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	t_0 = (a + b) * (a - b);
	tmp = 0.0;
	if (angle <= 2.7e+116)
		tmp = -0.011111111111111112 * (angle * (pi * t_0));
	else
		tmp = abs((-0.011111111111111112 * ((angle * pi) * t_0)));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[angle, 2.7e+116], N[(-0.011111111111111112 * N[(angle * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(-0.011111111111111112 * N[(N[(angle * Pi), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(a - b\right)\\
\mathbf{if}\;angle \leq 2.7 \cdot 10^{+116}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot t_0\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left|-0.011111111111111112 \cdot \left(\left(angle \cdot \pi\right) \cdot t_0\right)\right|\\


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

    1. Initial program 59.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. Simplified60.3%

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

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

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

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

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

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

    if 2.7e116 < angle

    1. Initial program 37.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. Simplified41.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;angle \leq 2.7 \cdot 10^{+116}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left|-0.011111111111111112 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right|\\ \end{array} \]

Alternative 12: 67.2% accurate, 2.9× speedup?

\[\begin{array}{l} b = |b|\\ \\ 2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (* 2.0 (* (+ a b) (* (- b a) (sin (* PI (* angle 0.005555555555555556)))))))
b = abs(b);
double code(double a, double b, double angle) {
	return 2.0 * ((a + b) * ((b - a) * sin((((double) M_PI) * (angle * 0.005555555555555556)))));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	return 2.0 * ((a + b) * ((b - a) * Math.sin((Math.PI * (angle * 0.005555555555555556)))));
}
b = abs(b)
def code(a, b, angle):
	return 2.0 * ((a + b) * ((b - a) * math.sin((math.pi * (angle * 0.005555555555555556)))))
b = abs(b)
function code(a, b, angle)
	return Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(pi * Float64(angle * 0.005555555555555556))))))
end
b = abs(b)
function tmp = code(a, b, angle)
	tmp = 2.0 * ((a + b) * ((b - a) * sin((pi * (angle * 0.005555555555555556)))));
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 56.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*56.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. associate-*l*56.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 43.7% accurate, 5.5× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} \mathbf{if}\;a \leq 12.8:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\left(a - b\right) \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\left(a - b\right) \cdot \left(a \cdot \pi\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (if (<= a 12.8)
   (* -0.011111111111111112 (* angle (* (- a b) (* b PI))))
   (* -0.011111111111111112 (* angle (* (- a b) (* a PI))))))
b = abs(b);
double code(double a, double b, double angle) {
	double tmp;
	if (a <= 12.8) {
		tmp = -0.011111111111111112 * (angle * ((a - b) * (b * ((double) M_PI))));
	} else {
		tmp = -0.011111111111111112 * (angle * ((a - b) * (a * ((double) M_PI))));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double tmp;
	if (a <= 12.8) {
		tmp = -0.011111111111111112 * (angle * ((a - b) * (b * Math.PI)));
	} else {
		tmp = -0.011111111111111112 * (angle * ((a - b) * (a * Math.PI)));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	tmp = 0
	if a <= 12.8:
		tmp = -0.011111111111111112 * (angle * ((a - b) * (b * math.pi)))
	else:
		tmp = -0.011111111111111112 * (angle * ((a - b) * (a * math.pi)))
	return tmp
b = abs(b)
function code(a, b, angle)
	tmp = 0.0
	if (a <= 12.8)
		tmp = Float64(-0.011111111111111112 * Float64(angle * Float64(Float64(a - b) * Float64(b * pi))));
	else
		tmp = Float64(-0.011111111111111112 * Float64(angle * Float64(Float64(a - b) * Float64(a * pi))));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (a <= 12.8)
		tmp = -0.011111111111111112 * (angle * ((a - b) * (b * pi)));
	else
		tmp = -0.011111111111111112 * (angle * ((a - b) * (a * pi)));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := If[LessEqual[a, 12.8], N[(-0.011111111111111112 * N[(angle * N[(N[(a - b), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(angle * N[(N[(a - b), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 12.8:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\left(a - b\right) \cdot \left(b \cdot \pi\right)\right)\right)\\

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


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

    1. Initial program 57.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(angle \cdot \color{blue}{\left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)}\right)} - 1\right) \]
    7. Applied egg-rr30.4%

      \[\leadsto -0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)\right)} - 1\right)} \]
    8. Step-by-step derivation
      1. expm1-def45.5%

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

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

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

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

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

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

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

    if 12.800000000000001 < a

    1. Initial program 53.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(angle \cdot \color{blue}{\left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)}\right)} - 1\right) \]
    7. Applied egg-rr24.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 12.8:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\left(a - b\right) \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\left(a - b\right) \cdot \left(a \cdot \pi\right)\right)\right)\\ \end{array} \]

Alternative 14: 54.8% accurate, 5.5× speedup?

\[\begin{array}{l} b = |b|\\ \\ -0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (* -0.011111111111111112 (* angle (* PI (* (+ a b) (- a b))))))
b = abs(b);
double code(double a, double b, double angle) {
	return -0.011111111111111112 * (angle * (((double) M_PI) * ((a + b) * (a - b))));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	return -0.011111111111111112 * (angle * (Math.PI * ((a + b) * (a - b))));
}
b = abs(b)
def code(a, b, angle):
	return -0.011111111111111112 * (angle * (math.pi * ((a + b) * (a - b))))
b = abs(b)
function code(a, b, angle)
	return Float64(-0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(a + b) * Float64(a - b)))))
end
b = abs(b)
function tmp = code(a, b, angle)
	tmp = -0.011111111111111112 * (angle * (pi * ((a + b) * (a - b))));
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := N[(-0.011111111111111112 * N[(angle * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 56.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. Simplified57.6%

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

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

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

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

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

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

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

Alternative 15: 37.7% accurate, 5.6× speedup?

\[\begin{array}{l} b = |b|\\ \\ -0.011111111111111112 \cdot \left(angle \cdot \left(\left(a - b\right) \cdot \left(a \cdot \pi\right)\right)\right) \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (* -0.011111111111111112 (* angle (* (- a b) (* a PI)))))
b = abs(b);
double code(double a, double b, double angle) {
	return -0.011111111111111112 * (angle * ((a - b) * (a * ((double) M_PI))));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	return -0.011111111111111112 * (angle * ((a - b) * (a * Math.PI)));
}
b = abs(b)
def code(a, b, angle):
	return -0.011111111111111112 * (angle * ((a - b) * (a * math.pi)))
b = abs(b)
function code(a, b, angle)
	return Float64(-0.011111111111111112 * Float64(angle * Float64(Float64(a - b) * Float64(a * pi))))
end
b = abs(b)
function tmp = code(a, b, angle)
	tmp = -0.011111111111111112 * (angle * ((a - b) * (a * pi)));
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := N[(-0.011111111111111112 * N[(angle * N[(N[(a - b), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
-0.011111111111111112 \cdot \left(angle \cdot \left(\left(a - b\right) \cdot \left(a \cdot \pi\right)\right)\right)
\end{array}
Derivation
  1. Initial program 56.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. Simplified57.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto -0.011111111111111112 \cdot \left(angle \cdot \left(\left(a - b\right) \cdot \left(a \cdot \pi\right)\right)\right) \]

Reproduce

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