ab-angle->ABCF B

Percentage Accurate: 53.6% → 66.9%
Time: 29.2s
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: 53.6% accurate, 1.0× speedup?

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

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

Alternative 1: 66.9% accurate, 0.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(t_1 \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \sqrt[3]{\pi \cdot \left(\pi \cdot \pi\right)}\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 a 2) < 5.00000000000000004e154

    1. Initial program 60.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*60.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. unpow260.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. unpow260.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-squares60.9%

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

      \[\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 66.5%

      \[\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. *-commutative66.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000004e154 < (pow.f64 a 2)

    1. Initial program 40.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*40.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. unpow240.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. unpow240.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-squares50.6%

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

      \[\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 71.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. *-commutative71.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 66.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{+56}:\\ \;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \left(a + b\right)\right) \cdot \log \left(e^{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \left(\sin \left({\left(\sqrt[3]{\pi \cdot \left(0.005555555555555556 \cdot angle\right)}\right)}^{3}\right) \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (if (<= (/ angle 180.0) 1e+56)
   (*
    2.0
    (*
     (- b a)
     (*
      (* (sin (/ PI (/ 180.0 angle))) (+ a b))
      (log (exp (cos (* 0.005555555555555556 (* angle PI))))))))
   (*
    (* 2.0 (* (- b a) (+ a b)))
    (*
     (sin (pow (cbrt (* PI (* 0.005555555555555556 angle))) 3.0))
     (cos (* angle (/ PI 180.0)))))))
double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= 1e+56) {
		tmp = 2.0 * ((b - a) * ((sin((((double) M_PI) / (180.0 / angle))) * (a + b)) * log(exp(cos((0.005555555555555556 * (angle * ((double) M_PI))))))));
	} else {
		tmp = (2.0 * ((b - a) * (a + b))) * (sin(pow(cbrt((((double) M_PI) * (0.005555555555555556 * angle))), 3.0)) * cos((angle * (((double) M_PI) / 180.0))));
	}
	return tmp;
}
public static double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= 1e+56) {
		tmp = 2.0 * ((b - a) * ((Math.sin((Math.PI / (180.0 / angle))) * (a + b)) * Math.log(Math.exp(Math.cos((0.005555555555555556 * (angle * Math.PI)))))));
	} else {
		tmp = (2.0 * ((b - a) * (a + b))) * (Math.sin(Math.pow(Math.cbrt((Math.PI * (0.005555555555555556 * angle))), 3.0)) * Math.cos((angle * (Math.PI / 180.0))));
	}
	return tmp;
}
function code(a, b, angle)
	tmp = 0.0
	if (Float64(angle / 180.0) <= 1e+56)
		tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(sin(Float64(pi / Float64(180.0 / angle))) * Float64(a + b)) * log(exp(cos(Float64(0.005555555555555556 * Float64(angle * pi))))))));
	else
		tmp = Float64(Float64(2.0 * Float64(Float64(b - a) * Float64(a + b))) * Float64(sin((cbrt(Float64(pi * Float64(0.005555555555555556 * angle))) ^ 3.0)) * cos(Float64(angle * Float64(pi / 180.0)))));
	end
	return tmp
end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+56], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Log[N[Exp[N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[Power[N[Power[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[Cos[N[(angle * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 61.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*61.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. unpow261.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. unpow261.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-squares66.1%

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

      \[\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 81.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. *-commutative81.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000009e56 < (/.f64 angle 180)

    1. Initial program 26.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*26.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. unpow226.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. unpow226.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-squares26.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. Simplified26.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. Step-by-step derivation
      1. add-cube-cbrt32.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 67.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \left(a + b\right)\right) \cdot \log \left(e^{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)\right)\right) \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (*
  2.0
  (*
   (- b a)
   (*
    (* (sin (/ PI (/ 180.0 angle))) (+ a b))
    (log (exp (cos (* 0.005555555555555556 (* angle PI)))))))))
double code(double a, double b, double angle) {
	return 2.0 * ((b - a) * ((sin((((double) M_PI) / (180.0 / angle))) * (a + b)) * log(exp(cos((0.005555555555555556 * (angle * ((double) M_PI))))))));
}
public static double code(double a, double b, double angle) {
	return 2.0 * ((b - a) * ((Math.sin((Math.PI / (180.0 / angle))) * (a + b)) * Math.log(Math.exp(Math.cos((0.005555555555555556 * (angle * Math.PI)))))));
}
def code(a, b, angle):
	return 2.0 * ((b - a) * ((math.sin((math.pi / (180.0 / angle))) * (a + b)) * math.log(math.exp(math.cos((0.005555555555555556 * (angle * math.pi)))))))
function code(a, b, angle)
	return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(sin(Float64(pi / Float64(180.0 / angle))) * Float64(a + b)) * log(exp(cos(Float64(0.005555555555555556 * Float64(angle * pi))))))))
end
function tmp = code(a, b, angle)
	tmp = 2.0 * ((b - a) * ((sin((pi / (180.0 / angle))) * (a + b)) * log(exp(cos((0.005555555555555556 * (angle * pi)))))));
end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Log[N[Exp[N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \left(a + b\right)\right) \cdot \log \left(e^{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.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*53.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. unpow253.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. unpow253.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-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 68.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. *-commutative68.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 67.4% accurate, 1.5× speedup?

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

\\
2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(a + b\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.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*53.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. unpow253.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. unpow253.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-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 68.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. *-commutative68.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 67.2% accurate, 1.5× speedup?

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

\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \left(a + b\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.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*53.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. unpow253.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. unpow253.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-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 68.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. *-commutative68.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 64.8% accurate, 2.9× speedup?

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

\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(a + b\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.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*53.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. unpow253.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. unpow253.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-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 68.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. Taylor expanded in angle around 0 66.6%

    \[\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) \]
  6. Final simplification66.6%

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

Alternative 7: 64.8% accurate, 2.9× speedup?

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

\\
2 \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \left(a + b\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.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*53.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. unpow253.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. unpow253.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-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 68.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. *-commutative68.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 41.4% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.2 \cdot 10^{+17}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\

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


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

    1. Initial program 54.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*54.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. unpow254.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. unpow254.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-squares57.6%

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

      \[\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 54.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 b around inf 41.8%

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

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

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

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

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

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

    if 3.2e17 < a

    1. Initial program 50.5%

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

        \[\leadsto \color{blue}{\left(2 \cdot \left({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. unpow250.5%

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

        \[\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 54.9%

      \[\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 47.7%

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

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

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

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

Alternative 9: 43.0% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.3 \cdot 10^{+19}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(b \cdot \pi\right)\right)\right)\\

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


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

    1. Initial program 54.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*54.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. unpow254.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. unpow254.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-squares57.6%

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

      \[\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 54.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 0 43.6%

      \[\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. *-commutative43.6%

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

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

    if 2.3e19 < a

    1. Initial program 50.5%

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

        \[\leadsto \color{blue}{\left(2 \cdot \left({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. unpow250.5%

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

        \[\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 54.9%

      \[\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 47.7%

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

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

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

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

Alternative 10: 53.9% accurate, 5.5× speedup?

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

\\
0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.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*53.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. unpow253.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. unpow253.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-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 0 54.4%

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

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

Alternative 11: 61.9% accurate, 5.5× speedup?

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

\\
0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot angle\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.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. *-commutative53.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*53.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. unpow253.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-neg55.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. unpow255.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. Simplified55.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. Taylor expanded in angle around 0 50.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*50.4%

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

      \[\leadsto \left(0.011111111111111112 \cdot angle\right) \cdot \left(\left(\color{blue}{b \cdot b} - {a}^{2}\right) \cdot \pi\right) \]
    3. unpow250.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-squares54.4%

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

      \[\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. *-commutative54.4%

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

      \[\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. +-commutative54.4%

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

      \[\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*64.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. *-commutative64.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. +-commutative64.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. Simplified64.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)} \]
  7. Final simplification64.1%

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

Alternative 12: 41.0% accurate, 5.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.6 \cdot 10^{+40}:\\
\;\;\;\;angle \cdot \left(\pi \cdot \left(\left(a \cdot a\right) \cdot -0.011111111111111112\right)\right)\\

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


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

    1. Initial program 52.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*52.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. unpow252.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. unpow252.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-squares53.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. Simplified53.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 0 53.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 b around 0 37.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.59999999999999987e40 < b

    1. Initial program 57.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*57.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. unpow257.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. unpow257.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-squares69.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. Simplified69.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 58.4%

      \[\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 53.5%

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

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

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

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

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

Alternative 13: 41.0% accurate, 5.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.8 \cdot 10^{+41}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\\

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


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

    1. Initial program 52.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*52.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. unpow252.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. unpow252.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-squares53.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. Simplified53.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 0 53.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 b around 0 37.8%

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

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

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

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

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

    if 3.8000000000000001e41 < b

    1. Initial program 57.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*57.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. unpow257.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. unpow257.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-squares69.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. Simplified69.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 58.4%

      \[\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 53.5%

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

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

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

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

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

Alternative 14: 41.0% accurate, 5.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.52 \cdot 10^{+37}:\\
\;\;\;\;\left(\pi \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot -0.011111111111111112\right)\\

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


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

    1. Initial program 52.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*52.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. unpow252.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. unpow252.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-squares53.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. Simplified53.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 0 53.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 b around 0 37.8%

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

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

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

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

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

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

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

    if 1.5200000000000001e37 < b

    1. Initial program 57.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*57.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. unpow257.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. unpow257.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-squares69.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. Simplified69.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 58.4%

      \[\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 53.5%

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

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

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

      \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(angle \cdot \left(\pi \cdot \left(b \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.52 \cdot 10^{+37}:\\ \;\;\;\;\left(\pi \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot -0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\ \end{array} \]

Alternative 15: 34.1% accurate, 5.7× speedup?

\[\begin{array}{l} \\ 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right) \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (* 0.011111111111111112 (* angle (* PI (* b b)))))
double code(double a, double b, double angle) {
	return 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
public static double code(double a, double b, double angle) {
	return 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
def code(a, b, angle):
	return 0.011111111111111112 * (angle * (math.pi * (b * b)))
function code(a, b, angle)
	return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b))))
end
function tmp = code(a, b, angle)
	tmp = 0.011111111111111112 * (angle * (pi * (b * b)));
end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.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*53.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. unpow253.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. unpow253.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-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 0 54.4%

    \[\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 36.6%

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

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

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

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

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

Alternative 16: 13.8% accurate, 617.0× speedup?

\[\begin{array}{l} \\ 0 \end{array} \]
(FPCore (a b angle) :precision binary64 0.0)
double code(double a, double b, double angle) {
	return 0.0;
}
real(8) function code(a, b, angle)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle
    code = 0.0d0
end function
public static double code(double a, double b, double angle) {
	return 0.0;
}
def code(a, b, angle):
	return 0.0
function code(a, b, angle)
	return 0.0
end
function tmp = code(a, b, angle)
	tmp = 0.0;
end
code[a_, b_, angle_] := 0.0
\begin{array}{l}

\\
0
\end{array}
Derivation
  1. Initial program 53.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*53.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. unpow253.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. unpow253.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-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. Step-by-step derivation
    1. add-cube-cbrt59.8%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{0} \]
  11. Final simplification12.3%

    \[\leadsto 0 \]

Reproduce

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