ab-angle->ABCF B

Percentage Accurate: 54.6% → 58.1%
Time: 33.9s
Alternatives: 10
Speedup: 27.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 54.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: 58.1% accurate, 0.8× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \left(b_m + a\right) \cdot \left(b_m - a\right)\\ t_1 := \cos \left(\pi \cdot \frac{angle}{180}\right)\\ t_2 := \sqrt[3]{angle \cdot 0.005555555555555556}\\ \mathbf{if}\;b_m \leq 3.7 \cdot 10^{+152}:\\ \;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\\ \mathbf{elif}\;b_m \leq 5 \cdot 10^{+245}:\\ \;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \sin \left({\left(\sqrt[3]{angle}\right)}^{2} \cdot \left(\sqrt[3]{angle} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \sin \left({t_2}^{2} \cdot \left(\pi \cdot t_2\right)\right)\right)\right)\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
 :precision binary64
 (let* ((t_0 (* (+ b_m a) (- b_m a)))
        (t_1 (cos (* PI (/ angle 180.0))))
        (t_2 (cbrt (* angle 0.005555555555555556))))
   (if (<= b_m 3.7e+152)
     (* 2.0 (* t_1 (* t_0 (sin (* 0.005555555555555556 (* PI angle))))))
     (if (<= b_m 5e+245)
       (*
        2.0
        (*
         t_1
         (*
          t_0
          (sin
           (*
            (pow (cbrt angle) 2.0)
            (* (cbrt angle) (* PI 0.005555555555555556)))))))
       (* 2.0 (* t_1 (* t_0 (sin (* (pow t_2 2.0) (* PI t_2))))))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
	double t_0 = (b_m + a) * (b_m - a);
	double t_1 = cos((((double) M_PI) * (angle / 180.0)));
	double t_2 = cbrt((angle * 0.005555555555555556));
	double tmp;
	if (b_m <= 3.7e+152) {
		tmp = 2.0 * (t_1 * (t_0 * sin((0.005555555555555556 * (((double) M_PI) * angle)))));
	} else if (b_m <= 5e+245) {
		tmp = 2.0 * (t_1 * (t_0 * sin((pow(cbrt(angle), 2.0) * (cbrt(angle) * (((double) M_PI) * 0.005555555555555556))))));
	} else {
		tmp = 2.0 * (t_1 * (t_0 * sin((pow(t_2, 2.0) * (((double) M_PI) * t_2)))));
	}
	return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
	double t_0 = (b_m + a) * (b_m - a);
	double t_1 = Math.cos((Math.PI * (angle / 180.0)));
	double t_2 = Math.cbrt((angle * 0.005555555555555556));
	double tmp;
	if (b_m <= 3.7e+152) {
		tmp = 2.0 * (t_1 * (t_0 * Math.sin((0.005555555555555556 * (Math.PI * angle)))));
	} else if (b_m <= 5e+245) {
		tmp = 2.0 * (t_1 * (t_0 * Math.sin((Math.pow(Math.cbrt(angle), 2.0) * (Math.cbrt(angle) * (Math.PI * 0.005555555555555556))))));
	} else {
		tmp = 2.0 * (t_1 * (t_0 * Math.sin((Math.pow(t_2, 2.0) * (Math.PI * t_2)))));
	}
	return tmp;
}
b_m = abs(b)
function code(a, b_m, angle)
	t_0 = Float64(Float64(b_m + a) * Float64(b_m - a))
	t_1 = cos(Float64(pi * Float64(angle / 180.0)))
	t_2 = cbrt(Float64(angle * 0.005555555555555556))
	tmp = 0.0
	if (b_m <= 3.7e+152)
		tmp = Float64(2.0 * Float64(t_1 * Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(pi * angle))))));
	elseif (b_m <= 5e+245)
		tmp = Float64(2.0 * Float64(t_1 * Float64(t_0 * sin(Float64((cbrt(angle) ^ 2.0) * Float64(cbrt(angle) * Float64(pi * 0.005555555555555556)))))));
	else
		tmp = Float64(2.0 * Float64(t_1 * Float64(t_0 * sin(Float64((t_2 ^ 2.0) * Float64(pi * t_2))))));
	end
	return tmp
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(angle * 0.005555555555555556), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[b$95$m, 3.7e+152], N[(2.0 * N[(t$95$1 * N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 5e+245], N[(2.0 * N[(t$95$1 * N[(t$95$0 * N[Sin[N[(N[Power[N[Power[angle, 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Power[angle, 1/3], $MachinePrecision] * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[(t$95$0 * N[Sin[N[(N[Power[t$95$2, 2.0], $MachinePrecision] * N[(Pi * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
b_m = \left|b\right|

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

\mathbf{elif}\;b_m \leq 5 \cdot 10^{+245}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \sin \left({\left(\sqrt[3]{angle}\right)}^{2} \cdot \left(\sqrt[3]{angle} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\

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


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

    1. Initial program 60.1%

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

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

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

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

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

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

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

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

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

    if 3.69999999999999996e152 < b < 5.00000000000000034e245

    1. Initial program 44.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000034e245 < b

    1. Initial program 18.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 54.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := \left(b_m + a\right) \cdot \left(b_m - a\right)\\
t_2 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;\left(\left(2 \cdot \left({b_m}^{2} - {a}^{2}\right)\right) \cdot \sin t_2\right) \cdot \cos t_2 \leq 2 \cdot 10^{+140}:\\
\;\;\;\;2 \cdot \left(\left(t_1 \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \log \left(e^{\cos t_0}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(t_1 \cdot \sin \left({\left(\sqrt[3]{angle}\right)}^{2} \cdot \left(\sqrt[3]{angle} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) < 2.00000000000000012e140

    1. Initial program 64.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000012e140 < (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))

    1. Initial program 38.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 42.1% accurate, 0.8× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \left(b_m + a\right) \cdot \left(b_m - a\right)\\ t_1 := \cos \left(\pi \cdot \frac{angle}{180}\right)\\ \mathbf{if}\;a \leq 5.1 \cdot 10^{+166}:\\ \;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \left|\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right|\right)\right)\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{+233}:\\ \;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \sin \left({\left(\sqrt[3]{angle}\right)}^{2} \cdot \left(\sqrt[3]{angle} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
 :precision binary64
 (let* ((t_0 (* (+ b_m a) (- b_m a))) (t_1 (cos (* PI (/ angle 180.0)))))
   (if (<= a 5.1e+166)
     (* 2.0 (* t_1 (* t_0 (fabs (sin (* PI (* angle 0.005555555555555556)))))))
     (if (<= a 1.05e+233)
       (*
        2.0
        (*
         t_1
         (*
          t_0
          (sin
           (*
            (pow (cbrt angle) 2.0)
            (* (cbrt angle) (* PI 0.005555555555555556)))))))
       (* 2.0 (* t_1 (* t_0 (sin (* 0.005555555555555556 (* PI angle))))))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
	double t_0 = (b_m + a) * (b_m - a);
	double t_1 = cos((((double) M_PI) * (angle / 180.0)));
	double tmp;
	if (a <= 5.1e+166) {
		tmp = 2.0 * (t_1 * (t_0 * fabs(sin((((double) M_PI) * (angle * 0.005555555555555556))))));
	} else if (a <= 1.05e+233) {
		tmp = 2.0 * (t_1 * (t_0 * sin((pow(cbrt(angle), 2.0) * (cbrt(angle) * (((double) M_PI) * 0.005555555555555556))))));
	} else {
		tmp = 2.0 * (t_1 * (t_0 * sin((0.005555555555555556 * (((double) M_PI) * angle)))));
	}
	return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
	double t_0 = (b_m + a) * (b_m - a);
	double t_1 = Math.cos((Math.PI * (angle / 180.0)));
	double tmp;
	if (a <= 5.1e+166) {
		tmp = 2.0 * (t_1 * (t_0 * Math.abs(Math.sin((Math.PI * (angle * 0.005555555555555556))))));
	} else if (a <= 1.05e+233) {
		tmp = 2.0 * (t_1 * (t_0 * Math.sin((Math.pow(Math.cbrt(angle), 2.0) * (Math.cbrt(angle) * (Math.PI * 0.005555555555555556))))));
	} else {
		tmp = 2.0 * (t_1 * (t_0 * Math.sin((0.005555555555555556 * (Math.PI * angle)))));
	}
	return tmp;
}
b_m = abs(b)
function code(a, b_m, angle)
	t_0 = Float64(Float64(b_m + a) * Float64(b_m - a))
	t_1 = cos(Float64(pi * Float64(angle / 180.0)))
	tmp = 0.0
	if (a <= 5.1e+166)
		tmp = Float64(2.0 * Float64(t_1 * Float64(t_0 * abs(sin(Float64(pi * Float64(angle * 0.005555555555555556)))))));
	elseif (a <= 1.05e+233)
		tmp = Float64(2.0 * Float64(t_1 * Float64(t_0 * sin(Float64((cbrt(angle) ^ 2.0) * Float64(cbrt(angle) * Float64(pi * 0.005555555555555556)))))));
	else
		tmp = Float64(2.0 * Float64(t_1 * Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(pi * angle))))));
	end
	return tmp
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a, 5.1e+166], N[(2.0 * N[(t$95$1 * N[(t$95$0 * N[Abs[N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e+233], N[(2.0 * N[(t$95$1 * N[(t$95$0 * N[Sin[N[(N[Power[N[Power[angle, 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Power[angle, 1/3], $MachinePrecision] * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|

\\
\begin{array}{l}
t_0 := \left(b_m + a\right) \cdot \left(b_m - a\right)\\
t_1 := \cos \left(\pi \cdot \frac{angle}{180}\right)\\
\mathbf{if}\;a \leq 5.1 \cdot 10^{+166}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \left|\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right|\right)\right)\\

\mathbf{elif}\;a \leq 1.05 \cdot 10^{+233}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \sin \left({\left(\sqrt[3]{angle}\right)}^{2} \cdot \left(\sqrt[3]{angle} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(t_0 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\\


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

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.1e166 < a < 1.04999999999999998e233

    1. Initial program 40.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.04999999999999998e233 < a

    1. Initial program 50.5%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 58.0% accurate, 1.3× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \left(b_m + a\right) \cdot \left(b_m - a\right)\\ t_1 := 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\\ \mathbf{if}\;{b_m}^{2} \leq 10^{+303}:\\ \;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(t_0 \cdot \sin t_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t_0 \cdot \left(t_1 + -2.8577960676726107 \cdot 10^{-8} \cdot \left({angle}^{3} \cdot {\pi}^{3}\right)\right)\right)\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
 :precision binary64
 (let* ((t_0 (* (+ b_m a) (- b_m a)))
        (t_1 (* 0.005555555555555556 (* PI angle))))
   (if (<= (pow b_m 2.0) 1e+303)
     (* 2.0 (* (cos (* PI (/ angle 180.0))) (* t_0 (sin t_1))))
     (*
      2.0
      (*
       t_0
       (+ t_1 (* -2.8577960676726107e-8 (* (pow angle 3.0) (pow PI 3.0)))))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
	double t_0 = (b_m + a) * (b_m - a);
	double t_1 = 0.005555555555555556 * (((double) M_PI) * angle);
	double tmp;
	if (pow(b_m, 2.0) <= 1e+303) {
		tmp = 2.0 * (cos((((double) M_PI) * (angle / 180.0))) * (t_0 * sin(t_1)));
	} else {
		tmp = 2.0 * (t_0 * (t_1 + (-2.8577960676726107e-8 * (pow(angle, 3.0) * pow(((double) M_PI), 3.0)))));
	}
	return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
	double t_0 = (b_m + a) * (b_m - a);
	double t_1 = 0.005555555555555556 * (Math.PI * angle);
	double tmp;
	if (Math.pow(b_m, 2.0) <= 1e+303) {
		tmp = 2.0 * (Math.cos((Math.PI * (angle / 180.0))) * (t_0 * Math.sin(t_1)));
	} else {
		tmp = 2.0 * (t_0 * (t_1 + (-2.8577960676726107e-8 * (Math.pow(angle, 3.0) * Math.pow(Math.PI, 3.0)))));
	}
	return tmp;
}
b_m = math.fabs(b)
def code(a, b_m, angle):
	t_0 = (b_m + a) * (b_m - a)
	t_1 = 0.005555555555555556 * (math.pi * angle)
	tmp = 0
	if math.pow(b_m, 2.0) <= 1e+303:
		tmp = 2.0 * (math.cos((math.pi * (angle / 180.0))) * (t_0 * math.sin(t_1)))
	else:
		tmp = 2.0 * (t_0 * (t_1 + (-2.8577960676726107e-8 * (math.pow(angle, 3.0) * math.pow(math.pi, 3.0)))))
	return tmp
b_m = abs(b)
function code(a, b_m, angle)
	t_0 = Float64(Float64(b_m + a) * Float64(b_m - a))
	t_1 = Float64(0.005555555555555556 * Float64(pi * angle))
	tmp = 0.0
	if ((b_m ^ 2.0) <= 1e+303)
		tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle / 180.0))) * Float64(t_0 * sin(t_1))));
	else
		tmp = Float64(2.0 * Float64(t_0 * Float64(t_1 + Float64(-2.8577960676726107e-8 * Float64((angle ^ 3.0) * (pi ^ 3.0))))));
	end
	return tmp
end
b_m = abs(b);
function tmp_2 = code(a, b_m, angle)
	t_0 = (b_m + a) * (b_m - a);
	t_1 = 0.005555555555555556 * (pi * angle);
	tmp = 0.0;
	if ((b_m ^ 2.0) <= 1e+303)
		tmp = 2.0 * (cos((pi * (angle / 180.0))) * (t_0 * sin(t_1)));
	else
		tmp = 2.0 * (t_0 * (t_1 + (-2.8577960676726107e-8 * ((angle ^ 3.0) * (pi ^ 3.0)))));
	end
	tmp_2 = tmp;
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b$95$m, 2.0], $MachinePrecision], 1e+303], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$0 * N[(t$95$1 + N[(-2.8577960676726107e-8 * N[(N[Power[angle, 3.0], $MachinePrecision] * N[Power[Pi, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_0 \cdot \left(t_1 + -2.8577960676726107 \cdot 10^{-8} \cdot \left({angle}^{3} \cdot {\pi}^{3}\right)\right)\right)\\


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

    1. Initial program 65.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*65.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*65.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. Simplified65.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. unpow265.6%

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

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

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

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

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

    if 1e303 < (pow.f64 b 2)

    1. Initial program 32.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 57.8% accurate, 1.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;2 \cdot t_0\\


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

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

    if 1.99999999999999997e307 < (pow.f64 b 2)

    1. Initial program 33.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 58.1% accurate, 1.9× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ 2 \cdot \left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(\left(\left(b_m + a\right) \cdot \left(b_m - a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right) \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
 :precision binary64
 (*
  2.0
  (*
   (cos (* PI (* angle 0.005555555555555556)))
   (* (* (+ b_m a) (- b_m a)) (sin (* 0.005555555555555556 (* PI angle)))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
	return 2.0 * (cos((((double) M_PI) * (angle * 0.005555555555555556))) * (((b_m + a) * (b_m - a)) * sin((0.005555555555555556 * (((double) M_PI) * angle)))));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
	return 2.0 * (Math.cos((Math.PI * (angle * 0.005555555555555556))) * (((b_m + a) * (b_m - a)) * Math.sin((0.005555555555555556 * (Math.PI * angle)))));
}
b_m = math.fabs(b)
def code(a, b_m, angle):
	return 2.0 * (math.cos((math.pi * (angle * 0.005555555555555556))) * (((b_m + a) * (b_m - a)) * math.sin((0.005555555555555556 * (math.pi * angle)))))
b_m = abs(b)
function code(a, b_m, angle)
	return Float64(2.0 * Float64(cos(Float64(pi * Float64(angle * 0.005555555555555556))) * Float64(Float64(Float64(b_m + a) * Float64(b_m - a)) * sin(Float64(0.005555555555555556 * Float64(pi * angle))))))
end
b_m = abs(b);
function tmp = code(a, b_m, angle)
	tmp = 2.0 * (cos((pi * (angle * 0.005555555555555556))) * (((b_m + a) * (b_m - a)) * sin((0.005555555555555556 * (pi * angle)))));
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := N[(2.0 * N[(N[Cos[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto 2 \cdot \left(\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \color{blue}{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \]
  11. Final simplification61.0%

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

Alternative 7: 56.2% accurate, 3.6× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ 2 \cdot \left(\left(\left(b_m + a\right) \cdot \left(b_m - a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
 :precision binary64
 (*
  2.0
  (* (* (+ b_m a) (- b_m a)) (sin (* 0.005555555555555556 (* PI angle))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
	return 2.0 * (((b_m + a) * (b_m - a)) * sin((0.005555555555555556 * (((double) M_PI) * angle))));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
	return 2.0 * (((b_m + a) * (b_m - a)) * Math.sin((0.005555555555555556 * (Math.PI * angle))));
}
b_m = math.fabs(b)
def code(a, b_m, angle):
	return 2.0 * (((b_m + a) * (b_m - a)) * math.sin((0.005555555555555556 * (math.pi * angle))))
b_m = abs(b)
function code(a, b_m, angle)
	return Float64(2.0 * Float64(Float64(Float64(b_m + a) * Float64(b_m - a)) * sin(Float64(0.005555555555555556 * Float64(pi * angle)))))
end
b_m = abs(b);
function tmp = code(a, b_m, angle)
	tmp = 2.0 * (((b_m + a) * (b_m - a)) * sin((0.005555555555555556 * (pi * angle))));
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := N[(2.0 * N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|

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

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

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

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

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

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

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

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

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

Alternative 8: 54.9% accurate, 27.9× speedup?

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

\\
2 \cdot \left(0.005555555555555556 \cdot \left(angle \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 56.6%

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

      \[\leadsto \color{blue}{\left(2 \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. associate-*l*56.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. Simplified56.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. unpow256.6%

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

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

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

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

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

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

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

Alternative 9: 54.9% accurate, 27.9× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ 2 \cdot \left(0.005555555555555556 \cdot \left(\left(\left(b_m + a\right) \cdot \left(b_m - a\right)\right) \cdot \left(\pi \cdot angle\right)\right)\right) \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
 :precision binary64
 (* 2.0 (* 0.005555555555555556 (* (* (+ b_m a) (- b_m a)) (* PI angle)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
	return 2.0 * (0.005555555555555556 * (((b_m + a) * (b_m - a)) * (((double) M_PI) * angle)));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
	return 2.0 * (0.005555555555555556 * (((b_m + a) * (b_m - a)) * (Math.PI * angle)));
}
b_m = math.fabs(b)
def code(a, b_m, angle):
	return 2.0 * (0.005555555555555556 * (((b_m + a) * (b_m - a)) * (math.pi * angle)))
b_m = abs(b)
function code(a, b_m, angle)
	return Float64(2.0 * Float64(0.005555555555555556 * Float64(Float64(Float64(b_m + a) * Float64(b_m - a)) * Float64(pi * angle))))
end
b_m = abs(b);
function tmp = code(a, b_m, angle)
	tmp = 2.0 * (0.005555555555555556 * (((b_m + a) * (b_m - a)) * (pi * angle)));
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := N[(2.0 * N[(0.005555555555555556 * N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 54.9% accurate, 27.9× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ 2 \cdot \left(\left(\left(b_m + a\right) \cdot \left(b_m - a\right)\right) \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
 :precision binary64
 (* 2.0 (* (* (+ b_m a) (- b_m a)) (* angle (* PI 0.005555555555555556)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
	return 2.0 * (((b_m + a) * (b_m - a)) * (angle * (((double) M_PI) * 0.005555555555555556)));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
	return 2.0 * (((b_m + a) * (b_m - a)) * (angle * (Math.PI * 0.005555555555555556)));
}
b_m = math.fabs(b)
def code(a, b_m, angle):
	return 2.0 * (((b_m + a) * (b_m - a)) * (angle * (math.pi * 0.005555555555555556)))
b_m = abs(b)
function code(a, b_m, angle)
	return Float64(2.0 * Float64(Float64(Float64(b_m + a) * Float64(b_m - a)) * Float64(angle * Float64(pi * 0.005555555555555556))))
end
b_m = abs(b);
function tmp = code(a, b_m, angle)
	tmp = 2.0 * (((b_m + a) * (b_m - a)) * (angle * (pi * 0.005555555555555556)));
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := N[(2.0 * N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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