ab-angle->ABCF B

Percentage Accurate: 54.2% → 67.4%
Time: 30.0s
Alternatives: 13
Speedup: 32.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 67.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+153}:\\
\;\;\;\;t\_1 \cdot \left(\left(\left(b + a\right) \cdot \left(a - b\right)\right) \cdot \left(2 \cdot t\_0\right)\right)\\

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow255.1%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{2 \cdot \left(b \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(a + -1 \cdot a\right)\right)}, -2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      4. *-commutative64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e51 < (/.f64 angle #s(literal 180 binary64)) < 1e153

    1. Initial program 43.4%

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

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

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

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

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

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

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

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

    1. Initial program 39.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow239.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 67.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+153}:\\
\;\;\;\;\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \left(\left(\left(b + a\right) \cdot \left(a - b\right)\right) \cdot \left(2 \cdot t\_1\right)\right)\\

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow255.0%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{2 \cdot \left(b \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(a + -1 \cdot a\right)\right)}, -2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      4. *-commutative64.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(b, 2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot b\right), -2 \cdot \color{blue}{\left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot a\right) \cdot a\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    10. Taylor expanded in angle around inf 71.2%

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

    if 2.00000000000000004e64 < (/.f64 angle #s(literal 180 binary64)) < 1e153

    1. Initial program 42.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. Add Preprocessing
    3. Taylor expanded in b around 0 20.4%

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

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

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

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

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

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

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

    1. Initial program 39.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow239.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 66.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+153}:\\
\;\;\;\;\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \left(\left(\left(b + a\right) \cdot \left(a - b\right)\right) \cdot \left(2 \cdot t\_0\right)\right)\\

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


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

    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. Simplified56.1%

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

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

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

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

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

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

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

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

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

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

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

    if 2e51 < (/.f64 angle #s(literal 180 binary64)) < 1e153

    1. Initial program 43.4%

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

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

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

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

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

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

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

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

    1. Initial program 39.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow239.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 66.2% accurate, 1.8× speedup?

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

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

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

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


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

    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. Simplified56.1%

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

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

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

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

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

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

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

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

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

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

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

    if 2e51 < (/.f64 angle #s(literal 180 binary64)) < 1e153

    1. Initial program 43.4%

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

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

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

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

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

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

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

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

    1. Initial program 39.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. Simplified44.1%

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

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

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

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

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

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

Alternative 5: 66.4% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+174}:\\
\;\;\;\;\cos t\_0 \cdot \left(t\_1 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sin t\_0\\


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

    1. Initial program 47.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. Simplified48.8%

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000004e-134 < (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000028e174

    1. Initial program 69.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow269.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.00000000000000028e174 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 35.1%

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

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

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

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

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

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

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

Alternative 6: 65.9% accurate, 3.4× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 41.4%

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

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

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

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

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

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

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

Alternative 7: 63.3% accurate, 23.3× speedup?

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

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

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


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

    1. Initial program 48.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. Simplified49.1%

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

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

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

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

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

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

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

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

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

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

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

    if 1.50000000000000008e-114 < angle

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 64.2% accurate, 23.3× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

    if 7.49999999999999981e-20 < angle

    1. Initial program 46.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 62.7% accurate, 23.3× speedup?

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

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

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


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

    1. Initial program 47.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. Simplified48.8%

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

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

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

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

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

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

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

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

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

    if 2.59999999999999996e-131 < angle

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 42.2% accurate, 26.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 6.20000000000000035e-78

    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.1%

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

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

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

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

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

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

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

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

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

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

    if 6.20000000000000035e-78 < b

    1. Initial program 50.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 54.5% accurate, 32.2× speedup?

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

\\
angle\_s \cdot \left(-0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(a - b\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 54.5% accurate, 32.2× speedup?

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

\\
angle\_s \cdot \left(-0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(a - b\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.1%

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

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

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

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

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

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

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

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

Alternative 13: 37.0% accurate, 38.1× speedup?

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

\\
angle\_s \cdot \left(-0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(a - b\right) \cdot \left(\pi \cdot a\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.1%

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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