ab-angle->ABCF B

Percentage Accurate: 53.4% → 60.7%
Time: 35.0s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 53.4% accurate, 1.0× speedup?

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

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

Alternative 1: 60.7% accurate, 0.6× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\ t_1 := \cos t\_0\\ t_2 := \sin t\_0\\ t_3 := \left(b - a\right) \cdot \left(b + a\right)\\ t_4 := \sqrt[3]{{\pi}^{3}}\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 3 \cdot 10^{-101}:\\ \;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot t\_1, t\_2 \cdot 0, \left(a \cdot -2\right) \cdot \left(t\_1 \cdot t\_2\right)\right), 2 \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left({b}^{2} \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+259}:\\ \;\;\;\;t\_3 \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_3 \cdot \left(2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot t\_4\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot t\_4\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 (* angle_m (* PI 0.005555555555555556)))
        (t_1 (cos t_0))
        (t_2 (sin t_0))
        (t_3 (* (- b a) (+ b a)))
        (t_4 (cbrt (pow PI 3.0))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 3e-101)
      (fma
       a
       (fma (* 2.0 t_1) (* t_2 0.0) (* (* a -2.0) (* t_1 t_2)))
       (* 2.0 (* (* angle_m 0.005555555555555556) (* (pow b 2.0) PI))))
      (if (<= (/ angle_m 180.0) 1e+259)
        (*
         t_3
         (*
          2.0
          (*
           (cos (* PI (/ angle_m 180.0)))
           (sin (* 0.005555555555555556 (* PI angle_m))))))
        (*
         t_3
         (*
          2.0
          (*
           (sin (* 0.005555555555555556 (* angle_m t_4)))
           (cos (* (/ angle_m 180.0) t_4))))))))))
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 * (((double) M_PI) * 0.005555555555555556);
	double t_1 = cos(t_0);
	double t_2 = sin(t_0);
	double t_3 = (b - a) * (b + a);
	double t_4 = cbrt(pow(((double) M_PI), 3.0));
	double tmp;
	if ((angle_m / 180.0) <= 3e-101) {
		tmp = fma(a, fma((2.0 * t_1), (t_2 * 0.0), ((a * -2.0) * (t_1 * t_2))), (2.0 * ((angle_m * 0.005555555555555556) * (pow(b, 2.0) * ((double) M_PI)))));
	} else if ((angle_m / 180.0) <= 1e+259) {
		tmp = t_3 * (2.0 * (cos((((double) M_PI) * (angle_m / 180.0))) * sin((0.005555555555555556 * (((double) M_PI) * angle_m)))));
	} else {
		tmp = t_3 * (2.0 * (sin((0.005555555555555556 * (angle_m * t_4))) * cos(((angle_m / 180.0) * t_4))));
	}
	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(angle_m * Float64(pi * 0.005555555555555556))
	t_1 = cos(t_0)
	t_2 = sin(t_0)
	t_3 = Float64(Float64(b - a) * Float64(b + a))
	t_4 = cbrt((pi ^ 3.0))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 3e-101)
		tmp = fma(a, fma(Float64(2.0 * t_1), Float64(t_2 * 0.0), Float64(Float64(a * -2.0) * Float64(t_1 * t_2))), Float64(2.0 * Float64(Float64(angle_m * 0.005555555555555556) * Float64((b ^ 2.0) * pi))));
	elseif (Float64(angle_m / 180.0) <= 1e+259)
		tmp = Float64(t_3 * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * sin(Float64(0.005555555555555556 * Float64(pi * angle_m))))));
	else
		tmp = Float64(t_3 * Float64(2.0 * Float64(sin(Float64(0.005555555555555556 * Float64(angle_m * t_4))) * cos(Float64(Float64(angle_m / 180.0) * t_4)))));
	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[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 3e-101], N[(a * N[(N[(2.0 * t$95$1), $MachinePrecision] * N[(t$95$2 * 0.0), $MachinePrecision] + N[(N[(a * -2.0), $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+259], N[(t$95$3 * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[(2.0 * N[(N[Sin[N[(0.005555555555555556 * N[(angle$95$m * t$95$4), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * t$95$4), $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 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
t_3 := \left(b - a\right) \cdot \left(b + a\right)\\
t_4 := \sqrt[3]{{\pi}^{3}}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 3 \cdot 10^{-101}:\\
\;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot t\_1, t\_2 \cdot 0, \left(a \cdot -2\right) \cdot \left(t\_1 \cdot t\_2\right)\right), 2 \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left({b}^{2} \cdot \pi\right)\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot t\_4\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot t\_4\right)\right)\right)\\


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

    1. Initial program 56.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right), \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot 0, \left(-2 \cdot a\right) \cdot \left(\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right), 2 \cdot \left(\left(\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right) \cdot {b}^{2}\right)\right)} \]
    13. Taylor expanded in angle around 0 62.1%

      \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right), \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot 0, \left(-2 \cdot a\right) \cdot \left(\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right), 2 \cdot \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right)\right)\right)}\right) \]
    14. Step-by-step derivation
      1. associate-*r*62.1%

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

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

    if 3.0000000000000003e-101 < (/.f64 angle #s(literal 180 binary64)) < 9.999999999999999e258

    1. Initial program 47.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.999999999999999e258 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 38.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 61.6% accurate, 0.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 \frac{angle\_m}{180}\\ t_1 := \sqrt[3]{{\pi}^{3}}\\ t_2 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\ t_3 := \sin t\_2\\ t_4 := \cos t\_2\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq -2 \cdot 10^{+238}:\\ \;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot t\_4, t\_3 \cdot 0, \left(a \cdot -2\right) \cdot \left(t\_4 \cdot t\_3\right)\right), 2 \cdot \left({b}^{2} \cdot \left(t\_4 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot t\_1\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot t\_1\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 (* PI (/ angle_m 180.0)))
        (t_1 (cbrt (pow PI 3.0)))
        (t_2 (* angle_m (* PI 0.005555555555555556)))
        (t_3 (sin t_2))
        (t_4 (cos t_2)))
   (*
    angle_s
    (if (<=
         (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))
         -2e+238)
      (fma
       a
       (fma (* 2.0 t_4) (* t_3 0.0) (* (* a -2.0) (* t_4 t_3)))
       (*
        2.0
        (* (pow b 2.0) (* t_4 (sin (* PI (* angle_m 0.005555555555555556)))))))
      (*
       (* (- b a) (+ b a))
       (*
        2.0
        (*
         (sin (* 0.005555555555555556 (* angle_m t_1)))
         (cos (* (/ angle_m 180.0) t_1)))))))))
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) * (angle_m / 180.0);
	double t_1 = cbrt(pow(((double) M_PI), 3.0));
	double t_2 = angle_m * (((double) M_PI) * 0.005555555555555556);
	double t_3 = sin(t_2);
	double t_4 = cos(t_2);
	double tmp;
	if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0)) <= -2e+238) {
		tmp = fma(a, fma((2.0 * t_4), (t_3 * 0.0), ((a * -2.0) * (t_4 * t_3))), (2.0 * (pow(b, 2.0) * (t_4 * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))))));
	} else {
		tmp = ((b - a) * (b + a)) * (2.0 * (sin((0.005555555555555556 * (angle_m * t_1))) * cos(((angle_m / 180.0) * t_1))));
	}
	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(angle_m / 180.0))
	t_1 = cbrt((pi ^ 3.0))
	t_2 = Float64(angle_m * Float64(pi * 0.005555555555555556))
	t_3 = sin(t_2)
	t_4 = cos(t_2)
	tmp = 0.0
	if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) <= -2e+238)
		tmp = fma(a, fma(Float64(2.0 * t_4), Float64(t_3 * 0.0), Float64(Float64(a * -2.0) * Float64(t_4 * t_3))), Float64(2.0 * Float64((b ^ 2.0) * Float64(t_4 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))))));
	else
		tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(2.0 * Float64(sin(Float64(0.005555555555555556 * Float64(angle_m * t_1))) * cos(Float64(Float64(angle_m / 180.0) * t_1)))));
	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[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$2 = N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[Cos[t$95$2], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[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], -2e+238], N[(a * N[(N[(2.0 * t$95$4), $MachinePrecision] * N[(t$95$3 * 0.0), $MachinePrecision] + N[(N[(a * -2.0), $MachinePrecision] * N[(t$95$4 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] * N[(t$95$4 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(0.005555555555555556 * N[(angle$95$m * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * t$95$1), $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 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := \sqrt[3]{{\pi}^{3}}\\
t_2 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_3 := \sin t\_2\\
t_4 := \cos t\_2\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq -2 \cdot 10^{+238}:\\
\;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot t\_4, t\_3 \cdot 0, \left(a \cdot -2\right) \cdot \left(t\_4 \cdot t\_3\right)\right), 2 \cdot \left({b}^{2} \cdot \left(t\_4 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -2.0000000000000001e238

    1. Initial program 51.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right), \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot 0, \left(-2 \cdot a\right) \cdot \left(\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right), 2 \cdot \left(\left(\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \sin \left(\left(angle \cdot \color{blue}{\sqrt[3]{{\pi}^{3}}}\right) \cdot 0.005555555555555556\right)\right) \cdot {b}^{2}\right)\right) \]
      4. *-un-lft-identity58.2%

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right), \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot 0, \left(-2 \cdot a\right) \cdot \left(\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right), 2 \cdot \left(\left(\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \color{blue}{\left(1 \cdot \sin \left(\left(angle \cdot \sqrt[3]{{\pi}^{3}}\right) \cdot 0.005555555555555556\right)\right)}\right) \cdot {b}^{2}\right)\right) \]
      5. rem-cbrt-cube60.6%

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right), \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot 0, \left(-2 \cdot a\right) \cdot \left(\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right), 2 \cdot \left(\left(\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(1 \cdot \sin \left(\left(angle \cdot \color{blue}{\pi}\right) \cdot 0.005555555555555556\right)\right)\right) \cdot {b}^{2}\right)\right) \]
      6. associate-*l*58.2%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right), \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot 0, \left(-2 \cdot a\right) \cdot \left(\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right), 2 \cdot \left(\left(\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(1 \cdot \sin \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right)\right)\right) \cdot {b}^{2}\right)\right) \]
    14. Applied egg-rr63.3%

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

    if -2.0000000000000001e238 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64)))))

    1. Initial program 53.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. Step-by-step derivation
      1. associate-*l*53.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq -2 \cdot 10^{+238}:\\ \;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right), \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot 0, \left(a \cdot -2\right) \cdot \left(\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right), 2 \cdot \left({b}^{2} \cdot \left(\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \sqrt[3]{{\pi}^{3}}\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 61.7% accurate, 0.3× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\ t_1 := \sin t\_0\\ t_2 := \cos t\_0\\ t_3 := t\_2 \cdot t\_1\\ t_4 := \pi \cdot \frac{angle\_m}{180}\\ t_5 := \sqrt[3]{{\pi}^{3}}\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_4\right) \cdot \cos t\_4 \leq -2 \cdot 10^{-217}:\\ \;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot t\_2, t\_1 \cdot 0, \left(a \cdot -2\right) \cdot t\_3\right), 2 \cdot \left({b}^{2} \cdot t\_3\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot t\_5\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot t\_5\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 (* angle_m (* PI 0.005555555555555556)))
        (t_1 (sin t_0))
        (t_2 (cos t_0))
        (t_3 (* t_2 t_1))
        (t_4 (* PI (/ angle_m 180.0)))
        (t_5 (cbrt (pow PI 3.0))))
   (*
    angle_s
    (if (<=
         (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_4)) (cos t_4))
         -2e-217)
      (fma
       a
       (fma (* 2.0 t_2) (* t_1 0.0) (* (* a -2.0) t_3))
       (* 2.0 (* (pow b 2.0) t_3)))
      (*
       (* (- b a) (+ b a))
       (*
        2.0
        (*
         (sin (* 0.005555555555555556 (* angle_m t_5)))
         (cos (* (/ angle_m 180.0) t_5)))))))))
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 * (((double) M_PI) * 0.005555555555555556);
	double t_1 = sin(t_0);
	double t_2 = cos(t_0);
	double t_3 = t_2 * t_1;
	double t_4 = ((double) M_PI) * (angle_m / 180.0);
	double t_5 = cbrt(pow(((double) M_PI), 3.0));
	double tmp;
	if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_4)) * cos(t_4)) <= -2e-217) {
		tmp = fma(a, fma((2.0 * t_2), (t_1 * 0.0), ((a * -2.0) * t_3)), (2.0 * (pow(b, 2.0) * t_3)));
	} else {
		tmp = ((b - a) * (b + a)) * (2.0 * (sin((0.005555555555555556 * (angle_m * t_5))) * cos(((angle_m / 180.0) * t_5))));
	}
	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(angle_m * Float64(pi * 0.005555555555555556))
	t_1 = sin(t_0)
	t_2 = cos(t_0)
	t_3 = Float64(t_2 * t_1)
	t_4 = Float64(pi * Float64(angle_m / 180.0))
	t_5 = cbrt((pi ^ 3.0))
	tmp = 0.0
	if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_4)) * cos(t_4)) <= -2e-217)
		tmp = fma(a, fma(Float64(2.0 * t_2), Float64(t_1 * 0.0), Float64(Float64(a * -2.0) * t_3)), Float64(2.0 * Float64((b ^ 2.0) * t_3)));
	else
		tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(2.0 * Float64(sin(Float64(0.005555555555555556 * Float64(angle_m * t_5))) * cos(Float64(Float64(angle_m / 180.0) * t_5)))));
	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[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$4], $MachinePrecision]), $MachinePrecision], -2e-217], N[(a * N[(N[(2.0 * t$95$2), $MachinePrecision] * N[(t$95$1 * 0.0), $MachinePrecision] + N[(N[(a * -2.0), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(0.005555555555555556 * N[(angle$95$m * t$95$5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * t$95$5), $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 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
t_3 := t\_2 \cdot t\_1\\
t_4 := \pi \cdot \frac{angle\_m}{180}\\
t_5 := \sqrt[3]{{\pi}^{3}}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_4\right) \cdot \cos t\_4 \leq -2 \cdot 10^{-217}:\\
\;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot t\_2, t\_1 \cdot 0, \left(a \cdot -2\right) \cdot t\_3\right), 2 \cdot \left({b}^{2} \cdot t\_3\right)\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -2.00000000000000016e-217

    1. Initial program 52.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000016e-217 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64)))))

    1. Initial program 54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq -2 \cdot 10^{-217}:\\ \;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(2 \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right), \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot 0, \left(a \cdot -2\right) \cdot \left(\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right), 2 \cdot \left({b}^{2} \cdot \left(\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \sqrt[3]{{\pi}^{3}}\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 60.5% accurate, 0.7× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \left(b - a\right) \cdot \left(b + a\right)\\ t_1 := \sqrt[3]{{\pi}^{3}}\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-86}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+259}:\\ \;\;\;\;t\_0 \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot t\_1\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot t\_1\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 (* (- b a) (+ b a))) (t_1 (cbrt (pow PI 3.0))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 5e-86)
      (*
       0.011111111111111112
       (- (* angle_m (* (pow b 2.0) PI)) (* a (* PI (* a angle_m)))))
      (if (<= (/ angle_m 180.0) 1e+259)
        (*
         t_0
         (*
          2.0
          (*
           (cos (* PI (/ angle_m 180.0)))
           (sin (* 0.005555555555555556 (* PI angle_m))))))
        (*
         t_0
         (*
          2.0
          (*
           (sin (* 0.005555555555555556 (* angle_m t_1)))
           (cos (* (/ angle_m 180.0) t_1))))))))))
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 = (b - a) * (b + a);
	double t_1 = cbrt(pow(((double) M_PI), 3.0));
	double tmp;
	if ((angle_m / 180.0) <= 5e-86) {
		tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (((double) M_PI) * (a * angle_m))));
	} else if ((angle_m / 180.0) <= 1e+259) {
		tmp = t_0 * (2.0 * (cos((((double) M_PI) * (angle_m / 180.0))) * sin((0.005555555555555556 * (((double) M_PI) * angle_m)))));
	} else {
		tmp = t_0 * (2.0 * (sin((0.005555555555555556 * (angle_m * t_1))) * cos(((angle_m / 180.0) * t_1))));
	}
	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 = (b - a) * (b + a);
	double t_1 = Math.cbrt(Math.pow(Math.PI, 3.0));
	double tmp;
	if ((angle_m / 180.0) <= 5e-86) {
		tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (Math.PI * (a * angle_m))));
	} else if ((angle_m / 180.0) <= 1e+259) {
		tmp = t_0 * (2.0 * (Math.cos((Math.PI * (angle_m / 180.0))) * Math.sin((0.005555555555555556 * (Math.PI * angle_m)))));
	} else {
		tmp = t_0 * (2.0 * (Math.sin((0.005555555555555556 * (angle_m * t_1))) * Math.cos(((angle_m / 180.0) * t_1))));
	}
	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(b - a) * Float64(b + a))
	t_1 = cbrt((pi ^ 3.0))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e-86)
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(pi * Float64(a * angle_m)))));
	elseif (Float64(angle_m / 180.0) <= 1e+259)
		tmp = Float64(t_0 * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * sin(Float64(0.005555555555555556 * Float64(pi * angle_m))))));
	else
		tmp = Float64(t_0 * Float64(2.0 * Float64(sin(Float64(0.005555555555555556 * Float64(angle_m * t_1))) * cos(Float64(Float64(angle_m / 180.0) * t_1)))));
	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[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-86], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(Pi * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+259], N[(t$95$0 * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(N[Sin[N[(0.005555555555555556 * N[(angle$95$m * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * t$95$1), $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 := \left(b - a\right) \cdot \left(b + a\right)\\
t_1 := \sqrt[3]{{\pi}^{3}}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-86}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\right)\\

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

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


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

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \left(a \cdot \left(angle \cdot \left(-1 \cdot \left(b \cdot \pi\right) + b \cdot \pi\right)\right) + \color{blue}{\left(-a \cdot \left(angle \cdot \pi\right)\right)} \cdot a\right)\right) \]
      6. distribute-lft-neg-out56.0%

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

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

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

    if 4.9999999999999999e-86 < (/.f64 angle #s(literal 180 binary64)) < 9.999999999999999e258

    1. Initial program 47.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.999999999999999e258 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 38.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 60.7% accurate, 1.0× 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 5 \cdot 10^{-86}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+264}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sin \left(angle\_m \cdot \frac{\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}}{-180}\right) \cdot \left(\left(b + a\right) \cdot \left(a - b\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 180.0) 5e-86)
    (*
     0.011111111111111112
     (- (* angle_m (* (pow b 2.0) PI)) (* a (* PI (* a angle_m)))))
    (if (<= (/ angle_m 180.0) 1e+264)
      (*
       (* (- b a) (+ b a))
       (*
        2.0
        (*
         (cos (* PI (/ angle_m 180.0)))
         (sin (* 0.005555555555555556 (* PI angle_m))))))
      (*
       2.0
       (*
        (sin (* angle_m (/ (* (cbrt PI) (pow (cbrt PI) 2.0)) -180.0)))
        (* (+ 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) {
	double tmp;
	if ((angle_m / 180.0) <= 5e-86) {
		tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (((double) M_PI) * (a * angle_m))));
	} else if ((angle_m / 180.0) <= 1e+264) {
		tmp = ((b - a) * (b + a)) * (2.0 * (cos((((double) M_PI) * (angle_m / 180.0))) * sin((0.005555555555555556 * (((double) M_PI) * angle_m)))));
	} else {
		tmp = 2.0 * (sin((angle_m * ((cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0)) / -180.0))) * ((b + a) * (a - b)));
	}
	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) <= 5e-86) {
		tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (Math.PI * (a * angle_m))));
	} else if ((angle_m / 180.0) <= 1e+264) {
		tmp = ((b - a) * (b + a)) * (2.0 * (Math.cos((Math.PI * (angle_m / 180.0))) * Math.sin((0.005555555555555556 * (Math.PI * angle_m)))));
	} else {
		tmp = 2.0 * (Math.sin((angle_m * ((Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0)) / -180.0))) * ((b + a) * (a - b)));
	}
	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) <= 5e-86)
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(pi * Float64(a * angle_m)))));
	elseif (Float64(angle_m / 180.0) <= 1e+264)
		tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * sin(Float64(0.005555555555555556 * Float64(pi * angle_m))))));
	else
		tmp = Float64(2.0 * Float64(sin(Float64(angle_m * Float64(Float64(cbrt(pi) * (cbrt(pi) ^ 2.0)) / -180.0))) * Float64(Float64(b + a) * Float64(a - b))));
	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_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-86], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(Pi * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+264], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(angle$95$m * N[(N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(a - b), $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}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-86}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\right)\\

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

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


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

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \left(a \cdot \left(angle \cdot \left(-1 \cdot \left(b \cdot \pi\right) + b \cdot \pi\right)\right) + \color{blue}{\left(-a \cdot \left(angle \cdot \pi\right)\right)} \cdot a\right)\right) \]
      6. distribute-lft-neg-out56.0%

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

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

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

    if 4.9999999999999999e-86 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e264

    1. Initial program 48.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000004e264 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 17.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. Simplified17.8%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 60.7% 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 := 0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-86}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\cos t\_0 \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin 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 (* 0.005555555555555556 (* PI angle_m))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 5e-86)
      (*
       0.011111111111111112
       (- (* angle_m (* (pow b 2.0) PI)) (* a (* PI (* a angle_m)))))
      (* 2.0 (* (cos t_0) (* (* (- b a) (+ b a)) (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 = 0.005555555555555556 * (((double) M_PI) * angle_m);
	double tmp;
	if ((angle_m / 180.0) <= 5e-86) {
		tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (((double) M_PI) * (a * angle_m))));
	} else {
		tmp = 2.0 * (cos(t_0) * (((b - a) * (b + a)) * 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 = 0.005555555555555556 * (Math.PI * angle_m);
	double tmp;
	if ((angle_m / 180.0) <= 5e-86) {
		tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (Math.PI * (a * angle_m))));
	} else {
		tmp = 2.0 * (Math.cos(t_0) * (((b - a) * (b + a)) * 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 = 0.005555555555555556 * (math.pi * angle_m)
	tmp = 0
	if (angle_m / 180.0) <= 5e-86:
		tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) - (a * (math.pi * (a * angle_m))))
	else:
		tmp = 2.0 * (math.cos(t_0) * (((b - a) * (b + a)) * 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(0.005555555555555556 * Float64(pi * angle_m))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e-86)
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(pi * Float64(a * angle_m)))));
	else
		tmp = Float64(2.0 * Float64(cos(t_0) * Float64(Float64(Float64(b - a) * Float64(b + a)) * 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 = 0.005555555555555556 * (pi * angle_m);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 5e-86)
		tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) - (a * (pi * (a * angle_m))));
	else
		tmp = 2.0 * (cos(t_0) * (((b - a) * (b + a)) * 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[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-86], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(Pi * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $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 := 0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-86}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\right)\\

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


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

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \left(a \cdot \left(angle \cdot \left(-1 \cdot \left(b \cdot \pi\right) + b \cdot \pi\right)\right) + \color{blue}{\left(-a \cdot \left(angle \cdot \pi\right)\right)} \cdot a\right)\right) \]
      6. distribute-lft-neg-out56.0%

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

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

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

    if 4.9999999999999999e-86 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 46.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 60.6% accurate, 1.8× 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 5 \cdot 10^{-86}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\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 180.0) 5e-86)
    (*
     0.011111111111111112
     (- (* angle_m (* (pow b 2.0) PI)) (* a (* PI (* a angle_m)))))
    (*
     (* (- b a) (+ b a))
     (*
      2.0
      (*
       (cos (* PI (/ angle_m 180.0)))
       (sin (* 0.005555555555555556 (* PI angle_m)))))))))
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) <= 5e-86) {
		tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (((double) M_PI) * (a * angle_m))));
	} else {
		tmp = ((b - a) * (b + a)) * (2.0 * (cos((((double) M_PI) * (angle_m / 180.0))) * sin((0.005555555555555556 * (((double) M_PI) * angle_m)))));
	}
	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) <= 5e-86) {
		tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (Math.PI * (a * angle_m))));
	} else {
		tmp = ((b - a) * (b + a)) * (2.0 * (Math.cos((Math.PI * (angle_m / 180.0))) * Math.sin((0.005555555555555556 * (Math.PI * angle_m)))));
	}
	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) <= 5e-86:
		tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) - (a * (math.pi * (a * angle_m))))
	else:
		tmp = ((b - a) * (b + a)) * (2.0 * (math.cos((math.pi * (angle_m / 180.0))) * math.sin((0.005555555555555556 * (math.pi * angle_m)))))
	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) <= 5e-86)
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(pi * Float64(a * angle_m)))));
	else
		tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * sin(Float64(0.005555555555555556 * Float64(pi * angle_m))))));
	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) <= 5e-86)
		tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) - (a * (pi * (a * angle_m))));
	else
		tmp = ((b - a) * (b + a)) * (2.0 * (cos((pi * (angle_m / 180.0))) * sin((0.005555555555555556 * (pi * angle_m)))));
	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], 5e-86], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(Pi * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $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}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-86}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\right)\\

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


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

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \left(a \cdot \left(angle \cdot \left(-1 \cdot \left(b \cdot \pi\right) + b \cdot \pi\right)\right) + \color{blue}{\left(-a \cdot \left(angle \cdot \pi\right)\right)} \cdot a\right)\right) \]
      6. distribute-lft-neg-out56.0%

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

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

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

    if 4.9999999999999999e-86 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 46.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 60.7% accurate, 3.5× 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.8 \cdot 10^{-83}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\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.8e-83)
    (*
     0.011111111111111112
     (- (* angle_m (* (pow b 2.0) PI)) (* a (* PI (* a angle_m)))))
    (*
     (* (- b a) (+ b a))
     (sin (* 2.0 (* 0.005555555555555556 (* PI angle_m))))))))
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.8e-83) {
		tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (((double) M_PI) * (a * angle_m))));
	} else {
		tmp = ((b - a) * (b + a)) * sin((2.0 * (0.005555555555555556 * (((double) M_PI) * angle_m))));
	}
	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.8e-83) {
		tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (Math.PI * (a * angle_m))));
	} else {
		tmp = ((b - a) * (b + a)) * Math.sin((2.0 * (0.005555555555555556 * (Math.PI * angle_m))));
	}
	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.8e-83:
		tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) - (a * (math.pi * (a * angle_m))))
	else:
		tmp = ((b - a) * (b + a)) * math.sin((2.0 * (0.005555555555555556 * (math.pi * angle_m))))
	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.8e-83)
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(pi * Float64(a * angle_m)))));
	else
		tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(2.0 * Float64(0.005555555555555556 * Float64(pi * angle_m)))));
	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.8e-83)
		tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) - (a * (pi * (a * angle_m))));
	else
		tmp = ((b - a) * (b + a)) * sin((2.0 * (0.005555555555555556 * (pi * angle_m))));
	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.8e-83], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(Pi * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(2.0 * N[(0.005555555555555556 * N[(Pi * angle$95$m), $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.8 \cdot 10^{-83}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(\pi \cdot \left(a \cdot angle\_m\right)\right)\right)\\

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


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

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \left(a \cdot \left(angle \cdot \left(-1 \cdot \left(b \cdot \pi\right) + b \cdot \pi\right)\right) + \color{blue}{\left(-a \cdot \left(angle \cdot \pi\right)\right)} \cdot a\right)\right) \]
      6. distribute-lft-neg-out56.0%

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

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

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

    if 7.800000000000001e-83 < angle

    1. Initial program 46.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 57.7% accurate, 3.6× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\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
  (*
   (* (- b a) (+ b a))
   (sin (* 2.0 (* 0.005555555555555556 (* PI angle_m)))))))
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 * (((b - a) * (b + a)) * sin((2.0 * (0.005555555555555556 * (((double) M_PI) * angle_m)))));
}
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 * (((b - a) * (b + a)) * Math.sin((2.0 * (0.005555555555555556 * (Math.PI * angle_m)))));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (((b - a) * (b + a)) * math.sin((2.0 * (0.005555555555555556 * (math.pi * angle_m)))))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(2.0 * Float64(0.005555555555555556 * Float64(pi * angle_m))))))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (((b - a) * (b + a)) * sin((2.0 * (0.005555555555555556 * (pi * angle_m)))));
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[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(2.0 * N[(0.005555555555555556 * N[(Pi * angle$95$m), $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(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 54.8% 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(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 (* PI (* (- b a) (+ 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 * (((double) M_PI) * ((b - a) * (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 * (Math.PI * ((b - a) * (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 * (math.pi * ((b - a) * (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(pi * Float64(Float64(b - a) * 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 * (pi * ((b - a) * (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[(Pi * N[(N[(b - a), $MachinePrecision] * 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(\pi \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.5%

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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