ab-angle->ABCF B

Percentage Accurate: 54.2% → 67.5%
Time: 44.2s
Alternatives: 17
Speedup: 5.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

Alternative 1: 67.5% accurate, 0.5× speedup?

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

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


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

    1. Initial program 59.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]

    if 2.00000000000000013e294 < (pow.f64 a 2)

    1. Initial program 30.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*30.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. associate-*l*30.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{+294}:\\ \;\;\;\;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(\pi \cdot angle\right)\right) \cdot \left(a + b\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(a + b\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right)\right)\right)\right)\\ \end{array} \]

Alternative 2: 67.5% accurate, 0.7× speedup?

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

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


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

    1. Initial program 59.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(b - a\right) \cdot \left(\mathsf{log1p}\left(\mathsf{expm1}\left(\cos \color{blue}{\left(\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)} \cdot \sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right) \cdot \sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
      8. add-cube-cbrt69.1%

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

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

      \[\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 \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]

    if 2.00000000000000013e294 < (pow.f64 a 2)

    1. Initial program 30.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*30.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. associate-*l*30.2%

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

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

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

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

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

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

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

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

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

Alternative 3: 67.2% accurate, 1.0× speedup?

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

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


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

    1. Initial program 45.1%

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

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

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

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

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

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

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

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

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

    1. Initial program 51.7%

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

        \[\leadsto \color{blue}{\left(2 \cdot \left({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. associate-*l*51.7%

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

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

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

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

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

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

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

Alternative 4: 67.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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 \pi\right)\right) \cdot \left(a + b\right)\right)\right)\right) \]
  7. Final simplification71.8%

    \[\leadsto 2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(a + b\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 5: 65.8% accurate, 1.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 angle 180) < -5.00000000000000025e116 or 2.00000000000000002e55 < (/.f64 angle 180)

    1. Initial program 26.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(\sin 0 + \sin \left(\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right) \cdot 0.5\right) \cdot \left(2 \cdot {\left(b + a\right)}^{2}\right)} \]
      3. sin-042.6%

        \[\leadsto \left(\left(\color{blue}{0} + \sin \left(\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right) \cdot 0.5\right) \cdot \left(2 \cdot {\left(b + a\right)}^{2}\right) \]
      4. +-lft-identity42.6%

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

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

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

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

    if -5.00000000000000025e116 < (/.f64 angle 180) < 2.00000000000000002e55

    1. Initial program 63.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*63.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. unpow263.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. unpow263.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-squares72.0%

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

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

        \[\leadsto \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 \color{blue}{\left(\left(\sqrt[3]{\pi \cdot \frac{angle}{180}} \cdot \sqrt[3]{\pi \cdot \frac{angle}{180}}\right) \cdot \sqrt[3]{\pi \cdot \frac{angle}{180}}\right)}\right) \]
      2. pow370.7%

        \[\leadsto \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 \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \frac{angle}{180}}\right)}^{3}\right)}\right) \]
      3. div-inv71.3%

        \[\leadsto \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({\left(\sqrt[3]{\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}}\right)}^{3}\right)\right) \]
      4. metadata-eval71.3%

        \[\leadsto \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({\left(\sqrt[3]{\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)}\right)}^{3}\right)\right) \]
    5. Applied egg-rr71.3%

      \[\leadsto \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 \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)}\right) \]
    6. Taylor expanded in angle around inf 89.6%

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

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

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

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

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

Alternative 6: 65.9% accurate, 2.9× speedup?

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

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

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

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

      \[\leadsto \left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    4. difference-of-squares57.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. Simplified57.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. Step-by-step derivation
    1. add-cube-cbrt57.4%

      \[\leadsto \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 \color{blue}{\left(\left(\sqrt[3]{\pi \cdot \frac{angle}{180}} \cdot \sqrt[3]{\pi \cdot \frac{angle}{180}}\right) \cdot \sqrt[3]{\pi \cdot \frac{angle}{180}}\right)}\right) \]
    2. pow358.0%

      \[\leadsto \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 \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \frac{angle}{180}}\right)}^{3}\right)}\right) \]
    3. div-inv58.9%

      \[\leadsto \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({\left(\sqrt[3]{\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}}\right)}^{3}\right)\right) \]
    4. metadata-eval58.9%

      \[\leadsto \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({\left(\sqrt[3]{\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)}\right)}^{3}\right)\right) \]
  5. Applied egg-rr58.9%

    \[\leadsto \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 \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)}\right) \]
  6. Taylor expanded in angle around inf 67.5%

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

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

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

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

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

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

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

Alternative 7: 49.2% accurate, 2.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.15e-166

    1. Initial program 54.7%

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

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

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

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

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

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

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

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

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

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

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

    if 2.15e-166 < a

    1. Initial program 44.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*44.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. unpow244.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. unpow244.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-squares53.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. Simplified53.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.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. Step-by-step derivation
      1. *-commutative53.0%

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

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

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

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

Alternative 8: 41.2% accurate, 5.4× speedup?

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

\mathbf{elif}\;a \leq 9.5 \cdot 10^{-11}:\\
\;\;\;\;\pi \cdot \left(\left(a \cdot a\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right)\\

\mathbf{elif}\;a \leq 4.5 \cdot 10^{+28}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 1.16000000000000005e-27 or 9.49999999999999951e-11 < a < 4.4999999999999997e28

    1. Initial program 55.9%

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

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

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

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

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

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

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

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

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

    if 1.16000000000000005e-27 < a < 9.49999999999999951e-11

    1. Initial program 67.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4999999999999997e28 < a

    1. Initial program 32.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*32.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. unpow232.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. unpow232.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-squares47.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. Simplified47.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 49.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 0 45.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 41.2% accurate, 5.4× speedup?

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

\mathbf{elif}\;a \leq 9.5 \cdot 10^{-11}:\\
\;\;\;\;\pi \cdot \left(\left(a \cdot a\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right)\\

\mathbf{elif}\;a \leq 5.2 \cdot 10^{+28}:\\
\;\;\;\;\left(angle \cdot 0.011111111111111112\right) \cdot t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < 7.1999999999999997e-27

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

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

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

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

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

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

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

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

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

    if 7.1999999999999997e-27 < a < 9.49999999999999951e-11

    1. Initial program 67.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.49999999999999951e-11 < a < 5.2000000000000004e28

    1. Initial program 48.9%

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

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

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

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

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

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

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

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

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

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

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

    if 5.2000000000000004e28 < a

    1. Initial program 32.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*32.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. unpow232.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. unpow232.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-squares47.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. Simplified47.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 49.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 0 45.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 42.3% accurate, 5.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 9.00000000000000085e-34

    1. Initial program 55.3%

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

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

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

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

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

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

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

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

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

    if 9.00000000000000085e-34 < a

    1. Initial program 40.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*40.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. unpow240.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. unpow240.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-squares51.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. Simplified51.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 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 46.7%

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

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

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

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

Alternative 11: 48.6% accurate, 5.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 5e-52

    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-squares58.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. Simplified58.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 56.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 0 42.1%

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

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

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

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

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

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

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

    if 5e-52 < b

    1. Initial program 42.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 54.5% accurate, 5.5× speedup?

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

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

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

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

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

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

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

Alternative 13: 54.5% accurate, 5.5× speedup?

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

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

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

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

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

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

    \[\leadsto \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 \color{blue}{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \]
  5. Taylor expanded in angle around 0 54.4%

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

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

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

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

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

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

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

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

Alternative 14: 54.5% accurate, 5.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 62.5% accurate, 5.5× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 16: 34.4% accurate, 5.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{angle \cdot \left(\pi \cdot \left(\left(a \cdot a\right) \cdot -0.011111111111111112\right)\right)} \]
  11. Final simplification36.2%

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

Alternative 17: 34.4% accurate, 5.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\pi \cdot \left(\left(a \cdot a\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right)} \]
  14. Final simplification36.2%

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

Reproduce

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