ab-angle->ABCF B

Percentage Accurate: 54.1% → 66.7%
Time: 28.4s
Alternatives: 12
Speedup: 27.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 54.1% accurate, 1.0× speedup?

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

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

Alternative 1: 66.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;b\_m \leq 5.6 \cdot 10^{+250}:\\
\;\;\;\;2 \cdot \left(\left(\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin t\_0\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right) \cdot \left(t\_0 + -2.8577960676726107 \cdot 10^{-8} \cdot \left({angle}^{3} \cdot {\pi}^{3}\right)\right)\right)\\


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

    1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.60000000000000019e250 < b

    1. Initial program 18.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 66.9% accurate, 1.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle 180) < 1.9999999999999999e-38

    1. Initial program 59.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e-38 < (/.f64 angle 180) < 3.99999999999999985e226

    1. Initial program 51.7%

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

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

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

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

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

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

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

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

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

    if 3.99999999999999985e226 < (/.f64 angle 180)

    1. Initial program 22.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 66.1% accurate, 1.8× speedup?

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

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

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

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


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

    1. Initial program 60.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000004e68 < (/.f64 angle 180) < 3.99999999999999985e226

    1. Initial program 41.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999985e226 < (/.f64 angle 180)

    1. Initial program 22.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 67.3% accurate, 1.8× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos t\_1 \cdot \left(t\_0 \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle 180) < 1.9999999999999999e-38

    1. Initial program 59.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e-38 < (/.f64 angle 180) < 1.99999999999999988e166

    1. Initial program 51.9%

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

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

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

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

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

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

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

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

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

    if 1.99999999999999988e166 < (/.f64 angle 180)

    1. Initial program 31.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 67.7% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 53.8% accurate, 3.4× speedup?

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

\\
\begin{array}{l}
t_0 := \left(b\_m + a\right) \cdot \left(b\_m - a\right)\\
\mathbf{if}\;a \leq 1.75 \cdot 10^{+189}:\\
\;\;\;\;2 \cdot \left(t\_0 \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\\

\mathbf{elif}\;a \leq 4.4 \cdot 10^{+232}:\\
\;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left|\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\right|\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot t\_0\right)\right)\right)\\


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

    1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.74999999999999998e189 < a < 4.4e232

    1. Initial program 48.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4e232 < a

    1. Initial program 37.2%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.75 \cdot 10^{+189}:\\ \;\;\;\;2 \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\\ \mathbf{elif}\;a \leq 4.4 \cdot 10^{+232}:\\ \;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left|\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right|\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 66.2% accurate, 3.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 angle 180) < 1.9999999999999999e-38

    1. Initial program 59.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e-38 < (/.f64 angle 180)

    1. Initial program 42.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 56.0% accurate, 3.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 56.1% accurate, 3.6× speedup?

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

\\
2 \cdot \left(\left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right) \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right)
\end{array}
Derivation
  1. Initial program 54.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 54.5% accurate, 27.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 54.5% accurate, 27.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto 2 \cdot \left(\left(0.005555555555555556 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} - 1\right)}\right) \cdot 1\right) \]
  11. Step-by-step derivation
    1. expm1-def40.3%

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

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

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

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

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

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

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

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

Alternative 12: 54.5% accurate, 27.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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