ab-angle->ABCF B

Percentage Accurate: 53.9% → 56.8%
Time: 42.3s
Alternatives: 11
Speedup: 5.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 53.9% 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: 56.8% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\\
t_1 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_2 := \pi \cdot \frac{angle}{180}\\
t_3 := \cos t_2\\
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t_2\right) \cdot t_3 \leq 5 \cdot 10^{+290}:\\
\;\;\;\;\left(t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot t_0\right)\\

\mathbf{else}:\\
\;\;\;\;t_3 \cdot \left(t_1 \cdot \sin \left(\frac{angle}{180} \cdot {\left(\sqrt{t_0}\right)}^{2}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) < 4.9999999999999998e290

    1. Initial program 56.3%

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

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

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

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

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

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

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

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

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

    if 4.9999999999999998e290 < (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))

    1. Initial program 39.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 56.7% accurate, 0.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot t_0\right) \cdot \sin \left(\frac{angle}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right)\\


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

    1. Initial program 49.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. Simplified43.3%

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Applied egg-rr57.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) \]

    if -2.0000000000000001e280 < (-.f64 (pow.f64 b 2) (pow.f64 a 2))

    1. Initial program 53.5%

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

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

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

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

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

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

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

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

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

Alternative 3: 56.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
\mathbf{if}\;\frac{angle}{180} \leq 10^{+83}:\\
\;\;\;\;\left(t_0 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_0 \cdot \sin \left(\frac{angle}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\\


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

    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. unpow257.7%

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

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

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

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

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

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

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

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

    if 1.00000000000000003e83 < (/.f64 angle 180)

    1. Initial program 25.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. unpow225.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 56.8% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(t_0 \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)\right)\\


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

    1. Initial program 49.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. Simplified43.1%

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Applied egg-rr57.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) \]

    if -1.0000000000000001e287 < (-.f64 (pow.f64 b 2) (pow.f64 a 2))

    1. Initial program 53.5%

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

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

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

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

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

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

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

Alternative 5: 56.9% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot t_0\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\\


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

    1. Initial program 48.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. Simplified42.2%

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

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

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

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

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

    if -2.00000000000000007e286 < (-.f64 (pow.f64 b 2) (pow.f64 a 2))

    1. Initial program 53.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. unpow253.8%

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

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

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

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

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

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

Alternative 6: 56.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(b - a\right)\\
\mathbf{if}\;{b}^{2} \leq 10^{-196}:\\
\;\;\;\;\left(2 \cdot t_0\right) \cdot \sin \left(\frac{angle}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\\

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


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

    1. Initial program 63.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. unpow263.8%

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

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

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

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

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

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

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

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

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

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

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

    if 1e-196 < (pow.f64 b 2)

    1. Initial program 45.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. Simplified44.8%

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

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

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

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

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

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

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

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

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

Alternative 7: 57.1% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 57.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. Simplified58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999993e278 < (pow.f64 a 2)

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

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Applied egg-rr54.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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.2%

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

Alternative 8: 57.1% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 57.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*57.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. *-commutative57.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*57.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. Simplified57.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. Step-by-step derivation
      1. *-commutative57.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999993e278 < (pow.f64 a 2)

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

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Applied egg-rr54.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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.9%

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

Alternative 9: 55.8% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 56.3%

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

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

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

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

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

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

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

    if 5.00000000000000008e140 < (pow.f64 a 2)

    1. Initial program 47.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. Simplified43.8%

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

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

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

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

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

      \[\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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.4%

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

Alternative 10: 54.2% accurate, 5.5× 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 52.7%

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

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

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

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

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  5. Applied egg-rr54.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) \]
  6. Final simplification54.3%

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

Alternative 11: 34.9% accurate, 5.7× speedup?

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

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

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

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

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

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\color{blue}{\left(b \cdot b\right)} \cdot \pi\right)\right) \]
  6. Applied egg-rr29.8%

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

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

Reproduce

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