ab-angle->ABCF B

Percentage Accurate: 53.6% → 57.5%
Time: 1.3min
Alternatives: 11
Speedup: 5.5×

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 11 alternatives:

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

Initial Program: 53.6% accurate, 1.0× speedup?

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

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

Alternative 1: 57.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle_m}{180}\\
t_1 := \sqrt[3]{{\pi}^{3}}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;b_m \leq 2.4 \cdot 10^{+147}:\\
\;\;\;\;\left(\left(2 \cdot \left({b_m}^{2} - {a}^{2}\right)\right) \cdot \sin t_0\right) \cdot \sqrt[3]{{\cos \left(t_1 \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)}^{3}}\\

\mathbf{elif}\;b_m \leq 4.4 \cdot 10^{+237}:\\
\;\;\;\;2 \cdot \left(e^{\log \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right) - -2 \cdot \log b_m} \cdot \cos t_0\right)\\

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\left(b_m - a\right) \cdot \left(b_m + a\right)\right)\right) \cdot \sin \left(\frac{angle_m}{180} \cdot t_1\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 2.40000000000000002e147

    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. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube57.5%

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

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

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

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

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

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

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

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

    if 2.40000000000000002e147 < b < 4.4e237

    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(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. associate-*l*23.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(e^{-2 \cdot \left(-\log b\right) + \log \sin \left(\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      5. *-commutative24.8%

        \[\leadsto 2 \cdot \left(e^{-2 \cdot \left(-\log b\right) + \log \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      6. *-commutative24.8%

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

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

    if 4.4e237 < b

    1. Initial program 55.8%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 56.2% accurate, 0.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\cos t_0 \cdot \left(2 \cdot \left({b_m}^{2} \cdot \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)\right)\\


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

    1. Initial program 48.1%

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

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

    if -9.9999999999999998e-268 < (-.f64 (pow.f64 b 2) (pow.f64 a 2))

    1. Initial program 60.6%

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

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

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

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

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

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

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

Alternative 3: 57.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle_m}{180}\\
t_1 := 2 \cdot \left(\left(b_m - a\right) \cdot \left(b_m + a\right)\right)\\
t_2 := \sqrt[3]{{\pi}^{3}}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;b_m \leq 2.4 \cdot 10^{+147}:\\
\;\;\;\;\sqrt[3]{{\cos \left(t_2 \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)}^{3}} \cdot \left(\sin t_0 \cdot t_1\right)\\

\mathbf{elif}\;b_m \leq 6.4 \cdot 10^{+236}:\\
\;\;\;\;2 \cdot \left(e^{\log \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right) - -2 \cdot \log b_m} \cdot \cos t_0\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 2.40000000000000002e147

    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. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube57.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.40000000000000002e147 < b < 6.4000000000000003e236

    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(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. associate-*l*23.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(e^{-2 \cdot \left(-\log b\right) + \log \sin \left(\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      5. *-commutative24.8%

        \[\leadsto 2 \cdot \left(e^{-2 \cdot \left(-\log b\right) + \log \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      6. *-commutative24.8%

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

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

    if 6.4000000000000003e236 < b

    1. Initial program 55.8%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 55.3% accurate, 0.9× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \begin{array}{l} \mathbf{if}\;{b_m}^{2} - {a}^{2} \leq -1 \cdot 10^{-267}:\\ \;\;\;\;\left(2 \cdot \left(\left(b_m - a\right) \cdot \left(b_m + a\right)\right)\right) \cdot \sin \left(\frac{angle_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(2 \cdot \left({b_m}^{2} \cdot \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)\right)\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b_m angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= (- (pow b_m 2.0) (pow a 2.0)) -1e-267)
    (*
     (* 2.0 (* (- b_m a) (+ b_m a)))
     (sin (* (/ angle_m 180.0) (cbrt (pow PI 3.0)))))
    (*
     (cos (* PI (/ angle_m 180.0)))
     (*
      2.0
      (* (pow b_m 2.0) (sin (* PI (* angle_m 0.005555555555555556)))))))))
b_m = fabs(b);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
	double tmp;
	if ((pow(b_m, 2.0) - pow(a, 2.0)) <= -1e-267) {
		tmp = (2.0 * ((b_m - a) * (b_m + a))) * sin(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0))));
	} else {
		tmp = cos((((double) M_PI) * (angle_m / 180.0))) * (2.0 * (pow(b_m, 2.0) * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))));
	}
	return angle_s * tmp;
}
b_m = Math.abs(b);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
	double tmp;
	if ((Math.pow(b_m, 2.0) - Math.pow(a, 2.0)) <= -1e-267) {
		tmp = (2.0 * ((b_m - a) * (b_m + a))) * Math.sin(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0))));
	} else {
		tmp = Math.cos((Math.PI * (angle_m / 180.0))) * (2.0 * (Math.pow(b_m, 2.0) * Math.sin((Math.PI * (angle_m * 0.005555555555555556)))));
	}
	return angle_s * tmp;
}
b_m = abs(b)
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b_m, angle_m)
	tmp = 0.0
	if (Float64((b_m ^ 2.0) - (a ^ 2.0)) <= -1e-267)
		tmp = Float64(Float64(2.0 * Float64(Float64(b_m - a) * Float64(b_m + a))) * sin(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0)))));
	else
		tmp = Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * Float64(2.0 * Float64((b_m ^ 2.0) * sin(Float64(pi * Float64(angle_m * 0.005555555555555556))))));
	end
	return Float64(angle_s * tmp)
end
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -1e-267], N[(N[(2.0 * N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[Power[b$95$m, 2.0], $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;{b_m}^{2} - {a}^{2} \leq -1 \cdot 10^{-267}:\\
\;\;\;\;\left(2 \cdot \left(\left(b_m - a\right) \cdot \left(b_m + a\right)\right)\right) \cdot \sin \left(\frac{angle_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\\

\mathbf{else}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(2 \cdot \left({b_m}^{2} \cdot \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)\right)\\


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

    1. Initial program 48.1%

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

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

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

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

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

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

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

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

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

    if -9.9999999999999998e-268 < (-.f64 (pow.f64 b 2) (pow.f64 a 2))

    1. Initial program 60.6%

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

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

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

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

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

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

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

Alternative 5: 58.1% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;b_m \leq 7.5 \cdot 10^{+236}:\\
\;\;\;\;2 \cdot \left(e^{\log \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right) - -2 \cdot \log b_m} \cdot \cos t_0\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 9.4999999999999995e153

    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. Add Preprocessing
    3. Taylor expanded in angle around inf 58.9%

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

    if 9.4999999999999995e153 < b < 7.5e236

    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(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. associate-*l*23.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(e^{-2 \cdot \left(-\log b\right) + \log \sin \left(\color{blue}{\left(angle \cdot 0.005555555555555556\right)} \cdot \pi\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      5. *-commutative24.8%

        \[\leadsto 2 \cdot \left(e^{-2 \cdot \left(-\log b\right) + \log \sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      6. *-commutative24.8%

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

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

    if 7.5e236 < b

    1. Initial program 55.8%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 55.8% accurate, 1.5× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \left(\left(2 \cdot \left(\left(b_m - a\right) \cdot \left(b_m + a\right)\right)\right) \cdot \sin \left(\frac{angle_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right) \end{array} \]
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b_m angle_m)
 :precision binary64
 (*
  angle_s
  (*
   (* 2.0 (* (- b_m a) (+ b_m a)))
   (sin (* (/ angle_m 180.0) (cbrt (pow PI 3.0)))))))
b_m = fabs(b);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
	return angle_s * ((2.0 * ((b_m - a) * (b_m + a))) * sin(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0)))));
}
b_m = Math.abs(b);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
	return angle_s * ((2.0 * ((b_m - a) * (b_m + a))) * Math.sin(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0)))));
}
b_m = abs(b)
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b_m, angle_m)
	return Float64(angle_s * Float64(Float64(2.0 * Float64(Float64(b_m - a) * Float64(b_m + a))) * sin(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0))))))
end
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, angle$95$m_] := N[(angle$95$s * N[(N[(2.0 * N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle_s \cdot \left(\left(2 \cdot \left(\left(b_m - a\right) \cdot \left(b_m + a\right)\right)\right) \cdot \sin \left(\frac{angle_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)
\end{array}
Derivation
  1. Initial program 55.3%

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

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

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

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

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

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

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

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

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

    \[\leadsto \left(2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \sqrt[3]{{\pi}^{3}}\right) \]
  9. Add Preprocessing

Alternative 7: 55.5% accurate, 2.8× speedup?

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

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

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


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

    1. Initial program 56.6%

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

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

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{\pi \cdot angle}{180}\right)}\right) \cdot 1 \]
      2. associate-/l*58.3%

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

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

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

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

    if 9.9999999999999992e249 < (/.f64 angle 180)

    1. Initial program 24.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 55.7% accurate, 2.9× speedup?

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

\\
angle_s \cdot \left(\left(2 \cdot \left(\left(b_m - a\right) \cdot \left(b_m + a\right)\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)\right)
\end{array}
Derivation
  1. Initial program 55.3%

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

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

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

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

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

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

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

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

Alternative 9: 56.1% accurate, 2.9× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ angle_m = \left|angle\right| \\ angle_s = \mathsf{copysign}\left(1, angle\right) \\ angle_s \cdot \left(\left(2 \cdot \left(\left(b_m - a\right) \cdot \left(b_m + a\right)\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle_m}}\right)\right) \end{array} \]
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b_m angle_m)
 :precision binary64
 (*
  angle_s
  (* (* 2.0 (* (- b_m a) (+ b_m a))) (sin (/ PI (/ 180.0 angle_m))))))
b_m = fabs(b);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
	return angle_s * ((2.0 * ((b_m - a) * (b_m + a))) * sin((((double) M_PI) / (180.0 / angle_m))));
}
b_m = Math.abs(b);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
	return angle_s * ((2.0 * ((b_m - a) * (b_m + a))) * Math.sin((Math.PI / (180.0 / angle_m))));
}
b_m = math.fabs(b)
angle_m = math.fabs(angle)
angle_s = math.copysign(1.0, angle)
def code(angle_s, a, b_m, angle_m):
	return angle_s * ((2.0 * ((b_m - a) * (b_m + a))) * math.sin((math.pi / (180.0 / angle_m))))
b_m = abs(b)
angle_m = abs(angle)
angle_s = copysign(1.0, angle)
function code(angle_s, a, b_m, angle_m)
	return Float64(angle_s * Float64(Float64(2.0 * Float64(Float64(b_m - a) * Float64(b_m + a))) * sin(Float64(pi / Float64(180.0 / angle_m)))))
end
b_m = abs(b);
angle_m = abs(angle);
angle_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b_m, angle_m)
	tmp = angle_s * ((2.0 * ((b_m - a) * (b_m + a))) * sin((pi / (180.0 / angle_m))));
end
b_m = N[Abs[b], $MachinePrecision]
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$95$m_, angle$95$m_] := N[(angle$95$s * N[(N[(2.0 * N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)

\\
angle_s \cdot \left(\left(2 \cdot \left(\left(b_m - a\right) \cdot \left(b_m + a\right)\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle_m}}\right)\right)
\end{array}
Derivation
  1. Initial program 55.3%

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

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

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

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

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \color{blue}{\left(\frac{\pi \cdot angle}{180}\right)}\right) \cdot 1 \]
    2. associate-/l*56.5%

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

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

    \[\leadsto \left(2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right) \]
  9. Add Preprocessing

Alternative 10: 54.2% accurate, 5.4× speedup?

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

\\
angle_s \cdot \left(\left(2 \cdot \left(\left(b_m - a\right) \cdot \left(b_m + a\right)\right)\right) \cdot \left(angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)
\end{array}
Derivation
  1. Initial program 55.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 54.2% accurate, 5.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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