ab-angle->ABCF B

Percentage Accurate: 54.5% → 65.7%
Time: 18.9s
Alternatives: 22
Speedup: 3.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 22 alternatives:

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

Initial Program: 54.5% accurate, 1.0× speedup?

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

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

Alternative 1: 65.7% accurate, 0.7× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \frac{angle\_m}{180} \cdot \pi\\ t_1 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\ t_2 := \sin t\_1\\ t_3 := \left(b - a\right) \cdot \left(b + a\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{-54}:\\ \;\;\;\;\left({\left(\left(b \cdot \sqrt{t\_2}\right) \cdot \sqrt{2}\right)}^{2} + a \cdot \left(t\_2 \cdot \left(a \cdot -2\right)\right)\right) \cdot \cos t\_0\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+159}:\\ \;\;\;\;\cos \left(e^{\log \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(\left(2 \cdot t\_3\right) \cdot \sin t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;{\left({\left(\left(2 \cdot \left(t\_2 \cdot t\_3\right)\right) \cdot \cos t\_1\right)}^{3}\right)}^{0.3333333333333333}\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (/ angle_m 180.0) PI))
        (t_1 (* 0.005555555555555556 (* angle_m PI)))
        (t_2 (sin t_1))
        (t_3 (* (- b a) (+ b a))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 2e-54)
      (*
       (+ (pow (* (* b (sqrt t_2)) (sqrt 2.0)) 2.0) (* a (* t_2 (* a -2.0))))
       (cos t_0))
      (if (<= (/ angle_m 180.0) 1e+159)
        (*
         (cos (exp (log (* PI (* angle_m 0.005555555555555556)))))
         (* (* 2.0 t_3) (sin t_0)))
        (pow
         (pow (* (* 2.0 (* t_2 t_3)) (cos t_1)) 3.0)
         0.3333333333333333))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * ((double) M_PI);
	double t_1 = 0.005555555555555556 * (angle_m * ((double) M_PI));
	double t_2 = sin(t_1);
	double t_3 = (b - a) * (b + a);
	double tmp;
	if ((angle_m / 180.0) <= 2e-54) {
		tmp = (pow(((b * sqrt(t_2)) * sqrt(2.0)), 2.0) + (a * (t_2 * (a * -2.0)))) * cos(t_0);
	} else if ((angle_m / 180.0) <= 1e+159) {
		tmp = cos(exp(log((((double) M_PI) * (angle_m * 0.005555555555555556))))) * ((2.0 * t_3) * sin(t_0));
	} else {
		tmp = pow(pow(((2.0 * (t_2 * t_3)) * cos(t_1)), 3.0), 0.3333333333333333);
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * Math.PI;
	double t_1 = 0.005555555555555556 * (angle_m * Math.PI);
	double t_2 = Math.sin(t_1);
	double t_3 = (b - a) * (b + a);
	double tmp;
	if ((angle_m / 180.0) <= 2e-54) {
		tmp = (Math.pow(((b * Math.sqrt(t_2)) * Math.sqrt(2.0)), 2.0) + (a * (t_2 * (a * -2.0)))) * Math.cos(t_0);
	} else if ((angle_m / 180.0) <= 1e+159) {
		tmp = Math.cos(Math.exp(Math.log((Math.PI * (angle_m * 0.005555555555555556))))) * ((2.0 * t_3) * Math.sin(t_0));
	} else {
		tmp = Math.pow(Math.pow(((2.0 * (t_2 * t_3)) * Math.cos(t_1)), 3.0), 0.3333333333333333);
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = (angle_m / 180.0) * math.pi
	t_1 = 0.005555555555555556 * (angle_m * math.pi)
	t_2 = math.sin(t_1)
	t_3 = (b - a) * (b + a)
	tmp = 0
	if (angle_m / 180.0) <= 2e-54:
		tmp = (math.pow(((b * math.sqrt(t_2)) * math.sqrt(2.0)), 2.0) + (a * (t_2 * (a * -2.0)))) * math.cos(t_0)
	elif (angle_m / 180.0) <= 1e+159:
		tmp = math.cos(math.exp(math.log((math.pi * (angle_m * 0.005555555555555556))))) * ((2.0 * t_3) * math.sin(t_0))
	else:
		tmp = math.pow(math.pow(((2.0 * (t_2 * t_3)) * math.cos(t_1)), 3.0), 0.3333333333333333)
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(Float64(angle_m / 180.0) * pi)
	t_1 = Float64(0.005555555555555556 * Float64(angle_m * pi))
	t_2 = sin(t_1)
	t_3 = Float64(Float64(b - a) * Float64(b + a))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 2e-54)
		tmp = Float64(Float64((Float64(Float64(b * sqrt(t_2)) * sqrt(2.0)) ^ 2.0) + Float64(a * Float64(t_2 * Float64(a * -2.0)))) * cos(t_0));
	elseif (Float64(angle_m / 180.0) <= 1e+159)
		tmp = Float64(cos(exp(log(Float64(pi * Float64(angle_m * 0.005555555555555556))))) * Float64(Float64(2.0 * t_3) * sin(t_0)));
	else
		tmp = (Float64(Float64(2.0 * Float64(t_2 * t_3)) * cos(t_1)) ^ 3.0) ^ 0.3333333333333333;
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = (angle_m / 180.0) * pi;
	t_1 = 0.005555555555555556 * (angle_m * pi);
	t_2 = sin(t_1);
	t_3 = (b - a) * (b + a);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 2e-54)
		tmp = ((((b * sqrt(t_2)) * sqrt(2.0)) ^ 2.0) + (a * (t_2 * (a * -2.0)))) * cos(t_0);
	elseif ((angle_m / 180.0) <= 1e+159)
		tmp = cos(exp(log((pi * (angle_m * 0.005555555555555556))))) * ((2.0 * t_3) * sin(t_0));
	else
		tmp = (((2.0 * (t_2 * t_3)) * cos(t_1)) ^ 3.0) ^ 0.3333333333333333;
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-54], N[(N[(N[Power[N[(N[(b * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(a * N[(t$95$2 * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+159], N[(N[Cos[N[Exp[N[Log[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[(2.0 * t$95$3), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(N[(2.0 * N[(t$95$2 * t$95$3), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+159}:\\
\;\;\;\;\cos \left(e^{\log \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(\left(2 \cdot t\_3\right) \cdot \sin t\_0\right)\\

\mathbf{else}:\\
\;\;\;\;{\left({\left(\left(2 \cdot \left(t\_2 \cdot t\_3\right)\right) \cdot \cos t\_1\right)}^{3}\right)}^{0.3333333333333333}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 2.0000000000000001e-54

    1. Initial program 52.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow252.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. unpow252.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-squares56.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. Applied egg-rr56.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) \]
    5. Taylor expanded in a around 0 64.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-54 < (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999993e158

    1. Initial program 37.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow237.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. unpow237.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-squares42.8%

        \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    4. Applied egg-rr42.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) \]
    5. Step-by-step derivation
      1. add-exp-log48.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(e^{\log \left(\pi \cdot \frac{angle}{180}\right)}\right)} \]
      2. div-inv48.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 \left(e^{\log \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right)}\right) \]
      3. metadata-eval48.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 \left(e^{\log \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right)}\right) \]
    6. Applied egg-rr48.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(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)} \]

    if 9.9999999999999993e158 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.0%

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

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

        \[\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-squares24.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. Applied egg-rr24.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. Step-by-step derivation
      1. add-cbrt-cube23.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \color{blue}{\sqrt[3]{\left(\left(b - a\right) \cdot \left(b - a\right)\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) \]
      2. pow323.3%

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

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

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

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

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

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

Alternative 2: 65.1% accurate, 0.4× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \frac{angle\_m}{180} \cdot \pi\\ t_1 := \cos t\_0\\ t_2 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \cdot \left(\sin t\_0 \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \leq -2 \cdot 10^{+138}:\\ \;\;\;\;\left(a \cdot \left(t\_2 \cdot \left(a \cdot -2\right)\right) + 2 \cdot \left(t\_2 \cdot {b}^{2}\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \mathsf{fma}\left(b, 2 \cdot \left(b \cdot t\_2\right), t\_2 \cdot \left(-2 \cdot {a}^{2}\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (/ angle_m 180.0) PI))
        (t_1 (cos t_0))
        (t_2 (sin (* 0.005555555555555556 (* angle_m PI)))))
   (*
    angle_s
    (if (<= (* t_1 (* (sin t_0) (* 2.0 (- (pow b 2.0) (pow a 2.0))))) -2e+138)
      (*
       (+ (* a (* t_2 (* a -2.0))) (* 2.0 (* t_2 (pow b 2.0))))
       (cos (expm1 (log1p (* PI (* angle_m 0.005555555555555556))))))
      (* t_1 (fma b (* 2.0 (* b t_2)) (* t_2 (* -2.0 (pow a 2.0)))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * ((double) M_PI);
	double t_1 = cos(t_0);
	double t_2 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	double tmp;
	if ((t_1 * (sin(t_0) * (2.0 * (pow(b, 2.0) - pow(a, 2.0))))) <= -2e+138) {
		tmp = ((a * (t_2 * (a * -2.0))) + (2.0 * (t_2 * pow(b, 2.0)))) * cos(expm1(log1p((((double) M_PI) * (angle_m * 0.005555555555555556)))));
	} else {
		tmp = t_1 * fma(b, (2.0 * (b * t_2)), (t_2 * (-2.0 * pow(a, 2.0))));
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(Float64(angle_m / 180.0) * pi)
	t_1 = cos(t_0)
	t_2 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))
	tmp = 0.0
	if (Float64(t_1 * Float64(sin(t_0) * Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))))) <= -2e+138)
		tmp = Float64(Float64(Float64(a * Float64(t_2 * Float64(a * -2.0))) + Float64(2.0 * Float64(t_2 * (b ^ 2.0)))) * cos(expm1(log1p(Float64(pi * Float64(angle_m * 0.005555555555555556))))));
	else
		tmp = Float64(t_1 * fma(b, Float64(2.0 * Float64(b * t_2)), Float64(t_2 * Float64(-2.0 * (a ^ 2.0)))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(t$95$1 * N[(N[Sin[t$95$0], $MachinePrecision] * N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e+138], N[(N[(N[(a * N[(t$95$2 * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$2 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Exp[N[Log[1 + N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(b * N[(2.0 * N[(b * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(-2.0 * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \frac{angle\_m}{180} \cdot \pi\\
t_1 := \cos t\_0\\
t_2 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \cdot \left(\sin t\_0 \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \leq -2 \cdot 10^{+138}:\\
\;\;\;\;\left(a \cdot \left(t\_2 \cdot \left(a \cdot -2\right)\right) + 2 \cdot \left(t\_2 \cdot {b}^{2}\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(b, 2 \cdot \left(b \cdot t\_2\right), t\_2 \cdot \left(-2 \cdot {a}^{2}\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -2.0000000000000001e138

    1. Initial program 26.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow226.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. unpow226.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-squares26.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. Applied egg-rr26.2%

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e138 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64)))))

    1. Initial program 53.6%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, 2 \cdot \left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) + 2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + -1 \cdot a\right)\right), -2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. distribute-lft-out59.7%

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{2 \cdot \left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) + \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + -1 \cdot a\right)\right)}, -2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      4. *-commutative59.7%

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

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

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

        \[\leadsto \mathsf{fma}\left(b, 2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot b + \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \color{blue}{0}\right), -2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      8. distribute-lft-out59.7%

        \[\leadsto \mathsf{fma}\left(b, 2 \cdot \color{blue}{\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + 0\right)\right)}, -2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      9. associate-*r*59.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \leq -2 \cdot 10^{+138}:\\ \;\;\;\;\left(a \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot -2\right)\right) + 2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \mathsf{fma}\left(b, 2 \cdot \left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right), \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-2 \cdot {a}^{2}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 65.8% accurate, 0.4× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \frac{angle\_m}{180} \cdot \pi\\ t_1 := \cos t\_0\\ t_2 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \cdot \left(\sin t\_0 \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \leq 5 \cdot 10^{+32}:\\ \;\;\;\;t\_1 \cdot \left(a \cdot \left(t\_2 \cdot \left(a \cdot -2\right)\right) + 2 \cdot \left(t\_2 \cdot {b}^{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \mathsf{fma}\left(b, 2 \cdot \left(b \cdot t\_2\right), t\_2 \cdot \left(-2 \cdot {a}^{2}\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (/ angle_m 180.0) PI))
        (t_1 (cos t_0))
        (t_2 (sin (* 0.005555555555555556 (* angle_m PI)))))
   (*
    angle_s
    (if (<= (* t_1 (* (sin t_0) (* 2.0 (- (pow b 2.0) (pow a 2.0))))) 5e+32)
      (* t_1 (+ (* a (* t_2 (* a -2.0))) (* 2.0 (* t_2 (pow b 2.0)))))
      (* t_1 (fma b (* 2.0 (* b t_2)) (* t_2 (* -2.0 (pow a 2.0)))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * ((double) M_PI);
	double t_1 = cos(t_0);
	double t_2 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	double tmp;
	if ((t_1 * (sin(t_0) * (2.0 * (pow(b, 2.0) - pow(a, 2.0))))) <= 5e+32) {
		tmp = t_1 * ((a * (t_2 * (a * -2.0))) + (2.0 * (t_2 * pow(b, 2.0))));
	} else {
		tmp = t_1 * fma(b, (2.0 * (b * t_2)), (t_2 * (-2.0 * pow(a, 2.0))));
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(Float64(angle_m / 180.0) * pi)
	t_1 = cos(t_0)
	t_2 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))
	tmp = 0.0
	if (Float64(t_1 * Float64(sin(t_0) * Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))))) <= 5e+32)
		tmp = Float64(t_1 * Float64(Float64(a * Float64(t_2 * Float64(a * -2.0))) + Float64(2.0 * Float64(t_2 * (b ^ 2.0)))));
	else
		tmp = Float64(t_1 * fma(b, Float64(2.0 * Float64(b * t_2)), Float64(t_2 * Float64(-2.0 * (a ^ 2.0)))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(t$95$1 * N[(N[Sin[t$95$0], $MachinePrecision] * N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+32], N[(t$95$1 * N[(N[(a * N[(t$95$2 * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$2 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(b * N[(2.0 * N[(b * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(-2.0 * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(b, 2 \cdot \left(b \cdot t\_2\right), t\_2 \cdot \left(-2 \cdot {a}^{2}\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 4.9999999999999997e32

    1. Initial program 50.8%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. unpow250.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. unpow250.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-squares50.8%

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

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

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

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

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

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

    if 4.9999999999999997e32 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64)))))

    1. Initial program 39.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow239.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. unpow239.2%

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares48.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. Applied egg-rr48.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. Taylor expanded in b around 0 44.2%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, 2 \cdot \left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) + 2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + -1 \cdot a\right)\right), -2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. distribute-lft-out51.6%

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{2 \cdot \left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) + \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + -1 \cdot a\right)\right)}, -2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      4. *-commutative51.6%

        \[\leadsto \mathsf{fma}\left(b, 2 \cdot \left(\color{blue}{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot b} + \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + -1 \cdot a\right)\right), -2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      5. distribute-rgt1-in51.6%

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

        \[\leadsto \mathsf{fma}\left(b, 2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot b + \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\color{blue}{0} \cdot a\right)\right), -2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      7. mul0-lft51.6%

        \[\leadsto \mathsf{fma}\left(b, 2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot b + \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \color{blue}{0}\right), -2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      8. distribute-lft-out51.6%

        \[\leadsto \mathsf{fma}\left(b, 2 \cdot \color{blue}{\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + 0\right)\right)}, -2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      9. associate-*r*51.6%

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

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

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

Alternative 4: 61.4% accurate, 0.7× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \frac{angle\_m}{180} \cdot \pi\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\cos t\_0 \cdot \left(\sin t\_0 \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \leq -5 \cdot 10^{+265}:\\ \;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(b - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (/ angle_m 180.0) PI)))
   (*
    angle_s
    (if (<=
         (* (cos t_0) (* (sin t_0) (* 2.0 (- (pow b 2.0) (pow a 2.0)))))
         -5e+265)
      (* (* a 0.011111111111111112) (* (* angle_m PI) (- b a)))
      (*
       (*
        (* 2.0 (* (- b a) (+ b a)))
        (sin (* PI (* angle_m 0.005555555555555556))))
       (cos (* 0.005555555555555556 (* angle_m PI))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * ((double) M_PI);
	double tmp;
	if ((cos(t_0) * (sin(t_0) * (2.0 * (pow(b, 2.0) - pow(a, 2.0))))) <= -5e+265) {
		tmp = (a * 0.011111111111111112) * ((angle_m * ((double) M_PI)) * (b - a));
	} else {
		tmp = ((2.0 * ((b - a) * (b + a))) * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))) * cos((0.005555555555555556 * (angle_m * ((double) M_PI))));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (angle_m / 180.0) * Math.PI;
	double tmp;
	if ((Math.cos(t_0) * (Math.sin(t_0) * (2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))))) <= -5e+265) {
		tmp = (a * 0.011111111111111112) * ((angle_m * Math.PI) * (b - a));
	} else {
		tmp = ((2.0 * ((b - a) * (b + a))) * Math.sin((Math.PI * (angle_m * 0.005555555555555556)))) * Math.cos((0.005555555555555556 * (angle_m * Math.PI)));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = (angle_m / 180.0) * math.pi
	tmp = 0
	if (math.cos(t_0) * (math.sin(t_0) * (2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))))) <= -5e+265:
		tmp = (a * 0.011111111111111112) * ((angle_m * math.pi) * (b - a))
	else:
		tmp = ((2.0 * ((b - a) * (b + a))) * math.sin((math.pi * (angle_m * 0.005555555555555556)))) * math.cos((0.005555555555555556 * (angle_m * math.pi)))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(Float64(angle_m / 180.0) * pi)
	tmp = 0.0
	if (Float64(cos(t_0) * Float64(sin(t_0) * Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))))) <= -5e+265)
		tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(angle_m * pi) * Float64(b - a)));
	else
		tmp = Float64(Float64(Float64(2.0 * Float64(Float64(b - a) * Float64(b + a))) * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))) * cos(Float64(0.005555555555555556 * Float64(angle_m * pi))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = (angle_m / 180.0) * pi;
	tmp = 0.0;
	if ((cos(t_0) * (sin(t_0) * (2.0 * ((b ^ 2.0) - (a ^ 2.0))))) <= -5e+265)
		tmp = (a * 0.011111111111111112) * ((angle_m * pi) * (b - a));
	else
		tmp = ((2.0 * ((b - a) * (b + a))) * sin((pi * (angle_m * 0.005555555555555556)))) * cos((0.005555555555555556 * (angle_m * pi)));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e+265], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \frac{angle\_m}{180} \cdot \pi\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\cos t\_0 \cdot \left(\sin t\_0 \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \leq -5 \cdot 10^{+265}:\\
\;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(b - a\right)\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -5.0000000000000002e265

    1. Initial program 27.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. Add Preprocessing
    3. Taylor expanded in angle around 0 42.0%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow227.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. unpow227.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-squares27.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) \]
    5. Applied egg-rr42.0%

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

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

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

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

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

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

    if -5.0000000000000002e265 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64)))))

    1. Initial program 51.0%

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

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

        \[\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.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. Applied egg-rr55.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. Taylor expanded in angle around inf 53.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}{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative53.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 \cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)} \]
    7. Simplified53.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}{\cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)} \]
    8. Taylor expanded in angle around inf 56.3%

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

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

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

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

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

Alternative 5: 65.2% accurate, 0.7× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\ t_1 := {b}^{2} - {a}^{2}\\ t_2 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq 10^{+256}:\\ \;\;\;\;t\_0 \cdot \left(a \cdot \left(t\_2 \cdot \left(a \cdot -2\right)\right) + 2 \cdot \left(t\_2 \cdot {b}^{2}\right)\right)\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(angle\_m \cdot \pi\right) \cdot {a}^{2}\right) + b \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(t\_2 \cdot \left(2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (cos (* (/ angle_m 180.0) PI)))
        (t_1 (- (pow b 2.0) (pow a 2.0)))
        (t_2 (sin (* 0.005555555555555556 (* angle_m PI)))))
   (*
    angle_s
    (if (<= t_1 1e+256)
      (* t_0 (+ (* a (* t_2 (* a -2.0))) (* 2.0 (* t_2 (pow b 2.0)))))
      (if (<= t_1 INFINITY)
        (+
         (* -0.011111111111111112 (* (* angle_m PI) (pow a 2.0)))
         (*
          b
          (+
           (* 0.011111111111111112 (* angle_m (* b PI)))
           (* 0.011111111111111112 (* angle_m (* PI (- a a)))))))
        (* t_0 (* t_2 (* 2.0 (* (- b a) (+ b a))))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = cos(((angle_m / 180.0) * ((double) M_PI)));
	double t_1 = pow(b, 2.0) - pow(a, 2.0);
	double t_2 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
	double tmp;
	if (t_1 <= 1e+256) {
		tmp = t_0 * ((a * (t_2 * (a * -2.0))) + (2.0 * (t_2 * pow(b, 2.0))));
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = (-0.011111111111111112 * ((angle_m * ((double) M_PI)) * pow(a, 2.0))) + (b * ((0.011111111111111112 * (angle_m * (b * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (a - a))))));
	} else {
		tmp = t_0 * (t_2 * (2.0 * ((b - a) * (b + a))));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = Math.cos(((angle_m / 180.0) * Math.PI));
	double t_1 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
	double t_2 = Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
	double tmp;
	if (t_1 <= 1e+256) {
		tmp = t_0 * ((a * (t_2 * (a * -2.0))) + (2.0 * (t_2 * Math.pow(b, 2.0))));
	} else if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = (-0.011111111111111112 * ((angle_m * Math.PI) * Math.pow(a, 2.0))) + (b * ((0.011111111111111112 * (angle_m * (b * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (a - a))))));
	} else {
		tmp = t_0 * (t_2 * (2.0 * ((b - a) * (b + a))));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = math.cos(((angle_m / 180.0) * math.pi))
	t_1 = math.pow(b, 2.0) - math.pow(a, 2.0)
	t_2 = math.sin((0.005555555555555556 * (angle_m * math.pi)))
	tmp = 0
	if t_1 <= 1e+256:
		tmp = t_0 * ((a * (t_2 * (a * -2.0))) + (2.0 * (t_2 * math.pow(b, 2.0))))
	elif t_1 <= math.inf:
		tmp = (-0.011111111111111112 * ((angle_m * math.pi) * math.pow(a, 2.0))) + (b * ((0.011111111111111112 * (angle_m * (b * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (a - a))))))
	else:
		tmp = t_0 * (t_2 * (2.0 * ((b - a) * (b + a))))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = cos(Float64(Float64(angle_m / 180.0) * pi))
	t_1 = Float64((b ^ 2.0) - (a ^ 2.0))
	t_2 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))
	tmp = 0.0
	if (t_1 <= 1e+256)
		tmp = Float64(t_0 * Float64(Float64(a * Float64(t_2 * Float64(a * -2.0))) + Float64(2.0 * Float64(t_2 * (b ^ 2.0)))));
	elseif (t_1 <= Inf)
		tmp = Float64(Float64(-0.011111111111111112 * Float64(Float64(angle_m * pi) * (a ^ 2.0))) + Float64(b * Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(b * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a - a)))))));
	else
		tmp = Float64(t_0 * Float64(t_2 * Float64(2.0 * Float64(Float64(b - a) * Float64(b + a)))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = cos(((angle_m / 180.0) * pi));
	t_1 = (b ^ 2.0) - (a ^ 2.0);
	t_2 = sin((0.005555555555555556 * (angle_m * pi)));
	tmp = 0.0;
	if (t_1 <= 1e+256)
		tmp = t_0 * ((a * (t_2 * (a * -2.0))) + (2.0 * (t_2 * (b ^ 2.0))));
	elseif (t_1 <= Inf)
		tmp = (-0.011111111111111112 * ((angle_m * pi) * (a ^ 2.0))) + (b * ((0.011111111111111112 * (angle_m * (b * pi))) + (0.011111111111111112 * (angle_m * (pi * (a - a))))));
	else
		tmp = t_0 * (t_2 * (2.0 * ((b - a) * (b + a))));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, 1e+256], N[(t$95$0 * N[(N[(a * N[(t$95$2 * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$2 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(-0.011111111111111112 * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(N[(0.011111111111111112 * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(t$95$2 * N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(angle\_m \cdot \pi\right) \cdot {a}^{2}\right) + b \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\

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


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

    1. Initial program 52.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow252.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. unpow252.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-squares52.8%

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

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

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

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

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

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

    if 1e256 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0

    1. Initial program 37.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. Add Preprocessing
    3. Taylor expanded in angle around 0 45.7%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow237.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. unpow237.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-squares37.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) \]
    5. Applied egg-rr45.7%

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

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

    if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 0.0%

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

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

        \[\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.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. Applied egg-rr51.9%

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

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

        \[\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 \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    7. Simplified64.4%

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

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

Alternative 6: 59.7% accurate, 1.0× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \left(b - a\right) \cdot \left(b + a\right)\\ t_1 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\ t_2 := \sin t\_1\\ t_3 := \frac{angle\_m}{180} \cdot \pi\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-40}:\\ \;\;\;\;\cos t\_3 \cdot \left(2 \cdot \left(t\_2 \cdot {b}^{2}\right) + a \cdot \left(angle\_m \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot a\right) + 0.011111111111111112 \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+159}:\\ \;\;\;\;\cos \left(e^{\log \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(\left(2 \cdot t\_0\right) \cdot \sin t\_3\right)\\ \mathbf{else}:\\ \;\;\;\;{\left({\left(\left(2 \cdot \left(t\_2 \cdot t\_0\right)\right) \cdot \cos t\_1\right)}^{3}\right)}^{0.3333333333333333}\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (- b a) (+ b a)))
        (t_1 (* 0.005555555555555556 (* angle_m PI)))
        (t_2 (sin t_1))
        (t_3 (* (/ angle_m 180.0) PI)))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 5e-40)
      (*
       (cos t_3)
       (+
        (* 2.0 (* t_2 (pow b 2.0)))
        (*
         a
         (*
          angle_m
          (+
           (* -0.011111111111111112 (* PI a))
           (* 0.011111111111111112 (* PI (- b b))))))))
      (if (<= (/ angle_m 180.0) 1e+159)
        (*
         (cos (exp (log (* PI (* angle_m 0.005555555555555556)))))
         (* (* 2.0 t_0) (sin t_3)))
        (pow
         (pow (* (* 2.0 (* t_2 t_0)) (cos t_1)) 3.0)
         0.3333333333333333))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (b - a) * (b + a);
	double t_1 = 0.005555555555555556 * (angle_m * ((double) M_PI));
	double t_2 = sin(t_1);
	double t_3 = (angle_m / 180.0) * ((double) M_PI);
	double tmp;
	if ((angle_m / 180.0) <= 5e-40) {
		tmp = cos(t_3) * ((2.0 * (t_2 * pow(b, 2.0))) + (a * (angle_m * ((-0.011111111111111112 * (((double) M_PI) * a)) + (0.011111111111111112 * (((double) M_PI) * (b - b)))))));
	} else if ((angle_m / 180.0) <= 1e+159) {
		tmp = cos(exp(log((((double) M_PI) * (angle_m * 0.005555555555555556))))) * ((2.0 * t_0) * sin(t_3));
	} else {
		tmp = pow(pow(((2.0 * (t_2 * t_0)) * cos(t_1)), 3.0), 0.3333333333333333);
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = (b - a) * (b + a);
	double t_1 = 0.005555555555555556 * (angle_m * Math.PI);
	double t_2 = Math.sin(t_1);
	double t_3 = (angle_m / 180.0) * Math.PI;
	double tmp;
	if ((angle_m / 180.0) <= 5e-40) {
		tmp = Math.cos(t_3) * ((2.0 * (t_2 * Math.pow(b, 2.0))) + (a * (angle_m * ((-0.011111111111111112 * (Math.PI * a)) + (0.011111111111111112 * (Math.PI * (b - b)))))));
	} else if ((angle_m / 180.0) <= 1e+159) {
		tmp = Math.cos(Math.exp(Math.log((Math.PI * (angle_m * 0.005555555555555556))))) * ((2.0 * t_0) * Math.sin(t_3));
	} else {
		tmp = Math.pow(Math.pow(((2.0 * (t_2 * t_0)) * Math.cos(t_1)), 3.0), 0.3333333333333333);
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = (b - a) * (b + a)
	t_1 = 0.005555555555555556 * (angle_m * math.pi)
	t_2 = math.sin(t_1)
	t_3 = (angle_m / 180.0) * math.pi
	tmp = 0
	if (angle_m / 180.0) <= 5e-40:
		tmp = math.cos(t_3) * ((2.0 * (t_2 * math.pow(b, 2.0))) + (a * (angle_m * ((-0.011111111111111112 * (math.pi * a)) + (0.011111111111111112 * (math.pi * (b - b)))))))
	elif (angle_m / 180.0) <= 1e+159:
		tmp = math.cos(math.exp(math.log((math.pi * (angle_m * 0.005555555555555556))))) * ((2.0 * t_0) * math.sin(t_3))
	else:
		tmp = math.pow(math.pow(((2.0 * (t_2 * t_0)) * math.cos(t_1)), 3.0), 0.3333333333333333)
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(Float64(b - a) * Float64(b + a))
	t_1 = Float64(0.005555555555555556 * Float64(angle_m * pi))
	t_2 = sin(t_1)
	t_3 = Float64(Float64(angle_m / 180.0) * pi)
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e-40)
		tmp = Float64(cos(t_3) * Float64(Float64(2.0 * Float64(t_2 * (b ^ 2.0))) + Float64(a * Float64(angle_m * Float64(Float64(-0.011111111111111112 * Float64(pi * a)) + Float64(0.011111111111111112 * Float64(pi * Float64(b - b))))))));
	elseif (Float64(angle_m / 180.0) <= 1e+159)
		tmp = Float64(cos(exp(log(Float64(pi * Float64(angle_m * 0.005555555555555556))))) * Float64(Float64(2.0 * t_0) * sin(t_3)));
	else
		tmp = (Float64(Float64(2.0 * Float64(t_2 * t_0)) * cos(t_1)) ^ 3.0) ^ 0.3333333333333333;
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = (b - a) * (b + a);
	t_1 = 0.005555555555555556 * (angle_m * pi);
	t_2 = sin(t_1);
	t_3 = (angle_m / 180.0) * pi;
	tmp = 0.0;
	if ((angle_m / 180.0) <= 5e-40)
		tmp = cos(t_3) * ((2.0 * (t_2 * (b ^ 2.0))) + (a * (angle_m * ((-0.011111111111111112 * (pi * a)) + (0.011111111111111112 * (pi * (b - b)))))));
	elseif ((angle_m / 180.0) <= 1e+159)
		tmp = cos(exp(log((pi * (angle_m * 0.005555555555555556))))) * ((2.0 * t_0) * sin(t_3));
	else
		tmp = (((2.0 * (t_2 * t_0)) * cos(t_1)) ^ 3.0) ^ 0.3333333333333333;
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-40], N[(N[Cos[t$95$3], $MachinePrecision] * N[(N[(2.0 * N[(t$95$2 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(angle$95$m * N[(N[(-0.011111111111111112 * N[(Pi * a), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+159], N[(N[Cos[N[Exp[N[Log[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[(2.0 * t$95$0), $MachinePrecision] * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(N[(2.0 * N[(t$95$2 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+159}:\\
\;\;\;\;\cos \left(e^{\log \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(\left(2 \cdot t\_0\right) \cdot \sin t\_3\right)\\

\mathbf{else}:\\
\;\;\;\;{\left({\left(\left(2 \cdot \left(t\_2 \cdot t\_0\right)\right) \cdot \cos t\_1\right)}^{3}\right)}^{0.3333333333333333}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999965e-40

    1. Initial program 53.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow253.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. unpow253.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-squares57.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. Applied egg-rr57.1%

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

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

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

    if 4.99999999999999965e-40 < (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999993e158

    1. Initial program 33.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow233.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. unpow233.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-squares38.3%

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

      \[\leadsto \left(\left(2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Step-by-step derivation
      1. add-exp-log44.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(e^{\log \left(\pi \cdot \frac{angle}{180}\right)}\right)} \]
      2. div-inv44.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 \left(e^{\log \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right)}\right) \]
      3. metadata-eval44.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 \left(e^{\log \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right)}\right) \]
    6. Applied egg-rr44.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(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)} \]

    if 9.9999999999999993e158 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.0%

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

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

        \[\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-squares24.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. Applied egg-rr24.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. Step-by-step derivation
      1. add-cbrt-cube23.3%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \color{blue}{\sqrt[3]{\left(\left(b - a\right) \cdot \left(b - a\right)\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) \]
      2. pow323.3%

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

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

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

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

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

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

Alternative 7: 60.9% accurate, 1.8× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\ t_1 := \left(b - a\right) \cdot \left(b + a\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-40}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+185}:\\ \;\;\;\;\left(2 \cdot \cos t\_0\right) \cdot \left(\sin t\_0 \cdot t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(2 \cdot \left(\pi \cdot \left(angle\_m \cdot -0.005555555555555556\right)\right)\right) \cdot \frac{2 \cdot t\_1}{2}\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* 0.005555555555555556 (* angle_m PI)))
        (t_1 (* (- b a) (+ b a))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 5e-40)
      (+
       (* 0.011111111111111112 (* angle_m (* PI (pow b 2.0))))
       (*
        a
        (+
         (* -0.011111111111111112 (* (* angle_m PI) a))
         (* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
      (if (<= (/ angle_m 180.0) 5e+185)
        (* (* 2.0 (cos t_0)) (* (sin t_0) t_1))
        (*
         (sin (* 2.0 (* PI (* angle_m -0.005555555555555556))))
         (/ (* 2.0 t_1) 2.0)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = 0.005555555555555556 * (angle_m * ((double) M_PI));
	double t_1 = (b - a) * (b + a);
	double tmp;
	if ((angle_m / 180.0) <= 5e-40) {
		tmp = (0.011111111111111112 * (angle_m * (((double) M_PI) * pow(b, 2.0)))) + (a * ((-0.011111111111111112 * ((angle_m * ((double) M_PI)) * a)) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
	} else if ((angle_m / 180.0) <= 5e+185) {
		tmp = (2.0 * cos(t_0)) * (sin(t_0) * t_1);
	} else {
		tmp = sin((2.0 * (((double) M_PI) * (angle_m * -0.005555555555555556)))) * ((2.0 * t_1) / 2.0);
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = 0.005555555555555556 * (angle_m * Math.PI);
	double t_1 = (b - a) * (b + a);
	double tmp;
	if ((angle_m / 180.0) <= 5e-40) {
		tmp = (0.011111111111111112 * (angle_m * (Math.PI * Math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * ((angle_m * Math.PI) * a)) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
	} else if ((angle_m / 180.0) <= 5e+185) {
		tmp = (2.0 * Math.cos(t_0)) * (Math.sin(t_0) * t_1);
	} else {
		tmp = Math.sin((2.0 * (Math.PI * (angle_m * -0.005555555555555556)))) * ((2.0 * t_1) / 2.0);
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = 0.005555555555555556 * (angle_m * math.pi)
	t_1 = (b - a) * (b + a)
	tmp = 0
	if (angle_m / 180.0) <= 5e-40:
		tmp = (0.011111111111111112 * (angle_m * (math.pi * math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * ((angle_m * math.pi) * a)) + (0.011111111111111112 * (angle_m * (math.pi * (b - b))))))
	elif (angle_m / 180.0) <= 5e+185:
		tmp = (2.0 * math.cos(t_0)) * (math.sin(t_0) * t_1)
	else:
		tmp = math.sin((2.0 * (math.pi * (angle_m * -0.005555555555555556)))) * ((2.0 * t_1) / 2.0)
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(0.005555555555555556 * Float64(angle_m * pi))
	t_1 = Float64(Float64(b - a) * Float64(b + a))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e-40)
		tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * (b ^ 2.0)))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(Float64(angle_m * pi) * a)) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b)))))));
	elseif (Float64(angle_m / 180.0) <= 5e+185)
		tmp = Float64(Float64(2.0 * cos(t_0)) * Float64(sin(t_0) * t_1));
	else
		tmp = Float64(sin(Float64(2.0 * Float64(pi * Float64(angle_m * -0.005555555555555556)))) * Float64(Float64(2.0 * t_1) / 2.0));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = 0.005555555555555556 * (angle_m * pi);
	t_1 = (b - a) * (b + a);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 5e-40)
		tmp = (0.011111111111111112 * (angle_m * (pi * (b ^ 2.0)))) + (a * ((-0.011111111111111112 * ((angle_m * pi) * a)) + (0.011111111111111112 * (angle_m * (pi * (b - b))))));
	elseif ((angle_m / 180.0) <= 5e+185)
		tmp = (2.0 * cos(t_0)) * (sin(t_0) * t_1);
	else
		tmp = sin((2.0 * (pi * (angle_m * -0.005555555555555556)))) * ((2.0 * t_1) / 2.0);
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-40], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(N[(angle$95$m * Pi), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+185], N[(N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(2.0 * N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(2.0 * t$95$1), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\
t_1 := \left(b - a\right) \cdot \left(b + a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-40}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+185}:\\
\;\;\;\;\left(2 \cdot \cos t\_0\right) \cdot \left(\sin t\_0 \cdot t\_1\right)\\

\mathbf{else}:\\
\;\;\;\;\sin \left(2 \cdot \left(\pi \cdot \left(angle\_m \cdot -0.005555555555555556\right)\right)\right) \cdot \frac{2 \cdot t\_1}{2}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999965e-40

    1. Initial program 53.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. Add Preprocessing
    3. Taylor expanded in angle around 0 51.5%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow253.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. unpow253.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-squares57.1%

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

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

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

    if 4.99999999999999965e-40 < (/.f64 angle #s(literal 180 binary64)) < 4.9999999999999999e185

    1. Initial program 30.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow230.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. unpow230.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-squares35.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. Applied egg-rr35.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. Step-by-step derivation
      1. add-cbrt-cube34.2%

        \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \color{blue}{\sqrt[3]{\left(\left(b - a\right) \cdot \left(b - a\right)\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) \]
      2. pow334.2%

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

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

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

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

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

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

    if 4.9999999999999999e185 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 26.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l*26.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sin \left(2 \cdot \left(\left(-0.005555555555555556 \cdot angle\right) \cdot \pi\right)\right) \cdot \frac{2 \cdot \left({b}^{2} - {a}^{2}\right)}{2}} \]
    7. Step-by-step derivation
      1. unpow226.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. unpow226.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-squares26.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) \]
    8. Applied egg-rr34.9%

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

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

Alternative 8: 60.0% accurate, 1.9× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+219}:\\ \;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \left(angle\_m \cdot \pi\right) \cdot {a}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\left(\pi \cdot a\right) \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= (pow a 2.0) 5e+219)
    (*
     0.011111111111111112
     (- (* b (* angle_m (* b PI))) (* (* angle_m PI) (pow a 2.0))))
    (* (- b a) (* (* PI a) (* angle_m 0.011111111111111112))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (pow(a, 2.0) <= 5e+219) {
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * ((double) M_PI)))) - ((angle_m * ((double) M_PI)) * pow(a, 2.0)));
	} else {
		tmp = (b - a) * ((((double) M_PI) * a) * (angle_m * 0.011111111111111112));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (Math.pow(a, 2.0) <= 5e+219) {
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * Math.PI))) - ((angle_m * Math.PI) * Math.pow(a, 2.0)));
	} else {
		tmp = (b - a) * ((Math.PI * a) * (angle_m * 0.011111111111111112));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if math.pow(a, 2.0) <= 5e+219:
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * math.pi))) - ((angle_m * math.pi) * math.pow(a, 2.0)))
	else:
		tmp = (b - a) * ((math.pi * a) * (angle_m * 0.011111111111111112))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if ((a ^ 2.0) <= 5e+219)
		tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(angle_m * Float64(b * pi))) - Float64(Float64(angle_m * pi) * (a ^ 2.0))));
	else
		tmp = Float64(Float64(b - a) * Float64(Float64(pi * a) * Float64(angle_m * 0.011111111111111112)));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if ((a ^ 2.0) <= 5e+219)
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * pi))) - ((angle_m * pi) * (a ^ 2.0)));
	else
		tmp = (b - a) * ((pi * a) * (angle_m * 0.011111111111111112));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+219], N[(0.011111111111111112 * N[(N[(b * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(angle$95$m * Pi), $MachinePrecision] * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * N[(N[(Pi * a), $MachinePrecision] * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 a #s(literal 2 binary64)) < 5e219

    1. Initial program 50.0%

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(b \cdot \left(angle \cdot \left(b \cdot \pi\right) + angle \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right)} \]
      4. distribute-lft-out51.0%

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \color{blue}{\left(angle \cdot \left(b \cdot \pi + \pi \cdot \left(a + -1 \cdot a\right)\right)\right)} - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      5. distribute-rgt1-in51.0%

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

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

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

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

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

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

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

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

    if 5e219 < (pow.f64 a #s(literal 2 binary64))

    1. Initial program 37.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. Add Preprocessing
    3. Taylor expanded in angle around 0 29.4%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow237.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. unpow237.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-squares49.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 57.6% accurate, 1.9× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{a}^{2} \leq 10^{+213}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(b \cdot \left(b \cdot \pi\right) - \pi \cdot {a}^{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\left(\pi \cdot a\right) \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= (pow a 2.0) 1e+213)
    (* 0.011111111111111112 (* angle_m (- (* b (* b PI)) (* PI (pow a 2.0)))))
    (* (- b a) (* (* PI a) (* angle_m 0.011111111111111112))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (pow(a, 2.0) <= 1e+213) {
		tmp = 0.011111111111111112 * (angle_m * ((b * (b * ((double) M_PI))) - (((double) M_PI) * pow(a, 2.0))));
	} else {
		tmp = (b - a) * ((((double) M_PI) * a) * (angle_m * 0.011111111111111112));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (Math.pow(a, 2.0) <= 1e+213) {
		tmp = 0.011111111111111112 * (angle_m * ((b * (b * Math.PI)) - (Math.PI * Math.pow(a, 2.0))));
	} else {
		tmp = (b - a) * ((Math.PI * a) * (angle_m * 0.011111111111111112));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if math.pow(a, 2.0) <= 1e+213:
		tmp = 0.011111111111111112 * (angle_m * ((b * (b * math.pi)) - (math.pi * math.pow(a, 2.0))))
	else:
		tmp = (b - a) * ((math.pi * a) * (angle_m * 0.011111111111111112))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if ((a ^ 2.0) <= 1e+213)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(b * Float64(b * pi)) - Float64(pi * (a ^ 2.0)))));
	else
		tmp = Float64(Float64(b - a) * Float64(Float64(pi * a) * Float64(angle_m * 0.011111111111111112)));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if ((a ^ 2.0) <= 1e+213)
		tmp = 0.011111111111111112 * (angle_m * ((b * (b * pi)) - (pi * (a ^ 2.0))));
	else
		tmp = (b - a) * ((pi * a) * (angle_m * 0.011111111111111112));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 1e+213], N[(0.011111111111111112 * N[(angle$95$m * N[(N[(b * N[(b * Pi), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * N[(N[(Pi * a), $MachinePrecision] * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 a #s(literal 2 binary64)) < 9.99999999999999984e212

    1. Initial program 50.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \color{blue}{\left(\pi \cdot \left(b + 0\right)\right)} - {a}^{2} \cdot \pi\right)\right) \]
      9. +-rgt-identity48.8%

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

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

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

    if 9.99999999999999984e212 < (pow.f64 a #s(literal 2 binary64))

    1. Initial program 37.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. Add Preprocessing
    3. Taylor expanded in angle around 0 29.1%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow237.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. unpow237.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 58.2% accurate, 3.1× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := 2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\\ t_1 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-40}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+156}:\\ \;\;\;\;t\_0 \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\\ \mathbf{else}:\\ \;\;\;\;\cos t\_1 \cdot \left(t\_0 \cdot t\_1\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* 2.0 (* (- b a) (+ b a))))
        (t_1 (* 0.005555555555555556 (* angle_m PI))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 5e-40)
      (+
       (* 0.011111111111111112 (* angle_m (* PI (pow b 2.0))))
       (*
        a
        (+
         (* -0.011111111111111112 (* (* angle_m PI) a))
         (* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
      (if (<= (/ angle_m 180.0) 1e+156)
        (* t_0 (sin (* (/ angle_m 180.0) PI)))
        (* (cos t_1) (* t_0 t_1)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = 2.0 * ((b - a) * (b + a));
	double t_1 = 0.005555555555555556 * (angle_m * ((double) M_PI));
	double tmp;
	if ((angle_m / 180.0) <= 5e-40) {
		tmp = (0.011111111111111112 * (angle_m * (((double) M_PI) * pow(b, 2.0)))) + (a * ((-0.011111111111111112 * ((angle_m * ((double) M_PI)) * a)) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
	} else if ((angle_m / 180.0) <= 1e+156) {
		tmp = t_0 * sin(((angle_m / 180.0) * ((double) M_PI)));
	} else {
		tmp = cos(t_1) * (t_0 * t_1);
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = 2.0 * ((b - a) * (b + a));
	double t_1 = 0.005555555555555556 * (angle_m * Math.PI);
	double tmp;
	if ((angle_m / 180.0) <= 5e-40) {
		tmp = (0.011111111111111112 * (angle_m * (Math.PI * Math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * ((angle_m * Math.PI) * a)) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
	} else if ((angle_m / 180.0) <= 1e+156) {
		tmp = t_0 * Math.sin(((angle_m / 180.0) * Math.PI));
	} else {
		tmp = Math.cos(t_1) * (t_0 * t_1);
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = 2.0 * ((b - a) * (b + a))
	t_1 = 0.005555555555555556 * (angle_m * math.pi)
	tmp = 0
	if (angle_m / 180.0) <= 5e-40:
		tmp = (0.011111111111111112 * (angle_m * (math.pi * math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * ((angle_m * math.pi) * a)) + (0.011111111111111112 * (angle_m * (math.pi * (b - b))))))
	elif (angle_m / 180.0) <= 1e+156:
		tmp = t_0 * math.sin(((angle_m / 180.0) * math.pi))
	else:
		tmp = math.cos(t_1) * (t_0 * t_1)
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(2.0 * Float64(Float64(b - a) * Float64(b + a)))
	t_1 = Float64(0.005555555555555556 * Float64(angle_m * pi))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e-40)
		tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * (b ^ 2.0)))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(Float64(angle_m * pi) * a)) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b)))))));
	elseif (Float64(angle_m / 180.0) <= 1e+156)
		tmp = Float64(t_0 * sin(Float64(Float64(angle_m / 180.0) * pi)));
	else
		tmp = Float64(cos(t_1) * Float64(t_0 * t_1));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = 2.0 * ((b - a) * (b + a));
	t_1 = 0.005555555555555556 * (angle_m * pi);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 5e-40)
		tmp = (0.011111111111111112 * (angle_m * (pi * (b ^ 2.0)))) + (a * ((-0.011111111111111112 * ((angle_m * pi) * a)) + (0.011111111111111112 * (angle_m * (pi * (b - b))))));
	elseif ((angle_m / 180.0) <= 1e+156)
		tmp = t_0 * sin(((angle_m / 180.0) * pi));
	else
		tmp = cos(t_1) * (t_0 * t_1);
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-40], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(N[(angle$95$m * Pi), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+156], N[(t$95$0 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$1], $MachinePrecision] * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\\
t_1 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-40}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+156}:\\
\;\;\;\;t\_0 \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999965e-40

    1. Initial program 53.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. Add Preprocessing
    3. Taylor expanded in angle around 0 51.5%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow253.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. unpow253.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-squares57.1%

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

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

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

    if 4.99999999999999965e-40 < (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999998e155

    1. Initial program 33.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow233.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. unpow233.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-squares38.3%

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

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

      \[\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)} \]
    6. Step-by-step derivation
      1. *-commutative33.0%

        \[\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)} \]
    7. Simplified33.0%

      \[\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(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)} \]
    8. Taylor expanded in angle around 0 39.0%

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

    if 9.9999999999999998e155 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.0%

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

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

        \[\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-squares24.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. Applied egg-rr24.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. Taylor expanded in angle around inf 25.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}{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative25.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 \cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)} \]
    7. Simplified25.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}{\cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)} \]
    8. Taylor expanded in angle around 0 21.3%

      \[\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 \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
    9. Step-by-step derivation
      1. *-commutative21.3%

        \[\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 \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
    10. Simplified21.3%

      \[\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 \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.5%

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

Alternative 11: 58.1% accurate, 3.1× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := 2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\\ t_1 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-40}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right) + a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - \left(angle\_m \cdot \pi\right) \cdot a\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+156}:\\ \;\;\;\;t\_0 \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\\ \mathbf{else}:\\ \;\;\;\;\cos t\_1 \cdot \left(t\_0 \cdot t\_1\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* 2.0 (* (- b a) (+ b a))))
        (t_1 (* 0.005555555555555556 (* angle_m PI))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 5e-40)
      (*
       0.011111111111111112
       (+
        (* angle_m (* PI (pow b 2.0)))
        (* a (- (* angle_m (* PI (- b b))) (* (* angle_m PI) a)))))
      (if (<= (/ angle_m 180.0) 1e+156)
        (* t_0 (sin (* (/ angle_m 180.0) PI)))
        (* (cos t_1) (* t_0 t_1)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = 2.0 * ((b - a) * (b + a));
	double t_1 = 0.005555555555555556 * (angle_m * ((double) M_PI));
	double tmp;
	if ((angle_m / 180.0) <= 5e-40) {
		tmp = 0.011111111111111112 * ((angle_m * (((double) M_PI) * pow(b, 2.0))) + (a * ((angle_m * (((double) M_PI) * (b - b))) - ((angle_m * ((double) M_PI)) * a))));
	} else if ((angle_m / 180.0) <= 1e+156) {
		tmp = t_0 * sin(((angle_m / 180.0) * ((double) M_PI)));
	} else {
		tmp = cos(t_1) * (t_0 * t_1);
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = 2.0 * ((b - a) * (b + a));
	double t_1 = 0.005555555555555556 * (angle_m * Math.PI);
	double tmp;
	if ((angle_m / 180.0) <= 5e-40) {
		tmp = 0.011111111111111112 * ((angle_m * (Math.PI * Math.pow(b, 2.0))) + (a * ((angle_m * (Math.PI * (b - b))) - ((angle_m * Math.PI) * a))));
	} else if ((angle_m / 180.0) <= 1e+156) {
		tmp = t_0 * Math.sin(((angle_m / 180.0) * Math.PI));
	} else {
		tmp = Math.cos(t_1) * (t_0 * t_1);
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = 2.0 * ((b - a) * (b + a))
	t_1 = 0.005555555555555556 * (angle_m * math.pi)
	tmp = 0
	if (angle_m / 180.0) <= 5e-40:
		tmp = 0.011111111111111112 * ((angle_m * (math.pi * math.pow(b, 2.0))) + (a * ((angle_m * (math.pi * (b - b))) - ((angle_m * math.pi) * a))))
	elif (angle_m / 180.0) <= 1e+156:
		tmp = t_0 * math.sin(((angle_m / 180.0) * math.pi))
	else:
		tmp = math.cos(t_1) * (t_0 * t_1)
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(2.0 * Float64(Float64(b - a) * Float64(b + a)))
	t_1 = Float64(0.005555555555555556 * Float64(angle_m * pi))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 5e-40)
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64(pi * (b ^ 2.0))) + Float64(a * Float64(Float64(angle_m * Float64(pi * Float64(b - b))) - Float64(Float64(angle_m * pi) * a)))));
	elseif (Float64(angle_m / 180.0) <= 1e+156)
		tmp = Float64(t_0 * sin(Float64(Float64(angle_m / 180.0) * pi)));
	else
		tmp = Float64(cos(t_1) * Float64(t_0 * t_1));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	t_0 = 2.0 * ((b - a) * (b + a));
	t_1 = 0.005555555555555556 * (angle_m * pi);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 5e-40)
		tmp = 0.011111111111111112 * ((angle_m * (pi * (b ^ 2.0))) + (a * ((angle_m * (pi * (b - b))) - ((angle_m * pi) * a))));
	elseif ((angle_m / 180.0) <= 1e+156)
		tmp = t_0 * sin(((angle_m / 180.0) * pi));
	else
		tmp = cos(t_1) * (t_0 * t_1);
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-40], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(angle$95$m * Pi), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+156], N[(t$95$0 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$1], $MachinePrecision] * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\\
t_1 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-40}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right) + a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - \left(angle\_m \cdot \pi\right) \cdot a\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+156}:\\
\;\;\;\;t\_0 \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999965e-40

    1. Initial program 53.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. Add Preprocessing
    3. Taylor expanded in angle around 0 51.5%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow253.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. unpow253.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-squares57.1%

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

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

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

    if 4.99999999999999965e-40 < (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999998e155

    1. Initial program 33.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow233.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. unpow233.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-squares38.3%

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

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

      \[\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)} \]
    6. Step-by-step derivation
      1. *-commutative33.0%

        \[\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)} \]
    7. Simplified33.0%

      \[\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(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)} \]
    8. Taylor expanded in angle around 0 39.0%

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

    if 9.9999999999999998e155 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.0%

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

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

        \[\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-squares24.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. Applied egg-rr24.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. Taylor expanded in angle around inf 25.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}{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative25.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 \cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)} \]
    7. Simplified25.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}{\cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)} \]
    8. Taylor expanded in angle around 0 21.3%

      \[\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 \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
    9. Step-by-step derivation
      1. *-commutative21.3%

        \[\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 \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
    10. Simplified21.3%

      \[\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 \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.2%

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

Alternative 12: 57.7% accurate, 3.5× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;a \leq 5.2 \cdot 10^{+172}:\\ \;\;\;\;\left(2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\left(\pi \cdot a\right) \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= a 5.2e+172)
    (* (* 2.0 (* (- b a) (+ b a))) (sin (* (/ angle_m 180.0) PI)))
    (* (- b a) (* (* PI a) (* angle_m 0.011111111111111112))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (a <= 5.2e+172) {
		tmp = (2.0 * ((b - a) * (b + a))) * sin(((angle_m / 180.0) * ((double) M_PI)));
	} else {
		tmp = (b - a) * ((((double) M_PI) * a) * (angle_m * 0.011111111111111112));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (a <= 5.2e+172) {
		tmp = (2.0 * ((b - a) * (b + a))) * Math.sin(((angle_m / 180.0) * Math.PI));
	} else {
		tmp = (b - a) * ((Math.PI * a) * (angle_m * 0.011111111111111112));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if a <= 5.2e+172:
		tmp = (2.0 * ((b - a) * (b + a))) * math.sin(((angle_m / 180.0) * math.pi))
	else:
		tmp = (b - a) * ((math.pi * a) * (angle_m * 0.011111111111111112))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (a <= 5.2e+172)
		tmp = Float64(Float64(2.0 * Float64(Float64(b - a) * Float64(b + a))) * sin(Float64(Float64(angle_m / 180.0) * pi)));
	else
		tmp = Float64(Float64(b - a) * Float64(Float64(pi * a) * Float64(angle_m * 0.011111111111111112)));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (a <= 5.2e+172)
		tmp = (2.0 * ((b - a) * (b + a))) * sin(((angle_m / 180.0) * pi));
	else
		tmp = (b - a) * ((pi * a) * (angle_m * 0.011111111111111112));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 5.2e+172], N[(N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * N[(N[(Pi * a), $MachinePrecision] * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 5.2 \cdot 10^{+172}:\\
\;\;\;\;\left(2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 5.2e172

    1. Initial program 47.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow247.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. unpow247.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-squares49.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. Applied egg-rr49.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) \]
    5. Taylor expanded in angle around inf 48.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}{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative48.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 \cos \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)} \]
    7. Simplified48.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}{\cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)} \]
    8. Taylor expanded in angle around 0 50.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}{1} \]

    if 5.2e172 < a

    1. Initial program 36.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. Add Preprocessing
    3. Taylor expanded in angle around 0 23.1%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow236.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. unpow236.7%

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

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

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

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

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

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

        \[\leadsto {\left(\left(0.011111111111111112 \cdot angle\right) \cdot \color{blue}{\left(\left(\pi \cdot a\right) \cdot \left(b - a\right)\right)}\right)}^{1} \]
    8. Applied egg-rr37.4%

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

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

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

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

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

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

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

Alternative 13: 57.7% accurate, 3.5× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+219}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\left(\pi \cdot a\right) \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= (pow a 2.0) 5e+219)
    (* 0.011111111111111112 (* angle_m (* PI (* (- b a) (+ b a)))))
    (* (- b a) (* (* PI a) (* angle_m 0.011111111111111112))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (pow(a, 2.0) <= 5e+219) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * ((b - a) * (b + a))));
	} else {
		tmp = (b - a) * ((((double) M_PI) * a) * (angle_m * 0.011111111111111112));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (Math.pow(a, 2.0) <= 5e+219) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * ((b - a) * (b + a))));
	} else {
		tmp = (b - a) * ((Math.PI * a) * (angle_m * 0.011111111111111112));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if math.pow(a, 2.0) <= 5e+219:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * ((b - a) * (b + a))))
	else:
		tmp = (b - a) * ((math.pi * a) * (angle_m * 0.011111111111111112))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if ((a ^ 2.0) <= 5e+219)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(b - a) * Float64(b + a)))));
	else
		tmp = Float64(Float64(b - a) * Float64(Float64(pi * a) * Float64(angle_m * 0.011111111111111112)));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if ((a ^ 2.0) <= 5e+219)
		tmp = 0.011111111111111112 * (angle_m * (pi * ((b - a) * (b + a))));
	else
		tmp = (b - a) * ((pi * a) * (angle_m * 0.011111111111111112));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+219], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * N[(N[(Pi * a), $MachinePrecision] * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 a #s(literal 2 binary64)) < 5e219

    1. Initial program 50.0%

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

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

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

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

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

    if 5e219 < (pow.f64 a #s(literal 2 binary64))

    1. Initial program 37.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. Add Preprocessing
    3. Taylor expanded in angle around 0 29.4%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow237.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. unpow237.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-squares49.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 44.6% accurate, 26.2× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;a \leq 1.5 \cdot 10^{+14}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b \cdot \left(b - a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\left(\pi \cdot a\right) \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= a 1.5e+14)
    (* 0.011111111111111112 (* angle_m (* PI (* b (- b a)))))
    (* (- b a) (* (* PI a) (* angle_m 0.011111111111111112))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (a <= 1.5e+14) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b * (b - a))));
	} else {
		tmp = (b - a) * ((((double) M_PI) * a) * (angle_m * 0.011111111111111112));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (a <= 1.5e+14) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b * (b - a))));
	} else {
		tmp = (b - a) * ((Math.PI * a) * (angle_m * 0.011111111111111112));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if a <= 1.5e+14:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (b * (b - a))))
	else:
		tmp = (b - a) * ((math.pi * a) * (angle_m * 0.011111111111111112))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (a <= 1.5e+14)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b * Float64(b - a)))));
	else
		tmp = Float64(Float64(b - a) * Float64(Float64(pi * a) * Float64(angle_m * 0.011111111111111112)));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (a <= 1.5e+14)
		tmp = 0.011111111111111112 * (angle_m * (pi * (b * (b - a))));
	else
		tmp = (b - a) * ((pi * a) * (angle_m * 0.011111111111111112));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 1.5e+14], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * N[(N[(Pi * a), $MachinePrecision] * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.5e14

    1. Initial program 49.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. Add Preprocessing
    3. Taylor expanded in angle around 0 46.9%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow249.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. unpow249.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-squares50.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) \]
    5. Applied egg-rr48.0%

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

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

    if 1.5e14 < a

    1. Initial program 34.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. Add Preprocessing
    3. Taylor expanded in angle around 0 28.1%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow234.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. unpow234.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-squares46.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) \]
    5. Applied egg-rr36.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 44.6% accurate, 26.2× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;a \leq 56000000000000:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b \cdot \left(b - a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(b - a\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= a 56000000000000.0)
    (* 0.011111111111111112 (* angle_m (* PI (* b (- b a)))))
    (* (* a 0.011111111111111112) (* (* angle_m PI) (- b a))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (a <= 56000000000000.0) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b * (b - a))));
	} else {
		tmp = (a * 0.011111111111111112) * ((angle_m * ((double) M_PI)) * (b - a));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (a <= 56000000000000.0) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b * (b - a))));
	} else {
		tmp = (a * 0.011111111111111112) * ((angle_m * Math.PI) * (b - a));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if a <= 56000000000000.0:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (b * (b - a))))
	else:
		tmp = (a * 0.011111111111111112) * ((angle_m * math.pi) * (b - a))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (a <= 56000000000000.0)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b * Float64(b - a)))));
	else
		tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(angle_m * pi) * Float64(b - a)));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (a <= 56000000000000.0)
		tmp = 0.011111111111111112 * (angle_m * (pi * (b * (b - a))));
	else
		tmp = (a * 0.011111111111111112) * ((angle_m * pi) * (b - a));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 56000000000000.0], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 56000000000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b \cdot \left(b - a\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 5.6e13

    1. Initial program 49.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. Add Preprocessing
    3. Taylor expanded in angle around 0 46.9%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow249.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. unpow249.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-squares50.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) \]
    5. Applied egg-rr48.0%

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

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

    if 5.6e13 < a

    1. Initial program 34.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. Add Preprocessing
    3. Taylor expanded in angle around 0 28.1%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow234.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. unpow234.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-squares46.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) \]
    5. Applied egg-rr36.2%

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

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

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

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

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

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

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

Alternative 16: 44.6% accurate, 26.2× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;a \leq 14500000000000:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b \cdot \left(b - a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(b - a\right) \cdot \left(angle\_m \cdot \left(\pi \cdot a\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= a 14500000000000.0)
    (* 0.011111111111111112 (* angle_m (* PI (* b (- b a)))))
    (* 0.011111111111111112 (* (- b a) (* angle_m (* PI a)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (a <= 14500000000000.0) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b * (b - a))));
	} else {
		tmp = 0.011111111111111112 * ((b - a) * (angle_m * (((double) M_PI) * a)));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (a <= 14500000000000.0) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b * (b - a))));
	} else {
		tmp = 0.011111111111111112 * ((b - a) * (angle_m * (Math.PI * a)));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if a <= 14500000000000.0:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (b * (b - a))))
	else:
		tmp = 0.011111111111111112 * ((b - a) * (angle_m * (math.pi * a)))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (a <= 14500000000000.0)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b * Float64(b - a)))));
	else
		tmp = Float64(0.011111111111111112 * Float64(Float64(b - a) * Float64(angle_m * Float64(pi * a))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (a <= 14500000000000.0)
		tmp = 0.011111111111111112 * (angle_m * (pi * (b * (b - a))));
	else
		tmp = 0.011111111111111112 * ((b - a) * (angle_m * (pi * a)));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 14500000000000.0], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(b - a), $MachinePrecision] * N[(angle$95$m * N[(Pi * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 14500000000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b \cdot \left(b - a\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.45e13

    1. Initial program 49.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. Add Preprocessing
    3. Taylor expanded in angle around 0 46.9%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow249.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. unpow249.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-squares50.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) \]
    5. Applied egg-rr48.0%

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

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

    if 1.45e13 < a

    1. Initial program 34.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. Add Preprocessing
    3. Taylor expanded in angle around 0 28.1%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow234.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. unpow234.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-squares46.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) \]
    5. Applied egg-rr36.2%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot {\left(angle \cdot \color{blue}{\left(\left(\pi \cdot a\right) \cdot \left(b - a\right)\right)}\right)}^{1} \]
    8. Applied egg-rr32.7%

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

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

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

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

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

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

Alternative 17: 43.1% accurate, 26.2× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b \leq 1.5:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a \cdot \left(b - a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b \cdot \left(b - a\right)\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= b 1.5)
    (* 0.011111111111111112 (* angle_m (* PI (* a (- b a)))))
    (* 0.011111111111111112 (* angle_m (* PI (* b (- b a))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (b <= 1.5) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (a * (b - a))));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b * (b - a))));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (b <= 1.5) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (a * (b - a))));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b * (b - a))));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if b <= 1.5:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (a * (b - a))))
	else:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (b * (b - a))))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (b <= 1.5)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a * Float64(b - a)))));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b * Float64(b - a)))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (b <= 1.5)
		tmp = 0.011111111111111112 * (angle_m * (pi * (a * (b - a))));
	else
		tmp = 0.011111111111111112 * (angle_m * (pi * (b * (b - a))));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 1.5], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 1.5:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a \cdot \left(b - a\right)\right)\right)\right)\\

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


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

    1. Initial program 49.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. Add Preprocessing
    3. Taylor expanded in angle around 0 44.8%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow249.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. unpow249.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-squares50.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) \]
    5. Applied egg-rr45.9%

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

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

    if 1.5 < b

    1. Initial program 38.7%

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

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. difference-of-squares47.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) \]
    5. Applied egg-rr45.1%

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

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

Alternative 18: 35.8% accurate, 26.2× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 1.05 \cdot 10^{+63}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a \cdot \left(b - a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= angle_m 1.05e+63)
    (* 0.011111111111111112 (* angle_m (* PI (* a (- b a)))))
    (* 0.011111111111111112 (* a (* angle_m (* b PI)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (angle_m <= 1.05e+63) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (a * (b - a))));
	} else {
		tmp = 0.011111111111111112 * (a * (angle_m * (b * ((double) M_PI))));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (angle_m <= 1.05e+63) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (a * (b - a))));
	} else {
		tmp = 0.011111111111111112 * (a * (angle_m * (b * Math.PI)));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if angle_m <= 1.05e+63:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (a * (b - a))))
	else:
		tmp = 0.011111111111111112 * (a * (angle_m * (b * math.pi)))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (angle_m <= 1.05e+63)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a * Float64(b - a)))));
	else
		tmp = Float64(0.011111111111111112 * Float64(a * Float64(angle_m * Float64(b * pi))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (angle_m <= 1.05e+63)
		tmp = 0.011111111111111112 * (angle_m * (pi * (a * (b - a))));
	else
		tmp = 0.011111111111111112 * (a * (angle_m * (b * pi)));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 1.05e+63], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


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

    1. Initial program 52.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. Add Preprocessing
    3. Taylor expanded in angle around 0 50.5%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. unpow252.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. unpow252.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-squares56.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) \]
    5. Applied egg-rr53.7%

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

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

    if 1.0500000000000001e63 < angle

    1. Initial program 26.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 34.7% accurate, 27.9× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 3 \cdot 10^{+162}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a \cdot \left(-a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot \left(angle\_m \cdot b\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= angle_m 3e+162)
    (* 0.011111111111111112 (* angle_m (* PI (* a (- a)))))
    (* 0.011111111111111112 (* a (* PI (* angle_m b)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (angle_m <= 3e+162) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (a * -a)));
	} else {
		tmp = 0.011111111111111112 * (a * (((double) M_PI) * (angle_m * b)));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (angle_m <= 3e+162) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (a * -a)));
	} else {
		tmp = 0.011111111111111112 * (a * (Math.PI * (angle_m * b)));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if angle_m <= 3e+162:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (a * -a)))
	else:
		tmp = 0.011111111111111112 * (a * (math.pi * (angle_m * b)))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (angle_m <= 3e+162)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a * Float64(-a)))));
	else
		tmp = Float64(0.011111111111111112 * Float64(a * Float64(pi * Float64(angle_m * b))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (angle_m <= 3e+162)
		tmp = 0.011111111111111112 * (angle_m * (pi * (a * -a)));
	else
		tmp = 0.011111111111111112 * (a * (pi * (angle_m * b)));
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 3e+162], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(Pi * N[(angle$95$m * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 3 \cdot 10^{+162}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a \cdot \left(-a\right)\right)\right)\right)\\

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


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

    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. Add Preprocessing
    3. Taylor expanded in angle around 0 47.0%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. 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-squares53.9%

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

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

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

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

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

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

    if 2.9999999999999998e162 < angle

    1. Initial program 24.0%

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

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

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

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

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

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

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

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

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

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

Alternative 20: 19.5% accurate, 46.6× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(\left(a \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(angle\_m \cdot b\right)\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* (* a 0.011111111111111112) (* PI (* angle_m b)))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * ((a * 0.011111111111111112) * (((double) M_PI) * (angle_m * b)));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * ((a * 0.011111111111111112) * (Math.PI * (angle_m * b)));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * ((a * 0.011111111111111112) * (math.pi * (angle_m * b)))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(Float64(a * 0.011111111111111112) * Float64(pi * Float64(angle_m * b))))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * ((a * 0.011111111111111112) * (pi * (angle_m * b)));
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(angle$95$m * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \left(\left(a \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(angle\_m \cdot b\right)\right)\right)
\end{array}
Derivation
  1. Initial program 46.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. Add Preprocessing
  3. Taylor expanded in angle around 0 43.2%

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
  4. Step-by-step derivation
    1. unpow246.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. unpow246.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-squares49.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) \]
  5. Applied egg-rr45.7%

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

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

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

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

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

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

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

Alternative 21: 19.5% accurate, 46.6× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot \left(angle\_m \cdot b\right)\right)\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* 0.011111111111111112 (* a (* PI (* angle_m b))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (a * (((double) M_PI) * (angle_m * b))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (a * (Math.PI * (angle_m * b))));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (0.011111111111111112 * (a * (math.pi * (angle_m * b))))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(0.011111111111111112 * Float64(a * Float64(pi * Float64(angle_m * b)))))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (0.011111111111111112 * (a * (pi * (angle_m * b))));
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(a * N[(Pi * N[(angle$95$m * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot \left(angle\_m \cdot b\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 46.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. Add Preprocessing
  3. Taylor expanded in angle around 0 43.2%

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
  4. Step-by-step derivation
    1. unpow246.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. unpow246.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-squares49.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) \]
  5. Applied egg-rr45.7%

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

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

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

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

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

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

Alternative 22: 19.5% accurate, 46.6× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right)\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* 0.011111111111111112 (* a (* angle_m (* b PI))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (a * (angle_m * (b * ((double) M_PI)))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (a * (angle_m * (b * Math.PI))));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (0.011111111111111112 * (a * (angle_m * (b * math.pi))))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(0.011111111111111112 * Float64(a * Float64(angle_m * Float64(b * pi)))))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (0.011111111111111112 * (a * (angle_m * (b * pi))));
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(a * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 46.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. Add Preprocessing
  3. Taylor expanded in angle around 0 43.2%

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
  4. Step-by-step derivation
    1. unpow246.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. unpow246.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-squares49.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) \]
  5. Applied egg-rr45.7%

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

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

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

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

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

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

Reproduce

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