ab-angle->ABCF B

Percentage Accurate: 54.1% → 67.7%
Time: 41.4s
Alternatives: 8
Speedup: 32.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 8 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: 67.7% accurate, 0.9× speedup?

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+72}:\\
\;\;\;\;t\_2 \cdot \left(2 \cdot \left(\sin t\_0 \cdot \cos \left({\left({t\_1}^{3}\right)}^{0.3333333333333333}\right)\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+129}:\\
\;\;\;\;t\_2 \cdot \left(2 \cdot \sin \left(\frac{angle\_m}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 2.4 \cdot 10^{+261}:\\
\;\;\;\;t\_2 \cdot \left(2 \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t\_1\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(2 \cdot \left(\sqrt{{\sin t\_1}^{2}} \cdot \cos t\_0\right)\right)\\


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

    1. Initial program 57.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999996e22 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999944e71

    1. Initial program 29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999944e71 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000003e129

    1. Initial program 23.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000003e129 < (/.f64 angle #s(literal 180 binary64)) < 2.3999999999999998e261

    1. Initial program 14.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.3999999999999998e261 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 12.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+22}:\\ \;\;\;\;\left(\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+72}:\\ \;\;\;\;\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left({\left({\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{3}\right)}^{0.3333333333333333}\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+129}:\\ \;\;\;\;\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left(\frac{angle}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2.4 \cdot 10^{+261}:\\ \;\;\;\;\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(\sqrt{{\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{2}} \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 68.1% accurate, 0.7× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\sqrt{{\sin t\_0}^{2}} \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t\_0\right)\right)\right)\right)\right)\\


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

    1. Initial program 57.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999996e22 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999944e71

    1. Initial program 29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999944e71 < (/.f64 angle #s(literal 180 binary64)) < 6e113

    1. Initial program 33.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6e113 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 13.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 68.1% accurate, 1.3× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b \leq 2.95 \cdot 10^{+193}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= b 2.95e+193)
    (*
     (- b a)
     (* (+ b a) (sin (expm1 (log1p (* PI (* angle_m 0.011111111111111112)))))))
    (*
     (- b a)
     (*
      (+ b a)
      (sin (* 0.011111111111111112 (* angle_m (cbrt (pow PI 3.0))))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (b <= 2.95e+193) {
		tmp = (b - a) * ((b + a) * sin(expm1(log1p((((double) M_PI) * (angle_m * 0.011111111111111112))))));
	} else {
		tmp = (b - a) * ((b + a) * sin((0.011111111111111112 * (angle_m * cbrt(pow(((double) M_PI), 3.0))))));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (b <= 2.95e+193) {
		tmp = (b - a) * ((b + a) * Math.sin(Math.expm1(Math.log1p((Math.PI * (angle_m * 0.011111111111111112))))));
	} else {
		tmp = (b - a) * ((b + a) * Math.sin((0.011111111111111112 * (angle_m * Math.cbrt(Math.pow(Math.PI, 3.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 (b <= 2.95e+193)
		tmp = Float64(Float64(b - a) * Float64(Float64(b + a) * sin(expm1(log1p(Float64(pi * Float64(angle_m * 0.011111111111111112)))))));
	else
		tmp = Float64(Float64(b - a) * Float64(Float64(b + a) * sin(Float64(0.011111111111111112 * Float64(angle_m * cbrt((pi ^ 3.0)))))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 2.95e+193], N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(Exp[N[Log[1 + N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(angle$95$m * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 2.95 \cdot 10^{+193}:\\
\;\;\;\;\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right)\right)\right)\\

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


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

    1. Initial program 50.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \]
    8. Step-by-step derivation
      1. expm1-log1p-u56.7%

        \[\leadsto \left(\sin \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\right)} \cdot \left(b + a\right)\right) \cdot \left(b - a\right) \]
      2. associate-*l*56.6%

        \[\leadsto \left(\sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\pi \cdot \left(angle \cdot 0.011111111111111112\right)}\right)\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right) \]
    9. Applied egg-rr56.6%

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

    if 2.9499999999999999e193 < b

    1. Initial program 22.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.95 \cdot 10^{+193}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 68.0% accurate, 1.3× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right)\right)\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (*
   (- b a)
   (* (+ b a) (sin (expm1 (log1p (* PI (* angle_m 0.011111111111111112)))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * ((b - a) * ((b + a) * sin(expm1(log1p((((double) M_PI) * (angle_m * 0.011111111111111112)))))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * ((b - a) * ((b + a) * Math.sin(Math.expm1(Math.log1p((Math.PI * (angle_m * 0.011111111111111112)))))));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * ((b - a) * ((b + a) * math.sin(math.expm1(math.log1p((math.pi * (angle_m * 0.011111111111111112)))))))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(Float64(b - a) * Float64(Float64(b + a) * sin(expm1(log1p(Float64(pi * Float64(angle_m * 0.011111111111111112))))))))
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[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(Exp[N[Log[1 + N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $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(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 46.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left(\sin \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\right)} \cdot \left(b + a\right)\right) \cdot \left(b - a\right) \]
  10. Final simplification56.2%

    \[\leadsto \left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\right)\right) \]
  11. Add Preprocessing

Alternative 5: 67.3% accurate, 1.9× speedup?

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

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


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

    1. Initial program 54.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000005e149 < (pow.f64 b #s(literal 2 binary64))

    1. Initial program 35.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 66.7% accurate, 3.5× speedup?

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

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

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


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

    1. Initial program 55.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 13.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 62.9% accurate, 32.2× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* (- b a) (* (+ b a) (* (* angle_m PI) 0.011111111111111112)))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * ((b - a) * ((b + a) * ((angle_m * ((double) M_PI)) * 0.011111111111111112)));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * ((b - a) * ((b + a) * ((angle_m * Math.PI) * 0.011111111111111112)));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * ((b - a) * ((b + a) * ((angle_m * math.pi) * 0.011111111111111112)))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(Float64(b - a) * Float64(Float64(b + a) * Float64(Float64(angle_m * pi) * 0.011111111111111112))))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * ((b - a) * ((b + a) * ((angle_m * pi) * 0.011111111111111112)));
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[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.011111111111111112), $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(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\right)
\end{array}
Derivation
  1. Initial program 46.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 54.7% accurate, 32.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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