ab-angle->ABCF B

Percentage Accurate: 53.3% → 56.4%
Time: 47.3s
Alternatives: 10
Speedup: 32.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 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: 53.3% 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: 56.4% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a_m \leq 1.2 \cdot 10^{+193}:\\
\;\;\;\;\left(t_1 \cdot \sin t_0\right) \cdot \cos \left(\frac{angle}{180} \cdot {\left(\sqrt[3]{{\pi}^{1.5}}\right)}^{2}\right)\\

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


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

    1. Initial program 56.1%

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

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      2. sqrt-unprod37.7%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      3. pow237.7%

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

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

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

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

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

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

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

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

    if 2.7e25 < a < 1.2e193

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e193 < a

    1. Initial program 41.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow241.7%

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

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

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

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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 \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.0%

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

Alternative 2: 57.3% accurate, 0.8× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(t_1 \cdot \sin \left(\frac{angle}{180} \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)\right)\\


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

    1. Initial program 57.0%

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

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      2. sqrt-unprod34.8%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      3. pow234.8%

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

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

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

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

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

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

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

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

    if 2e173 < a

    1. Initial program 33.8%

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

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

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

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

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

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

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

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

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

Alternative 3: 57.1% accurate, 0.8× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(t_1 \cdot \sin \left(\frac{angle}{180} \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)\right) \cdot t_0\\


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

    1. Initial program 56.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6e14 < a

    1. Initial program 50.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow250.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 57.1% accurate, 1.0× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\ t_1 := 2 \cdot \left(\left(a_m + b\right) \cdot \left(b - a_m\right)\right)\\ \mathbf{if}\;{b}^{2} - {a_m}^{2} \leq -\infty:\\ \;\;\;\;t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos t_0 \cdot \left(t_1 \cdot \sin t_0\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
 :precision binary64
 (let* ((t_0 (* PI (* angle 0.005555555555555556)))
        (t_1 (* 2.0 (* (+ a_m b) (- b a_m)))))
   (if (<= (- (pow b 2.0) (pow a_m 2.0)) (- INFINITY))
     (* t_1 (sin (* 0.005555555555555556 (* PI angle))))
     (* (cos t_0) (* t_1 (sin t_0))))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
	double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
	double t_1 = 2.0 * ((a_m + b) * (b - a_m));
	double tmp;
	if ((pow(b, 2.0) - pow(a_m, 2.0)) <= -((double) INFINITY)) {
		tmp = t_1 * sin((0.005555555555555556 * (((double) M_PI) * angle)));
	} else {
		tmp = cos(t_0) * (t_1 * sin(t_0));
	}
	return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
	double t_0 = Math.PI * (angle * 0.005555555555555556);
	double t_1 = 2.0 * ((a_m + b) * (b - a_m));
	double tmp;
	if ((Math.pow(b, 2.0) - Math.pow(a_m, 2.0)) <= -Double.POSITIVE_INFINITY) {
		tmp = t_1 * Math.sin((0.005555555555555556 * (Math.PI * angle)));
	} else {
		tmp = Math.cos(t_0) * (t_1 * Math.sin(t_0));
	}
	return tmp;
}
a_m = math.fabs(a)
def code(a_m, b, angle):
	t_0 = math.pi * (angle * 0.005555555555555556)
	t_1 = 2.0 * ((a_m + b) * (b - a_m))
	tmp = 0
	if (math.pow(b, 2.0) - math.pow(a_m, 2.0)) <= -math.inf:
		tmp = t_1 * math.sin((0.005555555555555556 * (math.pi * angle)))
	else:
		tmp = math.cos(t_0) * (t_1 * math.sin(t_0))
	return tmp
a_m = abs(a)
function code(a_m, b, angle)
	t_0 = Float64(pi * Float64(angle * 0.005555555555555556))
	t_1 = Float64(2.0 * Float64(Float64(a_m + b) * Float64(b - a_m)))
	tmp = 0.0
	if (Float64((b ^ 2.0) - (a_m ^ 2.0)) <= Float64(-Inf))
		tmp = Float64(t_1 * sin(Float64(0.005555555555555556 * Float64(pi * angle))));
	else
		tmp = Float64(cos(t_0) * Float64(t_1 * sin(t_0)));
	end
	return tmp
end
a_m = abs(a);
function tmp_2 = code(a_m, b, angle)
	t_0 = pi * (angle * 0.005555555555555556);
	t_1 = 2.0 * ((a_m + b) * (b - a_m));
	tmp = 0.0;
	if (((b ^ 2.0) - (a_m ^ 2.0)) <= -Inf)
		tmp = t_1 * sin((0.005555555555555556 * (pi * angle)));
	else
		tmp = cos(t_0) * (t_1 * sin(t_0));
	end
	tmp_2 = tmp;
end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(N[(a$95$m + b), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(t$95$1 * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$0], $MachinePrecision] * N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|

\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := 2 \cdot \left(\left(a_m + b\right) \cdot \left(b - a_m\right)\right)\\
\mathbf{if}\;{b}^{2} - {a_m}^{2} \leq -\infty:\\
\;\;\;\;t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\\

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


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

    1. Initial program 38.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow238.7%

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

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

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

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

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

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

    if -inf.0 < (-.f64 (pow.f64 b 2) (pow.f64 a 2))

    1. Initial program 58.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 57.2% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(t_0 \cdot \sin \left(\frac{angle}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\\


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

    1. Initial program 58.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e164 < a

    1. Initial program 28.3%

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

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

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

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

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

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

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

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

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

Alternative 6: 56.5% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 56.8%

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

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      2. sqrt-unprod34.7%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      3. pow234.7%

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

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

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

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

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

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

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

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

    if 1.9999999999999999e175 < a

    1. Initial program 35.4%

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

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

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

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

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.6%

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

Alternative 7: 57.5% accurate, 1.9× speedup?

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

\\
\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left(\left(a_m + b\right) \cdot \left(b - a_m\right)\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)
\end{array}
Derivation
  1. Initial program 55.3%

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

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

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

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

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

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

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

Alternative 8: 57.2% accurate, 1.9× speedup?

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

\\
\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left(\left(a_m + b\right) \cdot \left(b - a_m\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)
\end{array}
Derivation
  1. Initial program 55.3%

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

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

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

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

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

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
    2. sqrt-unprod34.2%

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
    3. pow234.2%

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

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

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

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

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

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

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

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

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

Alternative 9: 55.7% accurate, 3.6× speedup?

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

\\
\left(2 \cdot \left(\left(a_m + b\right) \cdot \left(b - a_m\right)\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)
\end{array}
Derivation
  1. Initial program 55.3%

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

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

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

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

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

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

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

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

Alternative 10: 54.2% accurate, 32.2× speedup?

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

\\
0.011111111111111112 \cdot \left(angle \cdot \left(\left(\left(a_m + b\right) \cdot \left(b - a_m\right)\right) \cdot \pi\right)\right)
\end{array}
Derivation
  1. Initial program 55.3%

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

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

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

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

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

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

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

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

Reproduce

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