ab-angle->ABCF B

Percentage Accurate: 53.8% → 57.8%
Time: 28.6s
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.8% 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: 57.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_0 := \left(b + a_m\right) \cdot \left(b - a_m\right)\\
t_1 := 2 \cdot t_0\\
t_2 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\
\mathbf{if}\;a_m \leq 1.05 \cdot 10^{-136}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{t_2}\right)}^{3}\right) \cdot \left(t_1 \cdot \sin t_2\right)\\

\mathbf{elif}\;a_m \leq 2.25 \cdot 10^{+216}:\\
\;\;\;\;\left(t_1 \cdot \sin \left(\frac{angle}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right) \cdot \sqrt[3]{{\cos \left(\frac{\pi}{\frac{180}{angle}}\right)}^{3}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 1.0499999999999999e-136

    1. Initial program 56.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. unpow256.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. unpow256.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-squares59.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-rr59.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-sqr-sqrt61.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. pow261.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-rr61.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) \]
    6. Step-by-step derivation
      1. add-cube-cbrt60.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0499999999999999e-136 < a < 2.25000000000000012e216

    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. unpow251.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. unpow251.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-squares55.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) \]
    3. Applied egg-rr55.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) \]
    4. Step-by-step derivation
      1. add-sqr-sqrt56.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.25000000000000012e216 < a

    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. unpow255.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. unpow255.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-squares72.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) \]
    3. Applied egg-rr72.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) \]
    4. Taylor expanded in angle around 0 61.1%

      \[\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}{1} \]
    5. Taylor expanded in angle around 0 83.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.05 \cdot 10^{-136}:\\ \;\;\;\;\cos \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right) \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\\ \mathbf{elif}\;a \leq 2.25 \cdot 10^{+216}:\\ \;\;\;\;\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) \cdot \sqrt[3]{{\cos \left(\frac{\pi}{\frac{180}{angle}}\right)}^{3}}\\ \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 2: 57.7% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t_0 \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\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)))) < 5.0000000000000004e189

    1. Initial program 62.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. unpow262.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. unpow262.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-squares62.7%

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

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

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

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

      \[\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. associate-*r/61.8%

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

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

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

    if 5.0000000000000004e189 < (*.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 38.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. unpow238.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. unpow238.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-squares51.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-rr51.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-sqr-sqrt53.6%

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

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

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

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

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

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

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

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

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

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

    \[\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^{+189}:\\ \;\;\;\;\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) \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)\\ \mathbf{else}:\\ \;\;\;\;\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) \cdot \cos \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right)\\ \end{array} \]

Alternative 3: 57.8% accurate, 0.7× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} t_0 := \left(b + a_m\right) \cdot \left(b - a_m\right)\\ t_1 := 2 \cdot t_0\\ t_2 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\ \mathbf{if}\;a_m \leq 1.12 \cdot 10^{-138}:\\ \;\;\;\;\cos \left({\left(\sqrt[3]{t_2}\right)}^{3}\right) \cdot \left(t_1 \cdot \sin t_2\right)\\ \mathbf{elif}\;a_m \leq 2.05 \cdot 10^{+216}:\\ \;\;\;\;\left(t_1 \cdot \sin \left(\frac{angle}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot t_0\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
 :precision binary64
 (let* ((t_0 (* (+ b a_m) (- b a_m)))
        (t_1 (* 2.0 t_0))
        (t_2 (* angle (* PI 0.005555555555555556))))
   (if (<= a_m 1.12e-138)
     (* (cos (pow (cbrt t_2) 3.0)) (* t_1 (sin t_2)))
     (if (<= a_m 2.05e+216)
       (*
        (* t_1 (sin (* (/ angle 180.0) (pow (sqrt PI) 2.0))))
        (log1p (expm1 (cos (/ PI (/ 180.0 angle))))))
       (* 0.011111111111111112 (* angle (* PI t_0)))))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
	double t_0 = (b + a_m) * (b - a_m);
	double t_1 = 2.0 * t_0;
	double t_2 = angle * (((double) M_PI) * 0.005555555555555556);
	double tmp;
	if (a_m <= 1.12e-138) {
		tmp = cos(pow(cbrt(t_2), 3.0)) * (t_1 * sin(t_2));
	} else if (a_m <= 2.05e+216) {
		tmp = (t_1 * sin(((angle / 180.0) * pow(sqrt(((double) M_PI)), 2.0)))) * log1p(expm1(cos((((double) M_PI) / (180.0 / angle)))));
	} else {
		tmp = 0.011111111111111112 * (angle * (((double) M_PI) * t_0));
	}
	return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
	double t_0 = (b + a_m) * (b - a_m);
	double t_1 = 2.0 * t_0;
	double t_2 = angle * (Math.PI * 0.005555555555555556);
	double tmp;
	if (a_m <= 1.12e-138) {
		tmp = Math.cos(Math.pow(Math.cbrt(t_2), 3.0)) * (t_1 * Math.sin(t_2));
	} else if (a_m <= 2.05e+216) {
		tmp = (t_1 * Math.sin(((angle / 180.0) * Math.pow(Math.sqrt(Math.PI), 2.0)))) * Math.log1p(Math.expm1(Math.cos((Math.PI / (180.0 / angle)))));
	} else {
		tmp = 0.011111111111111112 * (angle * (Math.PI * t_0));
	}
	return tmp;
}
a_m = abs(a)
function code(a_m, b, angle)
	t_0 = Float64(Float64(b + a_m) * Float64(b - a_m))
	t_1 = Float64(2.0 * t_0)
	t_2 = Float64(angle * Float64(pi * 0.005555555555555556))
	tmp = 0.0
	if (a_m <= 1.12e-138)
		tmp = Float64(cos((cbrt(t_2) ^ 3.0)) * Float64(t_1 * sin(t_2)));
	elseif (a_m <= 2.05e+216)
		tmp = Float64(Float64(t_1 * sin(Float64(Float64(angle / 180.0) * (sqrt(pi) ^ 2.0)))) * log1p(expm1(cos(Float64(pi / Float64(180.0 / angle))))));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * t_0)));
	end
	return tmp
end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a$95$m, 1.12e-138], N[(N[Cos[N[Power[N[Power[t$95$2, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a$95$m, 2.05e+216], N[(N[(t$95$1 * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Log[1 + N[(Exp[N[Cos[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
a_m = \left|a\right|

\\
\begin{array}{l}
t_0 := \left(b + a_m\right) \cdot \left(b - a_m\right)\\
t_1 := 2 \cdot t_0\\
t_2 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\
\mathbf{if}\;a_m \leq 1.12 \cdot 10^{-138}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{t_2}\right)}^{3}\right) \cdot \left(t_1 \cdot \sin t_2\right)\\

\mathbf{elif}\;a_m \leq 2.05 \cdot 10^{+216}:\\
\;\;\;\;\left(t_1 \cdot \sin \left(\frac{angle}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\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 3 regimes
  2. if a < 1.1199999999999999e-138

    1. Initial program 56.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. unpow256.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. unpow256.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-squares59.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-rr59.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-sqr-sqrt61.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. pow261.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-rr61.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) \]
    6. Step-by-step derivation
      1. add-cube-cbrt60.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1199999999999999e-138 < a < 2.0499999999999999e216

    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. unpow251.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. unpow251.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-squares55.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) \]
    3. Applied egg-rr55.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) \]
    4. Step-by-step derivation
      1. add-sqr-sqrt56.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle}{180}\right)\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \color{blue}{\left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}\right)\right) \]
      3. associate-*r*55.0%

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle}{180}\right)\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\left(angle \cdot \color{blue}{\frac{1}{180}}\right) \cdot \pi\right)\right)\right) \]
      5. div-inv56.9%

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle}{180}\right)\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\pi \cdot \color{blue}{\frac{1}{\frac{180}{angle}}}\right)\right)\right) \]
      8. un-div-inv60.2%

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

    if 2.0499999999999999e216 < a

    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. unpow255.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. unpow255.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-squares72.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) \]
    3. Applied egg-rr72.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) \]
    4. Taylor expanded in angle around 0 61.1%

      \[\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}{1} \]
    5. Taylor expanded in angle around 0 83.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.12 \cdot 10^{-138}:\\ \;\;\;\;\cos \left({\left(\sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right) \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\\ \mathbf{elif}\;a \leq 2.05 \cdot 10^{+216}:\\ \;\;\;\;\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) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\frac{\pi}{\frac{180}{angle}}\right)\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 4: 57.3% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(\sin t_1 \cdot t_0\right) \cdot \left(1 + \left(-1.54320987654321 \cdot 10^{-5} \cdot {angle}^{2}\right) \cdot {\pi}^{2}\right)\\


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

    1. Initial program 61.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. unpow261.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. unpow261.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-squares61.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) \]
    3. Applied egg-rr61.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) \]
    4. Step-by-step derivation
      1. add-sqr-sqrt64.2%

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

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

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

    if 5.00000000000000025e241 < (pow.f64 b 2)

    1. Initial program 42.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. unpow242.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. unpow242.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-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. Taylor expanded in angle around 0 58.9%

      \[\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}{\left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*58.9%

        \[\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 \left(1 + \color{blue}{\left(-1.54320987654321 \cdot 10^{-5} \cdot {angle}^{2}\right) \cdot {\pi}^{2}}\right) \]
    6. Simplified58.9%

      \[\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}{\left(1 + \left(-1.54320987654321 \cdot 10^{-5} \cdot {angle}^{2}\right) \cdot {\pi}^{2}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;{b}^{2} \leq 5 \cdot 10^{+241}:\\ \;\;\;\;\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)\\ \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 \left(1 + \left(-1.54320987654321 \cdot 10^{-5} \cdot {angle}^{2}\right) \cdot {\pi}^{2}\right)\\ \end{array} \]

Alternative 5: 57.0% accurate, 1.2× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos t_1 \cdot \left(\sin t_1 \cdot t_0\right)\right)\\


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

    1. Initial program 58.5%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. unpow258.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. unpow258.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-squares58.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-rr58.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. Taylor expanded in angle around 0 60.7%

      \[\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}{1} \]
    5. Step-by-step derivation
      1. add-cube-cbrt60.7%

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

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

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

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

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

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

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

    if 4e-242 < (pow.f64 a 2)

    1. Initial program 54.2%

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

        \[\leadsto \color{blue}{\left(2 \cdot \left(\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*54.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. Simplified54.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. Step-by-step derivation
      1. unpow254.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. unpow254.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-squares60.0%

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

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

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

Alternative 6: 57.4% accurate, 1.2× speedup?

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

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

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


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

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

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

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

      \[\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)} \]
    5. Step-by-step derivation
      1. *-commutative57.8%

        \[\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 \cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)} \]
      2. associate-*l*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 \cos \color{blue}{\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)} \]
    6. Simplified59.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(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)} \]

    if 1.00000000000000006e279 < (pow.f64 a 2)

    1. Initial program 50.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. unpow250.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. unpow250.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-squares66.0%

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

      \[\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 0 58.1%

      \[\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}{1} \]
    5. Step-by-step derivation
      1. add-log-exp27.4%

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

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

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \log \left(e^{\sin \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right)}\right)\right) \cdot 1 \]
    6. Applied egg-rr24.5%

      \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\log \left(e^{\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}\right) \cdot 1 \]
    7. Taylor expanded in angle around 0 70.8%

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

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

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

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

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

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

Alternative 7: 55.5% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 61.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. unpow261.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. unpow261.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-squares61.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) \]
    3. Applied egg-rr61.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) \]
    4. Taylor expanded in angle around 0 59.8%

      \[\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}{1} \]
    5. Taylor expanded in angle around inf 60.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 1 \]

    if 1e27 < (pow.f64 a 2)

    1. Initial program 48.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. unpow248.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. unpow248.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.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. Taylor expanded in angle around 0 50.8%

      \[\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}{1} \]
    5. Taylor expanded in angle around 0 58.7%

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

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

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

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

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

Alternative 8: 55.5% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 61.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. unpow261.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. unpow261.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-squares61.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) \]
    3. Applied egg-rr61.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) \]
    4. Taylor expanded in angle around 0 59.8%

      \[\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}{1} \]
    5. Taylor expanded in angle around inf 60.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 1 \]
    6. Step-by-step derivation
      1. *-commutative60.1%

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

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

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

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

    if 1e27 < (pow.f64 a 2)

    1. Initial program 48.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. unpow248.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. unpow248.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.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. Taylor expanded in angle around 0 50.8%

      \[\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}{1} \]
    5. Taylor expanded in angle around 0 58.7%

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

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

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

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

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

Alternative 9: 54.6% accurate, 5.4× speedup?

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

\\
\left(2 \cdot \left(\left(b + a_m\right) \cdot \left(b - a_m\right)\right)\right) \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)
\end{array}
Derivation
  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. unpow255.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. unpow255.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-squares59.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-rr59.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. Taylor expanded in angle around 0 55.7%

    \[\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}{1} \]
  5. Taylor expanded in angle around 0 56.6%

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

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

Alternative 10: 54.6% accurate, 5.5× speedup?

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

\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b + a_m\right) \cdot \left(b - a_m\right)\right)\right)\right)
\end{array}
Derivation
  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. unpow255.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. unpow255.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-squares59.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-rr59.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. Taylor expanded in angle around 0 55.7%

    \[\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}{1} \]
  5. Taylor expanded in angle around 0 56.6%

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

    \[\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: 54.6% accurate, 5.5× speedup?

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

\\
0.011111111111111112 \cdot \left(\left(\left(b + a_m\right) \cdot \left(b - a_m\right)\right) \cdot \left(\pi \cdot angle\right)\right)
\end{array}
Derivation
  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. unpow255.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. unpow255.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-squares59.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-rr59.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. Taylor expanded in angle around 0 55.7%

    \[\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}{1} \]
  5. Taylor expanded in angle around 0 56.6%

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

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

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

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

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

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

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

Reproduce

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