ab-angle->ABCF B

Percentage Accurate: 75.5% → 95.8%
Time: 30.4s
Alternatives: 8
Speedup: 27.9×

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 8 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: 75.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: 95.8% accurate, 1.9× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ 2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(\left(\left(b\_m - a\_m\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\right) \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
(FPCore (a_m b_m angle)
 :precision binary64
 (*
  2.0
  (*
   (+ a_m b_m)
   (*
    (* (- b_m a_m) (sin (* angle (* PI 0.005555555555555556))))
    (cos (* angle (* PI -0.005555555555555556)))))))
a_m = fabs(a);
b_m = fabs(b);
double code(double a_m, double b_m, double angle) {
	return 2.0 * ((a_m + b_m) * (((b_m - a_m) * sin((angle * (((double) M_PI) * 0.005555555555555556)))) * cos((angle * (((double) M_PI) * -0.005555555555555556)))));
}
a_m = Math.abs(a);
b_m = Math.abs(b);
public static double code(double a_m, double b_m, double angle) {
	return 2.0 * ((a_m + b_m) * (((b_m - a_m) * Math.sin((angle * (Math.PI * 0.005555555555555556)))) * Math.cos((angle * (Math.PI * -0.005555555555555556)))));
}
a_m = math.fabs(a)
b_m = math.fabs(b)
def code(a_m, b_m, angle):
	return 2.0 * ((a_m + b_m) * (((b_m - a_m) * math.sin((angle * (math.pi * 0.005555555555555556)))) * math.cos((angle * (math.pi * -0.005555555555555556)))))
a_m = abs(a)
b_m = abs(b)
function code(a_m, b_m, angle)
	return Float64(2.0 * Float64(Float64(a_m + b_m) * Float64(Float64(Float64(b_m - a_m) * sin(Float64(angle * Float64(pi * 0.005555555555555556)))) * cos(Float64(angle * Float64(pi * -0.005555555555555556))))))
end
a_m = abs(a);
b_m = abs(b);
function tmp = code(a_m, b_m, angle)
	tmp = 2.0 * ((a_m + b_m) * (((b_m - a_m) * sin((angle * (pi * 0.005555555555555556)))) * cos((angle * (pi * -0.005555555555555556)))));
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
code[a$95$m_, b$95$m_, angle_] := N[(2.0 * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[Sin[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|

\\
2 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(\left(\left(b\_m - a\_m\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(\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) \cdot \cos \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)} \]
    2. *-commutative79.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 83.8% accurate, 1.3× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ \begin{array}{l} t_0 := \cos \left(angle \cdot \frac{\pi}{-180}\right)\\ \mathbf{if}\;{b\_m}^{2} - {a\_m}^{2} \leq -\infty:\\ \;\;\;\;2 \cdot \left(t\_0 \cdot \left(-0.005555555555555556 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(angle \cdot \left(\left(a\_m + b\_m\right) \cdot \pi\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t\_0 \cdot \left(\left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \left(\left(a\_m + b\_m\right) \cdot \left(a\_m - b\_m\right)\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
(FPCore (a_m b_m angle)
 :precision binary64
 (let* ((t_0 (cos (* angle (/ PI -180.0)))))
   (if (<= (- (pow b_m 2.0) (pow a_m 2.0)) (- INFINITY))
     (*
      2.0
      (*
       t_0
       (* -0.005555555555555556 (* (+ a_m b_m) (* angle (* (+ a_m b_m) PI))))))
     (*
      2.0
      (*
       t_0
       (*
        (* angle (* PI -0.005555555555555556))
        (* (+ a_m b_m) (- a_m b_m))))))))
a_m = fabs(a);
b_m = fabs(b);
double code(double a_m, double b_m, double angle) {
	double t_0 = cos((angle * (((double) M_PI) / -180.0)));
	double tmp;
	if ((pow(b_m, 2.0) - pow(a_m, 2.0)) <= -((double) INFINITY)) {
		tmp = 2.0 * (t_0 * (-0.005555555555555556 * ((a_m + b_m) * (angle * ((a_m + b_m) * ((double) M_PI))))));
	} else {
		tmp = 2.0 * (t_0 * ((angle * (((double) M_PI) * -0.005555555555555556)) * ((a_m + b_m) * (a_m - b_m))));
	}
	return tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
public static double code(double a_m, double b_m, double angle) {
	double t_0 = Math.cos((angle * (Math.PI / -180.0)));
	double tmp;
	if ((Math.pow(b_m, 2.0) - Math.pow(a_m, 2.0)) <= -Double.POSITIVE_INFINITY) {
		tmp = 2.0 * (t_0 * (-0.005555555555555556 * ((a_m + b_m) * (angle * ((a_m + b_m) * Math.PI)))));
	} else {
		tmp = 2.0 * (t_0 * ((angle * (Math.PI * -0.005555555555555556)) * ((a_m + b_m) * (a_m - b_m))));
	}
	return tmp;
}
a_m = math.fabs(a)
b_m = math.fabs(b)
def code(a_m, b_m, angle):
	t_0 = math.cos((angle * (math.pi / -180.0)))
	tmp = 0
	if (math.pow(b_m, 2.0) - math.pow(a_m, 2.0)) <= -math.inf:
		tmp = 2.0 * (t_0 * (-0.005555555555555556 * ((a_m + b_m) * (angle * ((a_m + b_m) * math.pi)))))
	else:
		tmp = 2.0 * (t_0 * ((angle * (math.pi * -0.005555555555555556)) * ((a_m + b_m) * (a_m - b_m))))
	return tmp
a_m = abs(a)
b_m = abs(b)
function code(a_m, b_m, angle)
	t_0 = cos(Float64(angle * Float64(pi / -180.0)))
	tmp = 0.0
	if (Float64((b_m ^ 2.0) - (a_m ^ 2.0)) <= Float64(-Inf))
		tmp = Float64(2.0 * Float64(t_0 * Float64(-0.005555555555555556 * Float64(Float64(a_m + b_m) * Float64(angle * Float64(Float64(a_m + b_m) * pi))))));
	else
		tmp = Float64(2.0 * Float64(t_0 * Float64(Float64(angle * Float64(pi * -0.005555555555555556)) * Float64(Float64(a_m + b_m) * Float64(a_m - b_m)))));
	end
	return tmp
end
a_m = abs(a);
b_m = abs(b);
function tmp_2 = code(a_m, b_m, angle)
	t_0 = cos((angle * (pi / -180.0)));
	tmp = 0.0;
	if (((b_m ^ 2.0) - (a_m ^ 2.0)) <= -Inf)
		tmp = 2.0 * (t_0 * (-0.005555555555555556 * ((a_m + b_m) * (angle * ((a_m + b_m) * pi)))));
	else
		tmp = 2.0 * (t_0 * ((angle * (pi * -0.005555555555555556)) * ((a_m + b_m) * (a_m - b_m))));
	end
	tmp_2 = tmp;
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
code[a$95$m_, b$95$m_, angle_] := Block[{t$95$0 = N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(2.0 * N[(t$95$0 * N[(-0.005555555555555556 * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(angle * N[(N[(a$95$m + b$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$0 * N[(N[(angle * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision] * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(a$95$m - b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|

\\
\begin{array}{l}
t_0 := \cos \left(angle \cdot \frac{\pi}{-180}\right)\\
\mathbf{if}\;{b\_m}^{2} - {a\_m}^{2} \leq -\infty:\\
\;\;\;\;2 \cdot \left(t\_0 \cdot \left(-0.005555555555555556 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(angle \cdot \left(\left(a\_m + b\_m\right) \cdot \pi\right)\right)\right)\right)\right)\\

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


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

    1. Initial program 62.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. Simplified62.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 80.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. Simplified80.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 84.9% accurate, 1.3× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ \begin{array}{l} t_0 := angle \cdot \frac{\pi}{-180}\\ t_1 := \cos t\_0\\ t_2 := \left(a\_m + b\_m\right) \cdot \left(angle \cdot \pi\right)\\ \mathbf{if}\;{a\_m}^{2} \leq 10^{+302}:\\ \;\;\;\;2 \cdot \left(t\_1 \cdot \left(\sin t\_0 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(a\_m - b\_m\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t\_1 \cdot \left(-0.005555555555555556 \cdot \left(a\_m \cdot t\_2 + b\_m \cdot t\_2\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
(FPCore (a_m b_m angle)
 :precision binary64
 (let* ((t_0 (* angle (/ PI -180.0)))
        (t_1 (cos t_0))
        (t_2 (* (+ a_m b_m) (* angle PI))))
   (if (<= (pow a_m 2.0) 1e+302)
     (* 2.0 (* t_1 (* (sin t_0) (* (+ a_m b_m) (- a_m b_m)))))
     (* 2.0 (* t_1 (* -0.005555555555555556 (+ (* a_m t_2) (* b_m t_2))))))))
a_m = fabs(a);
b_m = fabs(b);
double code(double a_m, double b_m, double angle) {
	double t_0 = angle * (((double) M_PI) / -180.0);
	double t_1 = cos(t_0);
	double t_2 = (a_m + b_m) * (angle * ((double) M_PI));
	double tmp;
	if (pow(a_m, 2.0) <= 1e+302) {
		tmp = 2.0 * (t_1 * (sin(t_0) * ((a_m + b_m) * (a_m - b_m))));
	} else {
		tmp = 2.0 * (t_1 * (-0.005555555555555556 * ((a_m * t_2) + (b_m * t_2))));
	}
	return tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
public static double code(double a_m, double b_m, double angle) {
	double t_0 = angle * (Math.PI / -180.0);
	double t_1 = Math.cos(t_0);
	double t_2 = (a_m + b_m) * (angle * Math.PI);
	double tmp;
	if (Math.pow(a_m, 2.0) <= 1e+302) {
		tmp = 2.0 * (t_1 * (Math.sin(t_0) * ((a_m + b_m) * (a_m - b_m))));
	} else {
		tmp = 2.0 * (t_1 * (-0.005555555555555556 * ((a_m * t_2) + (b_m * t_2))));
	}
	return tmp;
}
a_m = math.fabs(a)
b_m = math.fabs(b)
def code(a_m, b_m, angle):
	t_0 = angle * (math.pi / -180.0)
	t_1 = math.cos(t_0)
	t_2 = (a_m + b_m) * (angle * math.pi)
	tmp = 0
	if math.pow(a_m, 2.0) <= 1e+302:
		tmp = 2.0 * (t_1 * (math.sin(t_0) * ((a_m + b_m) * (a_m - b_m))))
	else:
		tmp = 2.0 * (t_1 * (-0.005555555555555556 * ((a_m * t_2) + (b_m * t_2))))
	return tmp
a_m = abs(a)
b_m = abs(b)
function code(a_m, b_m, angle)
	t_0 = Float64(angle * Float64(pi / -180.0))
	t_1 = cos(t_0)
	t_2 = Float64(Float64(a_m + b_m) * Float64(angle * pi))
	tmp = 0.0
	if ((a_m ^ 2.0) <= 1e+302)
		tmp = Float64(2.0 * Float64(t_1 * Float64(sin(t_0) * Float64(Float64(a_m + b_m) * Float64(a_m - b_m)))));
	else
		tmp = Float64(2.0 * Float64(t_1 * Float64(-0.005555555555555556 * Float64(Float64(a_m * t_2) + Float64(b_m * t_2)))));
	end
	return tmp
end
a_m = abs(a);
b_m = abs(b);
function tmp_2 = code(a_m, b_m, angle)
	t_0 = angle * (pi / -180.0);
	t_1 = cos(t_0);
	t_2 = (a_m + b_m) * (angle * pi);
	tmp = 0.0;
	if ((a_m ^ 2.0) <= 1e+302)
		tmp = 2.0 * (t_1 * (sin(t_0) * ((a_m + b_m) * (a_m - b_m))));
	else
		tmp = 2.0 * (t_1 * (-0.005555555555555556 * ((a_m * t_2) + (b_m * t_2))));
	end
	tmp_2 = tmp;
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
code[a$95$m_, b$95$m_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[a$95$m, 2.0], $MachinePrecision], 1e+302], N[(2.0 * N[(t$95$1 * N[(N[Sin[t$95$0], $MachinePrecision] * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(a$95$m - b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[(-0.005555555555555556 * N[(N[(a$95$m * t$95$2), $MachinePrecision] + N[(b$95$m * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|

\\
\begin{array}{l}
t_0 := angle \cdot \frac{\pi}{-180}\\
t_1 := \cos t\_0\\
t_2 := \left(a\_m + b\_m\right) \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;{a\_m}^{2} \leq 10^{+302}:\\
\;\;\;\;2 \cdot \left(t\_1 \cdot \left(\sin t\_0 \cdot \left(\left(a\_m + b\_m\right) \cdot \left(a\_m - b\_m\right)\right)\right)\right)\\

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


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

    1. Initial program 84.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. Simplified84.8%

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

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

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

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

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

    if 1.0000000000000001e302 < (pow.f64 a 2)

    1. Initial program 51.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. Simplified51.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 82.9% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 84.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. Simplified84.8%

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

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

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

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

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

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

    if 1.0000000000000001e302 < (pow.f64 a 2)

    1. Initial program 51.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. Simplified51.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 76.8% accurate, 3.5× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ 2 \cdot \left(\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(\left(a\_m - b\_m\right) \cdot \left(\left(a\_m + b\_m\right) \cdot \pi\right)\right)\right)\right)\right) \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
(FPCore (a_m b_m angle)
 :precision binary64
 (*
  2.0
  (*
   (cos (* angle (/ PI -180.0)))
   (* -0.005555555555555556 (* angle (* (- a_m b_m) (* (+ a_m b_m) PI)))))))
a_m = fabs(a);
b_m = fabs(b);
double code(double a_m, double b_m, double angle) {
	return 2.0 * (cos((angle * (((double) M_PI) / -180.0))) * (-0.005555555555555556 * (angle * ((a_m - b_m) * ((a_m + b_m) * ((double) M_PI))))));
}
a_m = Math.abs(a);
b_m = Math.abs(b);
public static double code(double a_m, double b_m, double angle) {
	return 2.0 * (Math.cos((angle * (Math.PI / -180.0))) * (-0.005555555555555556 * (angle * ((a_m - b_m) * ((a_m + b_m) * Math.PI)))));
}
a_m = math.fabs(a)
b_m = math.fabs(b)
def code(a_m, b_m, angle):
	return 2.0 * (math.cos((angle * (math.pi / -180.0))) * (-0.005555555555555556 * (angle * ((a_m - b_m) * ((a_m + b_m) * math.pi)))))
a_m = abs(a)
b_m = abs(b)
function code(a_m, b_m, angle)
	return Float64(2.0 * Float64(cos(Float64(angle * Float64(pi / -180.0))) * Float64(-0.005555555555555556 * Float64(angle * Float64(Float64(a_m - b_m) * Float64(Float64(a_m + b_m) * pi))))))
end
a_m = abs(a);
b_m = abs(b);
function tmp = code(a_m, b_m, angle)
	tmp = 2.0 * (cos((angle * (pi / -180.0))) * (-0.005555555555555556 * (angle * ((a_m - b_m) * ((a_m + b_m) * pi)))));
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
code[a$95$m_, b$95$m_, angle_] := N[(2.0 * N[(N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-0.005555555555555556 * N[(angle * N[(N[(a$95$m - b$95$m), $MachinePrecision] * N[(N[(a$95$m + b$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|

\\
2 \cdot \left(\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(\left(a\_m - b\_m\right) \cdot \left(\left(a\_m + b\_m\right) \cdot \pi\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto 2 \cdot \left(\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(\left(a - b\right) \cdot \left(\left(a + b\right) \cdot \pi\right)\right)\right)\right)\right) \]
  13. Add Preprocessing

Alternative 6: 77.0% accurate, 27.9× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ 2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right)\right)\right) \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
(FPCore (a_m b_m angle)
 :precision binary64
 (* 2.0 (* 0.005555555555555556 (* angle (* PI (* (+ a_m b_m) (- b_m a_m)))))))
a_m = fabs(a);
b_m = fabs(b);
double code(double a_m, double b_m, double angle) {
	return 2.0 * (0.005555555555555556 * (angle * (((double) M_PI) * ((a_m + b_m) * (b_m - a_m)))));
}
a_m = Math.abs(a);
b_m = Math.abs(b);
public static double code(double a_m, double b_m, double angle) {
	return 2.0 * (0.005555555555555556 * (angle * (Math.PI * ((a_m + b_m) * (b_m - a_m)))));
}
a_m = math.fabs(a)
b_m = math.fabs(b)
def code(a_m, b_m, angle):
	return 2.0 * (0.005555555555555556 * (angle * (math.pi * ((a_m + b_m) * (b_m - a_m)))))
a_m = abs(a)
b_m = abs(b)
function code(a_m, b_m, angle)
	return Float64(2.0 * Float64(0.005555555555555556 * Float64(angle * Float64(pi * Float64(Float64(a_m + b_m) * Float64(b_m - a_m))))))
end
a_m = abs(a);
b_m = abs(b);
function tmp = code(a_m, b_m, angle)
	tmp = 2.0 * (0.005555555555555556 * (angle * (pi * ((a_m + b_m) * (b_m - a_m)))));
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
code[a$95$m_, b$95$m_, angle_] := N[(2.0 * N[(0.005555555555555556 * N[(angle * N[(Pi * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|

\\
2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a\_m + b\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 77.3% accurate, 27.9× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ 2 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a\_m + b\_m\right) \cdot \left(\left(b\_m - a\_m\right) \cdot 0.005555555555555556\right)\right)\right)\right) \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
(FPCore (a_m b_m angle)
 :precision binary64
 (* 2.0 (* angle (* PI (* (+ a_m b_m) (* (- b_m a_m) 0.005555555555555556))))))
a_m = fabs(a);
b_m = fabs(b);
double code(double a_m, double b_m, double angle) {
	return 2.0 * (angle * (((double) M_PI) * ((a_m + b_m) * ((b_m - a_m) * 0.005555555555555556))));
}
a_m = Math.abs(a);
b_m = Math.abs(b);
public static double code(double a_m, double b_m, double angle) {
	return 2.0 * (angle * (Math.PI * ((a_m + b_m) * ((b_m - a_m) * 0.005555555555555556))));
}
a_m = math.fabs(a)
b_m = math.fabs(b)
def code(a_m, b_m, angle):
	return 2.0 * (angle * (math.pi * ((a_m + b_m) * ((b_m - a_m) * 0.005555555555555556))))
a_m = abs(a)
b_m = abs(b)
function code(a_m, b_m, angle)
	return Float64(2.0 * Float64(angle * Float64(pi * Float64(Float64(a_m + b_m) * Float64(Float64(b_m - a_m) * 0.005555555555555556)))))
end
a_m = abs(a);
b_m = abs(b);
function tmp = code(a_m, b_m, angle)
	tmp = 2.0 * (angle * (pi * ((a_m + b_m) * ((b_m - a_m) * 0.005555555555555556))));
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
code[a$95$m_, b$95$m_, angle_] := N[(2.0 * N[(angle * N[(Pi * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(N[(b$95$m - a$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|

\\
2 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a\_m + b\_m\right) \cdot \left(\left(b\_m - a\_m\right) \cdot 0.005555555555555556\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 77.1% accurate, 27.9× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ 2 \cdot \left(\left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \left(\left(a\_m + b\_m\right) \cdot \left(a\_m - b\_m\right)\right)\right) \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
(FPCore (a_m b_m angle)
 :precision binary64
 (*
  2.0
  (* (* angle (* PI -0.005555555555555556)) (* (+ a_m b_m) (- a_m b_m)))))
a_m = fabs(a);
b_m = fabs(b);
double code(double a_m, double b_m, double angle) {
	return 2.0 * ((angle * (((double) M_PI) * -0.005555555555555556)) * ((a_m + b_m) * (a_m - b_m)));
}
a_m = Math.abs(a);
b_m = Math.abs(b);
public static double code(double a_m, double b_m, double angle) {
	return 2.0 * ((angle * (Math.PI * -0.005555555555555556)) * ((a_m + b_m) * (a_m - b_m)));
}
a_m = math.fabs(a)
b_m = math.fabs(b)
def code(a_m, b_m, angle):
	return 2.0 * ((angle * (math.pi * -0.005555555555555556)) * ((a_m + b_m) * (a_m - b_m)))
a_m = abs(a)
b_m = abs(b)
function code(a_m, b_m, angle)
	return Float64(2.0 * Float64(Float64(angle * Float64(pi * -0.005555555555555556)) * Float64(Float64(a_m + b_m) * Float64(a_m - b_m))))
end
a_m = abs(a);
b_m = abs(b);
function tmp = code(a_m, b_m, angle)
	tmp = 2.0 * ((angle * (pi * -0.005555555555555556)) * ((a_m + b_m) * (a_m - b_m)));
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
code[a$95$m_, b$95$m_, angle_] := N[(2.0 * N[(N[(angle * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision] * N[(N[(a$95$m + b$95$m), $MachinePrecision] * N[(a$95$m - b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|

\\
2 \cdot \left(\left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \left(\left(a\_m + b\_m\right) \cdot \left(a\_m - b\_m\right)\right)\right)
\end{array}
Derivation
  1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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