ab-angle->ABCF B

Percentage Accurate: 54.1% → 57.1%
Time: 55.9s
Alternatives: 13
Speedup: 2.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 54.1% 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: 57.1% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\ t_1 := {\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle_m}{180}\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 10^{+96}:\\ \;\;\;\;\cos t_1 \cdot \left(t_0 \cdot \sin \left(\frac{\pi \cdot angle_m}{180}\right)\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+219}:\\ \;\;\;\;t_0 \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(t_0 \cdot \sin t_1\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* 2.0 (* (+ b a) (- b a))))
        (t_1 (* (pow (sqrt PI) 2.0) (/ angle_m 180.0))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1e+96)
      (* (cos t_1) (* t_0 (sin (/ (* PI angle_m) 180.0))))
      (if (<= (/ angle_m 180.0) 5e+219)
        (* t_0 (sin (exp (log (* 0.005555555555555556 (* PI angle_m))))))
        (* (cos (* PI (/ angle_m 180.0))) (* t_0 (sin 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 = 2.0 * ((b + a) * (b - a));
	double t_1 = pow(sqrt(((double) M_PI)), 2.0) * (angle_m / 180.0);
	double tmp;
	if ((angle_m / 180.0) <= 1e+96) {
		tmp = cos(t_1) * (t_0 * sin(((((double) M_PI) * angle_m) / 180.0)));
	} else if ((angle_m / 180.0) <= 5e+219) {
		tmp = t_0 * sin(exp(log((0.005555555555555556 * (((double) M_PI) * angle_m)))));
	} else {
		tmp = cos((((double) M_PI) * (angle_m / 180.0))) * (t_0 * sin(t_1));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = 2.0 * ((b + a) * (b - a));
	double t_1 = Math.pow(Math.sqrt(Math.PI), 2.0) * (angle_m / 180.0);
	double tmp;
	if ((angle_m / 180.0) <= 1e+96) {
		tmp = Math.cos(t_1) * (t_0 * Math.sin(((Math.PI * angle_m) / 180.0)));
	} else if ((angle_m / 180.0) <= 5e+219) {
		tmp = t_0 * Math.sin(Math.exp(Math.log((0.005555555555555556 * (Math.PI * angle_m)))));
	} else {
		tmp = Math.cos((Math.PI * (angle_m / 180.0))) * (t_0 * Math.sin(t_1));
	}
	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 = 2.0 * ((b + a) * (b - a))
	t_1 = math.pow(math.sqrt(math.pi), 2.0) * (angle_m / 180.0)
	tmp = 0
	if (angle_m / 180.0) <= 1e+96:
		tmp = math.cos(t_1) * (t_0 * math.sin(((math.pi * angle_m) / 180.0)))
	elif (angle_m / 180.0) <= 5e+219:
		tmp = t_0 * math.sin(math.exp(math.log((0.005555555555555556 * (math.pi * angle_m)))))
	else:
		tmp = math.cos((math.pi * (angle_m / 180.0))) * (t_0 * math.sin(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(2.0 * Float64(Float64(b + a) * Float64(b - a)))
	t_1 = Float64((sqrt(pi) ^ 2.0) * Float64(angle_m / 180.0))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1e+96)
		tmp = Float64(cos(t_1) * Float64(t_0 * sin(Float64(Float64(pi * angle_m) / 180.0))));
	elseif (Float64(angle_m / 180.0) <= 5e+219)
		tmp = Float64(t_0 * sin(exp(log(Float64(0.005555555555555556 * Float64(pi * angle_m))))));
	else
		tmp = Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * Float64(t_0 * sin(t_1)));
	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 = 2.0 * ((b + a) * (b - a));
	t_1 = (sqrt(pi) ^ 2.0) * (angle_m / 180.0);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 1e+96)
		tmp = cos(t_1) * (t_0 * sin(((pi * angle_m) / 180.0)));
	elseif ((angle_m / 180.0) <= 5e+219)
		tmp = t_0 * sin(exp(log((0.005555555555555556 * (pi * angle_m)))));
	else
		tmp = cos((pi * (angle_m / 180.0))) * (t_0 * sin(t_1));
	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[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+96], N[(N[Cos[t$95$1], $MachinePrecision] * N[(t$95$0 * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+219], N[(t$95$0 * N[Sin[N[Exp[N[Log[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Sin[t$95$1], $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 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_1 := {\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle_m}{180}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{+96}:\\
\;\;\;\;\cos t_1 \cdot \left(t_0 \cdot \sin \left(\frac{\pi \cdot angle_m}{180}\right)\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+219}:\\
\;\;\;\;t_0 \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(t_0 \cdot \sin t_1\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle 180) < 1.00000000000000005e96

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000005e96 < (/.f64 angle 180) < 5e219

    1. Initial program 29.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. unpow229.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(e^{\log \color{blue}{\left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}}\right)\right) \cdot 1 \]
      6. *-commutative51.7%

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

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

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

    if 5e219 < (/.f64 angle 180)

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{+96}:\\ \;\;\;\;\cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+219}:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle}{180}\right)\right)\\ \end{array} \]

Alternative 2: 60.8% accurate, 0.6× 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^{+255}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)\right)\right)\right) \cdot \cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle_m}{180}\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt[3]{2} \cdot \left({\left(\sqrt[3]{b}\right)}^{2} \cdot \sqrt[3]{\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle_m\right)\right)}\right)\right)}^{3} \cdot \cos \left(\pi \cdot \frac{angle_m}{180}\right)\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= (- (pow b 2.0) (pow a 2.0)) 2e+255)
    (*
     (*
      (* 2.0 (* (+ b a) (- b a)))
      (sin (expm1 (log1p (* 0.005555555555555556 (* PI angle_m))))))
     (cos (* (pow (sqrt PI) 2.0) (/ angle_m 180.0))))
    (*
     (pow
      (*
       (cbrt 2.0)
       (*
        (pow (cbrt b) 2.0)
        (cbrt (sin (* PI (* 0.005555555555555556 angle_m))))))
      3.0)
     (cos (* 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 ((pow(b, 2.0) - pow(a, 2.0)) <= 2e+255) {
		tmp = ((2.0 * ((b + a) * (b - a))) * sin(expm1(log1p((0.005555555555555556 * (((double) M_PI) * angle_m)))))) * cos((pow(sqrt(((double) M_PI)), 2.0) * (angle_m / 180.0)));
	} else {
		tmp = pow((cbrt(2.0) * (pow(cbrt(b), 2.0) * cbrt(sin((((double) M_PI) * (0.005555555555555556 * angle_m)))))), 3.0) * cos((((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 ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= 2e+255) {
		tmp = ((2.0 * ((b + a) * (b - a))) * Math.sin(Math.expm1(Math.log1p((0.005555555555555556 * (Math.PI * angle_m)))))) * Math.cos((Math.pow(Math.sqrt(Math.PI), 2.0) * (angle_m / 180.0)));
	} else {
		tmp = Math.pow((Math.cbrt(2.0) * (Math.pow(Math.cbrt(b), 2.0) * Math.cbrt(Math.sin((Math.PI * (0.005555555555555556 * angle_m)))))), 3.0) * Math.cos((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((b ^ 2.0) - (a ^ 2.0)) <= 2e+255)
		tmp = Float64(Float64(Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) * sin(expm1(log1p(Float64(0.005555555555555556 * Float64(pi * angle_m)))))) * cos(Float64((sqrt(pi) ^ 2.0) * Float64(angle_m / 180.0))));
	else
		tmp = Float64((Float64(cbrt(2.0) * Float64((cbrt(b) ^ 2.0) * cbrt(sin(Float64(pi * Float64(0.005555555555555556 * angle_m)))))) ^ 3.0) * cos(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[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 2e+255], N[(N[(N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Exp[N[Log[1 + N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[Power[2.0, 1/3], $MachinePrecision] * N[(N[Power[N[Power[b, 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[Power[N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $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^{+255}:\\
\;\;\;\;\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)\right)\right)\right) \cdot \cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle_m}{180}\right)\\

\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{2} \cdot \left({\left(\sqrt[3]{b}\right)}^{2} \cdot \sqrt[3]{\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle_m\right)\right)}\right)\right)}^{3} \cdot \cos \left(\pi \cdot \frac{angle_m}{180}\right)\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999998e255 < (-.f64 (pow.f64 b 2) (pow.f64 a 2))

    1. Initial program 45.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. add-cube-cbrt45.6%

        \[\leadsto \color{blue}{\left(\left(\sqrt[3]{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \cdot \sqrt[3]{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)}\right) \cdot \sqrt[3]{\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. pow345.6%

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\sqrt[3]{2} \cdot {\left(1 \cdot \left({b}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)}^{0.3333333333333333}\right)}}^{3} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. unpow1/351.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt[3]{2} \cdot \left(\color{blue}{\left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)} \cdot \sqrt[3]{\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)\right)}^{3} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      6. pow270.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq 2 \cdot 10^{+255}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\right) \cdot \cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle}{180}\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt[3]{2} \cdot \left({\left(\sqrt[3]{b}\right)}^{2} \cdot \sqrt[3]{\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right)\right)}^{3} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\\ \end{array} \]

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

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\cos t_0\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 b 2) < 2.0000000000000002e172

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000002e172 < (pow.f64 b 2)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\cos \left(\color{blue}{\pi} \cdot \frac{angle}{180}\right)\right)\right) \]
      4. associate-*r/49.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{b}^{2} \leq 2 \cdot 10^{+172}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\right) \cdot \cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle}{180}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\\ \end{array} \]

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

\mathbf{else}:\\
\;\;\;\;\left(t_1 \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\cos t_0\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 b 2) < 3.99999999999999993e77

    1. Initial program 62.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. unpow262.4%

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

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

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

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

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

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

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

    if 3.99999999999999993e77 < (pow.f64 b 2)

    1. Initial program 47.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\cos \left(\color{blue}{\pi} \cdot \frac{angle}{180}\right)\right)\right) \]
      4. associate-*r/47.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{b}^{2} \leq 4 \cdot 10^{+77}:\\ \;\;\;\;\cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\\ \end{array} \]

Alternative 5: 57.0% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+78} \lor \neg \left(\frac{angle_m}{180} \leq 5 \cdot 10^{+186}\right):\\ \;\;\;\;\cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle_m}{180}\right) \cdot \left(t_0 \cdot \sin \left(\pi \cdot \frac{angle_m}{180}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)}\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* 2.0 (* (+ b a) (- b a)))))
   (*
    angle_s
    (if (or (<= (/ angle_m 180.0) 5e+78) (not (<= (/ angle_m 180.0) 5e+186)))
      (*
       (cos (* (pow (sqrt PI) 2.0) (/ angle_m 180.0)))
       (* t_0 (sin (* PI (/ angle_m 180.0)))))
      (* t_0 (sin (exp (log (* 0.005555555555555556 (* PI angle_m))))))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = 2.0 * ((b + a) * (b - a));
	double tmp;
	if (((angle_m / 180.0) <= 5e+78) || !((angle_m / 180.0) <= 5e+186)) {
		tmp = cos((pow(sqrt(((double) M_PI)), 2.0) * (angle_m / 180.0))) * (t_0 * sin((((double) M_PI) * (angle_m / 180.0))));
	} else {
		tmp = t_0 * sin(exp(log((0.005555555555555556 * (((double) M_PI) * angle_m)))));
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = 2.0 * ((b + a) * (b - a));
	double tmp;
	if (((angle_m / 180.0) <= 5e+78) || !((angle_m / 180.0) <= 5e+186)) {
		tmp = Math.cos((Math.pow(Math.sqrt(Math.PI), 2.0) * (angle_m / 180.0))) * (t_0 * Math.sin((Math.PI * (angle_m / 180.0))));
	} else {
		tmp = t_0 * Math.sin(Math.exp(Math.log((0.005555555555555556 * (Math.PI * angle_m)))));
	}
	return angle_s * tmp;
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = 2.0 * ((b + a) * (b - a))
	tmp = 0
	if ((angle_m / 180.0) <= 5e+78) or not ((angle_m / 180.0) <= 5e+186):
		tmp = math.cos((math.pow(math.sqrt(math.pi), 2.0) * (angle_m / 180.0))) * (t_0 * math.sin((math.pi * (angle_m / 180.0))))
	else:
		tmp = t_0 * math.sin(math.exp(math.log((0.005555555555555556 * (math.pi * angle_m)))))
	return angle_s * tmp
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a)))
	tmp = 0.0
	if ((Float64(angle_m / 180.0) <= 5e+78) || !(Float64(angle_m / 180.0) <= 5e+186))
		tmp = Float64(cos(Float64((sqrt(pi) ^ 2.0) * Float64(angle_m / 180.0))) * Float64(t_0 * sin(Float64(pi * Float64(angle_m / 180.0)))));
	else
		tmp = Float64(t_0 * sin(exp(log(Float64(0.005555555555555556 * Float64(pi * angle_m))))));
	end
	return Float64(angle_s * tmp)
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = 2.0 * ((b + a) * (b - a));
	tmp = 0.0;
	if (((angle_m / 180.0) <= 5e+78) || ~(((angle_m / 180.0) <= 5e+186)))
		tmp = cos(((sqrt(pi) ^ 2.0) * (angle_m / 180.0))) * (t_0 * sin((pi * (angle_m / 180.0))));
	else
		tmp = t_0 * sin(exp(log((0.005555555555555556 * (pi * angle_m)))));
	end
	tmp_2 = angle_s * tmp;
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[Or[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+78], N[Not[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+186]], $MachinePrecision]], N[(N[Cos[N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Sin[N[Exp[N[Log[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+78} \lor \neg \left(\frac{angle_m}{180} \leq 5 \cdot 10^{+186}\right):\\
\;\;\;\;\cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle_m}{180}\right) \cdot \left(t_0 \cdot \sin \left(\pi \cdot \frac{angle_m}{180}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_0 \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)}\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 angle 180) < 4.99999999999999984e78 or 4.99999999999999954e186 < (/.f64 angle 180)

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

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

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

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

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

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

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

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

    if 4.99999999999999984e78 < (/.f64 angle 180) < 4.99999999999999954e186

    1. Initial program 26.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. unpow226.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(e^{\log \color{blue}{\left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}}\right)\right) \cdot 1 \]
      6. *-commutative48.3%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(e^{\log \color{blue}{\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}}\right)\right) \cdot 1 \]
    6. Applied egg-rr48.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+78} \lor \neg \left(\frac{angle}{180} \leq 5 \cdot 10^{+186}\right):\\ \;\;\;\;\cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}\right)\\ \end{array} \]

Alternative 6: 57.0% accurate, 1.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\ t_1 := \pi \cdot \frac{angle_m}{180}\\ t_2 := {\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle_m}{180}\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+78}:\\ \;\;\;\;\cos t_2 \cdot \left(t_0 \cdot \sin t_1\right)\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+219}:\\ \;\;\;\;t_0 \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos t_1 \cdot \left(t_0 \cdot \sin t_2\right)\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* 2.0 (* (+ b a) (- b a))))
        (t_1 (* PI (/ angle_m 180.0)))
        (t_2 (* (pow (sqrt PI) 2.0) (/ angle_m 180.0))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 5e+78)
      (* (cos t_2) (* t_0 (sin t_1)))
      (if (<= (/ angle_m 180.0) 5e+219)
        (* t_0 (sin (exp (log (* 0.005555555555555556 (* PI angle_m))))))
        (* (cos t_1) (* t_0 (sin t_2))))))))
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 = 2.0 * ((b + a) * (b - a));
	double t_1 = ((double) M_PI) * (angle_m / 180.0);
	double t_2 = pow(sqrt(((double) M_PI)), 2.0) * (angle_m / 180.0);
	double tmp;
	if ((angle_m / 180.0) <= 5e+78) {
		tmp = cos(t_2) * (t_0 * sin(t_1));
	} else if ((angle_m / 180.0) <= 5e+219) {
		tmp = t_0 * sin(exp(log((0.005555555555555556 * (((double) M_PI) * angle_m)))));
	} else {
		tmp = cos(t_1) * (t_0 * sin(t_2));
	}
	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 = 2.0 * ((b + a) * (b - a));
	double t_1 = Math.PI * (angle_m / 180.0);
	double t_2 = Math.pow(Math.sqrt(Math.PI), 2.0) * (angle_m / 180.0);
	double tmp;
	if ((angle_m / 180.0) <= 5e+78) {
		tmp = Math.cos(t_2) * (t_0 * Math.sin(t_1));
	} else if ((angle_m / 180.0) <= 5e+219) {
		tmp = t_0 * Math.sin(Math.exp(Math.log((0.005555555555555556 * (Math.PI * angle_m)))));
	} else {
		tmp = Math.cos(t_1) * (t_0 * Math.sin(t_2));
	}
	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 = 2.0 * ((b + a) * (b - a))
	t_1 = math.pi * (angle_m / 180.0)
	t_2 = math.pow(math.sqrt(math.pi), 2.0) * (angle_m / 180.0)
	tmp = 0
	if (angle_m / 180.0) <= 5e+78:
		tmp = math.cos(t_2) * (t_0 * math.sin(t_1))
	elif (angle_m / 180.0) <= 5e+219:
		tmp = t_0 * math.sin(math.exp(math.log((0.005555555555555556 * (math.pi * angle_m)))))
	else:
		tmp = math.cos(t_1) * (t_0 * math.sin(t_2))
	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(2.0 * Float64(Float64(b + a) * Float64(b - a)))
	t_1 = Float64(pi * Float64(angle_m / 180.0))
	t_2 = Float64((sqrt(pi) ^ 2.0) * Float64(angle_m / 180.0))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e+78)
		tmp = Float64(cos(t_2) * Float64(t_0 * sin(t_1)));
	elseif (Float64(angle_m / 180.0) <= 5e+219)
		tmp = Float64(t_0 * sin(exp(log(Float64(0.005555555555555556 * Float64(pi * angle_m))))));
	else
		tmp = Float64(cos(t_1) * Float64(t_0 * sin(t_2)));
	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 = 2.0 * ((b + a) * (b - a));
	t_1 = pi * (angle_m / 180.0);
	t_2 = (sqrt(pi) ^ 2.0) * (angle_m / 180.0);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 5e+78)
		tmp = cos(t_2) * (t_0 * sin(t_1));
	elseif ((angle_m / 180.0) <= 5e+219)
		tmp = t_0 * sin(exp(log((0.005555555555555556 * (pi * angle_m)))));
	else
		tmp = cos(t_1) * (t_0 * sin(t_2));
	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[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+78], N[(N[Cos[t$95$2], $MachinePrecision] * N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+219], N[(t$95$0 * N[Sin[N[Exp[N[Log[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$1], $MachinePrecision] * N[(t$95$0 * N[Sin[t$95$2], $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 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_1 := \pi \cdot \frac{angle_m}{180}\\
t_2 := {\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle_m}{180}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+78}:\\
\;\;\;\;\cos t_2 \cdot \left(t_0 \cdot \sin t_1\right)\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+219}:\\
\;\;\;\;t_0 \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\cos t_1 \cdot \left(t_0 \cdot \sin t_2\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle 180) < 4.99999999999999984e78

    1. Initial program 63.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. unpow263.2%

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

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

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

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

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

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

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

    if 4.99999999999999984e78 < (/.f64 angle 180) < 5e219

    1. Initial program 31.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. unpow231.3%

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

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

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

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(e^{\log \left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \pi\right)}\right)\right) \cdot 1 \]
      4. metadata-eval49.6%

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(e^{\log \color{blue}{\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}}\right)\right) \cdot 1 \]
    6. Applied egg-rr49.6%

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

    if 5e219 < (/.f64 angle 180)

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+78}:\\ \;\;\;\;\cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+219}:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle}{180}\right)\right)\\ \end{array} \]

Alternative 7: 55.6% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\\
t_1 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 1.35 \cdot 10^{+17}:\\
\;\;\;\;t_1 \cdot \sin \left(\frac{\pi \cdot angle_m}{180}\right)\\

\mathbf{elif}\;a \leq 2.5 \cdot 10^{+189}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(t_1 \cdot \sin t_0\right)\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left(e^{\log t_0}\right)\\


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

    1. Initial program 60.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. unpow260.4%

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

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

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

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

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

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

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

    if 1.35e17 < a < 2.5000000000000002e189

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

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

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

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

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

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

    if 2.5000000000000002e189 < a

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(e^{\log \left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \pi\right)}\right)\right) \cdot 1 \]
      4. metadata-eval38.1%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(e^{\log \color{blue}{\left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}}\right)\right) \cdot 1 \]
      6. *-commutative38.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.35 \cdot 10^{+17}:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{+189}:\\ \;\;\;\;\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}\right)\\ \end{array} \]

Alternative 8: 56.9% accurate, 1.5× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\ t_1 := t_0 \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle_m\right)\right)\\ angle_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+74}:\\ \;\;\;\;\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot t_1\\ \mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+190}:\\ \;\;\;\;t_0 \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* 2.0 (* (+ b a) (- b a))))
        (t_1 (* t_0 (sin (* PI (* 0.005555555555555556 angle_m))))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 5e+74)
      (* (cos (* PI (/ angle_m 180.0))) t_1)
      (if (<= (/ angle_m 180.0) 5e+190)
        (* t_0 (sin (exp (log (* 0.005555555555555556 (* PI angle_m))))))
        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 = 2.0 * ((b + a) * (b - a));
	double t_1 = t_0 * sin((((double) M_PI) * (0.005555555555555556 * angle_m)));
	double tmp;
	if ((angle_m / 180.0) <= 5e+74) {
		tmp = cos((((double) M_PI) * (angle_m / 180.0))) * t_1;
	} else if ((angle_m / 180.0) <= 5e+190) {
		tmp = t_0 * sin(exp(log((0.005555555555555556 * (((double) M_PI) * angle_m)))));
	} else {
		tmp = t_1;
	}
	return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = 2.0 * ((b + a) * (b - a));
	double t_1 = t_0 * Math.sin((Math.PI * (0.005555555555555556 * angle_m)));
	double tmp;
	if ((angle_m / 180.0) <= 5e+74) {
		tmp = Math.cos((Math.PI * (angle_m / 180.0))) * t_1;
	} else if ((angle_m / 180.0) <= 5e+190) {
		tmp = t_0 * Math.sin(Math.exp(Math.log((0.005555555555555556 * (Math.PI * angle_m)))));
	} else {
		tmp = t_1;
	}
	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 = 2.0 * ((b + a) * (b - a))
	t_1 = t_0 * math.sin((math.pi * (0.005555555555555556 * angle_m)))
	tmp = 0
	if (angle_m / 180.0) <= 5e+74:
		tmp = math.cos((math.pi * (angle_m / 180.0))) * t_1
	elif (angle_m / 180.0) <= 5e+190:
		tmp = t_0 * math.sin(math.exp(math.log((0.005555555555555556 * (math.pi * angle_m)))))
	else:
		tmp = 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(2.0 * Float64(Float64(b + a) * Float64(b - a)))
	t_1 = Float64(t_0 * sin(Float64(pi * Float64(0.005555555555555556 * angle_m))))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e+74)
		tmp = Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * t_1);
	elseif (Float64(angle_m / 180.0) <= 5e+190)
		tmp = Float64(t_0 * sin(exp(log(Float64(0.005555555555555556 * Float64(pi * angle_m))))));
	else
		tmp = t_1;
	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 = 2.0 * ((b + a) * (b - a));
	t_1 = t_0 * sin((pi * (0.005555555555555556 * angle_m)));
	tmp = 0.0;
	if ((angle_m / 180.0) <= 5e+74)
		tmp = cos((pi * (angle_m / 180.0))) * t_1;
	elseif ((angle_m / 180.0) <= 5e+190)
		tmp = t_0 * sin(exp(log((0.005555555555555556 * (pi * angle_m)))));
	else
		tmp = t_1;
	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[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+74], N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+190], N[(t$95$0 * N[Sin[N[Exp[N[Log[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_1 := t_0 \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle_m\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+74}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot t_1\\

\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+190}:\\
\;\;\;\;t_0 \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle 180) < 4.99999999999999963e74

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999963e74 < (/.f64 angle 180) < 5.00000000000000036e190

    1. Initial program 26.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. unpow226.8%

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

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

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

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(e^{\log \left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \pi\right)}\right)\right) \cdot 1 \]
      4. metadata-eval48.6%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(e^{\log \color{blue}{\left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}}\right)\right) \cdot 1 \]
      6. *-commutative48.6%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(e^{\log \color{blue}{\left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}}\right)\right) \cdot 1 \]
    6. Applied egg-rr48.6%

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

    if 5.00000000000000036e190 < (/.f64 angle 180)

    1. Initial program 24.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. unpow224.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 54.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(b - a\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 4 \cdot 10^{-18}:\\
\;\;\;\;2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right) \cdot t_0\right)\\

\mathbf{else}:\\
\;\;\;\;\left(angle_m \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot t_0\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 a 2) < 4.0000000000000003e-18

    1. Initial program 66.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. unpow266.4%

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

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

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

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

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

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

    if 4.0000000000000003e-18 < (pow.f64 a 2)

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{a}^{2} \leq 4 \cdot 10^{-18}:\\ \;\;\;\;2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\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} \]

Alternative 10: 54.9% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(b - a\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 0.0013:\\
\;\;\;\;\left(2 \cdot t_0\right) \cdot \sin \left(\frac{\pi \cdot angle_m}{180}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(angle_m \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot t_0\right)\\


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

    1. Initial program 60.9%

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

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

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

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

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

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

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

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

    if 0.0012999999999999999 < a

    1. Initial program 45.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. unpow245.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 0.0013:\\ \;\;\;\;\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{\pi \cdot angle}{180}\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} \]

Alternative 11: 55.3% accurate, 2.9× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle_m\right)\right)\right) \end{array} \]
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (*
   (* 2.0 (* (+ b a) (- b a)))
   (sin (* PI (* 0.005555555555555556 angle_m))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * ((2.0 * ((b + a) * (b - a))) * sin((((double) M_PI) * (0.005555555555555556 * angle_m))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * ((2.0 * ((b + a) * (b - a))) * Math.sin((Math.PI * (0.005555555555555556 * angle_m))));
}
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * ((2.0 * ((b + a) * (b - a))) * math.sin((math.pi * (0.005555555555555556 * angle_m))))
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) * sin(Float64(pi * Float64(0.005555555555555556 * angle_m)))))
end
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * ((2.0 * ((b + a) * (b - a))) * sin((pi * (0.005555555555555556 * angle_m))));
end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $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(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle_m\right)\right)\right)
\end{array}
Derivation
  1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 53.7% accurate, 5.5× 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 1 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 56.6%

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

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

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

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

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

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

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

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

Alternative 13: 53.7% accurate, 5.5× 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 1 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 56.6%

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

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

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

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

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

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

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

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

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

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

Reproduce

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