ab-angle->ABCF B

Percentage Accurate: 54.3% → 64.3%
Time: 37.8s
Alternatives: 15
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 15 alternatives:

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

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

\[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} t_0 := \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\ t_1 := \cos \left(angle \cdot \frac{\pi}{-180}\right)\\ \mathbf{if}\;a\_m \leq 1.01:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \mathsf{fma}\left(b, t\_0 \cdot \left(-b\right), t\_0 \cdot {a\_m}^{2}\right)\right)\\ \mathbf{elif}\;a\_m \leq 1.58 \cdot 10^{+153}:\\ \;\;\;\;\left(2 \cdot \left(\sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right)\right)\right) \cdot \cos \left(\frac{angle \cdot \pi}{-180}\right)\\ \mathbf{elif}\;a\_m \leq 1.9 \cdot 10^{+195}:\\ \;\;\;\;2 \cdot \left(-0.005555555555555556 \cdot \left(a\_m \cdot \left(a\_m \cdot \left(angle \cdot \pi\right)\right) - angle \cdot \left(\pi \cdot {b}^{2}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \left(a\_m \cdot \left(a\_m \cdot t\_0\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
 :precision binary64
 (let* ((t_0 (sin (* -0.005555555555555556 (* angle PI))))
        (t_1 (cos (* angle (/ PI -180.0)))))
   (if (<= a_m 1.01)
     (* t_1 (* 2.0 (fma b (* t_0 (- b)) (* t_0 (pow a_m 2.0)))))
     (if (<= a_m 1.58e+153)
       (*
        (*
         2.0
         (*
          (sin (* angle (/ (cbrt (pow PI 3.0)) -180.0)))
          (* (+ a_m b) (- a_m b))))
        (cos (/ (* angle PI) -180.0)))
       (if (<= a_m 1.9e+195)
         (*
          2.0
          (*
           -0.005555555555555556
           (- (* a_m (* a_m (* angle PI))) (* angle (* PI (pow b 2.0))))))
         (* t_1 (* 2.0 (* a_m (* a_m t_0)))))))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
	double t_0 = sin((-0.005555555555555556 * (angle * ((double) M_PI))));
	double t_1 = cos((angle * (((double) M_PI) / -180.0)));
	double tmp;
	if (a_m <= 1.01) {
		tmp = t_1 * (2.0 * fma(b, (t_0 * -b), (t_0 * pow(a_m, 2.0))));
	} else if (a_m <= 1.58e+153) {
		tmp = (2.0 * (sin((angle * (cbrt(pow(((double) M_PI), 3.0)) / -180.0))) * ((a_m + b) * (a_m - b)))) * cos(((angle * ((double) M_PI)) / -180.0));
	} else if (a_m <= 1.9e+195) {
		tmp = 2.0 * (-0.005555555555555556 * ((a_m * (a_m * (angle * ((double) M_PI)))) - (angle * (((double) M_PI) * pow(b, 2.0)))));
	} else {
		tmp = t_1 * (2.0 * (a_m * (a_m * t_0)));
	}
	return tmp;
}
a_m = abs(a)
function code(a_m, b, angle)
	t_0 = sin(Float64(-0.005555555555555556 * Float64(angle * pi)))
	t_1 = cos(Float64(angle * Float64(pi / -180.0)))
	tmp = 0.0
	if (a_m <= 1.01)
		tmp = Float64(t_1 * Float64(2.0 * fma(b, Float64(t_0 * Float64(-b)), Float64(t_0 * (a_m ^ 2.0)))));
	elseif (a_m <= 1.58e+153)
		tmp = Float64(Float64(2.0 * Float64(sin(Float64(angle * Float64(cbrt((pi ^ 3.0)) / -180.0))) * Float64(Float64(a_m + b) * Float64(a_m - b)))) * cos(Float64(Float64(angle * pi) / -180.0)));
	elseif (a_m <= 1.9e+195)
		tmp = Float64(2.0 * Float64(-0.005555555555555556 * Float64(Float64(a_m * Float64(a_m * Float64(angle * pi))) - Float64(angle * Float64(pi * (b ^ 2.0))))));
	else
		tmp = Float64(t_1 * Float64(2.0 * Float64(a_m * Float64(a_m * t_0))));
	end
	return tmp
end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a$95$m, 1.01], N[(t$95$1 * N[(2.0 * N[(b * N[(t$95$0 * (-b)), $MachinePrecision] + N[(t$95$0 * N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a$95$m, 1.58e+153], N[(N[(2.0 * N[(N[Sin[N[(angle * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[a$95$m, 1.9e+195], N[(2.0 * N[(-0.005555555555555556 * N[(N[(a$95$m * N[(a$95$m * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(angle * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(a$95$m * N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
a_m = \left|a\right|

\\
\begin{array}{l}
t_0 := \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
t_1 := \cos \left(angle \cdot \frac{\pi}{-180}\right)\\
\mathbf{if}\;a\_m \leq 1.01:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \mathsf{fma}\left(b, t\_0 \cdot \left(-b\right), t\_0 \cdot {a\_m}^{2}\right)\right)\\

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

\mathbf{elif}\;a\_m \leq 1.9 \cdot 10^{+195}:\\
\;\;\;\;2 \cdot \left(-0.005555555555555556 \cdot \left(a\_m \cdot \left(a\_m \cdot \left(angle \cdot \pi\right)\right) - angle \cdot \left(\pi \cdot {b}^{2}\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(a\_m \cdot \left(a\_m \cdot t\_0\right)\right)\right)\\


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

    1. Initial program 53.2%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow255.2%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares57.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr57.4%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 b around 0 60.4%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) + \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + -1 \cdot a\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
      2. +-commutative62.0%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a + -1 \cdot a, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      4. distribute-rgt1-in62.0%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{\left(-1 + 1\right) \cdot a}, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      5. metadata-eval62.0%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0} \cdot a, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      6. mul0-lft62.0%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0}, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      7. mul-1-neg62.0%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), 0, \color{blue}{-b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      8. fmm-def62.0%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot 0 - \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot b}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      10. distribute-lft-out--62.0%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(0 - b\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      11. neg-sub062.0%

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

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

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

    if 1.01000000000000001 < a < 1.58e153

    1. Initial program 56.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. Simplified60.2%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow260.2%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares60.2%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr60.2%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. Step-by-step derivation
      1. add-cbrt-cube54.6%

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

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

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

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

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

    if 1.58e153 < a < 1.9e195

    1. Initial program 24.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. Simplified24.2%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow224.2%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares35.7%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr35.7%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 46.8%

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

      \[\leadsto 1 \cdot \left(2 \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) \]
    8. Taylor expanded in a around 0 77.9%

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

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

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

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

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

        \[\leadsto 1 \cdot \left(2 \cdot \left(-0.005555555555555556 \cdot \left(a \cdot \left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(b + -1 \cdot b\right)} + a \cdot \left(angle \cdot \pi\right)\right) - angle \cdot \left({b}^{2} \cdot \pi\right)\right)\right)\right) \]
      6. distribute-rgt1-in77.9%

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

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

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

        \[\leadsto 1 \cdot \left(2 \cdot \left(-0.005555555555555556 \cdot \left(a \cdot \left(\left(angle \cdot \pi\right) \cdot 0 + \color{blue}{\left(angle \cdot \pi\right) \cdot a}\right) - angle \cdot \left({b}^{2} \cdot \pi\right)\right)\right)\right) \]
      10. distribute-lft-out77.9%

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

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

    if 1.9e195 < a

    1. Initial program 55.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. Simplified55.2%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow255.2%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares64.3%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr64.3%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. Step-by-step derivation
      1. add-cbrt-cube64.3%

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

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

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

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

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a + -1 \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
      3. distribute-rgt1-in64.3%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0} \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      5. mul0-lft64.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.01:\\ \;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-b\right), \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {a}^{2}\right)\right)\\ \mathbf{elif}\;a \leq 1.58 \cdot 10^{+153}:\\ \;\;\;\;\left(2 \cdot \left(\sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \cdot \cos \left(\frac{angle \cdot \pi}{-180}\right)\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{+195}:\\ \;\;\;\;2 \cdot \left(-0.005555555555555556 \cdot \left(a \cdot \left(a \cdot \left(angle \cdot \pi\right)\right) - angle \cdot \left(\pi \cdot {b}^{2}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 63.6% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a\_m \leq 1.2 \cdot 10^{+192}:\\
\;\;\;\;\cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(2 \cdot \left(t\_1 - t\_0 \cdot {b}^{2}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(2 \cdot t\_1\right)\\


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

    1. Initial program 54.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. Simplified55.9%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow255.9%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares58.0%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr58.0%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 b around 0 60.9%

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

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

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a + -1 \cdot a, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      4. distribute-rgt1-in62.5%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0} \cdot a, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      6. mul0-lft62.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0}, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      7. mul-1-neg62.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), 0, \color{blue}{-b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      8. fmm-def62.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot 0 - b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      9. *-commutative62.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot 0 - \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot b}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      10. distribute-lft-out--62.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(0 - b\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      11. neg-sub062.5%

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

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

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

    if 4.40000000000000001e43 < a < 1.1999999999999999e192

    1. Initial program 43.2%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow246.7%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares50.0%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr50.0%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 a around 0 52.7%

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

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

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

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

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

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

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

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

        \[\leadsto \cos \color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \]
      5. add-sqr-sqrt30.9%

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

        \[\leadsto \cos \color{blue}{\left(\sqrt{\left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)} \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \]
      7. swap-sqr56.8%

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

        \[\leadsto \cos \left(\sqrt{\color{blue}{3.08641975308642 \cdot 10^{-5}} \cdot \left(\left(angle \cdot \pi\right) \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \]
      9. metadata-eval56.8%

        \[\leadsto \cos \left(\sqrt{\color{blue}{\left(0.005555555555555556 \cdot 0.005555555555555556\right)} \cdot \left(\left(angle \cdot \pi\right) \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \]
      10. swap-sqr53.5%

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

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

        \[\leadsto \cos \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \]
      13. expm1-log1p-u52.1%

        \[\leadsto \cos \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \]
      14. associate-*r*52.1%

        \[\leadsto \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(0.005555555555555556 \cdot angle\right) \cdot \pi}\right)\right)\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \]
    10. Applied egg-rr52.1%

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

    if 1.1999999999999999e192 < a

    1. Initial program 55.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. Simplified55.0%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow255.0%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares63.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr63.4%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. Step-by-step derivation
      1. add-cbrt-cube63.4%

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

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

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

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

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a + -1 \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
      3. distribute-rgt1-in63.4%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0} \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      5. mul0-lft63.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      6. fma-undefine63.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 4.4 \cdot 10^{+43}:\\ \;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-b\right), \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {a}^{2}\right)\right)\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{+192}:\\ \;\;\;\;\cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 61.4% accurate, 0.7× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} t_0 := \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\ \mathbf{if}\;b \leq 6.2 \cdot 10^{+144}:\\ \;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(a\_m \cdot \left(a\_m \cdot t\_0\right) - t\_0 \cdot {b}^{2}\right)\right)\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+241}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(b, t\_0 \cdot \left(-b\right), t\_0 \cdot {a\_m}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
 :precision binary64
 (let* ((t_0 (sin (* -0.005555555555555556 (* angle PI)))))
   (if (<= b 6.2e+144)
     (*
      (cos (* angle (/ PI -180.0)))
      (* 2.0 (- (* a_m (* a_m t_0)) (* t_0 (pow b 2.0)))))
     (if (<= b 5e+241)
       (* 2.0 (fma b (* t_0 (- b)) (* t_0 (pow a_m 2.0))))
       (*
        (cos (expm1 (log1p (* PI (* angle 0.005555555555555556)))))
        (*
         2.0
         (*
          (sin (* angle (/ (cbrt (pow PI 3.0)) -180.0)))
          (* (+ a_m b) (- a_m b)))))))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
	double t_0 = sin((-0.005555555555555556 * (angle * ((double) M_PI))));
	double tmp;
	if (b <= 6.2e+144) {
		tmp = cos((angle * (((double) M_PI) / -180.0))) * (2.0 * ((a_m * (a_m * t_0)) - (t_0 * pow(b, 2.0))));
	} else if (b <= 5e+241) {
		tmp = 2.0 * fma(b, (t_0 * -b), (t_0 * pow(a_m, 2.0)));
	} else {
		tmp = cos(expm1(log1p((((double) M_PI) * (angle * 0.005555555555555556))))) * (2.0 * (sin((angle * (cbrt(pow(((double) M_PI), 3.0)) / -180.0))) * ((a_m + b) * (a_m - b))));
	}
	return tmp;
}
a_m = abs(a)
function code(a_m, b, angle)
	t_0 = sin(Float64(-0.005555555555555556 * Float64(angle * pi)))
	tmp = 0.0
	if (b <= 6.2e+144)
		tmp = Float64(cos(Float64(angle * Float64(pi / -180.0))) * Float64(2.0 * Float64(Float64(a_m * Float64(a_m * t_0)) - Float64(t_0 * (b ^ 2.0)))));
	elseif (b <= 5e+241)
		tmp = Float64(2.0 * fma(b, Float64(t_0 * Float64(-b)), Float64(t_0 * (a_m ^ 2.0))));
	else
		tmp = Float64(cos(expm1(log1p(Float64(pi * Float64(angle * 0.005555555555555556))))) * Float64(2.0 * Float64(sin(Float64(angle * Float64(cbrt((pi ^ 3.0)) / -180.0))) * Float64(Float64(a_m + b) * Float64(a_m - b)))));
	end
	return tmp
end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, 6.2e+144], N[(N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(a$95$m * N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e+241], N[(2.0 * N[(b * N[(t$95$0 * (-b)), $MachinePrecision] + N[(t$95$0 * N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(Exp[N[Log[1 + N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(angle * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|

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

\mathbf{elif}\;b \leq 5 \cdot 10^{+241}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b, t\_0 \cdot \left(-b\right), t\_0 \cdot {a\_m}^{2}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 6.2000000000000003e144

    1. Initial program 56.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. Simplified57.8%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow257.8%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares59.8%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr59.8%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 a around 0 64.6%

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

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

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

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

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

    if 6.2000000000000003e144 < b < 5.00000000000000025e241

    1. Initial program 23.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. Simplified27.4%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow227.4%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares35.6%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr35.6%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 39.8%

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

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

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

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a + -1 \cdot a, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      4. distribute-rgt1-in58.5%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0} \cdot a, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      6. mul0-lft58.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0}, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      7. mul-1-neg58.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), 0, \color{blue}{-b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      8. fmm-def58.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot 0 - b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      9. *-commutative58.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot 0 - \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot b}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      10. distribute-lft-out--58.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(0 - b\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      11. neg-sub058.5%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-b\right), \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {a}^{2}}\right)\right) \]
    9. Simplified62.7%

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

    if 5.00000000000000025e241 < b

    1. Initial program 54.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. Simplified61.7%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow261.7%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares69.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr69.4%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. Step-by-step derivation
      1. add-cbrt-cube77.0%

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

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

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

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

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

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

        \[\leadsto \cos \color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \]
      5. add-sqr-sqrt46.2%

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

        \[\leadsto \cos \color{blue}{\left(\sqrt{\left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)} \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \]
      7. swap-sqr69.4%

        \[\leadsto \cos \left(\sqrt{\color{blue}{\left(-0.005555555555555556 \cdot -0.005555555555555556\right) \cdot \left(\left(angle \cdot \pi\right) \cdot \left(angle \cdot \pi\right)\right)}}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \]
      8. metadata-eval69.4%

        \[\leadsto \cos \left(\sqrt{\color{blue}{3.08641975308642 \cdot 10^{-5}} \cdot \left(\left(angle \cdot \pi\right) \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \]
      9. metadata-eval69.4%

        \[\leadsto \cos \left(\sqrt{\color{blue}{\left(0.005555555555555556 \cdot 0.005555555555555556\right)} \cdot \left(\left(angle \cdot \pi\right) \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \]
      10. swap-sqr69.4%

        \[\leadsto \cos \left(\sqrt{\color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \]
      11. sqrt-unprod23.2%

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

        \[\leadsto \cos \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \]
      13. expm1-log1p-u61.7%

        \[\leadsto \cos \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \]
      14. associate-*r*61.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 6.2 \cdot 10^{+144}:\\ \;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right)\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+241}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(b, \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-b\right), \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {a}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 63.9% accurate, 1.0× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} t_0 := -0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ t_1 := \sin t\_0\\ \mathbf{if}\;a\_m \leq 1.45 \cdot 10^{-18}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(b, t\_1 \cdot \left(-b\right), t\_1 \cdot {a\_m}^{2}\right)\\ \mathbf{elif}\;a\_m \leq 1.25 \cdot 10^{+150}:\\ \;\;\;\;\left(2 \cdot \left(\sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right)\right)\right) \cdot \cos t\_0\\ \mathbf{else}:\\ \;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(a\_m \cdot \left(a\_m \cdot t\_1\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
 :precision binary64
 (let* ((t_0 (* -0.005555555555555556 (* angle PI))) (t_1 (sin t_0)))
   (if (<= a_m 1.45e-18)
     (* 2.0 (fma b (* t_1 (- b)) (* t_1 (pow a_m 2.0))))
     (if (<= a_m 1.25e+150)
       (*
        (*
         2.0
         (*
          (sin (* angle (/ (cbrt (pow PI 3.0)) -180.0)))
          (* (+ a_m b) (- a_m b))))
        (cos t_0))
       (* (cos (* angle (/ PI -180.0))) (* 2.0 (* a_m (* a_m t_1))))))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
	double t_0 = -0.005555555555555556 * (angle * ((double) M_PI));
	double t_1 = sin(t_0);
	double tmp;
	if (a_m <= 1.45e-18) {
		tmp = 2.0 * fma(b, (t_1 * -b), (t_1 * pow(a_m, 2.0)));
	} else if (a_m <= 1.25e+150) {
		tmp = (2.0 * (sin((angle * (cbrt(pow(((double) M_PI), 3.0)) / -180.0))) * ((a_m + b) * (a_m - b)))) * cos(t_0);
	} else {
		tmp = cos((angle * (((double) M_PI) / -180.0))) * (2.0 * (a_m * (a_m * t_1)));
	}
	return tmp;
}
a_m = abs(a)
function code(a_m, b, angle)
	t_0 = Float64(-0.005555555555555556 * Float64(angle * pi))
	t_1 = sin(t_0)
	tmp = 0.0
	if (a_m <= 1.45e-18)
		tmp = Float64(2.0 * fma(b, Float64(t_1 * Float64(-b)), Float64(t_1 * (a_m ^ 2.0))));
	elseif (a_m <= 1.25e+150)
		tmp = Float64(Float64(2.0 * Float64(sin(Float64(angle * Float64(cbrt((pi ^ 3.0)) / -180.0))) * Float64(Float64(a_m + b) * Float64(a_m - b)))) * cos(t_0));
	else
		tmp = Float64(cos(Float64(angle * Float64(pi / -180.0))) * Float64(2.0 * Float64(a_m * Float64(a_m * t_1))));
	end
	return tmp
end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[a$95$m, 1.45e-18], N[(2.0 * N[(b * N[(t$95$1 * (-b)), $MachinePrecision] + N[(t$95$1 * N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a$95$m, 1.25e+150], N[(N[(2.0 * N[(N[Sin[N[(angle * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(a$95$m * N[(a$95$m * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|

\\
\begin{array}{l}
t_0 := -0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t\_0\\
\mathbf{if}\;a\_m \leq 1.45 \cdot 10^{-18}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b, t\_1 \cdot \left(-b\right), t\_1 \cdot {a\_m}^{2}\right)\\

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

\mathbf{else}:\\
\;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(a\_m \cdot \left(a\_m \cdot t\_1\right)\right)\right)\\


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

    1. Initial program 53.3%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow255.2%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares57.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr57.5%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 53.7%

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

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

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

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a + -1 \cdot a, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      4. distribute-rgt1-in62.1%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0} \cdot a, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      6. mul0-lft62.1%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0}, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      7. mul-1-neg62.1%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), 0, \color{blue}{-b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      8. fmm-def62.1%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot 0 - b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      9. *-commutative62.1%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot 0 - \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot b}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      10. distribute-lft-out--62.1%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(0 - b\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      11. neg-sub062.1%

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

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

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

    if 1.45e-18 < a < 1.25000000000000002e150

    1. Initial program 55.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. Simplified59.6%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow259.6%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares59.6%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr59.6%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. Step-by-step derivation
      1. add-cbrt-cube54.3%

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

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

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

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

    if 1.25000000000000002e150 < a

    1. Initial program 46.7%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow246.7%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares56.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr56.5%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. Step-by-step derivation
      1. add-cbrt-cube59.5%

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

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

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

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

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a + -1 \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
      3. distribute-rgt1-in53.4%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0} \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      5. mul0-lft53.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      6. fma-undefine53.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.45 \cdot 10^{-18}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(b, \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-b\right), \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {a}^{2}\right)\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{+150}:\\ \;\;\;\;\left(2 \cdot \left(\sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \cdot \cos \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 63.9% accurate, 1.0× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} t_0 := \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\ \mathbf{if}\;a\_m \leq 1.55 \cdot 10^{-18}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(b, t\_0 \cdot \left(-b\right), t\_0 \cdot {a\_m}^{2}\right)\\ \mathbf{elif}\;a\_m \leq 1.45 \cdot 10^{+153}:\\ \;\;\;\;\left(2 \cdot \left(\sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right)\right)\right) \cdot \cos \left(\frac{angle \cdot \pi}{-180}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(a\_m \cdot \left(a\_m \cdot t\_0\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
 :precision binary64
 (let* ((t_0 (sin (* -0.005555555555555556 (* angle PI)))))
   (if (<= a_m 1.55e-18)
     (* 2.0 (fma b (* t_0 (- b)) (* t_0 (pow a_m 2.0))))
     (if (<= a_m 1.45e+153)
       (*
        (*
         2.0
         (*
          (sin (* angle (/ (cbrt (pow PI 3.0)) -180.0)))
          (* (+ a_m b) (- a_m b))))
        (cos (/ (* angle PI) -180.0)))
       (* (cos (* angle (/ PI -180.0))) (* 2.0 (* a_m (* a_m t_0))))))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
	double t_0 = sin((-0.005555555555555556 * (angle * ((double) M_PI))));
	double tmp;
	if (a_m <= 1.55e-18) {
		tmp = 2.0 * fma(b, (t_0 * -b), (t_0 * pow(a_m, 2.0)));
	} else if (a_m <= 1.45e+153) {
		tmp = (2.0 * (sin((angle * (cbrt(pow(((double) M_PI), 3.0)) / -180.0))) * ((a_m + b) * (a_m - b)))) * cos(((angle * ((double) M_PI)) / -180.0));
	} else {
		tmp = cos((angle * (((double) M_PI) / -180.0))) * (2.0 * (a_m * (a_m * t_0)));
	}
	return tmp;
}
a_m = abs(a)
function code(a_m, b, angle)
	t_0 = sin(Float64(-0.005555555555555556 * Float64(angle * pi)))
	tmp = 0.0
	if (a_m <= 1.55e-18)
		tmp = Float64(2.0 * fma(b, Float64(t_0 * Float64(-b)), Float64(t_0 * (a_m ^ 2.0))));
	elseif (a_m <= 1.45e+153)
		tmp = Float64(Float64(2.0 * Float64(sin(Float64(angle * Float64(cbrt((pi ^ 3.0)) / -180.0))) * Float64(Float64(a_m + b) * Float64(a_m - b)))) * cos(Float64(Float64(angle * pi) / -180.0)));
	else
		tmp = Float64(cos(Float64(angle * Float64(pi / -180.0))) * Float64(2.0 * Float64(a_m * Float64(a_m * t_0))));
	end
	return tmp
end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a$95$m, 1.55e-18], N[(2.0 * N[(b * N[(t$95$0 * (-b)), $MachinePrecision] + N[(t$95$0 * N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a$95$m, 1.45e+153], N[(N[(2.0 * N[(N[Sin[N[(angle * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(a$95$m * N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|

\\
\begin{array}{l}
t_0 := \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;a\_m \leq 1.55 \cdot 10^{-18}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b, t\_0 \cdot \left(-b\right), t\_0 \cdot {a\_m}^{2}\right)\\

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

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


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

    1. Initial program 53.3%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow255.2%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares57.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr57.5%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 53.7%

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

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

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

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a + -1 \cdot a, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      4. distribute-rgt1-in62.1%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0} \cdot a, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      6. mul0-lft62.1%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0}, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      7. mul-1-neg62.1%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), 0, \color{blue}{-b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      8. fmm-def62.1%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot 0 - b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      9. *-commutative62.1%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot 0 - \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot b}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      10. distribute-lft-out--62.1%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(0 - b\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      11. neg-sub062.1%

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

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

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

    if 1.55000000000000003e-18 < a < 1.45000000000000001e153

    1. Initial program 55.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. Simplified59.6%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow259.6%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares59.6%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr59.6%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. Step-by-step derivation
      1. add-cbrt-cube54.3%

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

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

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

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

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

    if 1.45000000000000001e153 < a

    1. Initial program 46.7%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow246.7%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares56.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr56.5%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. Step-by-step derivation
      1. add-cbrt-cube59.5%

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

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

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

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

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a + -1 \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
      3. distribute-rgt1-in53.4%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0} \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      5. mul0-lft53.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      6. fma-undefine53.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.55 \cdot 10^{-18}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(b, \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-b\right), \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {a}^{2}\right)\\ \mathbf{elif}\;a \leq 1.45 \cdot 10^{+153}:\\ \;\;\;\;\left(2 \cdot \left(\sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \cdot \cos \left(\frac{angle \cdot \pi}{-180}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 65.2% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;a\_m \leq 2.6 \cdot 10^{+150}:\\
\;\;\;\;{a\_m}^{2} \cdot \left(\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \mathsf{fma}\left(b, \frac{b}{{a\_m}^{2}}, -1\right)\right)\\

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


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

    1. Initial program 55.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. Simplified57.0%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow257.0%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares59.1%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr59.1%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 55.5%

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

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

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

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a + -1 \cdot a, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      4. distribute-rgt1-in63.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{\left(-1 + 1\right) \cdot a}, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      5. metadata-eval63.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0} \cdot a, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      6. mul0-lft63.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0}, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      7. mul-1-neg63.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), 0, \color{blue}{-b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      8. fmm-def63.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot 0 - b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      9. *-commutative63.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot 0 - \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot b}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      10. distribute-lft-out--63.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(0 - b\right)}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      11. neg-sub063.4%

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

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

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

    if 1.8999999999999999e58 < a < 2.60000000000000006e150

    1. Initial program 38.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left({b}^{4} - {a}^{4}\right)}{\mathsf{fma}\left(a, a, {b}^{2}\right)}} \]
    7. Step-by-step derivation
      1. associate-/l*1.8%

        \[\leadsto \color{blue}{\sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \frac{{b}^{4} - {a}^{4}}{\mathsf{fma}\left(a, a, {b}^{2}\right)}} \]
      2. *-commutative1.8%

        \[\leadsto \sin \color{blue}{\left(\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right)} \cdot \frac{{b}^{4} - {a}^{4}}{\mathsf{fma}\left(a, a, {b}^{2}\right)} \]
      3. associate-*r*2.0%

        \[\leadsto \sin \left(\color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 2\right) \cdot \frac{{b}^{4} - {a}^{4}}{\mathsf{fma}\left(a, a, {b}^{2}\right)} \]
      4. *-commutative2.0%

        \[\leadsto \sin \left(\left(\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.005555555555555556\right) \cdot 2\right) \cdot \frac{{b}^{4} - {a}^{4}}{\mathsf{fma}\left(a, a, {b}^{2}\right)} \]
      5. associate-*l*2.0%

        \[\leadsto \sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(0.005555555555555556 \cdot 2\right)\right)} \cdot \frac{{b}^{4} - {a}^{4}}{\mathsf{fma}\left(a, a, {b}^{2}\right)} \]
      6. metadata-eval2.0%

        \[\leadsto \sin \left(\left(angle \cdot \pi\right) \cdot \color{blue}{0.011111111111111112}\right) \cdot \frac{{b}^{4} - {a}^{4}}{\mathsf{fma}\left(a, a, {b}^{2}\right)} \]
    8. Simplified2.0%

      \[\leadsto \color{blue}{\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right) \cdot \frac{{b}^{4} - {a}^{4}}{\mathsf{fma}\left(a, a, {b}^{2}\right)}} \]
    9. Taylor expanded in a around inf 42.8%

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

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

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

        \[\leadsto {a}^{2} \cdot \left(\sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right) \cdot -1 + \color{blue}{\sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{{b}^{2}}{{a}^{2}}}\right) \]
      4. distribute-lft-out42.8%

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

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

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

        \[\leadsto {a}^{2} \cdot \left(\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \color{blue}{\left(\frac{{b}^{2}}{{a}^{2}} + -1\right)}\right) \]
      8. metadata-eval44.0%

        \[\leadsto {a}^{2} \cdot \left(\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \left(\frac{{b}^{2}}{{a}^{2}} + \color{blue}{\left(-1\right)}\right)\right) \]
      9. sub-neg44.0%

        \[\leadsto {a}^{2} \cdot \left(\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \color{blue}{\left(\frac{{b}^{2}}{{a}^{2}} - 1\right)}\right) \]
      10. unpow244.0%

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

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

        \[\leadsto {a}^{2} \cdot \left(\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \color{blue}{\mathsf{fma}\left(b, \frac{b}{{a}^{2}}, -1\right)}\right) \]
      13. metadata-eval44.0%

        \[\leadsto {a}^{2} \cdot \left(\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \mathsf{fma}\left(b, \frac{b}{{a}^{2}}, \color{blue}{-1}\right)\right) \]
    11. Simplified44.0%

      \[\leadsto \color{blue}{{a}^{2} \cdot \left(\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \mathsf{fma}\left(b, \frac{b}{{a}^{2}}, -1\right)\right)} \]

    if 2.60000000000000006e150 < a

    1. Initial program 46.7%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow246.7%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares56.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr56.5%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. Step-by-step derivation
      1. add-cbrt-cube59.5%

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

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

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

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

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a + -1 \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
      3. distribute-rgt1-in53.4%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0} \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      5. mul0-lft53.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      6. fma-undefine53.4%

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

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

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

Alternative 7: 61.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 53.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.60000000000000006e150 < a

    1. Initial program 46.7%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow246.7%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares56.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr56.5%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. Step-by-step derivation
      1. add-cbrt-cube59.5%

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

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

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

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

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a + -1 \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
      3. distribute-rgt1-in53.4%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0} \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      5. mul0-lft53.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      6. fma-undefine53.4%

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

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

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

Alternative 8: 60.3% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 a #s(literal 2 binary64)) < 2.0000000000000001e300

    1. Initial program 56.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. Simplified58.8%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow258.8%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares58.8%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr58.8%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 54.4%

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

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

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

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

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

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

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

    if 2.0000000000000001e300 < (pow.f64 a #s(literal 2 binary64))

    1. Initial program 42.3%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow243.5%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares54.3%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr54.3%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. Step-by-step derivation
      1. add-cbrt-cube51.7%

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

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

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

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

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a + -1 \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
      3. distribute-rgt1-in53.0%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{\left(-1 + 1\right) \cdot a}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      4. metadata-eval53.0%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0} \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      5. mul0-lft53.0%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      6. fma-undefine53.0%

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

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

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

Alternative 9: 61.5% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 53.7%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow255.9%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares57.8%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr57.8%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 inf 57.2%

      \[\leadsto \color{blue}{\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \cdot \left(2 \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.25000000000000002e150 < a

    1. Initial program 46.7%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow246.7%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares56.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr56.5%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. Step-by-step derivation
      1. add-cbrt-cube59.5%

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

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

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

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

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a + -1 \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
      3. distribute-rgt1-in53.4%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0} \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      5. mul0-lft53.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      6. fma-undefine53.4%

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

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

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

Alternative 10: 61.6% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 53.7%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow255.9%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares57.8%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr57.8%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 2.60000000000000006e150 < a

    1. Initial program 46.7%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow246.7%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares56.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr56.5%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. Step-by-step derivation
      1. add-cbrt-cube59.5%

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

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

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

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

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), a + -1 \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
      3. distribute-rgt1-in53.4%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0} \cdot a, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      5. mul0-lft53.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right), \color{blue}{0}, {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
      6. fma-undefine53.4%

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

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

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

Alternative 11: 56.4% accurate, 3.2× speedup?

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

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

\mathbf{elif}\;angle \leq 4.5 \cdot 10^{+45}:\\
\;\;\;\;2 \cdot \left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot t\_0\right)\\

\mathbf{elif}\;angle \leq 5.5 \cdot 10^{+121}:\\
\;\;\;\;2 \cdot \left(t\_0 \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if angle < 1.6e13

    1. Initial program 60.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. Simplified62.9%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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.9%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares66.2%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr66.2%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 58.5%

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

      \[\leadsto 1 \cdot \left(2 \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) \]
    8. Taylor expanded in a around 0 61.5%

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

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

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

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

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

        \[\leadsto 1 \cdot \left(2 \cdot \left(-0.005555555555555556 \cdot \left(a \cdot \left(\color{blue}{\left(angle \cdot \pi\right) \cdot \left(b + -1 \cdot b\right)} + a \cdot \left(angle \cdot \pi\right)\right) - angle \cdot \left({b}^{2} \cdot \pi\right)\right)\right)\right) \]
      6. distribute-rgt1-in61.5%

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

        \[\leadsto 1 \cdot \left(2 \cdot \left(-0.005555555555555556 \cdot \left(a \cdot \left(\left(angle \cdot \pi\right) \cdot \left(\color{blue}{0} \cdot b\right) + a \cdot \left(angle \cdot \pi\right)\right) - angle \cdot \left({b}^{2} \cdot \pi\right)\right)\right)\right) \]
      8. mul0-lft61.5%

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

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

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

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

    if 1.6e13 < angle < 4.4999999999999998e45

    1. Initial program 0.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. Simplified3.8%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow23.8%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares23.8%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr23.8%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 60.2%

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

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

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

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

    if 4.4999999999999998e45 < angle < 5.4999999999999998e121

    1. Initial program 25.3%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow221.8%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares21.8%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr21.8%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 24.3%

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

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

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

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

    if 5.4999999999999998e121 < angle

    1. Initial program 28.7%

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

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow232.4%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares32.4%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr32.4%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 41.5%

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

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

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

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

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

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

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

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

Alternative 12: 56.5% accurate, 3.5× speedup?

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

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

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


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

    1. Initial program 55.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. Simplified56.5%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow256.5%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares58.5%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr58.5%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 54.3%

      \[\leadsto \color{blue}{1} \cdot \left(2 \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 9.9999999999999994e174 < b

    1. Initial program 36.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. Simplified42.5%

      \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow242.5%

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

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares51.9%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr51.9%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 51.9%

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

      \[\leadsto 1 \cdot \left(2 \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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.5%

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

Alternative 13: 55.9% accurate, 3.6× speedup?

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

\\
2 \cdot \left(\left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.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. Simplified54.7%

    \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow254.7%

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

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares57.6%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr57.6%

    \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 54.0%

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

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

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

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

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

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

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

Alternative 14: 56.1% accurate, 3.6× speedup?

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

\\
2 \cdot \left(\left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{-180}\right)\right)
\end{array}
Derivation
  1. Initial program 52.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. Simplified54.7%

    \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow254.7%

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

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares57.6%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr57.6%

    \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 54.0%

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

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

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

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

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

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

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

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

Alternative 15: 54.6% accurate, 27.9× speedup?

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

\\
2 \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.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. Simplified54.7%

    \[\leadsto \color{blue}{\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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. unpow254.7%

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

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-squares57.6%

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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-rr57.6%

    \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \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 54.0%

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

    \[\leadsto 1 \cdot \left(2 \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) \]
  8. Final simplification52.3%

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

Reproduce

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