ab-angle->ABCF B

Percentage Accurate: 54.0% → 66.6%
Time: 45.2s
Alternatives: 14
Speedup: 5.4×

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 14 alternatives:

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

Initial Program: 54.0% 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.6% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt[3]{\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(t_0 \cdot \left(t_0 \cdot t_0\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right)\right)\right)\right) \cdot \left(b + a\right)\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 53.6%

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

    \[\leadsto \color{blue}{2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)} \]
  5. Step-by-step derivation
    1. add-cube-cbrt66.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 \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\left(\left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\pi}\right)}\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
  6. Applied egg-rr66.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 \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\left(\left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\pi}\right)}\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
  7. Step-by-step derivation
    1. associate-*r*67.7%

      \[\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(0.005555555555555556 \cdot \left(angle \cdot \left(\left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\pi}\right)\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
    2. *-commutative67.7%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 66.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ 2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right)\right)\right)\right) \cdot \left(b + a\right)\right) \cdot \log \left(e^{\cos \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)
   (*
    (*
     (sin
      (* 0.005555555555555556 (* angle (* (cbrt PI) (* (cbrt PI) (cbrt PI))))))
     (+ b a))
    (log (exp (cos (* PI (* 0.005555555555555556 angle)))))))))
double code(double a, double b, double angle) {
	return 2.0 * ((b - a) * ((sin((0.005555555555555556 * (angle * (cbrt(((double) M_PI)) * (cbrt(((double) M_PI)) * cbrt(((double) M_PI))))))) * (b + a)) * log(exp(cos((((double) M_PI) * (0.005555555555555556 * angle)))))));
}
public static double code(double a, double b, double angle) {
	return 2.0 * ((b - a) * ((Math.sin((0.005555555555555556 * (angle * (Math.cbrt(Math.PI) * (Math.cbrt(Math.PI) * Math.cbrt(Math.PI)))))) * (b + a)) * Math.log(Math.exp(Math.cos((Math.PI * (0.005555555555555556 * angle)))))));
}
function code(a, b, angle)
	return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(sin(Float64(0.005555555555555556 * Float64(angle * Float64(cbrt(pi) * Float64(cbrt(pi) * cbrt(pi)))))) * Float64(b + a)) * log(exp(cos(Float64(pi * Float64(0.005555555555555556 * angle))))))))
end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[Sin[N[(0.005555555555555556 * N[(angle * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[Pi, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Log[N[Exp[N[Cos[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right)\right)\right)\right) \cdot \left(b + a\right)\right) \cdot \log \left(e^{\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.6%

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

    \[\leadsto \color{blue}{2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)} \]
  5. Step-by-step derivation
    1. add-cube-cbrt66.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 \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\left(\left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\pi}\right)}\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
  6. Applied egg-rr66.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 \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\left(\left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\pi}\right)}\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
  7. Step-by-step derivation
    1. associate-*r*67.7%

      \[\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(0.005555555555555556 \cdot \left(angle \cdot \left(\left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\pi}\right)\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
    2. *-commutative67.7%

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

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

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

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

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

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

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

      \[\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(0.005555555555555556 \cdot \left(angle \cdot \left(\left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\pi}\right)\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
  8. Applied egg-rr67.7%

    \[\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(0.005555555555555556 \cdot \left(angle \cdot \left(\left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\pi}\right)\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
  9. Final simplification67.7%

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

Alternative 3: 66.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ 2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right)\right)\right)\right) \cdot \left(b + a\right)\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\right)\right) \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (*
  2.0
  (*
   (- b a)
   (*
    (*
     (sin
      (* 0.005555555555555556 (* angle (* (cbrt PI) (* (cbrt PI) (cbrt PI))))))
     (+ b a))
    (log1p (expm1 (cos (* PI (* 0.005555555555555556 angle)))))))))
double code(double a, double b, double angle) {
	return 2.0 * ((b - a) * ((sin((0.005555555555555556 * (angle * (cbrt(((double) M_PI)) * (cbrt(((double) M_PI)) * cbrt(((double) M_PI))))))) * (b + a)) * log1p(expm1(cos((((double) M_PI) * (0.005555555555555556 * angle)))))));
}
public static double code(double a, double b, double angle) {
	return 2.0 * ((b - a) * ((Math.sin((0.005555555555555556 * (angle * (Math.cbrt(Math.PI) * (Math.cbrt(Math.PI) * Math.cbrt(Math.PI)))))) * (b + a)) * Math.log1p(Math.expm1(Math.cos((Math.PI * (0.005555555555555556 * angle)))))));
}
function code(a, b, angle)
	return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(sin(Float64(0.005555555555555556 * Float64(angle * Float64(cbrt(pi) * Float64(cbrt(pi) * cbrt(pi)))))) * Float64(b + a)) * log1p(expm1(cos(Float64(pi * Float64(0.005555555555555556 * angle))))))))
end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[Sin[N[(0.005555555555555556 * N[(angle * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[Pi, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Log[1 + N[(Exp[N[Cos[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right)\right)\right)\right) \cdot \left(b + a\right)\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.6%

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

    \[\leadsto \color{blue}{2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)} \]
  5. Step-by-step derivation
    1. add-cube-cbrt66.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 \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\left(\left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\pi}\right)}\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
  6. Applied egg-rr66.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 \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\left(\left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\pi}\right)}\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
  7. Step-by-step derivation
    1. associate-*r*67.7%

      \[\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(0.005555555555555556 \cdot \left(angle \cdot \left(\left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\pi}\right)\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
    2. *-commutative67.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto 2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right)\right)\right)\right) \cdot \left(b + a\right)\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\right)\right) \]

Alternative 4: 66.7% accurate, 0.7× speedup?

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

\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right)\right)\right)\right) \cdot \left(b + a\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.6%

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

    \[\leadsto \color{blue}{2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)} \]
  5. Step-by-step derivation
    1. add-cube-cbrt66.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 \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\left(\left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\pi}\right)}\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
  6. Applied egg-rr66.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 \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\left(\left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right) \cdot \sqrt[3]{\pi}\right)}\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
  7. Final simplification66.8%

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

Alternative 5: 67.0% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 25.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*25.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. unpow225.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. unpow225.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-squares41.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. Simplified41.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 70.8%

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

      \[\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) \]

    if -1.2999999999999999e111 < a

    1. Initial program 58.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*58.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. unpow258.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. unpow258.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-squares59.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 67.1% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\\
2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_0 \cdot \left(\left(b + a\right) \cdot \sin t_0\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 53.6%

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

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

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

Alternative 7: 67.2% accurate, 1.5× speedup?

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

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

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

    \[\leadsto \color{blue}{2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right)} \]
  5. Step-by-step derivation
    1. associate-*r*65.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(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
    2. *-commutative65.1%

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

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

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

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

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

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

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

Alternative 8: 66.2% accurate, 2.9× speedup?

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

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

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

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

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

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

Alternative 9: 50.5% accurate, 5.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.9 \cdot 10^{-77} \lor \neg \left(b \leq 2.2 \cdot 10^{+31}\right):\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot angle\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 (or (<= b -2.9e-77) (not (<= b 2.2e+31)))
   (* 0.011111111111111112 (* PI (* b (* b angle))))
   (* 0.011111111111111112 (* angle (* (- b a) (* a PI))))))
double code(double a, double b, double angle) {
	double tmp;
	if ((b <= -2.9e-77) || !(b <= 2.2e+31)) {
		tmp = 0.011111111111111112 * (((double) M_PI) * (b * (b * angle)));
	} 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 ((b <= -2.9e-77) || !(b <= 2.2e+31)) {
		tmp = 0.011111111111111112 * (Math.PI * (b * (b * angle)));
	} else {
		tmp = 0.011111111111111112 * (angle * ((b - a) * (a * Math.PI)));
	}
	return tmp;
}
def code(a, b, angle):
	tmp = 0
	if (b <= -2.9e-77) or not (b <= 2.2e+31):
		tmp = 0.011111111111111112 * (math.pi * (b * (b * angle)))
	else:
		tmp = 0.011111111111111112 * (angle * ((b - a) * (a * math.pi)))
	return tmp
function code(a, b, angle)
	tmp = 0.0
	if ((b <= -2.9e-77) || !(b <= 2.2e+31))
		tmp = Float64(0.011111111111111112 * Float64(pi * Float64(b * Float64(b * angle))));
	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 ((b <= -2.9e-77) || ~((b <= 2.2e+31)))
		tmp = 0.011111111111111112 * (pi * (b * (b * angle)));
	else
		tmp = 0.011111111111111112 * (angle * ((b - a) * (a * pi)));
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_] := If[Or[LessEqual[b, -2.9e-77], N[Not[LessEqual[b, 2.2e+31]], $MachinePrecision]], N[(0.011111111111111112 * N[(Pi * N[(b * N[(b * angle), $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}\;b \leq -2.9 \cdot 10^{-77} \lor \neg \left(b \leq 2.2 \cdot 10^{+31}\right):\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot angle\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 b < -2.8999999999999999e-77 or 2.2000000000000001e31 < b

    1. Initial program 53.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8999999999999999e-77 < b < 2.2000000000000001e31

    1. Initial program 54.2%

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

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

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

        \[\leadsto \left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      4. difference-of-squares54.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. Simplified54.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 51.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.9 \cdot 10^{-77} \lor \neg \left(b \leq 2.2 \cdot 10^{+31}\right):\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot angle\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: 55.9% accurate, 5.4× speedup?

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

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

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


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

    1. Initial program 57.2%

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

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

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

        \[\leadsto \left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      4. difference-of-squares58.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. Simplified58.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 0 53.6%

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

    if 3.8000000000000002e171 < b

    1. Initial program 23.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    4. Taylor expanded in angle around 0 57.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 57.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \pi\right)} \]
      3. *-commutative57.1%

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

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

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

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

Alternative 11: 62.5% accurate, 5.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 9.50000000000000001e142

    1. Initial program 57.2%

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. associate-*r*66.5%

        \[\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)} \]
      2. *-commutative66.5%

        \[\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)} \]
      3. +-commutative66.5%

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

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

    if 9.50000000000000001e142 < angle

    1. Initial program 28.2%

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

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

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

        \[\leadsto \left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      4. difference-of-squares31.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. Simplified31.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 23.8%

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

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

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

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

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

Alternative 12: 48.8% accurate, 5.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.2 \cdot 10^{-136} \lor \neg \left(b \leq 4.5 \cdot 10^{+51}\right):\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -9.19999999999999994e-136 or 4.5e51 < b

    1. Initial program 51.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*51.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. unpow251.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. unpow251.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-squares57.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. Simplified57.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 0 53.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \pi\right)} \]
      3. *-commutative47.1%

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

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

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

    if -9.19999999999999994e-136 < b < 4.5e51

    1. Initial program 55.6%

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

        \[\leadsto \left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
      4. difference-of-squares55.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. Simplified55.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 0 48.8%

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(-angle \cdot \left({a}^{2} \cdot \pi\right)\right)} \]
      2. distribute-rgt-neg-in48.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -9.2 \cdot 10^{-136} \lor \neg \left(b \leq 4.5 \cdot 10^{+51}\right):\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a \cdot \left(-a\right)\right)\right)\right)\\ \end{array} \]

Alternative 13: 34.2% 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.6%

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

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

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

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

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

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

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

Alternative 14: 37.5% accurate, 5.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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