ab-angle->ABCF B

Percentage Accurate: 53.5% → 67.0%
Time: 37.7s
Alternatives: 9
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 9 alternatives:

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

Initial Program: 53.5% accurate, 1.0× speedup?

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

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

Alternative 1: 67.0% accurate, 1.0× speedup?

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

\mathbf{elif}\;\frac{angle}{180} \leq 0.2:\\
\;\;\;\;\left(2 \cdot \left(\left(\sin \left(\frac{angle}{\frac{180}{\pi}}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\right) \cdot t_2\\

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

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


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

    1. Initial program 30.6%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Simplified23.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. unpow223.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. unpow223.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-squares24.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 \color{blue}{\left(\left(a + b\right) \cdot \left(a - b\right)\right)}\right) \]
    4. Applied egg-rr24.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 \color{blue}{\left(\left(a + b\right) \cdot \left(a - b\right)\right)}\right) \]
    5. Step-by-step derivation
      1. add-sqr-sqrt41.5%

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

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

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

    if -1.99999999999999989e49 < (/.f64 angle 180) < 0.20000000000000001

    1. Initial program 70.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. unpow270.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.20000000000000001 < (/.f64 angle 180) < 1.99999999999999988e166

    1. Initial program 12.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. Simplified20.4%

      \[\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. unpow220.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 \left(\color{blue}{a \cdot a} - {b}^{2}\right)\right) \]
      2. unpow220.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 \left(a \cdot a - \color{blue}{b \cdot b}\right)\right) \]
      3. difference-of-squares23.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-rr23.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. Step-by-step derivation
      1. add-cbrt-cube37.7%

        \[\leadsto \left(2 \cdot \sin \left(angle \cdot \frac{\color{blue}{\sqrt[3]{\left(\pi \cdot \pi\right) \cdot \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) \]
      2. pow337.7%

        \[\leadsto \left(2 \cdot \sin \left(angle \cdot \frac{\sqrt[3]{\color{blue}{{\pi}^{3}}}}{-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. Applied egg-rr37.7%

      \[\leadsto \left(2 \cdot \sin \left(angle \cdot \frac{\color{blue}{\sqrt[3]{{\pi}^{3}}}}{-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) \]

    if 1.99999999999999988e166 < (/.f64 angle 180)

    1. Initial program 44.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. unpow244.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{+49}:\\ \;\;\;\;\left(2 \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right) \cdot \left(\cos \left(angle \cdot \frac{{\left(\sqrt{\pi}\right)}^{2}}{-180}\right) \cdot \left(\left(a - b\right) \cdot \left(a + b\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 0.2:\\ \;\;\;\;\left(2 \cdot \left(\left(\sin \left(\frac{angle}{\frac{180}{\pi}}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+166}:\\ \;\;\;\;\left(2 \cdot \sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\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{else}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(2 \cdot \left(\left(b - a\right) \cdot \left(\left(a + b\right) \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right)\right)\right)\\ \end{array} \]

Alternative 2: 66.5% accurate, 1.0× speedup?

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

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


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

    1. Initial program 30.6%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Simplified23.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. unpow223.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. unpow223.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-squares24.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 \color{blue}{\left(\left(a + b\right) \cdot \left(a - b\right)\right)}\right) \]
    4. Applied egg-rr24.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 \color{blue}{\left(\left(a + b\right) \cdot \left(a - b\right)\right)}\right) \]
    5. Step-by-step derivation
      1. add-sqr-sqrt41.5%

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

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

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

    if -1.99999999999999989e49 < (/.f64 angle 180)

    1. Initial program 58.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. unpow258.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 65.1% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 33.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. unpow233.2%

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

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

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

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

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

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

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

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

    if -5.0000000000000002e137 < (/.f64 angle 180) < 9.9999999999999998e-67

    1. Initial program 63.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. unpow263.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999998e-67 < (/.f64 angle 180)

    1. Initial program 35.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. Simplified38.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. unpow238.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. unpow238.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.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-rr41.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) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification68.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{+137}:\\ \;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{-66}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(2 \cdot \left(\left(b - a\right) \cdot \left(\left(a + b\right) \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \sin \left(angle \cdot \frac{\pi}{-180}\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)\\ \end{array} \]

Alternative 4: 66.7% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 64.2% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 33.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. unpow233.2%

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

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

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

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

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

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

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

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

    if -5.0000000000000002e137 < (/.f64 angle 180) < 4.0000000000000002e-33

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.0000000000000002e-33 < (/.f64 angle 180)

    1. Initial program 31.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. *-commutative31.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left({\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
    6. Taylor expanded in angle around inf 31.6%

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

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

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

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

Alternative 6: 64.2% accurate, 1.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 angle 180) < -5.0000000000000002e137 or 2e46 < (/.f64 angle 180)

    1. Initial program 31.6%

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

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

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

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

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

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

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

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

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

    if -5.0000000000000002e137 < (/.f64 angle 180) < 2e46

    1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 62.7% accurate, 2.7× speedup?

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

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


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

    1. Initial program 43.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. unpow243.1%

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

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

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

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

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

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

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

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

    if -2e-136 < (/.f64 angle 180) < 1.99999999999999998e-95

    1. Initial program 68.8%

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

      \[\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.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 \left(\color{blue}{a \cdot a} - {b}^{2}\right)\right) \]
      2. unpow268.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 \left(a \cdot a - \color{blue}{b \cdot b}\right)\right) \]
      3. difference-of-squares69.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-rr69.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 69.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. *-commutative69.1%

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

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

        \[\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)} \]
      4. +-commutative69.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 55.1% accurate, 2.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 53.8% accurate, 5.5× speedup?

\[\begin{array}{l} a = |a|\\ 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: a should be positive before calling this function
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (* -0.011111111111111112 (* angle (* PI (* (- a b) (+ a b))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
	return -0.011111111111111112 * (angle * (((double) M_PI) * ((a - b) * (a + b))));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	return -0.011111111111111112 * (angle * (Math.PI * ((a - b) * (a + b))));
}
a = abs(a)
b = abs(b)
def code(a, b, angle):
	return -0.011111111111111112 * (angle * (math.pi * ((a - b) * (a + b))))
a = abs(a)
b = abs(b)
function code(a, b, angle)
	return Float64(-0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(a - b) * Float64(a + b)))))
end
a = abs(a)
b = abs(b)
function tmp = code(a, b, angle)
	tmp = -0.011111111111111112 * (angle * (pi * ((a - b) * (a + b))));
end
NOTE: a should be positive before calling this function
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}
a = |a|\\
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 51.6%

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. Simplified50.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. Taylor expanded in angle around 0 47.0%

    \[\leadsto \color{blue}{-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({a}^{2} - {b}^{2}\right)\right)\right)} \]
  4. Step-by-step derivation
    1. unpow250.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. unpow250.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-squares54.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 \color{blue}{\left(\left(a + b\right) \cdot \left(a - b\right)\right)}\right) \]
  5. Applied egg-rr50.6%

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

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

Reproduce

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