ab-angle->ABCF B

Percentage Accurate: 55.3% → 65.1%
Time: 15.4s
Alternatives: 16
Speedup: 32.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 55.3% 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: 65.1% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;{b}^{2} \leq 2 \cdot 10^{+282}:\\
\;\;\;\;2 \cdot \left(b \cdot \left(t\_1 \cdot \left(\sin t\_0 \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 b #s(literal 2 binary64)) < 3.9999999999999998e-269

    1. Initial program 65.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999998e-269 < (pow.f64 b #s(literal 2 binary64)) < 2.00000000000000007e282

    1. Initial program 58.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(b \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(\left(a + b\right) \cdot \left(1 - \frac{a}{b}\right)\right)\right)\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*59.1%

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

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

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

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

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

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

    if 2.00000000000000007e282 < (pow.f64 b #s(literal 2 binary64))

    1. Initial program 38.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*38.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. *-commutative38.1%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(b \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(\left(a + b\right) \cdot \left(1 - \frac{a}{b}\right)\right)\right)\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*73.5%

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

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

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

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

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

Alternative 2: 68.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
t_3 := t\_2 \cdot t\_1\\
\mathbf{if}\;{b}^{2} \leq 2 \cdot 10^{+282}:\\
\;\;\;\;2 \cdot \left({b}^{2} \cdot t\_3\right) + a \cdot \left(-2 \cdot \left(t\_3 \cdot a\right) + 2 \cdot \left(t\_2 \cdot \left(t\_1 \cdot \left(b - b\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(b \cdot \left(t\_0 \cdot \left(\left(b + a\right) \cdot \left(1 - \frac{a}{b}\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 b #s(literal 2 binary64)) < 2.00000000000000007e282

    1. Initial program 61.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*61.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. *-commutative61.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left({b}^{2} \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) + a \cdot \left(-2 \cdot \left(a \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) + 2 \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(b + -1 \cdot b\right)\right)\right)\right)} \]

    if 2.00000000000000007e282 < (pow.f64 b #s(literal 2 binary64))

    1. Initial program 38.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*38.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. *-commutative38.1%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(b \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(\left(a + b\right) \cdot \left(1 - \frac{a}{b}\right)\right)\right)\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*73.5%

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

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

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

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

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

Alternative 3: 66.7% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000012e-295

    1. Initial program 61.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*61.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. *-commutative61.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000012e-295 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 49.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*49.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. *-commutative49.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(b \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(\left(a + b\right) \cdot \left(1 - \frac{a}{b}\right)\right)\right)\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*69.3%

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

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

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

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

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

Alternative 4: 60.7% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 b #s(literal 2 binary64)) < 2.4699999999999999e-269

    1. Initial program 66.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*66.6%

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

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

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    6. Taylor expanded in b around 0 62.4%

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

    if 2.4699999999999999e-269 < (pow.f64 b #s(literal 2 binary64))

    1. Initial program 50.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*50.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. *-commutative50.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(b \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(\left(a + b\right) \cdot \left(1 - \frac{a}{b}\right)\right)\right)\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*64.2%

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

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

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

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

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

Alternative 5: 49.1% accurate, 17.4× speedup?

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

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

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


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

    1. Initial program 58.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*58.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(b \cdot \pi + \color{blue}{\left(-1 \cdot a\right) \cdot \pi}\right)\right)\right) \]
      3. neg-mul-144.9%

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

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

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

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

    if 4.97000000000000028e-135 < b

    1. Initial program 51.8%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(b \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(\left(a + b\right) \cdot \left(1 - \frac{a}{b}\right)\right)\right)\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*67.2%

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

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

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

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

Alternative 6: 49.1% accurate, 17.4× speedup?

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

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

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


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

    1. Initial program 57.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(b \cdot \pi + \color{blue}{\left(-1 \cdot a\right) \cdot \pi}\right)\right)\right) \]
      3. neg-mul-144.6%

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

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

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

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

    if 3.5999999999999999e-134 < b

    1. Initial program 52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(b \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(\left(a + b\right) \cdot \left(1 - \frac{a}{b}\right)\right)\right)\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*67.8%

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

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

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

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

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

Alternative 7: 58.2% accurate, 19.0× speedup?

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

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

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


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

    1. Initial program 55.6%

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

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

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

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

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

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

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

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

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

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

    if 4.8000000000000001e-63 < b

    1. Initial program 55.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*55.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. *-commutative55.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot b\right) \cdot \color{blue}{\left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(1 - \frac{a}{b}\right)\right)}\right) \]
      3. +-commutative72.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 4.8 \cdot 10^{-63}:\\ \;\;\;\;\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(b \cdot angle\right) \cdot \left(\left(1 - \frac{a}{b}\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 43.9% accurate, 24.6× speedup?

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

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

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


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

    1. Initial program 56.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.8e15 < b

    1. Initial program 51.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 43.8% accurate, 26.2× speedup?

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

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

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


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

    1. Initial program 57.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(b \cdot \pi + \color{blue}{\left(-1 \cdot a\right) \cdot \pi}\right)\right)\right) \]
      3. neg-mul-143.1%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(b \cdot \pi + \color{blue}{\left(-a\right)} \cdot \pi\right)\right)\right) \]
      4. distribute-rgt-in43.1%

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

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

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

    if 7.4e19 < b

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

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

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

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

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

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

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

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

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

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

Alternative 10: 41.6% accurate, 26.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 1.2999999999999999e-189

    1. Initial program 58.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*58.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. *-commutative58.4%

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

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

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

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

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

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

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

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

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

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

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

    if 1.2999999999999999e-189 < angle

    1. Initial program 50.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\left(a \cdot \left(-1 \cdot \left(a \cdot \pi\right) + b \cdot \pi\right)\right)}\right) \]
    10. Step-by-step derivation
      1. +-commutative32.0%

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(b \cdot \pi + \color{blue}{\left(-1 \cdot a\right) \cdot \pi}\right)\right)\right) \]
      3. neg-mul-132.0%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(b \cdot \pi + \color{blue}{\left(-a\right)} \cdot \pi\right)\right)\right) \]
      4. distribute-rgt-in32.0%

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

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

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

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

Alternative 11: 42.2% accurate, 26.2× speedup?

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

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

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


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

    1. Initial program 59.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*59.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. *-commutative59.2%

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

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

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

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

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

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

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

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

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

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

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

    if 5.5999999999999998e149 < angle

    1. Initial program 30.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*30.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 55.4% accurate, 32.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 55.4% accurate, 32.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 55.4% accurate, 32.2× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 15: 21.7% accurate, 46.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(b \cdot \pi\right)\right)\right) \]
  13. Add Preprocessing

Alternative 16: 20.2% accurate, 46.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto 0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
  13. Add Preprocessing

Reproduce

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