ab-angle->ABCF B

Percentage Accurate: 54.2% → 67.1%
Time: 39.8s
Alternatives: 20
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 20 alternatives:

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

Initial Program: 54.2% accurate, 1.0× speedup?

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

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

Alternative 1: 67.1% 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 := \pi \cdot \frac{angle\_m}{180}\\ t_1 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\ t_2 := \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin t\_0\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-6}:\\ \;\;\;\;2 \cdot \left(\left(a \cdot \left(t\_1 \cdot \left(b - b\right) - a \cdot t\_1\right) + {\left(b \cdot \sqrt{t\_1}\right)}^{2}\right) \cdot \cos t\_0\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+172}:\\ \;\;\;\;2 \cdot \left(t\_2 \cdot \cos \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t\_2 \cdot \sqrt{{\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)}^{2}}\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 (sin (* 0.005555555555555556 (* angle_m PI))))
        (t_2 (* (* (+ b a) (- b a)) (sin t_0))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1e-6)
      (*
       2.0
       (*
        (+ (* a (- (* t_1 (- b b)) (* a t_1))) (pow (* b (sqrt t_1)) 2.0))
        (cos t_0)))
      (if (<= (/ angle_m 180.0) 2e+172)
        (* 2.0 (* t_2 (cos (* (/ angle_m 180.0) (cbrt (pow PI 3.0))))))
        (*
         2.0
         (*
          t_2
          (sqrt (pow (cos (* PI (* 0.005555555555555556 angle_m))) 2.0)))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m / 180.0);
	double t_1 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	double t_2 = ((b + a) * (b - a)) * sin(t_0);
	double tmp;
	if ((angle_m / 180.0) <= 1e-6) {
		tmp = 2.0 * (((a * ((t_1 * (b - b)) - (a * t_1))) + pow((b * sqrt(t_1)), 2.0)) * cos(t_0));
	} else if ((angle_m / 180.0) <= 2e+172) {
		tmp = 2.0 * (t_2 * cos(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0)))));
	} else {
		tmp = 2.0 * (t_2 * sqrt(pow(cos((((double) M_PI) * (0.005555555555555556 * angle_m))), 2.0)));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = Math.PI * (angle_m / 180.0);
	double t_1 = Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
	double t_2 = ((b + a) * (b - a)) * Math.sin(t_0);
	double tmp;
	if ((angle_m / 180.0) <= 1e-6) {
		tmp = 2.0 * (((a * ((t_1 * (b - b)) - (a * t_1))) + Math.pow((b * Math.sqrt(t_1)), 2.0)) * Math.cos(t_0));
	} else if ((angle_m / 180.0) <= 2e+172) {
		tmp = 2.0 * (t_2 * Math.cos(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0)))));
	} else {
		tmp = 2.0 * (t_2 * Math.sqrt(Math.pow(Math.cos((Math.PI * (0.005555555555555556 * angle_m))), 2.0)));
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(pi * Float64(angle_m / 180.0))
	t_1 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))
	t_2 = Float64(Float64(Float64(b + a) * Float64(b - a)) * sin(t_0))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1e-6)
		tmp = Float64(2.0 * Float64(Float64(Float64(a * Float64(Float64(t_1 * Float64(b - b)) - Float64(a * t_1))) + (Float64(b * sqrt(t_1)) ^ 2.0)) * cos(t_0)));
	elseif (Float64(angle_m / 180.0) <= 2e+172)
		tmp = Float64(2.0 * Float64(t_2 * cos(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0))))));
	else
		tmp = Float64(2.0 * Float64(t_2 * sqrt((cos(Float64(pi * Float64(0.005555555555555556 * angle_m))) ^ 2.0))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-6], N[(2.0 * N[(N[(N[(a * N[(N[(t$95$1 * N[(b - b), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[N[(b * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+172], N[(2.0 * N[(t$95$2 * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$2 * N[Sqrt[N[Power[N[Cos[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.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 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
t_2 := \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-6}:\\
\;\;\;\;2 \cdot \left(\left(a \cdot \left(t\_1 \cdot \left(b - b\right) - a \cdot t\_1\right) + {\left(b \cdot \sqrt{t\_1}\right)}^{2}\right) \cdot \cos t\_0\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+172}:\\
\;\;\;\;2 \cdot \left(t\_2 \cdot \cos \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_2 \cdot \sqrt{{\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)}^{2}}\right)\\


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

    1. Initial program 55.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*55.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999955e-7 < (/.f64 angle #s(literal 180 binary64)) < 2.0000000000000002e172

    1. Initial program 50.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*50.3%

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000002e172 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 34.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*34.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 65.9% 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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{-250}:\\ \;\;\;\;2 \cdot \left(\left(a \cdot \left(t\_0 \cdot \left(b - b\right) - a \cdot t\_0\right) + {b}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)\right)\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\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 (sin (* 0.005555555555555556 (* angle_m PI)))))
   (*
    angle_s
    (if (<= (- (pow b 2.0) (pow a 2.0)) -1e-250)
      (*
       2.0
       (*
        (+
         (* a (- (* t_0 (- b b)) (* a t_0)))
         (*
          (pow b 2.0)
          (sin
           (*
            0.005555555555555556
            (* angle_m (* (cbrt PI) (pow (cbrt PI) 2.0)))))))
        (expm1 (log1p (cos (* PI (* 0.005555555555555556 angle_m)))))))
      (*
       (hypot b a)
       (*
        (hypot b a)
        (sin (* 2.0 (* angle_m (* 0.005555555555555556 PI))))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	double tmp;
	if ((pow(b, 2.0) - pow(a, 2.0)) <= -1e-250) {
		tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (pow(b, 2.0) * sin((0.005555555555555556 * (angle_m * (cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0))))))) * expm1(log1p(cos((((double) M_PI) * (0.005555555555555556 * angle_m))))));
	} else {
		tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * ((double) M_PI))))));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
	double tmp;
	if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -1e-250) {
		tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (Math.pow(b, 2.0) * Math.sin((0.005555555555555556 * (angle_m * (Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0))))))) * Math.expm1(Math.log1p(Math.cos((Math.PI * (0.005555555555555556 * angle_m))))));
	} else {
		tmp = Math.hypot(b, a) * (Math.hypot(b, a) * Math.sin((2.0 * (angle_m * (0.005555555555555556 * Math.PI)))));
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))
	tmp = 0.0
	if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -1e-250)
		tmp = Float64(2.0 * Float64(Float64(Float64(a * Float64(Float64(t_0 * Float64(b - b)) - Float64(a * t_0))) + Float64((b ^ 2.0) * sin(Float64(0.005555555555555556 * Float64(angle_m * Float64(cbrt(pi) * (cbrt(pi) ^ 2.0))))))) * expm1(log1p(cos(Float64(pi * Float64(0.005555555555555556 * angle_m)))))));
	else
		tmp = Float64(hypot(b, a) * Float64(hypot(b, a) * sin(Float64(2.0 * Float64(angle_m * Float64(0.005555555555555556 * pi))))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -1e-250], N[(2.0 * N[(N[(N[(a * N[(N[(t$95$0 * N[(b - b), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[b, 2.0], $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Exp[N[Log[1 + N[Cos[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[Sin[N[(2.0 * N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{-250}:\\
\;\;\;\;2 \cdot \left(\left(a \cdot \left(t\_0 \cdot \left(b - b\right) - a \cdot t\_0\right) + {b}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)\right)\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\right)\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.0000000000000001e-250

    1. Initial program 50.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*50.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.0000000000000001e-250 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 53.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\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)\right) \cdot \left(\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)\right)\right) \cdot \left(\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)\right)}} \]
      2. pow1/330.3%

        \[\leadsto \color{blue}{{\left(\left(\left(\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)\right) \cdot \left(\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)\right)\right) \cdot \left(\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)\right)\right)}^{0.3333333333333333}} \]
    6. Applied egg-rr30.3%

      \[\leadsto \color{blue}{{\left({\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\left(2 \cdot \pi\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
    7. Step-by-step derivation
      1. unpow1/341.3%

        \[\leadsto \color{blue}{\sqrt[3]{{\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\left(2 \cdot \pi\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}}} \]
      2. rem-cbrt-cube54.7%

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

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

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

      \[\leadsto \color{blue}{\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.4%

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

Alternative 3: 65.9% accurate, 0.4× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{-250}:\\ \;\;\;\;2 \cdot \left(\left(a \cdot \left(t\_0 \cdot \left(b - b\right) - a \cdot t\_0\right) + {b}^{2} \cdot t\_0\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\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 (sin (* 0.005555555555555556 (* angle_m PI)))))
   (*
    angle_s
    (if (<= (- (pow b 2.0) (pow a 2.0)) -1e-250)
      (*
       2.0
       (*
        (+ (* a (- (* t_0 (- b b)) (* a t_0))) (* (pow b 2.0) t_0))
        (log1p (expm1 (cos (* PI (* 0.005555555555555556 angle_m)))))))
      (*
       (hypot b a)
       (*
        (hypot b a)
        (sin (* 2.0 (* angle_m (* 0.005555555555555556 PI))))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	double tmp;
	if ((pow(b, 2.0) - pow(a, 2.0)) <= -1e-250) {
		tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (pow(b, 2.0) * t_0)) * log1p(expm1(cos((((double) M_PI) * (0.005555555555555556 * angle_m))))));
	} else {
		tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * ((double) M_PI))))));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
	double tmp;
	if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -1e-250) {
		tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (Math.pow(b, 2.0) * t_0)) * Math.log1p(Math.expm1(Math.cos((Math.PI * (0.005555555555555556 * angle_m))))));
	} else {
		tmp = Math.hypot(b, a) * (Math.hypot(b, a) * Math.sin((2.0 * (angle_m * (0.005555555555555556 * Math.PI)))));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = math.sin((0.005555555555555556 * (angle_m * math.pi)))
	tmp = 0
	if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= -1e-250:
		tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (math.pow(b, 2.0) * t_0)) * math.log1p(math.expm1(math.cos((math.pi * (0.005555555555555556 * angle_m))))))
	else:
		tmp = math.hypot(b, a) * (math.hypot(b, a) * math.sin((2.0 * (angle_m * (0.005555555555555556 * math.pi)))))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))
	tmp = 0.0
	if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -1e-250)
		tmp = Float64(2.0 * Float64(Float64(Float64(a * Float64(Float64(t_0 * Float64(b - b)) - Float64(a * t_0))) + Float64((b ^ 2.0) * t_0)) * log1p(expm1(cos(Float64(pi * Float64(0.005555555555555556 * angle_m)))))));
	else
		tmp = Float64(hypot(b, a) * Float64(hypot(b, a) * sin(Float64(2.0 * Float64(angle_m * Float64(0.005555555555555556 * pi))))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -1e-250], N[(2.0 * N[(N[(N[(a * N[(N[(t$95$0 * N[(b - b), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[b, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[Log[1 + N[(Exp[N[Cos[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[Sin[N[(2.0 * N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{-250}:\\
\;\;\;\;2 \cdot \left(\left(a \cdot \left(t\_0 \cdot \left(b - b\right) - a \cdot t\_0\right) + {b}^{2} \cdot t\_0\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\right)\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.0000000000000001e-250

    1. Initial program 50.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*50.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.0000000000000001e-250 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 53.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\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)\right) \cdot \left(\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)\right)\right) \cdot \left(\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)\right)}} \]
      2. pow1/330.3%

        \[\leadsto \color{blue}{{\left(\left(\left(\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)\right) \cdot \left(\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)\right)\right) \cdot \left(\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)\right)\right)}^{0.3333333333333333}} \]
    6. Applied egg-rr30.3%

      \[\leadsto \color{blue}{{\left({\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\left(2 \cdot \pi\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
    7. Step-by-step derivation
      1. unpow1/341.3%

        \[\leadsto \color{blue}{\sqrt[3]{{\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\left(2 \cdot \pi\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}}} \]
      2. rem-cbrt-cube54.7%

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

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

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

      \[\leadsto \color{blue}{\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{-250}:\\ \;\;\;\;2 \cdot \left(\left(a \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b - b\right) - a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) + {b}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 65.9% accurate, 0.5× speedup?

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.0000000000000001e-250

    1. Initial program 50.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*50.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.0000000000000001e-250 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 53.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\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)\right) \cdot \left(\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)\right)\right) \cdot \left(\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)\right)}} \]
      2. pow1/330.3%

        \[\leadsto \color{blue}{{\left(\left(\left(\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)\right) \cdot \left(\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)\right)\right) \cdot \left(\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)\right)\right)}^{0.3333333333333333}} \]
    6. Applied egg-rr30.3%

      \[\leadsto \color{blue}{{\left({\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\left(2 \cdot \pi\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
    7. Step-by-step derivation
      1. unpow1/341.3%

        \[\leadsto \color{blue}{\sqrt[3]{{\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\left(2 \cdot \pi\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}}} \]
      2. rem-cbrt-cube54.7%

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

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

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

      \[\leadsto \color{blue}{\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification67.6%

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

Alternative 5: 65.9% 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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{-250}:\\ \;\;\;\;2 \cdot \left(\left(a \cdot \left(t\_0 \cdot \left(b - b\right) - a \cdot t\_0\right) + {b}^{2} \cdot t\_0\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\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 (sin (* 0.005555555555555556 (* angle_m PI)))))
   (*
    angle_s
    (if (<= (- (pow b 2.0) (pow a 2.0)) -1e-250)
      (*
       2.0
       (*
        (+ (* a (- (* t_0 (- b b)) (* a t_0))) (* (pow b 2.0) t_0))
        (cos (* PI (/ angle_m 180.0)))))
      (*
       (hypot b a)
       (*
        (hypot b a)
        (sin (* 2.0 (* angle_m (* 0.005555555555555556 PI))))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	double tmp;
	if ((pow(b, 2.0) - pow(a, 2.0)) <= -1e-250) {
		tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (pow(b, 2.0) * t_0)) * cos((((double) M_PI) * (angle_m / 180.0))));
	} else {
		tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * ((double) M_PI))))));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
	double tmp;
	if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -1e-250) {
		tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (Math.pow(b, 2.0) * t_0)) * Math.cos((Math.PI * (angle_m / 180.0))));
	} else {
		tmp = Math.hypot(b, a) * (Math.hypot(b, a) * Math.sin((2.0 * (angle_m * (0.005555555555555556 * Math.PI)))));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = math.sin((0.005555555555555556 * (angle_m * math.pi)))
	tmp = 0
	if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= -1e-250:
		tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (math.pow(b, 2.0) * t_0)) * math.cos((math.pi * (angle_m / 180.0))))
	else:
		tmp = math.hypot(b, a) * (math.hypot(b, a) * math.sin((2.0 * (angle_m * (0.005555555555555556 * math.pi)))))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))
	tmp = 0.0
	if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -1e-250)
		tmp = Float64(2.0 * Float64(Float64(Float64(a * Float64(Float64(t_0 * Float64(b - b)) - Float64(a * t_0))) + Float64((b ^ 2.0) * t_0)) * cos(Float64(pi * Float64(angle_m / 180.0)))));
	else
		tmp = Float64(hypot(b, a) * Float64(hypot(b, a) * sin(Float64(2.0 * Float64(angle_m * Float64(0.005555555555555556 * pi))))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = sin((0.005555555555555556 * (angle_m * pi)));
	tmp = 0.0;
	if (((b ^ 2.0) - (a ^ 2.0)) <= -1e-250)
		tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + ((b ^ 2.0) * t_0)) * cos((pi * (angle_m / 180.0))));
	else
		tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * pi)))));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -1e-250], N[(2.0 * N[(N[(N[(a * N[(N[(t$95$0 * N[(b - b), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[b, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[Sin[N[(2.0 * N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{-250}:\\
\;\;\;\;2 \cdot \left(\left(a \cdot \left(t\_0 \cdot \left(b - b\right) - a \cdot t\_0\right) + {b}^{2} \cdot t\_0\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.0000000000000001e-250

    1. Initial program 50.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*50.1%

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

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

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

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

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

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

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

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

    if -1.0000000000000001e-250 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 53.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\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)\right) \cdot \left(\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)\right)\right) \cdot \left(\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)\right)}} \]
      2. pow1/330.3%

        \[\leadsto \color{blue}{{\left(\left(\left(\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)\right) \cdot \left(\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)\right)\right) \cdot \left(\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)\right)\right)}^{0.3333333333333333}} \]
    6. Applied egg-rr30.3%

      \[\leadsto \color{blue}{{\left({\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\left(2 \cdot \pi\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
    7. Step-by-step derivation
      1. unpow1/341.3%

        \[\leadsto \color{blue}{\sqrt[3]{{\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\left(2 \cdot \pi\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}}} \]
      2. rem-cbrt-cube54.7%

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

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

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

      \[\leadsto \color{blue}{\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification67.6%

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

Alternative 6: 64.8% 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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq 10^{+60}:\\ \;\;\;\;2 \cdot \left(a \cdot \left(t\_0 \cdot \left(b - b\right) - a \cdot t\_0\right) + {b}^{2} \cdot t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\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 (sin (* 0.005555555555555556 (* angle_m PI)))))
   (*
    angle_s
    (if (<= (- (pow b 2.0) (pow a 2.0)) 1e+60)
      (* 2.0 (+ (* a (- (* t_0 (- b b)) (* a t_0))) (* (pow b 2.0) t_0)))
      (*
       (hypot b a)
       (*
        (hypot b a)
        (sin (* 2.0 (* angle_m (* 0.005555555555555556 PI))))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	double tmp;
	if ((pow(b, 2.0) - pow(a, 2.0)) <= 1e+60) {
		tmp = 2.0 * ((a * ((t_0 * (b - b)) - (a * t_0))) + (pow(b, 2.0) * t_0));
	} else {
		tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * ((double) M_PI))))));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
	double tmp;
	if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= 1e+60) {
		tmp = 2.0 * ((a * ((t_0 * (b - b)) - (a * t_0))) + (Math.pow(b, 2.0) * t_0));
	} else {
		tmp = Math.hypot(b, a) * (Math.hypot(b, a) * Math.sin((2.0 * (angle_m * (0.005555555555555556 * Math.PI)))));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = math.sin((0.005555555555555556 * (angle_m * math.pi)))
	tmp = 0
	if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= 1e+60:
		tmp = 2.0 * ((a * ((t_0 * (b - b)) - (a * t_0))) + (math.pow(b, 2.0) * t_0))
	else:
		tmp = math.hypot(b, a) * (math.hypot(b, a) * math.sin((2.0 * (angle_m * (0.005555555555555556 * math.pi)))))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))
	tmp = 0.0
	if (Float64((b ^ 2.0) - (a ^ 2.0)) <= 1e+60)
		tmp = Float64(2.0 * Float64(Float64(a * Float64(Float64(t_0 * Float64(b - b)) - Float64(a * t_0))) + Float64((b ^ 2.0) * t_0)));
	else
		tmp = Float64(hypot(b, a) * Float64(hypot(b, a) * sin(Float64(2.0 * Float64(angle_m * Float64(0.005555555555555556 * pi))))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = sin((0.005555555555555556 * (angle_m * pi)));
	tmp = 0.0;
	if (((b ^ 2.0) - (a ^ 2.0)) <= 1e+60)
		tmp = 2.0 * ((a * ((t_0 * (b - b)) - (a * t_0))) + ((b ^ 2.0) * t_0));
	else
		tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * pi)))));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 1e+60], N[(2.0 * N[(N[(a * N[(N[(t$95$0 * N[(b - b), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[b, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[Sin[N[(2.0 * N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq 10^{+60}:\\
\;\;\;\;2 \cdot \left(a \cdot \left(t\_0 \cdot \left(b - b\right) - a \cdot t\_0\right) + {b}^{2} \cdot t\_0\right)\\

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


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

    1. Initial program 55.2%

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999995e59 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 47.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*47.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. *-commutative47.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*47.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. Simplified47.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. Step-by-step derivation
      1. add-cbrt-cube36.7%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\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)\right) \cdot \left(\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)\right)\right) \cdot \left(\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)\right)}} \]
      2. pow1/323.5%

        \[\leadsto \color{blue}{{\left(\left(\left(\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)\right) \cdot \left(\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)\right)\right) \cdot \left(\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)\right)\right)}^{0.3333333333333333}} \]
    6. Applied egg-rr23.5%

      \[\leadsto \color{blue}{{\left({\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\left(2 \cdot \pi\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
    7. Step-by-step derivation
      1. unpow1/337.9%

        \[\leadsto \color{blue}{\sqrt[3]{{\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\left(2 \cdot \pi\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}}} \]
      2. rem-cbrt-cube48.8%

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

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

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

      \[\leadsto \color{blue}{\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.2%

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

Alternative 7: 61.6% 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 := {b}^{2} - {a}^{2}\\ t_1 := \left(b + a\right) \cdot \left(b - a\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 2 \cdot 10^{+307}:\\ \;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right) \cdot t\_1\right)\right)\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(b, \left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(b \cdot \pi\right), \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) \cdot -0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot t\_1\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 (- (pow b 2.0) (pow a 2.0))) (t_1 (* (+ b a) (- b a))))
   (*
    angle_s
    (if (<= t_0 2e+307)
      (*
       2.0
       (*
        (cos (* PI (* 0.005555555555555556 angle_m)))
        (* (sin (* 0.005555555555555556 (* angle_m PI))) t_1)))
      (if (<= t_0 INFINITY)
        (fma
         b
         (* (* angle_m 0.011111111111111112) (* b PI))
         (* (* (pow a 2.0) (* angle_m PI)) -0.011111111111111112))
        (* (* angle_m 0.011111111111111112) (* PI 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 = pow(b, 2.0) - pow(a, 2.0);
	double t_1 = (b + a) * (b - a);
	double tmp;
	if (t_0 <= 2e+307) {
		tmp = 2.0 * (cos((((double) M_PI) * (0.005555555555555556 * angle_m))) * (sin((0.005555555555555556 * (angle_m * ((double) M_PI)))) * t_1));
	} else if (t_0 <= ((double) INFINITY)) {
		tmp = fma(b, ((angle_m * 0.011111111111111112) * (b * ((double) M_PI))), ((pow(a, 2.0) * (angle_m * ((double) M_PI))) * -0.011111111111111112));
	} else {
		tmp = (angle_m * 0.011111111111111112) * (((double) M_PI) * 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((b ^ 2.0) - (a ^ 2.0))
	t_1 = Float64(Float64(b + a) * Float64(b - a))
	tmp = 0.0
	if (t_0 <= 2e+307)
		tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(0.005555555555555556 * angle_m))) * Float64(sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) * t_1)));
	elseif (t_0 <= Inf)
		tmp = fma(b, Float64(Float64(angle_m * 0.011111111111111112) * Float64(b * pi)), Float64(Float64((a ^ 2.0) * Float64(angle_m * pi)) * -0.011111111111111112));
	else
		tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(pi * 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[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, 2e+307], N[(2.0 * N[(N[Cos[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(b * N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(Pi * t$95$1), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(b, \left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(b \cdot \pi\right), \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) \cdot -0.011111111111111112\right)\\

\mathbf{else}:\\
\;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot t\_1\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.99999999999999997e307

    1. Initial program 56.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999997e307 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0

    1. Initial program 51.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*51.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. *-commutative51.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*51.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. Simplified51.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 0 47.8%

      \[\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. unpow251.9%

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

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

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

      \[\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. Taylor expanded in b around 0 68.5%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, 0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)\right), -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right)} \]
      3. associate-*r*68.6%

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(0.011111111111111112 \cdot angle\right) \cdot \left(b \cdot \pi\right)} + 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)\right), -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      4. associate-*r*68.6%

        \[\leadsto \mathsf{fma}\left(b, \left(0.011111111111111112 \cdot angle\right) \cdot \left(b \cdot \pi\right) + \color{blue}{\left(0.011111111111111112 \cdot angle\right) \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)}, -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      5. distribute-lft-out68.6%

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(0.011111111111111112 \cdot angle\right) \cdot \left(b \cdot \pi + \pi \cdot \left(a + -1 \cdot a\right)\right)}, -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      6. +-commutative68.6%

        \[\leadsto \mathsf{fma}\left(b, \left(0.011111111111111112 \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot \left(a + -1 \cdot a\right) + b \cdot \pi\right)}, -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      7. *-commutative68.6%

        \[\leadsto \mathsf{fma}\left(b, \left(0.011111111111111112 \cdot angle\right) \cdot \left(\color{blue}{\left(a + -1 \cdot a\right) \cdot \pi} + b \cdot \pi\right), -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      8. distribute-rgt1-in68.6%

        \[\leadsto \mathsf{fma}\left(b, \left(0.011111111111111112 \cdot angle\right) \cdot \left(\color{blue}{\left(\left(-1 + 1\right) \cdot a\right)} \cdot \pi + b \cdot \pi\right), -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      9. metadata-eval68.6%

        \[\leadsto \mathsf{fma}\left(b, \left(0.011111111111111112 \cdot angle\right) \cdot \left(\left(\color{blue}{0} \cdot a\right) \cdot \pi + b \cdot \pi\right), -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      10. mul0-lft68.6%

        \[\leadsto \mathsf{fma}\left(b, \left(0.011111111111111112 \cdot angle\right) \cdot \left(\color{blue}{0} \cdot \pi + b \cdot \pi\right), -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      11. distribute-rgt-out68.6%

        \[\leadsto \mathsf{fma}\left(b, \left(0.011111111111111112 \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot \left(0 + b\right)\right)}, -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      12. *-commutative68.6%

        \[\leadsto \mathsf{fma}\left(b, \left(0.011111111111111112 \cdot angle\right) \cdot \left(\pi \cdot \left(0 + b\right)\right), \color{blue}{\left({a}^{2} \cdot \left(angle \cdot \pi\right)\right) \cdot -0.011111111111111112}\right) \]
    10. Simplified68.6%

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

    if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 0.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*0.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. *-commutative0.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*0.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. Simplified0.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 0 0.0%

      \[\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. unpow20.0%

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

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

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

      \[\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. Taylor expanded in angle around 0 42.3%

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

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

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

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

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

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

Alternative 8: 61.6% accurate, 0.7× speedup?

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

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


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

    1. Initial program 55.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000015e191 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 45.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*45.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. *-commutative45.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*45.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. Simplified45.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. Step-by-step derivation
      1. add-cbrt-cube38.4%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\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)\right) \cdot \left(\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)\right)\right) \cdot \left(\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)\right)}} \]
      2. pow1/325.4%

        \[\leadsto \color{blue}{{\left(\left(\left(\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)\right) \cdot \left(\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)\right)\right) \cdot \left(\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)\right)\right)}^{0.3333333333333333}} \]
    6. Applied egg-rr25.4%

      \[\leadsto \color{blue}{{\left({\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\left(2 \cdot \pi\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
    7. Step-by-step derivation
      1. unpow1/339.7%

        \[\leadsto \color{blue}{\sqrt[3]{{\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\left(2 \cdot \pi\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}}} \]
      2. rem-cbrt-cube47.6%

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

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

        \[\leadsto \color{blue}{\sqrt{{b}^{2} - {a}^{2}} \cdot \left(\sqrt{{b}^{2} - {a}^{2}} \cdot \sin \left(\left(2 \cdot \pi\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)} \]
    8. Applied egg-rr76.9%

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

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

Alternative 9: 61.5% accurate, 0.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}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{-250}:\\ \;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\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 (<= (- (pow b 2.0) (pow a 2.0)) -1e-250)
    (*
     2.0
     (*
      (cos (* PI (* 0.005555555555555556 angle_m)))
      (* (sin (* 0.005555555555555556 (* angle_m PI))) (* (+ b a) (- b a)))))
    (*
     (hypot b a)
     (* (hypot b a) (sin (* 2.0 (* angle_m (* 0.005555555555555556 PI)))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if ((pow(b, 2.0) - pow(a, 2.0)) <= -1e-250) {
		tmp = 2.0 * (cos((((double) M_PI) * (0.005555555555555556 * angle_m))) * (sin((0.005555555555555556 * (angle_m * ((double) M_PI)))) * ((b + a) * (b - a))));
	} else {
		tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * ((double) M_PI))))));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -1e-250) {
		tmp = 2.0 * (Math.cos((Math.PI * (0.005555555555555556 * angle_m))) * (Math.sin((0.005555555555555556 * (angle_m * Math.PI))) * ((b + a) * (b - a))));
	} else {
		tmp = Math.hypot(b, a) * (Math.hypot(b, a) * Math.sin((2.0 * (angle_m * (0.005555555555555556 * Math.PI)))));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= -1e-250:
		tmp = 2.0 * (math.cos((math.pi * (0.005555555555555556 * angle_m))) * (math.sin((0.005555555555555556 * (angle_m * math.pi))) * ((b + a) * (b - a))))
	else:
		tmp = math.hypot(b, a) * (math.hypot(b, a) * math.sin((2.0 * (angle_m * (0.005555555555555556 * math.pi)))))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -1e-250)
		tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(0.005555555555555556 * angle_m))) * Float64(sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) * Float64(Float64(b + a) * Float64(b - a)))));
	else
		tmp = Float64(hypot(b, a) * Float64(hypot(b, a) * sin(Float64(2.0 * Float64(angle_m * Float64(0.005555555555555556 * pi))))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (((b ^ 2.0) - (a ^ 2.0)) <= -1e-250)
		tmp = 2.0 * (cos((pi * (0.005555555555555556 * angle_m))) * (sin((0.005555555555555556 * (angle_m * pi))) * ((b + a) * (b - a))));
	else
		tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * pi)))));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -1e-250], N[(2.0 * N[(N[Cos[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[Sin[N[(2.0 * N[(angle$95$m * N[(0.005555555555555556 * Pi), $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}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{-250}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.0000000000000001e-250

    1. Initial program 50.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*50.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.0000000000000001e-250 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 53.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\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)\right) \cdot \left(\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)\right)\right) \cdot \left(\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)\right)}} \]
      2. pow1/330.3%

        \[\leadsto \color{blue}{{\left(\left(\left(\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)\right) \cdot \left(\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)\right)\right) \cdot \left(\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)\right)\right)}^{0.3333333333333333}} \]
    6. Applied egg-rr30.3%

      \[\leadsto \color{blue}{{\left({\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\left(2 \cdot \pi\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
    7. Step-by-step derivation
      1. unpow1/341.3%

        \[\leadsto \color{blue}{\sqrt[3]{{\left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\left(2 \cdot \pi\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{3}}} \]
      2. rem-cbrt-cube54.7%

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

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

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

      \[\leadsto \color{blue}{\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.3%

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

Alternative 10: 61.3% accurate, 0.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}\;{b}^{2} - {a}^{2} \leq 2 \cdot 10^{+294}:\\ \;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot {\left(\mathsf{hypot}\left(b, a\right) \cdot \sqrt{angle\_m \cdot \pi}\right)}^{2}\\ \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 (<= (- (pow b 2.0) (pow a 2.0)) 2e+294)
    (*
     2.0
     (*
      (cos (* PI (* 0.005555555555555556 angle_m)))
      (* (sin (* 0.005555555555555556 (* angle_m PI))) (* (+ b a) (- b a)))))
    (* 0.011111111111111112 (pow (* (hypot b a) (sqrt (* angle_m PI))) 2.0)))))
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 ((pow(b, 2.0) - pow(a, 2.0)) <= 2e+294) {
		tmp = 2.0 * (cos((((double) M_PI) * (0.005555555555555556 * angle_m))) * (sin((0.005555555555555556 * (angle_m * ((double) M_PI)))) * ((b + a) * (b - a))));
	} else {
		tmp = 0.011111111111111112 * pow((hypot(b, a) * sqrt((angle_m * ((double) M_PI)))), 2.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 tmp;
	if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= 2e+294) {
		tmp = 2.0 * (Math.cos((Math.PI * (0.005555555555555556 * angle_m))) * (Math.sin((0.005555555555555556 * (angle_m * Math.PI))) * ((b + a) * (b - a))));
	} else {
		tmp = 0.011111111111111112 * Math.pow((Math.hypot(b, a) * Math.sqrt((angle_m * Math.PI))), 2.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):
	tmp = 0
	if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= 2e+294:
		tmp = 2.0 * (math.cos((math.pi * (0.005555555555555556 * angle_m))) * (math.sin((0.005555555555555556 * (angle_m * math.pi))) * ((b + a) * (b - a))))
	else:
		tmp = 0.011111111111111112 * math.pow((math.hypot(b, a) * math.sqrt((angle_m * math.pi))), 2.0)
	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((b ^ 2.0) - (a ^ 2.0)) <= 2e+294)
		tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(0.005555555555555556 * angle_m))) * Float64(sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) * Float64(Float64(b + a) * Float64(b - a)))));
	else
		tmp = Float64(0.011111111111111112 * (Float64(hypot(b, a) * sqrt(Float64(angle_m * pi))) ^ 2.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)
	tmp = 0.0;
	if (((b ^ 2.0) - (a ^ 2.0)) <= 2e+294)
		tmp = 2.0 * (cos((pi * (0.005555555555555556 * angle_m))) * (sin((0.005555555555555556 * (angle_m * pi))) * ((b + a) * (b - a))));
	else
		tmp = 0.011111111111111112 * ((hypot(b, a) * sqrt((angle_m * pi))) ^ 2.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_] := N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 2e+294], N[(2.0 * N[(N[Cos[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[Power[N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[Sqrt[N[(angle$95$m * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq 2 \cdot 10^{+294}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot {\left(\mathsf{hypot}\left(b, a\right) \cdot \sqrt{angle\_m \cdot \pi}\right)}^{2}\\


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

    1. Initial program 55.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*55.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000013e294 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 40.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*40.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. *-commutative40.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*40.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. Simplified40.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 37.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. add-sqr-sqrt20.8%

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

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

      \[\leadsto 0.011111111111111112 \cdot \color{blue}{{\left(\sqrt{\pi \cdot angle} \cdot \mathsf{hypot}\left(b, a\right)\right)}^{2}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification52.9%

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

Alternative 11: 58.8% accurate, 1.9× 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 2 \cdot 10^{-230}:\\ \;\;\;\;\mathsf{fma}\left(b, \left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(b \cdot \pi\right), \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) \cdot -0.011111111111111112\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-155}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+76}:\\ \;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\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) 2e-230)
    (fma
     b
     (* (* angle_m 0.011111111111111112) (* b PI))
     (* (* (pow a 2.0) (* angle_m PI)) -0.011111111111111112))
    (if (<= (/ angle_m 180.0) 4e-155)
      (+
       (* 0.011111111111111112 (* angle_m (* (pow b 2.0) PI)))
       (*
        a
        (+
         (* -0.011111111111111112 (* a (* angle_m PI)))
         (* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
      (if (<= (/ angle_m 180.0) 1e+76)
        (* (* angle_m 0.011111111111111112) (* (- b a) (* PI (+ b a))))
        (* 2.0 (* (* (+ b a) (- b a)) (sin (* PI (/ angle_m 180.0))))))))))
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) <= 2e-230) {
		tmp = fma(b, ((angle_m * 0.011111111111111112) * (b * ((double) M_PI))), ((pow(a, 2.0) * (angle_m * ((double) M_PI))) * -0.011111111111111112));
	} else if ((angle_m / 180.0) <= 4e-155) {
		tmp = (0.011111111111111112 * (angle_m * (pow(b, 2.0) * ((double) M_PI)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
	} else if ((angle_m / 180.0) <= 1e+76) {
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (((double) M_PI) * (b + a)));
	} else {
		tmp = 2.0 * (((b + a) * (b - a)) * sin((((double) M_PI) * (angle_m / 180.0))));
	}
	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) <= 2e-230)
		tmp = fma(b, Float64(Float64(angle_m * 0.011111111111111112) * Float64(b * pi)), Float64(Float64((a ^ 2.0) * Float64(angle_m * pi)) * -0.011111111111111112));
	elseif (Float64(angle_m / 180.0) <= 4e-155)
		tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64((b ^ 2.0) * pi))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b)))))));
	elseif (Float64(angle_m / 180.0) <= 1e+76)
		tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(Float64(b - a) * Float64(pi * Float64(b + a))));
	else
		tmp = Float64(2.0 * Float64(Float64(Float64(b + a) * Float64(b - a)) * sin(Float64(pi * Float64(angle_m / 180.0)))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-230], N[(b * N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e-155], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+76], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $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 2 \cdot 10^{-230}:\\
\;\;\;\;\mathsf{fma}\left(b, \left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(b \cdot \pi\right), \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) \cdot -0.011111111111111112\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-155}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\

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

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


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

    1. Initial program 44.5%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*44.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. *-commutative44.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*44.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. Simplified44.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 44.7%

      \[\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. unpow244.5%

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

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

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

      \[\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. Taylor expanded in b around 0 47.8%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, 0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)\right), -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right)} \]
      3. associate-*r*47.8%

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(0.011111111111111112 \cdot angle\right) \cdot \left(b \cdot \pi\right)} + 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)\right), -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      4. associate-*r*47.8%

        \[\leadsto \mathsf{fma}\left(b, \left(0.011111111111111112 \cdot angle\right) \cdot \left(b \cdot \pi\right) + \color{blue}{\left(0.011111111111111112 \cdot angle\right) \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)}, -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      5. distribute-lft-out47.8%

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(0.011111111111111112 \cdot angle\right) \cdot \left(b \cdot \pi + \pi \cdot \left(a + -1 \cdot a\right)\right)}, -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      6. +-commutative47.8%

        \[\leadsto \mathsf{fma}\left(b, \left(0.011111111111111112 \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot \left(a + -1 \cdot a\right) + b \cdot \pi\right)}, -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      7. *-commutative47.8%

        \[\leadsto \mathsf{fma}\left(b, \left(0.011111111111111112 \cdot angle\right) \cdot \left(\color{blue}{\left(a + -1 \cdot a\right) \cdot \pi} + b \cdot \pi\right), -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      8. distribute-rgt1-in47.8%

        \[\leadsto \mathsf{fma}\left(b, \left(0.011111111111111112 \cdot angle\right) \cdot \left(\color{blue}{\left(\left(-1 + 1\right) \cdot a\right)} \cdot \pi + b \cdot \pi\right), -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      9. metadata-eval47.8%

        \[\leadsto \mathsf{fma}\left(b, \left(0.011111111111111112 \cdot angle\right) \cdot \left(\left(\color{blue}{0} \cdot a\right) \cdot \pi + b \cdot \pi\right), -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      10. mul0-lft47.8%

        \[\leadsto \mathsf{fma}\left(b, \left(0.011111111111111112 \cdot angle\right) \cdot \left(\color{blue}{0} \cdot \pi + b \cdot \pi\right), -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      11. distribute-rgt-out47.8%

        \[\leadsto \mathsf{fma}\left(b, \left(0.011111111111111112 \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot \left(0 + b\right)\right)}, -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \]
      12. *-commutative47.8%

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

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

    if 2.00000000000000009e-230 < (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000006e-155

    1. Initial program 82.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*82.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. *-commutative82.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*82.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. Simplified82.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 0 81.8%

      \[\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. unpow282.0%

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

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

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

      \[\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. Taylor expanded in a around 0 99.4%

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

    if 4.00000000000000006e-155 < (/.f64 angle #s(literal 180 binary64)) < 1e76

    1. Initial program 74.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*74.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. *-commutative74.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*74.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. Simplified74.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 71.0%

      \[\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. unpow274.5%

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

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

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

      \[\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. Taylor expanded in angle around 0 75.1%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 41.4%

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

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

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

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

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

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

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

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

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

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

Alternative 12: 58.8% accurate, 3.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 2 \cdot 10^{-230}:\\ \;\;\;\;\left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) \cdot -0.011111111111111112 + b \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-155}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+76}:\\ \;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\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) 2e-230)
    (+
     (* (* (pow a 2.0) (* angle_m PI)) -0.011111111111111112)
     (*
      b
      (+
       (* 0.011111111111111112 (* angle_m (* b PI)))
       (* 0.011111111111111112 (* angle_m (* PI (- a a)))))))
    (if (<= (/ angle_m 180.0) 4e-155)
      (+
       (* 0.011111111111111112 (* angle_m (* (pow b 2.0) PI)))
       (*
        a
        (+
         (* -0.011111111111111112 (* a (* angle_m PI)))
         (* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
      (if (<= (/ angle_m 180.0) 1e+76)
        (* (* angle_m 0.011111111111111112) (* (- b a) (* PI (+ b a))))
        (* 2.0 (* (* (+ b a) (- b a)) (sin (* PI (/ angle_m 180.0))))))))))
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) <= 2e-230) {
		tmp = ((pow(a, 2.0) * (angle_m * ((double) M_PI))) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (a - a))))));
	} else if ((angle_m / 180.0) <= 4e-155) {
		tmp = (0.011111111111111112 * (angle_m * (pow(b, 2.0) * ((double) M_PI)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
	} else if ((angle_m / 180.0) <= 1e+76) {
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (((double) M_PI) * (b + a)));
	} else {
		tmp = 2.0 * (((b + a) * (b - a)) * sin((((double) M_PI) * (angle_m / 180.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 tmp;
	if ((angle_m / 180.0) <= 2e-230) {
		tmp = ((Math.pow(a, 2.0) * (angle_m * Math.PI)) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (a - a))))));
	} else if ((angle_m / 180.0) <= 4e-155) {
		tmp = (0.011111111111111112 * (angle_m * (Math.pow(b, 2.0) * Math.PI))) + (a * ((-0.011111111111111112 * (a * (angle_m * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
	} else if ((angle_m / 180.0) <= 1e+76) {
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (Math.PI * (b + a)));
	} else {
		tmp = 2.0 * (((b + a) * (b - a)) * Math.sin((Math.PI * (angle_m / 180.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):
	tmp = 0
	if (angle_m / 180.0) <= 2e-230:
		tmp = ((math.pow(a, 2.0) * (angle_m * math.pi)) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (a - a))))))
	elif (angle_m / 180.0) <= 4e-155:
		tmp = (0.011111111111111112 * (angle_m * (math.pow(b, 2.0) * math.pi))) + (a * ((-0.011111111111111112 * (a * (angle_m * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (b - b))))))
	elif (angle_m / 180.0) <= 1e+76:
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (math.pi * (b + a)))
	else:
		tmp = 2.0 * (((b + a) * (b - a)) * math.sin((math.pi * (angle_m / 180.0))))
	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) <= 2e-230)
		tmp = Float64(Float64(Float64((a ^ 2.0) * Float64(angle_m * pi)) * -0.011111111111111112) + Float64(b * Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(b * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a - a)))))));
	elseif (Float64(angle_m / 180.0) <= 4e-155)
		tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64((b ^ 2.0) * pi))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b)))))));
	elseif (Float64(angle_m / 180.0) <= 1e+76)
		tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(Float64(b - a) * Float64(pi * Float64(b + a))));
	else
		tmp = Float64(2.0 * Float64(Float64(Float64(b + a) * Float64(b - a)) * sin(Float64(pi * Float64(angle_m / 180.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)
	tmp = 0.0;
	if ((angle_m / 180.0) <= 2e-230)
		tmp = (((a ^ 2.0) * (angle_m * pi)) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * pi))) + (0.011111111111111112 * (angle_m * (pi * (a - a))))));
	elseif ((angle_m / 180.0) <= 4e-155)
		tmp = (0.011111111111111112 * (angle_m * ((b ^ 2.0) * pi))) + (a * ((-0.011111111111111112 * (a * (angle_m * pi))) + (0.011111111111111112 * (angle_m * (pi * (b - b))))));
	elseif ((angle_m / 180.0) <= 1e+76)
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (pi * (b + a)));
	else
		tmp = 2.0 * (((b + a) * (b - a)) * sin((pi * (angle_m / 180.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_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-230], N[(N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] + N[(b * N[(N[(0.011111111111111112 * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e-155], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+76], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $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 2 \cdot 10^{-230}:\\
\;\;\;\;\left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) \cdot -0.011111111111111112 + b \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-155}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\

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

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


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

    1. Initial program 44.5%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*44.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. *-commutative44.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*44.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. Simplified44.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 44.7%

      \[\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. unpow244.5%

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

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

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

      \[\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. Taylor expanded in b around 0 47.8%

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

    if 2.00000000000000009e-230 < (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000006e-155

    1. Initial program 82.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*82.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. *-commutative82.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*82.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. Simplified82.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 0 81.8%

      \[\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. unpow282.0%

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

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

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

      \[\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. Taylor expanded in a around 0 99.4%

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

    if 4.00000000000000006e-155 < (/.f64 angle #s(literal 180 binary64)) < 1e76

    1. Initial program 74.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*74.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. *-commutative74.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*74.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. Simplified74.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 71.0%

      \[\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. unpow274.5%

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

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

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

      \[\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. Taylor expanded in angle around 0 75.1%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 41.4%

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

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

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

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

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

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

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

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

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

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

Alternative 13: 58.8% accurate, 3.1× 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 2 \cdot 10^{-230}:\\ \;\;\;\;\left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) \cdot -0.011111111111111112 + b \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-155}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 6 \cdot 10^{+69}:\\ \;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\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) 2e-230)
    (+
     (* (* (pow a 2.0) (* angle_m PI)) -0.011111111111111112)
     (*
      b
      (+
       (* 0.011111111111111112 (* angle_m (* b PI)))
       (* 0.011111111111111112 (* angle_m (* PI (- a a)))))))
    (if (<= (/ angle_m 180.0) 4e-155)
      (*
       0.011111111111111112
       (- (* angle_m (* (pow b 2.0) PI)) (* a (* a (* angle_m PI)))))
      (if (<= (/ angle_m 180.0) 6e+69)
        (* (* angle_m 0.011111111111111112) (* (- b a) (* PI (+ b a))))
        (* 2.0 (* (* (+ b a) (- b a)) (sin (* PI (/ angle_m 180.0))))))))))
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) <= 2e-230) {
		tmp = ((pow(a, 2.0) * (angle_m * ((double) M_PI))) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (a - a))))));
	} else if ((angle_m / 180.0) <= 4e-155) {
		tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (a * (angle_m * ((double) M_PI)))));
	} else if ((angle_m / 180.0) <= 6e+69) {
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (((double) M_PI) * (b + a)));
	} else {
		tmp = 2.0 * (((b + a) * (b - a)) * sin((((double) M_PI) * (angle_m / 180.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 tmp;
	if ((angle_m / 180.0) <= 2e-230) {
		tmp = ((Math.pow(a, 2.0) * (angle_m * Math.PI)) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (a - a))))));
	} else if ((angle_m / 180.0) <= 4e-155) {
		tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (a * (angle_m * Math.PI))));
	} else if ((angle_m / 180.0) <= 6e+69) {
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (Math.PI * (b + a)));
	} else {
		tmp = 2.0 * (((b + a) * (b - a)) * Math.sin((Math.PI * (angle_m / 180.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):
	tmp = 0
	if (angle_m / 180.0) <= 2e-230:
		tmp = ((math.pow(a, 2.0) * (angle_m * math.pi)) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (a - a))))))
	elif (angle_m / 180.0) <= 4e-155:
		tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) - (a * (a * (angle_m * math.pi))))
	elif (angle_m / 180.0) <= 6e+69:
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (math.pi * (b + a)))
	else:
		tmp = 2.0 * (((b + a) * (b - a)) * math.sin((math.pi * (angle_m / 180.0))))
	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) <= 2e-230)
		tmp = Float64(Float64(Float64((a ^ 2.0) * Float64(angle_m * pi)) * -0.011111111111111112) + Float64(b * Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(b * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a - a)))))));
	elseif (Float64(angle_m / 180.0) <= 4e-155)
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(a * Float64(angle_m * pi)))));
	elseif (Float64(angle_m / 180.0) <= 6e+69)
		tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(Float64(b - a) * Float64(pi * Float64(b + a))));
	else
		tmp = Float64(2.0 * Float64(Float64(Float64(b + a) * Float64(b - a)) * sin(Float64(pi * Float64(angle_m / 180.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)
	tmp = 0.0;
	if ((angle_m / 180.0) <= 2e-230)
		tmp = (((a ^ 2.0) * (angle_m * pi)) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * pi))) + (0.011111111111111112 * (angle_m * (pi * (a - a))))));
	elseif ((angle_m / 180.0) <= 4e-155)
		tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) - (a * (a * (angle_m * pi))));
	elseif ((angle_m / 180.0) <= 6e+69)
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (pi * (b + a)));
	else
		tmp = 2.0 * (((b + a) * (b - a)) * sin((pi * (angle_m / 180.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_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-230], N[(N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] + N[(b * N[(N[(0.011111111111111112 * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e-155], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 6e+69], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $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 2 \cdot 10^{-230}:\\
\;\;\;\;\left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) \cdot -0.011111111111111112 + b \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-155}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 6 \cdot 10^{+69}:\\
\;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\

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


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

    1. Initial program 44.5%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*44.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. *-commutative44.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*44.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. Simplified44.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 44.7%

      \[\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. unpow244.5%

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

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

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

      \[\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. Taylor expanded in b around 0 47.8%

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

    if 2.00000000000000009e-230 < (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000006e-155

    1. Initial program 82.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*82.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. *-commutative82.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*82.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. Simplified82.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 0 81.8%

      \[\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. unpow282.0%

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

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

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

      \[\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. Taylor expanded in a around 0 99.2%

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

        \[\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(\pi \cdot \left(b + -1 \cdot b\right)\right)\right)\right)} \]
      2. *-commutative99.2%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \color{blue}{\mathsf{fma}\left(angle \cdot \pi, b + -1 \cdot b, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)} \cdot a\right) \]
      6. distribute-rgt1-in99.2%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, \color{blue}{\left(-1 + 1\right) \cdot b}, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right) \cdot a\right) \]
      7. metadata-eval99.2%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, \color{blue}{0} \cdot b, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right) \cdot a\right) \]
      8. mul0-lft99.2%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, \color{blue}{0}, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right) \cdot a\right) \]
      9. mul-1-neg99.2%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, 0, \color{blue}{-a \cdot \left(angle \cdot \pi\right)}\right) \cdot a\right) \]
      10. fma-neg99.2%

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

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

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

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

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

    if 4.00000000000000006e-155 < (/.f64 angle #s(literal 180 binary64)) < 5.99999999999999967e69

    1. Initial program 76.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*76.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. *-commutative76.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*76.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. Simplified76.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 0 70.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. unpow276.0%

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

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

        \[\leadsto 2 \cdot \left(\left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    7. Applied egg-rr74.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. Taylor expanded in angle around 0 74.6%

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

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

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

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

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

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

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

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

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

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

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

    if 5.99999999999999967e69 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 40.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*40.6%

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

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

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

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

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

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

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

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

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

Alternative 14: 58.7% accurate, 3.1× 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 2 \cdot 10^{-230}:\\ \;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot angle\_m\right)\right) - {a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-155}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 6 \cdot 10^{+69}:\\ \;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\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) 2e-230)
    (*
     0.011111111111111112
     (- (* b (* PI (* b angle_m))) (* (pow a 2.0) (* angle_m PI))))
    (if (<= (/ angle_m 180.0) 4e-155)
      (*
       0.011111111111111112
       (- (* angle_m (* (pow b 2.0) PI)) (* a (* a (* angle_m PI)))))
      (if (<= (/ angle_m 180.0) 6e+69)
        (* (* angle_m 0.011111111111111112) (* (- b a) (* PI (+ b a))))
        (* 2.0 (* (* (+ b a) (- b a)) (sin (* PI (/ angle_m 180.0))))))))))
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) <= 2e-230) {
		tmp = 0.011111111111111112 * ((b * (((double) M_PI) * (b * angle_m))) - (pow(a, 2.0) * (angle_m * ((double) M_PI))));
	} else if ((angle_m / 180.0) <= 4e-155) {
		tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (a * (angle_m * ((double) M_PI)))));
	} else if ((angle_m / 180.0) <= 6e+69) {
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (((double) M_PI) * (b + a)));
	} else {
		tmp = 2.0 * (((b + a) * (b - a)) * sin((((double) M_PI) * (angle_m / 180.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 tmp;
	if ((angle_m / 180.0) <= 2e-230) {
		tmp = 0.011111111111111112 * ((b * (Math.PI * (b * angle_m))) - (Math.pow(a, 2.0) * (angle_m * Math.PI)));
	} else if ((angle_m / 180.0) <= 4e-155) {
		tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (a * (angle_m * Math.PI))));
	} else if ((angle_m / 180.0) <= 6e+69) {
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (Math.PI * (b + a)));
	} else {
		tmp = 2.0 * (((b + a) * (b - a)) * Math.sin((Math.PI * (angle_m / 180.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):
	tmp = 0
	if (angle_m / 180.0) <= 2e-230:
		tmp = 0.011111111111111112 * ((b * (math.pi * (b * angle_m))) - (math.pow(a, 2.0) * (angle_m * math.pi)))
	elif (angle_m / 180.0) <= 4e-155:
		tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) - (a * (a * (angle_m * math.pi))))
	elif (angle_m / 180.0) <= 6e+69:
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (math.pi * (b + a)))
	else:
		tmp = 2.0 * (((b + a) * (b - a)) * math.sin((math.pi * (angle_m / 180.0))))
	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) <= 2e-230)
		tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(pi * Float64(b * angle_m))) - Float64((a ^ 2.0) * Float64(angle_m * pi))));
	elseif (Float64(angle_m / 180.0) <= 4e-155)
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(a * Float64(angle_m * pi)))));
	elseif (Float64(angle_m / 180.0) <= 6e+69)
		tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(Float64(b - a) * Float64(pi * Float64(b + a))));
	else
		tmp = Float64(2.0 * Float64(Float64(Float64(b + a) * Float64(b - a)) * sin(Float64(pi * Float64(angle_m / 180.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)
	tmp = 0.0;
	if ((angle_m / 180.0) <= 2e-230)
		tmp = 0.011111111111111112 * ((b * (pi * (b * angle_m))) - ((a ^ 2.0) * (angle_m * pi)));
	elseif ((angle_m / 180.0) <= 4e-155)
		tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) - (a * (a * (angle_m * pi))));
	elseif ((angle_m / 180.0) <= 6e+69)
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (pi * (b + a)));
	else
		tmp = 2.0 * (((b + a) * (b - a)) * sin((pi * (angle_m / 180.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_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-230], N[(0.011111111111111112 * N[(N[(b * N[(Pi * N[(b * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e-155], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 6e+69], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $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 2 \cdot 10^{-230}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot angle\_m\right)\right) - {a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-155}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 6 \cdot 10^{+69}:\\
\;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\

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


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

    1. Initial program 44.5%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*44.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. *-commutative44.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*44.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. Simplified44.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 44.7%

      \[\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. unpow244.5%

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

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

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

      \[\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. Taylor expanded in b around 0 47.2%

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

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

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

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

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

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

    if 2.00000000000000009e-230 < (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000006e-155

    1. Initial program 82.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*82.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. *-commutative82.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*82.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. Simplified82.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 0 81.8%

      \[\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. unpow282.0%

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

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

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

      \[\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. Taylor expanded in a around 0 99.2%

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

        \[\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(\pi \cdot \left(b + -1 \cdot b\right)\right)\right)\right)} \]
      2. *-commutative99.2%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \color{blue}{\mathsf{fma}\left(angle \cdot \pi, b + -1 \cdot b, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)} \cdot a\right) \]
      6. distribute-rgt1-in99.2%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, \color{blue}{\left(-1 + 1\right) \cdot b}, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right) \cdot a\right) \]
      7. metadata-eval99.2%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, \color{blue}{0} \cdot b, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right) \cdot a\right) \]
      8. mul0-lft99.2%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, \color{blue}{0}, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right) \cdot a\right) \]
      9. mul-1-neg99.2%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, 0, \color{blue}{-a \cdot \left(angle \cdot \pi\right)}\right) \cdot a\right) \]
      10. fma-neg99.2%

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

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

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

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

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

    if 4.00000000000000006e-155 < (/.f64 angle #s(literal 180 binary64)) < 5.99999999999999967e69

    1. Initial program 76.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*76.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. *-commutative76.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*76.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. Simplified76.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 0 70.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. unpow276.0%

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

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

        \[\leadsto 2 \cdot \left(\left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    7. Applied egg-rr74.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. Taylor expanded in angle around 0 74.6%

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

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

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

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

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

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

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

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

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

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

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

    if 5.99999999999999967e69 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 40.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*40.6%

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

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

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

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

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

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

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

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

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

Alternative 15: 53.2% accurate, 3.2× 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.011111111111111112\right)\\ t_1 := 0.011111111111111112 \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot angle\_m\right)\right) - {a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 3.1 \cdot 10^{-227}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;angle\_m \leq 2.6 \cdot 10^{-151}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;angle\_m \leq 9.2 \cdot 10^{-114}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot \left(b - a\right)\right) \cdot t\_0 + t\_0 \cdot \left(a \cdot \left(b - a\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.011111111111111112)))
        (t_1
         (*
          0.011111111111111112
          (- (* b (* PI (* b angle_m))) (* (pow a 2.0) (* angle_m PI))))))
   (*
    angle_s
    (if (<= angle_m 3.1e-227)
      t_1
      (if (<= angle_m 2.6e-151)
        (*
         0.011111111111111112
         (- (* angle_m (* (pow b 2.0) PI)) (* a (* a (* angle_m PI)))))
        (if (<= angle_m 9.2e-114)
          t_1
          (+ (* (* b (- b a)) t_0) (* t_0 (* 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) {
	double t_0 = angle_m * (((double) M_PI) * 0.011111111111111112);
	double t_1 = 0.011111111111111112 * ((b * (((double) M_PI) * (b * angle_m))) - (pow(a, 2.0) * (angle_m * ((double) M_PI))));
	double tmp;
	if (angle_m <= 3.1e-227) {
		tmp = t_1;
	} else if (angle_m <= 2.6e-151) {
		tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (a * (angle_m * ((double) M_PI)))));
	} else if (angle_m <= 9.2e-114) {
		tmp = t_1;
	} else {
		tmp = ((b * (b - a)) * t_0) + (t_0 * (a * (b - a)));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = angle_m * (Math.PI * 0.011111111111111112);
	double t_1 = 0.011111111111111112 * ((b * (Math.PI * (b * angle_m))) - (Math.pow(a, 2.0) * (angle_m * Math.PI)));
	double tmp;
	if (angle_m <= 3.1e-227) {
		tmp = t_1;
	} else if (angle_m <= 2.6e-151) {
		tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (a * (angle_m * Math.PI))));
	} else if (angle_m <= 9.2e-114) {
		tmp = t_1;
	} else {
		tmp = ((b * (b - a)) * t_0) + (t_0 * (a * (b - a)));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = angle_m * (math.pi * 0.011111111111111112)
	t_1 = 0.011111111111111112 * ((b * (math.pi * (b * angle_m))) - (math.pow(a, 2.0) * (angle_m * math.pi)))
	tmp = 0
	if angle_m <= 3.1e-227:
		tmp = t_1
	elif angle_m <= 2.6e-151:
		tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) - (a * (a * (angle_m * math.pi))))
	elif angle_m <= 9.2e-114:
		tmp = t_1
	else:
		tmp = ((b * (b - a)) * t_0) + (t_0 * (a * (b - a)))
	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.011111111111111112))
	t_1 = Float64(0.011111111111111112 * Float64(Float64(b * Float64(pi * Float64(b * angle_m))) - Float64((a ^ 2.0) * Float64(angle_m * pi))))
	tmp = 0.0
	if (angle_m <= 3.1e-227)
		tmp = t_1;
	elseif (angle_m <= 2.6e-151)
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(a * Float64(angle_m * pi)))));
	elseif (angle_m <= 9.2e-114)
		tmp = t_1;
	else
		tmp = Float64(Float64(Float64(b * Float64(b - a)) * t_0) + Float64(t_0 * Float64(a * Float64(b - a))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = angle_m * (pi * 0.011111111111111112);
	t_1 = 0.011111111111111112 * ((b * (pi * (b * angle_m))) - ((a ^ 2.0) * (angle_m * pi)));
	tmp = 0.0;
	if (angle_m <= 3.1e-227)
		tmp = t_1;
	elseif (angle_m <= 2.6e-151)
		tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) - (a * (a * (angle_m * pi))));
	elseif (angle_m <= 9.2e-114)
		tmp = t_1;
	else
		tmp = ((b * (b - a)) * t_0) + (t_0 * (a * (b - a)));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.011111111111111112 * N[(N[(b * N[(Pi * N[(b * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 3.1e-227], t$95$1, If[LessEqual[angle$95$m, 2.6e-151], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 9.2e-114], t$95$1, N[(N[(N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(t$95$0 * N[(a * N[(b - a), $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.011111111111111112\right)\\
t_1 := 0.011111111111111112 \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot angle\_m\right)\right) - {a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 3.1 \cdot 10^{-227}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;angle\_m \leq 2.6 \cdot 10^{-151}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\

\mathbf{elif}\;angle\_m \leq 9.2 \cdot 10^{-114}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if angle < 3.09999999999999979e-227 or 2.6e-151 < angle < 9.1999999999999997e-114

    1. Initial program 44.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*44.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. *-commutative44.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*44.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. Simplified44.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 0 44.5%

      \[\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. unpow244.4%

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

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

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

      \[\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. Taylor expanded in b around 0 47.7%

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

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

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

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

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

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

    if 3.09999999999999979e-227 < angle < 2.6e-151

    1. Initial program 82.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*82.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. *-commutative82.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*82.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. Simplified82.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 0 81.8%

      \[\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. unpow282.0%

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

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

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

      \[\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. Taylor expanded in a around 0 99.2%

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

        \[\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(\pi \cdot \left(b + -1 \cdot b\right)\right)\right)\right)} \]
      2. *-commutative99.2%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \color{blue}{\mathsf{fma}\left(angle \cdot \pi, b + -1 \cdot b, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)} \cdot a\right) \]
      6. distribute-rgt1-in99.2%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, \color{blue}{\left(-1 + 1\right) \cdot b}, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right) \cdot a\right) \]
      7. metadata-eval99.2%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, \color{blue}{0} \cdot b, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right) \cdot a\right) \]
      8. mul0-lft99.2%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, \color{blue}{0}, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right) \cdot a\right) \]
      9. mul-1-neg99.2%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, 0, \color{blue}{-a \cdot \left(angle \cdot \pi\right)}\right) \cdot a\right) \]
      10. fma-neg99.2%

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

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

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

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

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

    if 9.1999999999999997e-114 < angle

    1. Initial program 58.6%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*58.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. *-commutative58.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*58.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. Simplified58.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 50.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.6%

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

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

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

      \[\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. Taylor expanded in angle around 0 53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 57.2% 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 1.25 \cdot 10^{-152}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\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 1.25e-152)
    (*
     0.011111111111111112
     (- (* angle_m (* (pow b 2.0) PI)) (* a (* a (* angle_m PI)))))
    (* (* angle_m 0.011111111111111112) (* (- b a) (* PI (+ b a)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (angle_m <= 1.25e-152) {
		tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (a * (angle_m * ((double) M_PI)))));
	} else {
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (((double) M_PI) * (b + a)));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (angle_m <= 1.25e-152) {
		tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (a * (angle_m * Math.PI))));
	} else {
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (Math.PI * (b + a)));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if angle_m <= 1.25e-152:
		tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) - (a * (a * (angle_m * math.pi))))
	else:
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (math.pi * (b + a)))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (angle_m <= 1.25e-152)
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(a * Float64(angle_m * pi)))));
	else
		tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(Float64(b - a) * Float64(pi * Float64(b + a))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (angle_m <= 1.25e-152)
		tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) - (a * (a * (angle_m * pi))));
	else
		tmp = (angle_m * 0.011111111111111112) * ((b - a) * (pi * (b + a)));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 1.25e-152], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


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

    1. Initial program 48.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*48.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. *-commutative48.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*48.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. Simplified48.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 0 48.5%

      \[\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. unpow248.4%

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

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

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

      \[\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. Taylor expanded in a around 0 49.6%

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

        \[\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(\pi \cdot \left(b + -1 \cdot b\right)\right)\right)\right)} \]
      2. *-commutative49.6%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \color{blue}{\mathsf{fma}\left(angle \cdot \pi, b + -1 \cdot b, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)} \cdot a\right) \]
      6. distribute-rgt1-in49.6%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, \color{blue}{\left(-1 + 1\right) \cdot b}, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right) \cdot a\right) \]
      7. metadata-eval49.6%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, \color{blue}{0} \cdot b, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right) \cdot a\right) \]
      8. mul0-lft49.6%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, \color{blue}{0}, -1 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right) \cdot a\right) \]
      9. mul-1-neg49.6%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right) + \mathsf{fma}\left(angle \cdot \pi, 0, \color{blue}{-a \cdot \left(angle \cdot \pi\right)}\right) \cdot a\right) \]
      10. fma-neg49.6%

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

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

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

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

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

    if 1.2499999999999999e-152 < angle

    1. Initial program 57.8%

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

        \[\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. *-commutative57.8%

        \[\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*57.8%

        \[\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. Simplified57.8%

      \[\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 49.7%

      \[\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. unpow257.8%

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

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

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

      \[\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. Taylor expanded in angle around 0 53.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 49.3% accurate, 18.2× 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.011111111111111112\right)\\ angle\_s \cdot \left(\left(b \cdot \left(b - a\right)\right) \cdot t\_0 + t\_0 \cdot \left(a \cdot \left(b - a\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
 (let* ((t_0 (* angle_m (* PI 0.011111111111111112))))
   (* angle_s (+ (* (* b (- b a)) t_0) (* t_0 (* 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) {
	double t_0 = angle_m * (((double) M_PI) * 0.011111111111111112);
	return angle_s * (((b * (b - a)) * t_0) + (t_0 * (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) {
	double t_0 = angle_m * (Math.PI * 0.011111111111111112);
	return angle_s * (((b * (b - a)) * t_0) + (t_0 * (a * (b - a))));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = angle_m * (math.pi * 0.011111111111111112)
	return angle_s * (((b * (b - a)) * t_0) + (t_0 * (a * (b - a))))
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.011111111111111112))
	return Float64(angle_s * Float64(Float64(Float64(b * Float64(b - a)) * t_0) + Float64(t_0 * Float64(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)
	t_0 = angle_m * (pi * 0.011111111111111112);
	tmp = angle_s * (((b * (b - a)) * t_0) + (t_0 * (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_] := Block[{t$95$0 = N[(angle$95$m * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * N[(N[(N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(t$95$0 * N[(a * N[(b - a), $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.011111111111111112\right)\\
angle\_s \cdot \left(\left(b \cdot \left(b - a\right)\right) \cdot t\_0 + t\_0 \cdot \left(a \cdot \left(b - a\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 52.1%

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. Step-by-step derivation
    1. associate-*l*52.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. *-commutative52.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*52.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. Simplified52.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 0 49.0%

    \[\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. unpow252.1%

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

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

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

    \[\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. Taylor expanded in angle around 0 51.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 54.5% accurate, 32.2× speedup?

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

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

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. Step-by-step derivation
    1. associate-*l*52.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. *-commutative52.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*52.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. Simplified52.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 0 49.0%

    \[\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. unpow252.1%

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

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

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

    \[\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. Taylor expanded in angle around 0 51.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 54.5% accurate, 32.2× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* (* angle_m 0.011111111111111112) (* 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 * ((angle_m * 0.011111111111111112) * (((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 * ((angle_m * 0.011111111111111112) * (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 * ((angle_m * 0.011111111111111112) * (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(Float64(angle_m * 0.011111111111111112) * 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 * ((angle_m * 0.011111111111111112) * (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[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. Step-by-step derivation
    1. associate-*l*52.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. *-commutative52.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*52.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. Simplified52.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 0 49.0%

    \[\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. unpow252.1%

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

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

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

    \[\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. Taylor expanded in angle around 0 51.5%

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

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

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

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

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

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

Alternative 20: 54.5% accurate, 32.2× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(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 52.1%

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. Step-by-step derivation
    1. associate-*l*52.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. *-commutative52.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*52.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. Simplified52.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 0 49.0%

    \[\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. unpow252.1%

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

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

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

    \[\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. Add Preprocessing

Reproduce

?
herbie shell --seed 2024096 
(FPCore (a b angle)
  :name "ab-angle->ABCF B"
  :precision binary64
  (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0)))) (cos (* PI (/ angle 180.0)))))