ab-angle->ABCF B

Percentage Accurate: 54.5% → 67.3%
Time: 52.0s
Alternatives: 16
Speedup: 5.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 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.5% accurate, 1.0× speedup?

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

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

Alternative 1: 67.3% accurate, 1.0× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\ t_1 := 2 \cdot \left(b - a\right)\\ \mathbf{if}\;b \leq 1.38 \cdot 10^{+209}:\\ \;\;\;\;\left(\sin \left({\left(\sqrt{\pi}\right)}^{2} \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\cos t_0 \cdot \left(b + a\right)\right)\right) \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \left(\sin t_0 \cdot \left(\left(b + a\right) \cdot \left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot {\pi}^{2}\right)\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* PI (* 0.005555555555555556 angle))) (t_1 (* 2.0 (- b a))))
   (if (<= b 1.38e+209)
     (*
      (*
       (sin (* (pow (sqrt PI) 2.0) (* 0.005555555555555556 angle)))
       (* (cos t_0) (+ b a)))
      t_1)
     (*
      t_1
      (*
       (sin t_0)
       (*
        (+ b a)
        (+ 1.0 (* -1.54320987654321e-5 (* (* angle angle) (pow PI 2.0))))))))))
b = abs(b);
double code(double a, double b, double angle) {
	double t_0 = ((double) M_PI) * (0.005555555555555556 * angle);
	double t_1 = 2.0 * (b - a);
	double tmp;
	if (b <= 1.38e+209) {
		tmp = (sin((pow(sqrt(((double) M_PI)), 2.0) * (0.005555555555555556 * angle))) * (cos(t_0) * (b + a))) * t_1;
	} else {
		tmp = t_1 * (sin(t_0) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * pow(((double) M_PI), 2.0))))));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double t_0 = Math.PI * (0.005555555555555556 * angle);
	double t_1 = 2.0 * (b - a);
	double tmp;
	if (b <= 1.38e+209) {
		tmp = (Math.sin((Math.pow(Math.sqrt(Math.PI), 2.0) * (0.005555555555555556 * angle))) * (Math.cos(t_0) * (b + a))) * t_1;
	} else {
		tmp = t_1 * (Math.sin(t_0) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * Math.pow(Math.PI, 2.0))))));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	t_0 = math.pi * (0.005555555555555556 * angle)
	t_1 = 2.0 * (b - a)
	tmp = 0
	if b <= 1.38e+209:
		tmp = (math.sin((math.pow(math.sqrt(math.pi), 2.0) * (0.005555555555555556 * angle))) * (math.cos(t_0) * (b + a))) * t_1
	else:
		tmp = t_1 * (math.sin(t_0) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * math.pow(math.pi, 2.0))))))
	return tmp
b = abs(b)
function code(a, b, angle)
	t_0 = Float64(pi * Float64(0.005555555555555556 * angle))
	t_1 = Float64(2.0 * Float64(b - a))
	tmp = 0.0
	if (b <= 1.38e+209)
		tmp = Float64(Float64(sin(Float64((sqrt(pi) ^ 2.0) * Float64(0.005555555555555556 * angle))) * Float64(cos(t_0) * Float64(b + a))) * t_1);
	else
		tmp = Float64(t_1 * Float64(sin(t_0) * Float64(Float64(b + a) * Float64(1.0 + Float64(-1.54320987654321e-5 * Float64(Float64(angle * angle) * (pi ^ 2.0)))))));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	t_0 = pi * (0.005555555555555556 * angle);
	t_1 = 2.0 * (b - a);
	tmp = 0.0;
	if (b <= 1.38e+209)
		tmp = (sin(((sqrt(pi) ^ 2.0) * (0.005555555555555556 * angle))) * (cos(t_0) * (b + a))) * t_1;
	else
		tmp = t_1 * (sin(t_0) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * (pi ^ 2.0))))));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 1.38e+209], N[(N[(N[Sin[N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[(N[Sin[t$95$0], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(1.0 + N[(-1.54320987654321e-5 * N[(N[(angle * angle), $MachinePrecision] * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
t_1 := 2 \cdot \left(b - a\right)\\
\mathbf{if}\;b \leq 1.38 \cdot 10^{+209}:\\
\;\;\;\;\left(\sin \left({\left(\sqrt{\pi}\right)}^{2} \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\cos t_0 \cdot \left(b + a\right)\right)\right) \cdot t_1\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(\sin t_0 \cdot \left(\left(b + a\right) \cdot \left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot {\pi}^{2}\right)\right)\right)\right)\\


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

    1. Initial program 52.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*52.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3799999999999999e209 < b

    1. Initial program 42.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*42.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot {\pi}^{2}\right)\right) \cdot \left(b + a\right)\right)\right) \cdot \left(2 \cdot \left(b - a\right)\right) \]
    9. Simplified93.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.38 \cdot 10^{+209}:\\ \;\;\;\;\left(\sin \left({\left(\sqrt{\pi}\right)}^{2} \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(b + a\right)\right)\right) \cdot \left(2 \cdot \left(b - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\left(b + a\right) \cdot \left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot {\pi}^{2}\right)\right)\right)\right)\\ \end{array} \]

Alternative 2: 67.4% accurate, 1.0× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} \mathbf{if}\;b \leq 2 \cdot 10^{+213}:\\ \;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left({\left(\sqrt{\pi}\right)}^{2} \cdot angle\right)\right) \cdot \left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\left(b + a\right) \cdot \left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot {\pi}^{2}\right)\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (if (<= b 2e+213)
   (*
    2.0
    (*
     (- b a)
     (*
      (cos (* 0.005555555555555556 (* (pow (sqrt PI) 2.0) angle)))
      (* (+ b a) (sin (* 0.005555555555555556 (* PI angle)))))))
   (*
    (* 2.0 (- b a))
    (*
     (sin (* PI (* 0.005555555555555556 angle)))
     (*
      (+ b a)
      (+ 1.0 (* -1.54320987654321e-5 (* (* angle angle) (pow PI 2.0)))))))))
b = abs(b);
double code(double a, double b, double angle) {
	double tmp;
	if (b <= 2e+213) {
		tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (pow(sqrt(((double) M_PI)), 2.0) * angle))) * ((b + a) * sin((0.005555555555555556 * (((double) M_PI) * angle))))));
	} else {
		tmp = (2.0 * (b - a)) * (sin((((double) M_PI) * (0.005555555555555556 * angle))) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * pow(((double) M_PI), 2.0))))));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double tmp;
	if (b <= 2e+213) {
		tmp = 2.0 * ((b - a) * (Math.cos((0.005555555555555556 * (Math.pow(Math.sqrt(Math.PI), 2.0) * angle))) * ((b + a) * Math.sin((0.005555555555555556 * (Math.PI * angle))))));
	} else {
		tmp = (2.0 * (b - a)) * (Math.sin((Math.PI * (0.005555555555555556 * angle))) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * Math.pow(Math.PI, 2.0))))));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	tmp = 0
	if b <= 2e+213:
		tmp = 2.0 * ((b - a) * (math.cos((0.005555555555555556 * (math.pow(math.sqrt(math.pi), 2.0) * angle))) * ((b + a) * math.sin((0.005555555555555556 * (math.pi * angle))))))
	else:
		tmp = (2.0 * (b - a)) * (math.sin((math.pi * (0.005555555555555556 * angle))) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * math.pow(math.pi, 2.0))))))
	return tmp
b = abs(b)
function code(a, b, angle)
	tmp = 0.0
	if (b <= 2e+213)
		tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(Float64(0.005555555555555556 * Float64((sqrt(pi) ^ 2.0) * angle))) * Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * Float64(pi * angle)))))));
	else
		tmp = Float64(Float64(2.0 * Float64(b - a)) * Float64(sin(Float64(pi * Float64(0.005555555555555556 * angle))) * Float64(Float64(b + a) * Float64(1.0 + Float64(-1.54320987654321e-5 * Float64(Float64(angle * angle) * (pi ^ 2.0)))))));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (b <= 2e+213)
		tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * ((sqrt(pi) ^ 2.0) * angle))) * ((b + a) * sin((0.005555555555555556 * (pi * angle))))));
	else
		tmp = (2.0 * (b - a)) * (sin((pi * (0.005555555555555556 * angle))) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * (pi ^ 2.0))))));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := If[LessEqual[b, 2e+213], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(0.005555555555555556 * N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(1.0 + N[(-1.54320987654321e-5 * N[(N[(angle * angle), $MachinePrecision] * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2 \cdot 10^{+213}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left({\left(\sqrt{\pi}\right)}^{2} \cdot angle\right)\right) \cdot \left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\left(b + a\right) \cdot \left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot {\pi}^{2}\right)\right)\right)\right)\\


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

    1. Initial program 52.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*52.7%

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

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

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

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

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

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

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

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

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

    if 1.99999999999999997e213 < b

    1. Initial program 44.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left(\color{blue}{\left(angle \cdot angle\right)} \cdot {\pi}^{2}\right)\right) \cdot \left(b + a\right)\right)\right) \cdot \left(2 \cdot \left(b - a\right)\right) \]
    9. Simplified93.8%

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

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

Alternative 3: 67.3% accurate, 1.5× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\ t_1 := \pi \cdot \frac{angle}{180}\\ \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{+53}:\\ \;\;\;\;\left(2 \cdot \left(b - a\right)\right) \cdot \left(\left(\cos t_0 \cdot \left(b + a\right)\right) \cdot \sin t_0\right)\\ \mathbf{else}:\\ \;\;\;\;\sin t_1 \cdot \left(\left(2 \cdot \left(b \cdot b + a \cdot a\right)\right) \cdot \cos t_1\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* PI (* 0.005555555555555556 angle)))
        (t_1 (* PI (/ angle 180.0))))
   (if (<= (/ angle 180.0) 2e+53)
     (* (* 2.0 (- b a)) (* (* (cos t_0) (+ b a)) (sin t_0)))
     (* (sin t_1) (* (* 2.0 (+ (* b b) (* a a))) (cos t_1))))))
b = abs(b);
double code(double a, double b, double angle) {
	double t_0 = ((double) M_PI) * (0.005555555555555556 * angle);
	double t_1 = ((double) M_PI) * (angle / 180.0);
	double tmp;
	if ((angle / 180.0) <= 2e+53) {
		tmp = (2.0 * (b - a)) * ((cos(t_0) * (b + a)) * sin(t_0));
	} else {
		tmp = sin(t_1) * ((2.0 * ((b * b) + (a * a))) * cos(t_1));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double t_0 = Math.PI * (0.005555555555555556 * angle);
	double t_1 = Math.PI * (angle / 180.0);
	double tmp;
	if ((angle / 180.0) <= 2e+53) {
		tmp = (2.0 * (b - a)) * ((Math.cos(t_0) * (b + a)) * Math.sin(t_0));
	} else {
		tmp = Math.sin(t_1) * ((2.0 * ((b * b) + (a * a))) * Math.cos(t_1));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	t_0 = math.pi * (0.005555555555555556 * angle)
	t_1 = math.pi * (angle / 180.0)
	tmp = 0
	if (angle / 180.0) <= 2e+53:
		tmp = (2.0 * (b - a)) * ((math.cos(t_0) * (b + a)) * math.sin(t_0))
	else:
		tmp = math.sin(t_1) * ((2.0 * ((b * b) + (a * a))) * math.cos(t_1))
	return tmp
b = abs(b)
function code(a, b, angle)
	t_0 = Float64(pi * Float64(0.005555555555555556 * angle))
	t_1 = Float64(pi * Float64(angle / 180.0))
	tmp = 0.0
	if (Float64(angle / 180.0) <= 2e+53)
		tmp = Float64(Float64(2.0 * Float64(b - a)) * Float64(Float64(cos(t_0) * Float64(b + a)) * sin(t_0)));
	else
		tmp = Float64(sin(t_1) * Float64(Float64(2.0 * Float64(Float64(b * b) + Float64(a * a))) * cos(t_1)));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	t_0 = pi * (0.005555555555555556 * angle);
	t_1 = pi * (angle / 180.0);
	tmp = 0.0;
	if ((angle / 180.0) <= 2e+53)
		tmp = (2.0 * (b - a)) * ((cos(t_0) * (b + a)) * sin(t_0));
	else
		tmp = sin(t_1) * ((2.0 * ((b * b) + (a * a))) * cos(t_1));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+53], N[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[t$95$0], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[t$95$1], $MachinePrecision] * N[(N[(2.0 * N[(N[(b * b), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
t_1 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{+53}:\\
\;\;\;\;\left(2 \cdot \left(b - a\right)\right) \cdot \left(\left(\cos t_0 \cdot \left(b + a\right)\right) \cdot \sin t_0\right)\\

\mathbf{else}:\\
\;\;\;\;\sin t_1 \cdot \left(\left(2 \cdot \left(b \cdot b + a \cdot a\right)\right) \cdot \cos t_1\right)\\


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

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

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

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

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

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

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

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

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

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

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

    if 2e53 < (/.f64 angle 180)

    1. Initial program 23.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef23.3%

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

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

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

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

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

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

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

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

Alternative 4: 65.9% accurate, 1.5× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\ t_1 := 2 \cdot \left(b - a\right)\\ \mathbf{if}\;{b}^{2} \leq 2 \cdot 10^{+240}:\\ \;\;\;\;t_1 \cdot \left(\left(b + a\right) \cdot \sin t_0\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \left(\left(\cos t_0 \cdot \left(b + a\right)\right) \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* PI (* 0.005555555555555556 angle))) (t_1 (* 2.0 (- b a))))
   (if (<= (pow b 2.0) 2e+240)
     (* t_1 (* (+ b a) (sin t_0)))
     (* t_1 (* (* (cos t_0) (+ b a)) (* 0.005555555555555556 (* PI angle)))))))
b = abs(b);
double code(double a, double b, double angle) {
	double t_0 = ((double) M_PI) * (0.005555555555555556 * angle);
	double t_1 = 2.0 * (b - a);
	double tmp;
	if (pow(b, 2.0) <= 2e+240) {
		tmp = t_1 * ((b + a) * sin(t_0));
	} else {
		tmp = t_1 * ((cos(t_0) * (b + a)) * (0.005555555555555556 * (((double) M_PI) * angle)));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double t_0 = Math.PI * (0.005555555555555556 * angle);
	double t_1 = 2.0 * (b - a);
	double tmp;
	if (Math.pow(b, 2.0) <= 2e+240) {
		tmp = t_1 * ((b + a) * Math.sin(t_0));
	} else {
		tmp = t_1 * ((Math.cos(t_0) * (b + a)) * (0.005555555555555556 * (Math.PI * angle)));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	t_0 = math.pi * (0.005555555555555556 * angle)
	t_1 = 2.0 * (b - a)
	tmp = 0
	if math.pow(b, 2.0) <= 2e+240:
		tmp = t_1 * ((b + a) * math.sin(t_0))
	else:
		tmp = t_1 * ((math.cos(t_0) * (b + a)) * (0.005555555555555556 * (math.pi * angle)))
	return tmp
b = abs(b)
function code(a, b, angle)
	t_0 = Float64(pi * Float64(0.005555555555555556 * angle))
	t_1 = Float64(2.0 * Float64(b - a))
	tmp = 0.0
	if ((b ^ 2.0) <= 2e+240)
		tmp = Float64(t_1 * Float64(Float64(b + a) * sin(t_0)));
	else
		tmp = Float64(t_1 * Float64(Float64(cos(t_0) * Float64(b + a)) * Float64(0.005555555555555556 * Float64(pi * angle))));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	t_0 = pi * (0.005555555555555556 * angle);
	t_1 = 2.0 * (b - a);
	tmp = 0.0;
	if ((b ^ 2.0) <= 2e+240)
		tmp = t_1 * ((b + a) * sin(t_0));
	else
		tmp = t_1 * ((cos(t_0) * (b + a)) * (0.005555555555555556 * (pi * angle)));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 2e+240], N[(t$95$1 * N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(N[Cos[t$95$0], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
t_1 := 2 \cdot \left(b - a\right)\\
\mathbf{if}\;{b}^{2} \leq 2 \cdot 10^{+240}:\\
\;\;\;\;t_1 \cdot \left(\left(b + a\right) \cdot \sin t_0\right)\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(\left(\cos t_0 \cdot \left(b + a\right)\right) \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\\


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

    1. Initial program 57.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000003e240 < (pow.f64 b 2)

    1. Initial program 39.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*39.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 67.2% accurate, 1.5× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} t_0 := 2 \cdot \left(b - a\right)\\ t_1 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\ \mathbf{if}\;b \leq 2 \cdot 10^{+162}:\\ \;\;\;\;t_0 \cdot \left(\sin t_1 \cdot \left(\left(b + a\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(\left(\cos t_1 \cdot \left(b + a\right)\right) \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* 2.0 (- b a))) (t_1 (* PI (* 0.005555555555555556 angle))))
   (if (<= b 2e+162)
     (* t_0 (* (sin t_1) (* (+ b a) (cos (/ PI (/ 180.0 angle))))))
     (* t_0 (* (* (cos t_1) (+ b a)) (* 0.005555555555555556 (* PI angle)))))))
b = abs(b);
double code(double a, double b, double angle) {
	double t_0 = 2.0 * (b - a);
	double t_1 = ((double) M_PI) * (0.005555555555555556 * angle);
	double tmp;
	if (b <= 2e+162) {
		tmp = t_0 * (sin(t_1) * ((b + a) * cos((((double) M_PI) / (180.0 / angle)))));
	} else {
		tmp = t_0 * ((cos(t_1) * (b + a)) * (0.005555555555555556 * (((double) M_PI) * angle)));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double t_0 = 2.0 * (b - a);
	double t_1 = Math.PI * (0.005555555555555556 * angle);
	double tmp;
	if (b <= 2e+162) {
		tmp = t_0 * (Math.sin(t_1) * ((b + a) * Math.cos((Math.PI / (180.0 / angle)))));
	} else {
		tmp = t_0 * ((Math.cos(t_1) * (b + a)) * (0.005555555555555556 * (Math.PI * angle)));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	t_0 = 2.0 * (b - a)
	t_1 = math.pi * (0.005555555555555556 * angle)
	tmp = 0
	if b <= 2e+162:
		tmp = t_0 * (math.sin(t_1) * ((b + a) * math.cos((math.pi / (180.0 / angle)))))
	else:
		tmp = t_0 * ((math.cos(t_1) * (b + a)) * (0.005555555555555556 * (math.pi * angle)))
	return tmp
b = abs(b)
function code(a, b, angle)
	t_0 = Float64(2.0 * Float64(b - a))
	t_1 = Float64(pi * Float64(0.005555555555555556 * angle))
	tmp = 0.0
	if (b <= 2e+162)
		tmp = Float64(t_0 * Float64(sin(t_1) * Float64(Float64(b + a) * cos(Float64(pi / Float64(180.0 / angle))))));
	else
		tmp = Float64(t_0 * Float64(Float64(cos(t_1) * Float64(b + a)) * Float64(0.005555555555555556 * Float64(pi * angle))));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	t_0 = 2.0 * (b - a);
	t_1 = pi * (0.005555555555555556 * angle);
	tmp = 0.0;
	if (b <= 2e+162)
		tmp = t_0 * (sin(t_1) * ((b + a) * cos((pi / (180.0 / angle)))));
	else
		tmp = t_0 * ((cos(t_1) * (b + a)) * (0.005555555555555556 * (pi * angle)));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 2e+162], N[(t$95$0 * N[(N[Sin[t$95$1], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Cos[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(N[Cos[t$95$1], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := 2 \cdot \left(b - a\right)\\
t_1 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
\mathbf{if}\;b \leq 2 \cdot 10^{+162}:\\
\;\;\;\;t_0 \cdot \left(\sin t_1 \cdot \left(\left(b + a\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(\left(\cos t_1 \cdot \left(b + a\right)\right) \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\\


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

    1. Initial program 52.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*52.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e162 < b

    1. Initial program 48.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 63.1% accurate, 2.0× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} \mathbf{if}\;{b}^{2} \leq 0:\\ \;\;\;\;-2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(a \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (if (<= (pow b 2.0) 0.0)
   (* -2.0 (* (sin (* 0.005555555555555556 (* PI angle))) (* a a)))
   (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a))))))
b = abs(b);
double code(double a, double b, double angle) {
	double tmp;
	if (pow(b, 2.0) <= 0.0) {
		tmp = -2.0 * (sin((0.005555555555555556 * (((double) M_PI) * angle))) * (a * a));
	} else {
		tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double tmp;
	if (Math.pow(b, 2.0) <= 0.0) {
		tmp = -2.0 * (Math.sin((0.005555555555555556 * (Math.PI * angle))) * (a * a));
	} else {
		tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	tmp = 0
	if math.pow(b, 2.0) <= 0.0:
		tmp = -2.0 * (math.sin((0.005555555555555556 * (math.pi * angle))) * (a * a))
	else:
		tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a)))
	return tmp
b = abs(b)
function code(a, b, angle)
	tmp = 0.0
	if ((b ^ 2.0) <= 0.0)
		tmp = Float64(-2.0 * Float64(sin(Float64(0.005555555555555556 * Float64(pi * angle))) * Float64(a * a)));
	else
		tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a))));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if ((b ^ 2.0) <= 0.0)
		tmp = -2.0 * (sin((0.005555555555555556 * (pi * angle))) * (a * a));
	else
		tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a)));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 0.0], N[(-2.0 * N[(N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 0:\\
\;\;\;\;-2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(a \cdot a\right)\right)\\

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


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

    1. Initial program 61.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. Taylor expanded in b around 0 61.0%

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

        \[\leadsto \left(-2 \cdot \left(\color{blue}{\left(a \cdot 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) \]
      2. *-commutative61.0%

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

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

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

    if 0.0 < (pow.f64 b 2)

    1. Initial program 48.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. *-commutative48.9%

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

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

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

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

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

      \[\leadsto \color{blue}{\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    4. Taylor expanded in angle around 0 46.2%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \pi\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*46.1%

        \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot angle\right) \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \pi\right)} \]
      2. unpow246.1%

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

        \[\leadsto \left(0.011111111111111112 \cdot angle\right) \cdot \left(\left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \pi\right) \]
      4. difference-of-squares50.5%

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

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

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

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

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

        \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)} \]
      10. associate-*r*63.1%

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

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

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

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

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

Alternative 7: 65.9% accurate, 2.9× speedup?

\[\begin{array}{l} b = |b|\\ \\ 2 \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right) \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (* 2.0 (* (- b a) (* (+ b a) (sin (* 0.005555555555555556 (* PI angle)))))))
b = abs(b);
double code(double a, double b, double angle) {
	return 2.0 * ((b - a) * ((b + a) * sin((0.005555555555555556 * (((double) M_PI) * angle)))));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	return 2.0 * ((b - a) * ((b + a) * Math.sin((0.005555555555555556 * (Math.PI * angle)))));
}
b = abs(b)
def code(a, b, angle):
	return 2.0 * ((b - a) * ((b + a) * math.sin((0.005555555555555556 * (math.pi * angle)))))
b = abs(b)
function code(a, b, angle)
	return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * Float64(pi * angle))))))
end
b = abs(b)
function tmp = code(a, b, angle)
	tmp = 2.0 * ((b - a) * ((b + a) * sin((0.005555555555555556 * (pi * angle)))));
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.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*52.2%

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

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

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

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

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

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

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

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

    \[\leadsto 2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\left({\left(\sqrt[3]{\pi}\right)}^{2} \cdot \sqrt[3]{\pi}\right)}\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
  7. Taylor expanded in angle around 0 65.9%

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

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

Alternative 8: 63.4% accurate, 2.9× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+15}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot {\left(b + a\right)}^{2}\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (if (<= (/ angle 180.0) 5e+15)
   (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a))))
   (* angle (* 0.011111111111111112 (* PI (pow (+ b a) 2.0))))))
b = abs(b);
double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= 5e+15) {
		tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
	} else {
		tmp = angle * (0.011111111111111112 * (((double) M_PI) * pow((b + a), 2.0)));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= 5e+15) {
		tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
	} else {
		tmp = angle * (0.011111111111111112 * (Math.PI * Math.pow((b + a), 2.0)));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	tmp = 0
	if (angle / 180.0) <= 5e+15:
		tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a)))
	else:
		tmp = angle * (0.011111111111111112 * (math.pi * math.pow((b + a), 2.0)))
	return tmp
b = abs(b)
function code(a, b, angle)
	tmp = 0.0
	if (Float64(angle / 180.0) <= 5e+15)
		tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a))));
	else
		tmp = Float64(angle * Float64(0.011111111111111112 * Float64(pi * (Float64(b + a) ^ 2.0))));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if ((angle / 180.0) <= 5e+15)
		tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a)));
	else
		tmp = angle * (0.011111111111111112 * (pi * ((b + a) ^ 2.0)));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+15], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(angle * N[(0.011111111111111112 * N[(Pi * N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+15}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)\\

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


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

    1. Initial program 60.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. *-commutative60.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    4. Taylor expanded in angle around 0 57.4%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \pi\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*57.4%

        \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot angle\right) \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \pi\right)} \]
      2. unpow257.4%

        \[\leadsto \left(0.011111111111111112 \cdot angle\right) \cdot \left(\left(\color{blue}{b \cdot b} - {a}^{2}\right) \cdot \pi\right) \]
      3. unpow257.4%

        \[\leadsto \left(0.011111111111111112 \cdot angle\right) \cdot \left(\left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \pi\right) \]
      4. difference-of-squares61.0%

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

        \[\leadsto \left(0.011111111111111112 \cdot angle\right) \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)} \]
      6. *-commutative61.0%

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

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

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

        \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)} \]
      10. associate-*r*74.3%

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)} \]
      11. *-commutative74.3%

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

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

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

    if 5e15 < (/.f64 angle 180)

    1. Initial program 25.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. *-commutative25.4%

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot {\left(b + a\right)}^{2}\right) \cdot \log \left(\sqrt{e^{\color{blue}{0} + \sin \left(\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right)}}\right) \]
      3. +-lft-identity35.2%

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

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

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

        \[\leadsto \left(2 \cdot {\left(b + a\right)}^{2}\right) \cdot \log \left(\sqrt{e^{\sin \left(\pi \cdot \left(angle \cdot \color{blue}{0.011111111111111112}\right)\right)}}\right) \]
    6. Simplified35.2%

      \[\leadsto \color{blue}{\left(2 \cdot {\left(b + a\right)}^{2}\right) \cdot \log \left(\sqrt{e^{\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)}}\right)} \]
    7. Taylor expanded in angle around 0 28.2%

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

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

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

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

        \[\leadsto angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot {\color{blue}{\left(b + a\right)}}^{2}\right)\right) \]
    9. Simplified28.2%

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

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

Alternative 9: 43.0% accurate, 5.5× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} \mathbf{if}\;a \leq 5.2:\\ \;\;\;\;angle \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot a\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (if (<= a 5.2)
   (* angle (* PI (* (* b b) 0.011111111111111112)))
   (* 0.011111111111111112 (* angle (* (- b a) (* PI a))))))
b = abs(b);
double code(double a, double b, double angle) {
	double tmp;
	if (a <= 5.2) {
		tmp = angle * (((double) M_PI) * ((b * b) * 0.011111111111111112));
	} else {
		tmp = 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * a)));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double tmp;
	if (a <= 5.2) {
		tmp = angle * (Math.PI * ((b * b) * 0.011111111111111112));
	} else {
		tmp = 0.011111111111111112 * (angle * ((b - a) * (Math.PI * a)));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	tmp = 0
	if a <= 5.2:
		tmp = angle * (math.pi * ((b * b) * 0.011111111111111112))
	else:
		tmp = 0.011111111111111112 * (angle * ((b - a) * (math.pi * a)))
	return tmp
b = abs(b)
function code(a, b, angle)
	tmp = 0.0
	if (a <= 5.2)
		tmp = Float64(angle * Float64(pi * Float64(Float64(b * b) * 0.011111111111111112)));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * a))));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (a <= 5.2)
		tmp = angle * (pi * ((b * b) * 0.011111111111111112));
	else
		tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * a)));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := If[LessEqual[a, 5.2], N[(angle * N[(Pi * N[(N[(b * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(Pi * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5.2:\\
\;\;\;\;angle \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\right)\\

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


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

    1. Initial program 52.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*52.6%

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

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

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

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

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)} \]
    5. Taylor expanded in b around inf 37.4%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative37.4%

        \[\leadsto \color{blue}{\left(angle \cdot \left({b}^{2} \cdot \pi\right)\right) \cdot 0.011111111111111112} \]
      2. associate-*l*37.4%

        \[\leadsto \color{blue}{angle \cdot \left(\left({b}^{2} \cdot \pi\right) \cdot 0.011111111111111112\right)} \]
      3. *-commutative37.4%

        \[\leadsto angle \cdot \left(\color{blue}{\left(\pi \cdot {b}^{2}\right)} \cdot 0.011111111111111112\right) \]
      4. unpow237.4%

        \[\leadsto angle \cdot \left(\left(\pi \cdot \color{blue}{\left(b \cdot b\right)}\right) \cdot 0.011111111111111112\right) \]
    7. Simplified37.4%

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

      \[\leadsto angle \cdot \color{blue}{\left(0.011111111111111112 \cdot \left({b}^{2} \cdot \pi\right)\right)} \]
    9. Step-by-step derivation
      1. *-commutative37.4%

        \[\leadsto angle \cdot \left(0.011111111111111112 \cdot \color{blue}{\left(\pi \cdot {b}^{2}\right)}\right) \]
      2. *-commutative37.4%

        \[\leadsto angle \cdot \color{blue}{\left(\left(\pi \cdot {b}^{2}\right) \cdot 0.011111111111111112\right)} \]
      3. associate-*r*37.4%

        \[\leadsto angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} \cdot 0.011111111111111112\right)\right)} \]
      4. *-commutative37.4%

        \[\leadsto angle \cdot \left(\pi \cdot \color{blue}{\left(0.011111111111111112 \cdot {b}^{2}\right)}\right) \]
      5. unpow237.4%

        \[\leadsto angle \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
    10. Simplified37.4%

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

    if 5.20000000000000018 < a

    1. Initial program 51.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*51.1%

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

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

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

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

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)} \]
    5. Taylor expanded in a around inf 42.5%

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \color{blue}{\left(a \cdot \pi\right)}\right)\right) \]
    6. Step-by-step derivation
      1. *-commutative42.5%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \color{blue}{\left(\pi \cdot a\right)}\right)\right) \]
    7. Simplified42.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 5.2:\\ \;\;\;\;angle \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot a\right)\right)\right)\\ \end{array} \]

Alternative 10: 48.3% accurate, 5.5× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} \mathbf{if}\;b \leq 1.06 \cdot 10^{+41}:\\ \;\;\;\;\left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(b \cdot \pi\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (if (<= b 1.06e+41)
   (* (* PI (* angle (* a a))) -0.011111111111111112)
   (* 0.011111111111111112 (* angle (* (- b a) (* b PI))))))
b = abs(b);
double code(double a, double b, double angle) {
	double tmp;
	if (b <= 1.06e+41) {
		tmp = (((double) M_PI) * (angle * (a * a))) * -0.011111111111111112;
	} else {
		tmp = 0.011111111111111112 * (angle * ((b - a) * (b * ((double) M_PI))));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double tmp;
	if (b <= 1.06e+41) {
		tmp = (Math.PI * (angle * (a * a))) * -0.011111111111111112;
	} else {
		tmp = 0.011111111111111112 * (angle * ((b - a) * (b * Math.PI)));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	tmp = 0
	if b <= 1.06e+41:
		tmp = (math.pi * (angle * (a * a))) * -0.011111111111111112
	else:
		tmp = 0.011111111111111112 * (angle * ((b - a) * (b * math.pi)))
	return tmp
b = abs(b)
function code(a, b, angle)
	tmp = 0.0
	if (b <= 1.06e+41)
		tmp = Float64(Float64(pi * Float64(angle * Float64(a * a))) * -0.011111111111111112);
	else
		tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(b * pi))));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (b <= 1.06e+41)
		tmp = (pi * (angle * (a * a))) * -0.011111111111111112;
	else
		tmp = 0.011111111111111112 * (angle * ((b - a) * (b * pi)));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := If[LessEqual[b, 1.06e+41], N[(N[(Pi * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.06 \cdot 10^{+41}:\\
\;\;\;\;\left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112\\

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


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

    1. Initial program 52.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.011111111111111112 \cdot \left(angle \cdot \left({a}^{2} \cdot \pi\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative39.0%

        \[\leadsto \color{blue}{\left(angle \cdot \left({a}^{2} \cdot \pi\right)\right) \cdot -0.011111111111111112} \]
      2. associate-*r*39.5%

        \[\leadsto \color{blue}{\left(\left(angle \cdot {a}^{2}\right) \cdot \pi\right)} \cdot -0.011111111111111112 \]
      3. unpow239.5%

        \[\leadsto \left(\left(angle \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \pi\right) \cdot -0.011111111111111112 \]
    7. Simplified39.5%

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

    if 1.06e41 < b

    1. Initial program 52.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*52.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.06 \cdot 10^{+41}:\\ \;\;\;\;\left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(b \cdot \pi\right)\right)\right)\\ \end{array} \]

Alternative 11: 54.7% accurate, 5.5× speedup?

\[\begin{array}{l} b = |b|\\ \\ 0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right) \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (* 0.011111111111111112 (* angle (* (- b a) (* PI (+ b a))))))
b = abs(b);
double code(double a, double b, double angle) {
	return 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * (b + a))));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	return 0.011111111111111112 * (angle * ((b - a) * (Math.PI * (b + a))));
}
b = abs(b)
def code(a, b, angle):
	return 0.011111111111111112 * (angle * ((b - a) * (math.pi * (b + a))))
b = abs(b)
function code(a, b, angle)
	return Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * Float64(b + a)))))
end
b = abs(b)
function tmp = code(a, b, angle)
	tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * (b + a))));
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.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*52.2%

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

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

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

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

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

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

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

Alternative 12: 62.1% accurate, 5.5× speedup?

\[\begin{array}{l} b = |b|\\ \\ 0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right) \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a)))))
b = abs(b);
double code(double a, double b, double angle) {
	return 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	return 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
}
b = abs(b)
def code(a, b, angle):
	return 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a)))
b = abs(b)
function code(a, b, angle)
	return Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a))))
end
b = abs(b)
function tmp = code(a, b, angle)
	tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a)));
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.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. *-commutative52.2%

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

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

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

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

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

    \[\leadsto \color{blue}{\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
  4. Taylor expanded in angle around 0 49.4%

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \pi\right)\right)} \]
  5. Step-by-step derivation
    1. associate-*r*49.3%

      \[\leadsto \color{blue}{\left(0.011111111111111112 \cdot angle\right) \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \pi\right)} \]
    2. unpow249.3%

      \[\leadsto \left(0.011111111111111112 \cdot angle\right) \cdot \left(\left(\color{blue}{b \cdot b} - {a}^{2}\right) \cdot \pi\right) \]
    3. unpow249.3%

      \[\leadsto \left(0.011111111111111112 \cdot angle\right) \cdot \left(\left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \pi\right) \]
    4. difference-of-squares52.5%

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

      \[\leadsto \left(0.011111111111111112 \cdot angle\right) \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)} \]
    6. *-commutative52.5%

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

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

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)} \]
    10. associate-*r*61.6%

      \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)} \]
    11. *-commutative61.6%

      \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)} \]
    12. +-commutative61.6%

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

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

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

Alternative 13: 47.2% accurate, 5.6× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} \mathbf{if}\;b \leq 1.1 \cdot 10^{+41}:\\ \;\;\;\;\left(\pi \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot -0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (if (<= b 1.1e+41)
   (* (* PI (* a a)) (* angle -0.011111111111111112))
   (* angle (* PI (* (* b b) 0.011111111111111112)))))
b = abs(b);
double code(double a, double b, double angle) {
	double tmp;
	if (b <= 1.1e+41) {
		tmp = (((double) M_PI) * (a * a)) * (angle * -0.011111111111111112);
	} else {
		tmp = angle * (((double) M_PI) * ((b * b) * 0.011111111111111112));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double tmp;
	if (b <= 1.1e+41) {
		tmp = (Math.PI * (a * a)) * (angle * -0.011111111111111112);
	} else {
		tmp = angle * (Math.PI * ((b * b) * 0.011111111111111112));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	tmp = 0
	if b <= 1.1e+41:
		tmp = (math.pi * (a * a)) * (angle * -0.011111111111111112)
	else:
		tmp = angle * (math.pi * ((b * b) * 0.011111111111111112))
	return tmp
b = abs(b)
function code(a, b, angle)
	tmp = 0.0
	if (b <= 1.1e+41)
		tmp = Float64(Float64(pi * Float64(a * a)) * Float64(angle * -0.011111111111111112));
	else
		tmp = Float64(angle * Float64(pi * Float64(Float64(b * b) * 0.011111111111111112)));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (b <= 1.1e+41)
		tmp = (pi * (a * a)) * (angle * -0.011111111111111112);
	else
		tmp = angle * (pi * ((b * b) * 0.011111111111111112));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := If[LessEqual[b, 1.1e+41], N[(N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(angle * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(angle * N[(Pi * N[(N[(b * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.1 \cdot 10^{+41}:\\
\;\;\;\;\left(\pi \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot -0.011111111111111112\right)\\

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


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

    1. Initial program 52.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.011111111111111112 \cdot \left(angle \cdot \left({a}^{2} \cdot \pi\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative39.0%

        \[\leadsto \color{blue}{\left(angle \cdot \left({a}^{2} \cdot \pi\right)\right) \cdot -0.011111111111111112} \]
      2. *-commutative39.0%

        \[\leadsto \color{blue}{\left(\left({a}^{2} \cdot \pi\right) \cdot angle\right)} \cdot -0.011111111111111112 \]
      3. associate-*l*39.0%

        \[\leadsto \color{blue}{\left({a}^{2} \cdot \pi\right) \cdot \left(angle \cdot -0.011111111111111112\right)} \]
      4. *-commutative39.0%

        \[\leadsto \color{blue}{\left(\pi \cdot {a}^{2}\right)} \cdot \left(angle \cdot -0.011111111111111112\right) \]
      5. unpow239.0%

        \[\leadsto \left(\pi \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \left(angle \cdot -0.011111111111111112\right) \]
    7. Simplified39.0%

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

    if 1.09999999999999995e41 < b

    1. Initial program 52.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*52.0%

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

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

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

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

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)} \]
    5. Taylor expanded in b around inf 46.7%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative46.7%

        \[\leadsto \color{blue}{\left(angle \cdot \left({b}^{2} \cdot \pi\right)\right) \cdot 0.011111111111111112} \]
      2. associate-*l*46.7%

        \[\leadsto \color{blue}{angle \cdot \left(\left({b}^{2} \cdot \pi\right) \cdot 0.011111111111111112\right)} \]
      3. *-commutative46.7%

        \[\leadsto angle \cdot \left(\color{blue}{\left(\pi \cdot {b}^{2}\right)} \cdot 0.011111111111111112\right) \]
      4. unpow246.7%

        \[\leadsto angle \cdot \left(\left(\pi \cdot \color{blue}{\left(b \cdot b\right)}\right) \cdot 0.011111111111111112\right) \]
    7. Simplified46.7%

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

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

        \[\leadsto angle \cdot \left(0.011111111111111112 \cdot \color{blue}{\left(\pi \cdot {b}^{2}\right)}\right) \]
      2. *-commutative46.7%

        \[\leadsto angle \cdot \color{blue}{\left(\left(\pi \cdot {b}^{2}\right) \cdot 0.011111111111111112\right)} \]
      3. associate-*r*46.7%

        \[\leadsto angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} \cdot 0.011111111111111112\right)\right)} \]
      4. *-commutative46.7%

        \[\leadsto angle \cdot \left(\pi \cdot \color{blue}{\left(0.011111111111111112 \cdot {b}^{2}\right)}\right) \]
      5. unpow246.7%

        \[\leadsto angle \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
    10. Simplified46.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.1 \cdot 10^{+41}:\\ \;\;\;\;\left(\pi \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot -0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\right)\\ \end{array} \]

Alternative 14: 47.2% accurate, 5.6× speedup?

\[\begin{array}{l} b = |b|\\ \\ \begin{array}{l} \mathbf{if}\;b \leq 1.65 \cdot 10^{+41}:\\ \;\;\;\;\left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\right)\\ \end{array} \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (if (<= b 1.65e+41)
   (* (* PI (* angle (* a a))) -0.011111111111111112)
   (* angle (* PI (* (* b b) 0.011111111111111112)))))
b = abs(b);
double code(double a, double b, double angle) {
	double tmp;
	if (b <= 1.65e+41) {
		tmp = (((double) M_PI) * (angle * (a * a))) * -0.011111111111111112;
	} else {
		tmp = angle * (((double) M_PI) * ((b * b) * 0.011111111111111112));
	}
	return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	double tmp;
	if (b <= 1.65e+41) {
		tmp = (Math.PI * (angle * (a * a))) * -0.011111111111111112;
	} else {
		tmp = angle * (Math.PI * ((b * b) * 0.011111111111111112));
	}
	return tmp;
}
b = abs(b)
def code(a, b, angle):
	tmp = 0
	if b <= 1.65e+41:
		tmp = (math.pi * (angle * (a * a))) * -0.011111111111111112
	else:
		tmp = angle * (math.pi * ((b * b) * 0.011111111111111112))
	return tmp
b = abs(b)
function code(a, b, angle)
	tmp = 0.0
	if (b <= 1.65e+41)
		tmp = Float64(Float64(pi * Float64(angle * Float64(a * a))) * -0.011111111111111112);
	else
		tmp = Float64(angle * Float64(pi * Float64(Float64(b * b) * 0.011111111111111112)));
	end
	return tmp
end
b = abs(b)
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (b <= 1.65e+41)
		tmp = (pi * (angle * (a * a))) * -0.011111111111111112;
	else
		tmp = angle * (pi * ((b * b) * 0.011111111111111112));
	end
	tmp_2 = tmp;
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := If[LessEqual[b, 1.65e+41], N[(N[(Pi * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision], N[(angle * N[(Pi * N[(N[(b * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.65 \cdot 10^{+41}:\\
\;\;\;\;\left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112\\

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


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

    1. Initial program 52.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.011111111111111112 \cdot \left(angle \cdot \left({a}^{2} \cdot \pi\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative39.0%

        \[\leadsto \color{blue}{\left(angle \cdot \left({a}^{2} \cdot \pi\right)\right) \cdot -0.011111111111111112} \]
      2. associate-*r*39.5%

        \[\leadsto \color{blue}{\left(\left(angle \cdot {a}^{2}\right) \cdot \pi\right)} \cdot -0.011111111111111112 \]
      3. unpow239.5%

        \[\leadsto \left(\left(angle \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \pi\right) \cdot -0.011111111111111112 \]
    7. Simplified39.5%

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

    if 1.65e41 < b

    1. Initial program 52.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*52.0%

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

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

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

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

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)} \]
    5. Taylor expanded in b around inf 46.7%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative46.7%

        \[\leadsto \color{blue}{\left(angle \cdot \left({b}^{2} \cdot \pi\right)\right) \cdot 0.011111111111111112} \]
      2. associate-*l*46.7%

        \[\leadsto \color{blue}{angle \cdot \left(\left({b}^{2} \cdot \pi\right) \cdot 0.011111111111111112\right)} \]
      3. *-commutative46.7%

        \[\leadsto angle \cdot \left(\color{blue}{\left(\pi \cdot {b}^{2}\right)} \cdot 0.011111111111111112\right) \]
      4. unpow246.7%

        \[\leadsto angle \cdot \left(\left(\pi \cdot \color{blue}{\left(b \cdot b\right)}\right) \cdot 0.011111111111111112\right) \]
    7. Simplified46.7%

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

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

        \[\leadsto angle \cdot \left(0.011111111111111112 \cdot \color{blue}{\left(\pi \cdot {b}^{2}\right)}\right) \]
      2. *-commutative46.7%

        \[\leadsto angle \cdot \color{blue}{\left(\left(\pi \cdot {b}^{2}\right) \cdot 0.011111111111111112\right)} \]
      3. associate-*r*46.7%

        \[\leadsto angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} \cdot 0.011111111111111112\right)\right)} \]
      4. *-commutative46.7%

        \[\leadsto angle \cdot \left(\pi \cdot \color{blue}{\left(0.011111111111111112 \cdot {b}^{2}\right)}\right) \]
      5. unpow246.7%

        \[\leadsto angle \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
    10. Simplified46.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.65 \cdot 10^{+41}:\\ \;\;\;\;\left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\right)\\ \end{array} \]

Alternative 15: 35.5% accurate, 5.7× speedup?

\[\begin{array}{l} b = |b|\\ \\ 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right) \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (* 0.011111111111111112 (* angle (* PI (* b b)))))
b = abs(b);
double code(double a, double b, double angle) {
	return 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	return 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
b = abs(b)
def code(a, b, angle):
	return 0.011111111111111112 * (angle * (math.pi * (b * b)))
b = abs(b)
function code(a, b, angle)
	return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b))))
end
b = abs(b)
function tmp = code(a, b, angle)
	tmp = 0.011111111111111112 * (angle * (pi * (b * b)));
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.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*52.2%

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

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

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

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

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

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)} \]
  5. Taylor expanded in b around inf 31.6%

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right)\right)} \]
  6. Step-by-step derivation
    1. *-commutative31.6%

      \[\leadsto \color{blue}{\left(angle \cdot \left({b}^{2} \cdot \pi\right)\right) \cdot 0.011111111111111112} \]
    2. associate-*l*31.6%

      \[\leadsto \color{blue}{angle \cdot \left(\left({b}^{2} \cdot \pi\right) \cdot 0.011111111111111112\right)} \]
    3. *-commutative31.6%

      \[\leadsto angle \cdot \left(\color{blue}{\left(\pi \cdot {b}^{2}\right)} \cdot 0.011111111111111112\right) \]
    4. unpow231.6%

      \[\leadsto angle \cdot \left(\left(\pi \cdot \color{blue}{\left(b \cdot b\right)}\right) \cdot 0.011111111111111112\right) \]
  7. Simplified31.6%

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

    \[\leadsto angle \cdot \color{blue}{\left(0.011111111111111112 \cdot \left({b}^{2} \cdot \pi\right)\right)} \]
  9. Step-by-step derivation
    1. *-commutative31.6%

      \[\leadsto angle \cdot \left(0.011111111111111112 \cdot \color{blue}{\left(\pi \cdot {b}^{2}\right)}\right) \]
    2. *-commutative31.6%

      \[\leadsto angle \cdot \color{blue}{\left(\left(\pi \cdot {b}^{2}\right) \cdot 0.011111111111111112\right)} \]
    3. associate-*r*31.6%

      \[\leadsto angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} \cdot 0.011111111111111112\right)\right)} \]
    4. *-commutative31.6%

      \[\leadsto angle \cdot \left(\pi \cdot \color{blue}{\left(0.011111111111111112 \cdot {b}^{2}\right)}\right) \]
    5. unpow231.6%

      \[\leadsto angle \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
  10. Simplified31.6%

    \[\leadsto angle \cdot \color{blue}{\left(\pi \cdot \left(0.011111111111111112 \cdot \left(b \cdot b\right)\right)\right)} \]
  11. Taylor expanded in angle around 0 31.6%

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right)\right)} \]
  12. Step-by-step derivation
    1. unpow231.6%

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\color{blue}{\left(b \cdot b\right)} \cdot \pi\right)\right) \]
  13. Simplified31.6%

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\left(b \cdot b\right) \cdot \pi\right)\right)} \]
  14. Final simplification31.6%

    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right) \]

Alternative 16: 35.5% accurate, 5.7× speedup?

\[\begin{array}{l} b = |b|\\ \\ angle \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\right) \end{array} \]
NOTE: b should be positive before calling this function
(FPCore (a b angle)
 :precision binary64
 (* angle (* PI (* (* b b) 0.011111111111111112))))
b = abs(b);
double code(double a, double b, double angle) {
	return angle * (((double) M_PI) * ((b * b) * 0.011111111111111112));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
	return angle * (Math.PI * ((b * b) * 0.011111111111111112));
}
b = abs(b)
def code(a, b, angle):
	return angle * (math.pi * ((b * b) * 0.011111111111111112))
b = abs(b)
function code(a, b, angle)
	return Float64(angle * Float64(pi * Float64(Float64(b * b) * 0.011111111111111112)))
end
b = abs(b)
function tmp = code(a, b, angle)
	tmp = angle * (pi * ((b * b) * 0.011111111111111112));
end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := N[(angle * N[(Pi * N[(N[(b * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
angle \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\right)
\end{array}
Derivation
  1. Initial program 52.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*52.2%

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

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

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

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

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

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)} \]
  5. Taylor expanded in b around inf 31.6%

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right)\right)} \]
  6. Step-by-step derivation
    1. *-commutative31.6%

      \[\leadsto \color{blue}{\left(angle \cdot \left({b}^{2} \cdot \pi\right)\right) \cdot 0.011111111111111112} \]
    2. associate-*l*31.6%

      \[\leadsto \color{blue}{angle \cdot \left(\left({b}^{2} \cdot \pi\right) \cdot 0.011111111111111112\right)} \]
    3. *-commutative31.6%

      \[\leadsto angle \cdot \left(\color{blue}{\left(\pi \cdot {b}^{2}\right)} \cdot 0.011111111111111112\right) \]
    4. unpow231.6%

      \[\leadsto angle \cdot \left(\left(\pi \cdot \color{blue}{\left(b \cdot b\right)}\right) \cdot 0.011111111111111112\right) \]
  7. Simplified31.6%

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

    \[\leadsto angle \cdot \color{blue}{\left(0.011111111111111112 \cdot \left({b}^{2} \cdot \pi\right)\right)} \]
  9. Step-by-step derivation
    1. *-commutative31.6%

      \[\leadsto angle \cdot \left(0.011111111111111112 \cdot \color{blue}{\left(\pi \cdot {b}^{2}\right)}\right) \]
    2. *-commutative31.6%

      \[\leadsto angle \cdot \color{blue}{\left(\left(\pi \cdot {b}^{2}\right) \cdot 0.011111111111111112\right)} \]
    3. associate-*r*31.6%

      \[\leadsto angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} \cdot 0.011111111111111112\right)\right)} \]
    4. *-commutative31.6%

      \[\leadsto angle \cdot \left(\pi \cdot \color{blue}{\left(0.011111111111111112 \cdot {b}^{2}\right)}\right) \]
    5. unpow231.6%

      \[\leadsto angle \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
  10. Simplified31.6%

    \[\leadsto angle \cdot \color{blue}{\left(\pi \cdot \left(0.011111111111111112 \cdot \left(b \cdot b\right)\right)\right)} \]
  11. Final simplification31.6%

    \[\leadsto angle \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\right) \]

Reproduce

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