ab-angle->ABCF B

Percentage Accurate: 55.1% → 66.6%
Time: 17.3s
Alternatives: 21
Speedup: 23.3×

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 21 alternatives:

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

Initial Program: 55.1% 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: 66.6% accurate, 0.3× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \cos \left(angle\_m \cdot \frac{\pi}{-180}\right)\\ t_1 := \pi \cdot \frac{angle\_m}{180}\\ t_2 := \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_1\right) \cdot \cos t\_1\\ t_3 := \sin \left(angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-266}:\\ \;\;\;\;t\_0 \cdot \left(2 \cdot \left(a \cdot \left(a \cdot t\_3\right) - {b}^{2} \cdot t\_3\right)\right)\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;t\_0 \cdot \left(2 \cdot \mathsf{fma}\left(b, t\_3 \cdot \left(-b\right), {a}^{2} \cdot t\_3\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(2 \cdot \left(\left(angle\_m \cdot -0.005555555555555556\right) \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(a - b\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 (/ PI -180.0))))
        (t_1 (* PI (/ angle_m 180.0)))
        (t_2 (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_1)) (cos t_1)))
        (t_3 (sin (* angle_m (* PI -0.005555555555555556)))))
   (*
    angle_s
    (if (<= t_2 -2e-266)
      (* t_0 (* 2.0 (- (* a (* a t_3)) (* (pow b 2.0) t_3))))
      (if (<= t_2 INFINITY)
        (* t_0 (* 2.0 (fma b (* t_3 (- b)) (* (pow a 2.0) t_3))))
        (*
         t_0
         (*
          2.0
          (*
           (* angle_m -0.005555555555555556)
           (* (* PI (+ b a)) (- a b))))))))))
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 * (((double) M_PI) / -180.0)));
	double t_1 = ((double) M_PI) * (angle_m / 180.0);
	double t_2 = ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_1)) * cos(t_1);
	double t_3 = sin((angle_m * (((double) M_PI) * -0.005555555555555556)));
	double tmp;
	if (t_2 <= -2e-266) {
		tmp = t_0 * (2.0 * ((a * (a * t_3)) - (pow(b, 2.0) * t_3)));
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = t_0 * (2.0 * fma(b, (t_3 * -b), (pow(a, 2.0) * t_3)));
	} else {
		tmp = t_0 * (2.0 * ((angle_m * -0.005555555555555556) * ((((double) M_PI) * (b + a)) * (a - b))));
	}
	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(angle_m * Float64(pi / -180.0)))
	t_1 = Float64(pi * Float64(angle_m / 180.0))
	t_2 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_1)) * cos(t_1))
	t_3 = sin(Float64(angle_m * Float64(pi * -0.005555555555555556)))
	tmp = 0.0
	if (t_2 <= -2e-266)
		tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(a * Float64(a * t_3)) - Float64((b ^ 2.0) * t_3))));
	elseif (t_2 <= Inf)
		tmp = Float64(t_0 * Float64(2.0 * fma(b, Float64(t_3 * Float64(-b)), Float64((a ^ 2.0) * t_3))));
	else
		tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(angle_m * -0.005555555555555556) * Float64(Float64(pi * Float64(b + a)) * Float64(a - b)))));
	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[Cos[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, -2e-266], N[(t$95$0 * N[(2.0 * N[(N[(a * N[(a * t$95$3), $MachinePrecision]), $MachinePrecision] - N[(N[Power[b, 2.0], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(t$95$0 * N[(2.0 * N[(b * N[(t$95$3 * (-b)), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(N[(angle$95$m * -0.005555555555555556), $MachinePrecision] * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(a - b), $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(angle\_m \cdot \frac{\pi}{-180}\right)\\
t_1 := \pi \cdot \frac{angle\_m}{180}\\
t_2 := \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_1\right) \cdot \cos t\_1\\
t_3 := \sin \left(angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-266}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(a \cdot \left(a \cdot t\_3\right) - {b}^{2} \cdot t\_3\right)\right)\\

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \mathsf{fma}\left(b, t\_3 \cdot \left(-b\right), {a}^{2} \cdot t\_3\right)\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 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))))) < -2e-266

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

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

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

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

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

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

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

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

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

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

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

    if -2e-266 < (*.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))))) < +inf.0

    1. Initial program 67.1%

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

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

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

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

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

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

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\left(b \cdot \left(-1 \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(a + -1 \cdot a\right)\right) + {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
    7. Step-by-step derivation
      1. fma-define70.8%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b, -1 \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(a + -1 \cdot a\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
      2. +-commutative70.8%

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

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

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

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

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

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

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

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

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

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

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

    if +inf.0 < (*.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 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. Simplified0.0%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 66.3% accurate, 0.3× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \pi \cdot \frac{angle\_m}{180}\\ t_1 := angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\\ t_2 := \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\ t_3 := angle\_m \cdot \frac{\pi}{-180}\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot angle\_m\right)\right)\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+268}:\\ \;\;\;\;\cos \left(\frac{\pi \cdot angle\_m}{180}\right) \cdot \left(2 \cdot \left(\sin t\_3 \cdot \left({a}^{2} - {b}^{2}\right)\right)\right)\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(b, \left(-b\right) \cdot t\_1, {a}^{2} \cdot \sin t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\cos t\_3 \cdot \left(2 \cdot \left(\left(angle\_m \cdot -0.005555555555555556\right) \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(a - b\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 (* PI (/ angle_m 180.0)))
        (t_1 (* angle_m (* PI -0.005555555555555556)))
        (t_2 (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0)))
        (t_3 (* angle_m (/ PI -180.0))))
   (*
    angle_s
    (if (<= t_2 (- INFINITY))
      (* (* a 0.011111111111111112) (* (- b a) (* PI angle_m)))
      (if (<= t_2 5e+268)
        (*
         (cos (/ (* PI angle_m) 180.0))
         (* 2.0 (* (sin t_3) (- (pow a 2.0) (pow b 2.0)))))
        (if (<= t_2 INFINITY)
          (* 2.0 (fma b (* (- b) t_1) (* (pow a 2.0) (sin t_1))))
          (*
           (cos t_3)
           (*
            2.0
            (*
             (* angle_m -0.005555555555555556)
             (* (* PI (+ b a)) (- a b)))))))))))
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 = ((double) M_PI) * (angle_m / 180.0);
	double t_1 = angle_m * (((double) M_PI) * -0.005555555555555556);
	double t_2 = ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
	double t_3 = angle_m * (((double) M_PI) / -180.0);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = (a * 0.011111111111111112) * ((b - a) * (((double) M_PI) * angle_m));
	} else if (t_2 <= 5e+268) {
		tmp = cos(((((double) M_PI) * angle_m) / 180.0)) * (2.0 * (sin(t_3) * (pow(a, 2.0) - pow(b, 2.0))));
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = 2.0 * fma(b, (-b * t_1), (pow(a, 2.0) * sin(t_1)));
	} else {
		tmp = cos(t_3) * (2.0 * ((angle_m * -0.005555555555555556) * ((((double) M_PI) * (b + a)) * (a - b))));
	}
	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(pi * Float64(angle_m / 180.0))
	t_1 = Float64(angle_m * Float64(pi * -0.005555555555555556))
	t_2 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0))
	t_3 = Float64(angle_m * Float64(pi / -180.0))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(b - a) * Float64(pi * angle_m)));
	elseif (t_2 <= 5e+268)
		tmp = Float64(cos(Float64(Float64(pi * angle_m) / 180.0)) * Float64(2.0 * Float64(sin(t_3) * Float64((a ^ 2.0) - (b ^ 2.0)))));
	elseif (t_2 <= Inf)
		tmp = Float64(2.0 * fma(b, Float64(Float64(-b) * t_1), Float64((a ^ 2.0) * sin(t_1))));
	else
		tmp = Float64(cos(t_3) * Float64(2.0 * Float64(Float64(angle_m * -0.005555555555555556) * Float64(Float64(pi * Float64(b + a)) * Float64(a - b)))));
	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[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, (-Infinity)], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+268], N[(N[Cos[N[(N[(Pi * angle$95$m), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[Sin[t$95$3], $MachinePrecision] * N[(N[Power[a, 2.0], $MachinePrecision] - N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(2.0 * N[(b * N[((-b) * t$95$1), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$3], $MachinePrecision] * N[(2.0 * N[(N[(angle$95$m * -0.005555555555555556), $MachinePrecision] * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(a - b), $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 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\\
t_2 := \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\
t_3 := angle\_m \cdot \frac{\pi}{-180}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot angle\_m\right)\right)\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+268}:\\
\;\;\;\;\cos \left(\frac{\pi \cdot angle\_m}{180}\right) \cdot \left(2 \cdot \left(\sin t\_3 \cdot \left({a}^{2} - {b}^{2}\right)\right)\right)\\

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 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))))) < -inf.0

    1. Initial program 39.1%

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares32.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) \]
    7. Applied egg-rr32.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) \]
    8. Taylor expanded in b around 0 23.4%

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

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

        \[\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*41.8%

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

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

    if -inf.0 < (*.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.0000000000000002e268

    1. Initial program 65.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. Simplified65.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000002e268 < (*.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))))) < +inf.0

    1. Initial program 56.9%

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

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

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

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

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

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

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\left(b \cdot \left(-1 \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(a + -1 \cdot a\right)\right) + {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
    7. Step-by-step derivation
      1. fma-define68.3%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b, -1 \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(a + -1 \cdot a\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
      2. +-commutative68.3%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1} \cdot \left(2 \cdot \mathsf{fma}\left(b, \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \left(0 + \left(-b\right)\right), {a}^{2} \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\right) \]
    10. Taylor expanded in angle around 0 59.6%

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

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

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

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

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

    if +inf.0 < (*.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 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. Simplified0.0%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 66.6% accurate, 0.5× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \cos \left(angle\_m \cdot \frac{\pi}{-180}\right)\\ t_1 := {b}^{2} - {a}^{2}\\ t_2 := \sin \left(angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq 4 \cdot 10^{+51}:\\ \;\;\;\;t\_0 \cdot \left(2 \cdot \left(a \cdot \left(a \cdot t\_2\right) - {b}^{2} \cdot t\_2\right)\right)\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(b, t\_2 \cdot \left(-b\right), {a}^{2} \cdot t\_2\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(2 \cdot \left(\left(angle\_m \cdot -0.005555555555555556\right) \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(a - b\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 (/ PI -180.0))))
        (t_1 (- (pow b 2.0) (pow a 2.0)))
        (t_2 (sin (* angle_m (* PI -0.005555555555555556)))))
   (*
    angle_s
    (if (<= t_1 4e+51)
      (* t_0 (* 2.0 (- (* a (* a t_2)) (* (pow b 2.0) t_2))))
      (if (<= t_1 INFINITY)
        (* 2.0 (fma b (* t_2 (- b)) (* (pow a 2.0) t_2)))
        (*
         t_0
         (*
          2.0
          (*
           (* angle_m -0.005555555555555556)
           (* (* PI (+ b a)) (- a b))))))))))
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 * (((double) M_PI) / -180.0)));
	double t_1 = pow(b, 2.0) - pow(a, 2.0);
	double t_2 = sin((angle_m * (((double) M_PI) * -0.005555555555555556)));
	double tmp;
	if (t_1 <= 4e+51) {
		tmp = t_0 * (2.0 * ((a * (a * t_2)) - (pow(b, 2.0) * t_2)));
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = 2.0 * fma(b, (t_2 * -b), (pow(a, 2.0) * t_2));
	} else {
		tmp = t_0 * (2.0 * ((angle_m * -0.005555555555555556) * ((((double) M_PI) * (b + a)) * (a - b))));
	}
	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(angle_m * Float64(pi / -180.0)))
	t_1 = Float64((b ^ 2.0) - (a ^ 2.0))
	t_2 = sin(Float64(angle_m * Float64(pi * -0.005555555555555556)))
	tmp = 0.0
	if (t_1 <= 4e+51)
		tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(a * Float64(a * t_2)) - Float64((b ^ 2.0) * t_2))));
	elseif (t_1 <= Inf)
		tmp = Float64(2.0 * fma(b, Float64(t_2 * Float64(-b)), Float64((a ^ 2.0) * t_2)));
	else
		tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(angle_m * -0.005555555555555556) * Float64(Float64(pi * Float64(b + a)) * Float64(a - b)))));
	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[Cos[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $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[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, 4e+51], N[(t$95$0 * N[(2.0 * N[(N[(a * N[(a * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[Power[b, 2.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(2.0 * N[(b * N[(t$95$2 * (-b)), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(N[(angle$95$m * -0.005555555555555556), $MachinePrecision] * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(a - b), $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(angle\_m \cdot \frac{\pi}{-180}\right)\\
t_1 := {b}^{2} - {a}^{2}\\
t_2 := \sin \left(angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{+51}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(a \cdot \left(a \cdot t\_2\right) - {b}^{2} \cdot t\_2\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(\left(angle\_m \cdot -0.005555555555555556\right) \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(a - b\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))) < 4e51

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 45.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. Simplified50.3%

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

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

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

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

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

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\left(b \cdot \left(-1 \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(a + -1 \cdot a\right)\right) + {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
    7. Step-by-step derivation
      1. fma-define70.6%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b, -1 \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(a + -1 \cdot a\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
      2. +-commutative70.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1} \cdot \left(2 \cdot \mathsf{fma}\left(b, \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \left(0 + \left(-b\right)\right), {a}^{2} \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\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. Simplified0.0%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 61.2% 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 := \sin \left(angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;a \leq 2.5 \cdot 10^{+125}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(b, t\_0 \cdot \left(-b\right), {a}^{2} \cdot t\_0\right)\\ \mathbf{elif}\;a \leq 8.8 \cdot 10^{+182}:\\ \;\;\;\;\left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(a \cdot \pi\right)\right) \cdot \left(b - a\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(e^{\log \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle\_m \cdot \frac{\pi}{-180}\right) \cdot \left(\left(b + a\right) \cdot \left(a - b\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 (sin (* angle_m (* PI -0.005555555555555556)))))
   (*
    angle_s
    (if (<= a 2.5e+125)
      (* 2.0 (fma b (* t_0 (- b)) (* (pow a 2.0) t_0)))
      (if (<= a 8.8e+182)
        (* (* (* angle_m 0.011111111111111112) (* a PI)) (- b a))
        (*
         (cos (exp (log (* PI (* angle_m 0.005555555555555556)))))
         (* 2.0 (* (sin (* angle_m (/ PI -180.0))) (* (+ b a) (- a b))))))))))
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 = sin((angle_m * (((double) M_PI) * -0.005555555555555556)));
	double tmp;
	if (a <= 2.5e+125) {
		tmp = 2.0 * fma(b, (t_0 * -b), (pow(a, 2.0) * t_0));
	} else if (a <= 8.8e+182) {
		tmp = ((angle_m * 0.011111111111111112) * (a * ((double) M_PI))) * (b - a);
	} else {
		tmp = cos(exp(log((((double) M_PI) * (angle_m * 0.005555555555555556))))) * (2.0 * (sin((angle_m * (((double) M_PI) / -180.0))) * ((b + a) * (a - b))));
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = sin(Float64(angle_m * Float64(pi * -0.005555555555555556)))
	tmp = 0.0
	if (a <= 2.5e+125)
		tmp = Float64(2.0 * fma(b, Float64(t_0 * Float64(-b)), Float64((a ^ 2.0) * t_0)));
	elseif (a <= 8.8e+182)
		tmp = Float64(Float64(Float64(angle_m * 0.011111111111111112) * Float64(a * pi)) * Float64(b - a));
	else
		tmp = Float64(cos(exp(log(Float64(pi * Float64(angle_m * 0.005555555555555556))))) * Float64(2.0 * Float64(sin(Float64(angle_m * Float64(pi / -180.0))) * Float64(Float64(b + a) * Float64(a - b)))));
	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[Sin[N[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[a, 2.5e+125], N[(2.0 * N[(b * N[(t$95$0 * (-b)), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.8e+182], N[(N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[Exp[N[Log[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(a - b), $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 := \sin \left(angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 2.5 \cdot 10^{+125}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b, t\_0 \cdot \left(-b\right), {a}^{2} \cdot t\_0\right)\\

\mathbf{elif}\;a \leq 8.8 \cdot 10^{+182}:\\
\;\;\;\;\left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(a \cdot \pi\right)\right) \cdot \left(b - a\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 2.49999999999999981e125

    1. Initial program 53.5%

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

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

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

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

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

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

      \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\left(b \cdot \left(-1 \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(a + -1 \cdot a\right)\right) + {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
    7. Step-by-step derivation
      1. fma-define65.6%

        \[\leadsto \cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b, -1 \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(a + -1 \cdot a\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
      2. +-commutative65.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.49999999999999981e125 < a < 8.79999999999999986e182

    1. Initial program 47.6%

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

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

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

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

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

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

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

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

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

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

        \[\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*33.2%

        \[\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*33.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} \]
    10. Applied egg-rr33.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}} \]
    11. Step-by-step derivation
      1. unpow133.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.1%

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

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

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

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

    if 8.79999999999999986e182 < a

    1. Initial program 45.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. Simplified50.9%

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

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

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

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

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

        \[\leadsto \cos \color{blue}{\left(e^{\log \left(angle \cdot \frac{\pi}{-180}\right)}\right)} \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      2. add-sqr-sqrt45.0%

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{angle \cdot \pi}{-180}} \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      5. associate-*r/50.9%

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

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      10. metadata-eval50.9%

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{\pi \cdot angle}{180} \cdot \frac{\pi \cdot angle}{180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      12. associate-*r/50.9%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \frac{\pi \cdot angle}{180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      13. associate-*r/50.9%

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      15. add-sqr-sqrt40.9%

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

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

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

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

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

Alternative 5: 61.3% 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 := angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{-139}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(b, \left(-b\right) \cdot t\_0, {a}^{2} \cdot \sin t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(e^{\log \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle\_m \cdot \frac{\pi}{-180}\right) \cdot \left(\left(b + a\right) \cdot \left(a - b\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 (* angle_m (* PI -0.005555555555555556))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1.5e-139)
      (* 2.0 (fma b (* (- b) t_0) (* (pow a 2.0) (sin t_0))))
      (*
       (cos (exp (log (* PI (* angle_m 0.005555555555555556)))))
       (* 2.0 (* (sin (* angle_m (/ PI -180.0))) (* (+ b a) (- a b)))))))))
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 * (((double) M_PI) * -0.005555555555555556);
	double tmp;
	if ((angle_m / 180.0) <= 1.5e-139) {
		tmp = 2.0 * fma(b, (-b * t_0), (pow(a, 2.0) * sin(t_0)));
	} else {
		tmp = cos(exp(log((((double) M_PI) * (angle_m * 0.005555555555555556))))) * (2.0 * (sin((angle_m * (((double) M_PI) / -180.0))) * ((b + a) * (a - b))));
	}
	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(angle_m * Float64(pi * -0.005555555555555556))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1.5e-139)
		tmp = Float64(2.0 * fma(b, Float64(Float64(-b) * t_0), Float64((a ^ 2.0) * sin(t_0))));
	else
		tmp = Float64(cos(exp(log(Float64(pi * Float64(angle_m * 0.005555555555555556))))) * Float64(2.0 * Float64(sin(Float64(angle_m * Float64(pi / -180.0))) * Float64(Float64(b + a) * Float64(a - b)))));
	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[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1.5e-139], N[(2.0 * N[(b * N[((-b) * t$95$0), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[Exp[N[Log[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(a - b), $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 := angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{-139}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b, \left(-b\right) \cdot t\_0, {a}^{2} \cdot \sin t\_0\right)\\

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


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

    1. Initial program 54.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1} \cdot \left(2 \cdot \mathsf{fma}\left(b, \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \left(0 + \left(-b\right)\right), {a}^{2} \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\right) \]
    10. Taylor expanded in angle around 0 61.7%

      \[\leadsto 1 \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \cdot \left(0 + \left(-b\right)\right), {a}^{2} \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\right) \]
    11. Step-by-step derivation
      1. *-commutative61.7%

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

        \[\leadsto 1 \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)} \cdot \left(0 + \left(-b\right)\right), {a}^{2} \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\right) \]
      3. *-commutative61.7%

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

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

    if 1.5e-139 < (/.f64 angle #s(literal 180 binary64))

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

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

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

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

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

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

        \[\leadsto \cos \color{blue}{\left(e^{\log \left(angle \cdot \frac{\pi}{-180}\right)}\right)} \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      2. add-sqr-sqrt0.0%

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{angle \cdot \pi}{-180}} \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      5. associate-*r/45.8%

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

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      10. metadata-eval45.8%

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{\pi \cdot angle}{180} \cdot \frac{\pi \cdot angle}{180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      12. associate-*r/45.8%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \frac{\pi \cdot angle}{180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      13. associate-*r/45.8%

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      15. add-sqr-sqrt64.0%

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

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

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

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

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

Alternative 6: 61.0% accurate, 1.3× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\\ t_1 := \left(b + a\right) \cdot \left(a - b\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{-139}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(b, \left(-b\right) \cdot t\_0, {a}^{2} \cdot \sin t\_0\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+223}:\\ \;\;\;\;\left(2 \cdot \left(\sin \left(angle\_m \cdot \frac{\pi}{-180}\right) \cdot t\_1\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot t\_1\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 (* PI -0.005555555555555556)))
        (t_1 (* (+ b a) (- a b))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1.5e-139)
      (* 2.0 (fma b (* (- b) t_0) (* (pow a 2.0) (sin t_0))))
      (if (<= (/ angle_m 180.0) 2e+223)
        (*
         (* 2.0 (* (sin (* angle_m (/ PI -180.0))) t_1))
         (cos (/ 1.0 (/ 180.0 (* PI angle_m)))))
        (*
         (cos (* -0.005555555555555556 (* PI angle_m)))
         (* 2.0 (* (sin (* PI (/ angle_m 180.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 = angle_m * (((double) M_PI) * -0.005555555555555556);
	double t_1 = (b + a) * (a - b);
	double tmp;
	if ((angle_m / 180.0) <= 1.5e-139) {
		tmp = 2.0 * fma(b, (-b * t_0), (pow(a, 2.0) * sin(t_0)));
	} else if ((angle_m / 180.0) <= 2e+223) {
		tmp = (2.0 * (sin((angle_m * (((double) M_PI) / -180.0))) * t_1)) * cos((1.0 / (180.0 / (((double) M_PI) * angle_m))));
	} else {
		tmp = cos((-0.005555555555555556 * (((double) M_PI) * angle_m))) * (2.0 * (sin((((double) M_PI) * (angle_m / 180.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(angle_m * Float64(pi * -0.005555555555555556))
	t_1 = Float64(Float64(b + a) * Float64(a - b))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1.5e-139)
		tmp = Float64(2.0 * fma(b, Float64(Float64(-b) * t_0), Float64((a ^ 2.0) * sin(t_0))));
	elseif (Float64(angle_m / 180.0) <= 2e+223)
		tmp = Float64(Float64(2.0 * Float64(sin(Float64(angle_m * Float64(pi / -180.0))) * t_1)) * cos(Float64(1.0 / Float64(180.0 / Float64(pi * angle_m)))));
	else
		tmp = Float64(cos(Float64(-0.005555555555555556 * Float64(pi * angle_m))) * Float64(2.0 * Float64(sin(Float64(pi * Float64(angle_m / 180.0))) * t_1)));
	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[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b + a), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1.5e-139], N[(2.0 * N[(b * N[((-b) * t$95$0), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+223], N[(N[(2.0 * N[(N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(1.0 / N[(180.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $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 := angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\\
t_1 := \left(b + a\right) \cdot \left(a - b\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{-139}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b, \left(-b\right) \cdot t\_0, {a}^{2} \cdot \sin t\_0\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+223}:\\
\;\;\;\;\left(2 \cdot \left(\sin \left(angle\_m \cdot \frac{\pi}{-180}\right) \cdot t\_1\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right)\\

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


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

    1. Initial program 54.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1} \cdot \left(2 \cdot \mathsf{fma}\left(b, \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \left(0 + \left(-b\right)\right), {a}^{2} \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\right) \]
    10. Taylor expanded in angle around 0 61.7%

      \[\leadsto 1 \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} \cdot \left(0 + \left(-b\right)\right), {a}^{2} \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\right) \]
    11. Step-by-step derivation
      1. *-commutative61.7%

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

        \[\leadsto 1 \cdot \left(2 \cdot \mathsf{fma}\left(b, \color{blue}{\left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)} \cdot \left(0 + \left(-b\right)\right), {a}^{2} \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\right) \]
      3. *-commutative61.7%

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

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

    if 1.5e-139 < (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000009e223

    1. Initial program 53.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. Simplified54.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000009e223 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 31.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. Simplified36.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 59.1% accurate, 1.8× 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}\;\frac{angle\_m}{180} \leq 10^{-206}:\\ \;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+53}:\\ \;\;\;\;0.011111111111111112 \cdot \mathsf{fma}\left(a, angle\_m \cdot \left(\pi \cdot 0\right) - \pi \cdot \left(a \cdot angle\_m\right), angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sin \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(b + a\right) \cdot \left(a - 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 180.0) 1e-206)
    (*
     0.011111111111111112
     (- (* b (* angle_m (* b PI))) (* PI (* (pow a 2.0) angle_m))))
    (if (<= (/ angle_m 180.0) 2e+53)
      (*
       0.011111111111111112
       (fma
        a
        (- (* angle_m (* PI 0.0)) (* PI (* a angle_m)))
        (* angle_m (* (pow b 2.0) PI))))
      (* 2.0 (* (sin (* PI (/ angle_m 180.0))) (* (+ b a) (- a 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 / 180.0) <= 1e-206) {
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * ((double) M_PI)))) - (((double) M_PI) * (pow(a, 2.0) * angle_m)));
	} else if ((angle_m / 180.0) <= 2e+53) {
		tmp = 0.011111111111111112 * fma(a, ((angle_m * (((double) M_PI) * 0.0)) - (((double) M_PI) * (a * angle_m))), (angle_m * (pow(b, 2.0) * ((double) M_PI))));
	} else {
		tmp = 2.0 * (sin((((double) M_PI) * (angle_m / 180.0))) * ((b + a) * (a - 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 (Float64(angle_m / 180.0) <= 1e-206)
		tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(angle_m * Float64(b * pi))) - Float64(pi * Float64((a ^ 2.0) * angle_m))));
	elseif (Float64(angle_m / 180.0) <= 2e+53)
		tmp = Float64(0.011111111111111112 * fma(a, Float64(Float64(angle_m * Float64(pi * 0.0)) - Float64(pi * Float64(a * angle_m))), Float64(angle_m * Float64((b ^ 2.0) * pi))));
	else
		tmp = Float64(2.0 * Float64(sin(Float64(pi * Float64(angle_m / 180.0))) * Float64(Float64(b + a) * Float64(a - b))));
	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_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-206], N[(0.011111111111111112 * N[(N[(b * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[(N[Power[a, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+53], N[(0.011111111111111112 * N[(a * N[(N[(angle$95$m * N[(Pi * 0.0), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(a - 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}\;\frac{angle\_m}{180} \leq 10^{-206}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+53}:\\
\;\;\;\;0.011111111111111112 \cdot \mathsf{fma}\left(a, angle\_m \cdot \left(\pi \cdot 0\right) - \pi \cdot \left(a \cdot angle\_m\right), angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right)\\

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


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

    1. Initial program 53.8%

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)\right) \]
    7. Applied egg-rr54.5%

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

      \[\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)} \]
    9. Step-by-step derivation
      1. +-commutative56.5%

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

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

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

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

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

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

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

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

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

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

        \[\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) \]
    10. Simplified56.5%

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

    if 1.00000000000000003e-206 < (/.f64 angle #s(literal 180 binary64)) < 2e53

    1. Initial program 69.4%

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares75.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) \]
    7. Applied egg-rr75.1%

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

      \[\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)} \]
    9. Step-by-step derivation
      1. fma-define81.8%

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

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

        \[\leadsto 0.011111111111111112 \cdot \mathsf{fma}\left(a, angle \cdot \left(\pi \cdot \left(b + -1 \cdot b\right)\right) + \color{blue}{\left(-a \cdot \left(angle \cdot \pi\right)\right)}, angle \cdot \left({b}^{2} \cdot \pi\right)\right) \]
      4. unsub-neg81.8%

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

        \[\leadsto 0.011111111111111112 \cdot \mathsf{fma}\left(a, angle \cdot \left(\pi \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot b\right)}\right) - a \cdot \left(angle \cdot \pi\right), angle \cdot \left({b}^{2} \cdot \pi\right)\right) \]
      6. metadata-eval81.8%

        \[\leadsto 0.011111111111111112 \cdot \mathsf{fma}\left(a, angle \cdot \left(\pi \cdot \left(\color{blue}{0} \cdot b\right)\right) - a \cdot \left(angle \cdot \pi\right), angle \cdot \left({b}^{2} \cdot \pi\right)\right) \]
      7. mul0-lft81.8%

        \[\leadsto 0.011111111111111112 \cdot \mathsf{fma}\left(a, angle \cdot \left(\pi \cdot \color{blue}{0}\right) - a \cdot \left(angle \cdot \pi\right), angle \cdot \left({b}^{2} \cdot \pi\right)\right) \]
      8. associate-*r*81.8%

        \[\leadsto 0.011111111111111112 \cdot \mathsf{fma}\left(a, angle \cdot \left(\pi \cdot 0\right) - \color{blue}{\left(a \cdot angle\right) \cdot \pi}, angle \cdot \left({b}^{2} \cdot \pi\right)\right) \]
      9. *-commutative81.8%

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

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

    if 2e53 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 29.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. Simplified33.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 59.0% accurate, 3.0× 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}\;\frac{angle\_m}{180} \leq 10^{-206}:\\ \;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 0.5:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sin \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(b + a\right) \cdot \left(a - 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 180.0) 1e-206)
    (*
     0.011111111111111112
     (- (* b (* angle_m (* b PI))) (* PI (* (pow a 2.0) angle_m))))
    (if (<= (/ angle_m 180.0) 0.5)
      (+
       (* 0.011111111111111112 (* angle_m (* (pow b 2.0) PI)))
       (*
        a
        (+
         (* -0.011111111111111112 (* a (* PI angle_m)))
         (* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
      (* 2.0 (* (sin (* PI (/ angle_m 180.0))) (* (+ b a) (- a 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 / 180.0) <= 1e-206) {
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * ((double) M_PI)))) - (((double) M_PI) * (pow(a, 2.0) * angle_m)));
	} else if ((angle_m / 180.0) <= 0.5) {
		tmp = (0.011111111111111112 * (angle_m * (pow(b, 2.0) * ((double) M_PI)))) + (a * ((-0.011111111111111112 * (a * (((double) M_PI) * angle_m))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
	} else {
		tmp = 2.0 * (sin((((double) M_PI) * (angle_m / 180.0))) * ((b + a) * (a - 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 / 180.0) <= 1e-206) {
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * Math.PI))) - (Math.PI * (Math.pow(a, 2.0) * angle_m)));
	} else if ((angle_m / 180.0) <= 0.5) {
		tmp = (0.011111111111111112 * (angle_m * (Math.pow(b, 2.0) * Math.PI))) + (a * ((-0.011111111111111112 * (a * (Math.PI * angle_m))) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
	} else {
		tmp = 2.0 * (Math.sin((Math.PI * (angle_m / 180.0))) * ((b + a) * (a - 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 / 180.0) <= 1e-206:
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * math.pi))) - (math.pi * (math.pow(a, 2.0) * angle_m)))
	elif (angle_m / 180.0) <= 0.5:
		tmp = (0.011111111111111112 * (angle_m * (math.pow(b, 2.0) * math.pi))) + (a * ((-0.011111111111111112 * (a * (math.pi * angle_m))) + (0.011111111111111112 * (angle_m * (math.pi * (b - b))))))
	else:
		tmp = 2.0 * (math.sin((math.pi * (angle_m / 180.0))) * ((b + a) * (a - 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 (Float64(angle_m / 180.0) <= 1e-206)
		tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(angle_m * Float64(b * pi))) - Float64(pi * Float64((a ^ 2.0) * angle_m))));
	elseif (Float64(angle_m / 180.0) <= 0.5)
		tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64((b ^ 2.0) * pi))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(pi * angle_m))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b)))))));
	else
		tmp = Float64(2.0 * Float64(sin(Float64(pi * Float64(angle_m / 180.0))) * Float64(Float64(b + a) * Float64(a - 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 / 180.0) <= 1e-206)
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * pi))) - (pi * ((a ^ 2.0) * angle_m)));
	elseif ((angle_m / 180.0) <= 0.5)
		tmp = (0.011111111111111112 * (angle_m * ((b ^ 2.0) * pi))) + (a * ((-0.011111111111111112 * (a * (pi * angle_m))) + (0.011111111111111112 * (angle_m * (pi * (b - b))))));
	else
		tmp = 2.0 * (sin((pi * (angle_m / 180.0))) * ((b + a) * (a - 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[N[(angle$95$m / 180.0), $MachinePrecision], 1e-206], N[(0.011111111111111112 * N[(N[(b * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[(N[Power[a, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 0.5], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(a - 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}\;\frac{angle\_m}{180} \leq 10^{-206}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 0.5:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\

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


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

    1. Initial program 53.8%

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)\right) \]
    7. Applied egg-rr54.5%

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

      \[\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)} \]
    9. Step-by-step derivation
      1. +-commutative56.5%

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

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

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

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

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

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

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

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

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

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

        \[\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) \]
    10. Simplified56.5%

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

    if 1.00000000000000003e-206 < (/.f64 angle #s(literal 180 binary64)) < 0.5

    1. Initial program 76.1%

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares79.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) \]
    7. Applied egg-rr79.1%

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)\right) \]
    8. Taylor expanded in a around 0 89.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 0.5 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 30.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 58.9% accurate, 3.0× 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}\;\frac{angle\_m}{180} \leq 10^{-206}:\\ \;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 0.5:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) + a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sin \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(b + a\right) \cdot \left(a - 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 180.0) 1e-206)
    (*
     0.011111111111111112
     (- (* b (* angle_m (* b PI))) (* PI (* (pow a 2.0) angle_m))))
    (if (<= (/ angle_m 180.0) 0.5)
      (*
       0.011111111111111112
       (+
        (* angle_m (* (pow b 2.0) PI))
        (* a (- (* angle_m (* PI (- b b))) (* a (* PI angle_m))))))
      (* 2.0 (* (sin (* PI (/ angle_m 180.0))) (* (+ b a) (- a 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 / 180.0) <= 1e-206) {
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * ((double) M_PI)))) - (((double) M_PI) * (pow(a, 2.0) * angle_m)));
	} else if ((angle_m / 180.0) <= 0.5) {
		tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) + (a * ((angle_m * (((double) M_PI) * (b - b))) - (a * (((double) M_PI) * angle_m)))));
	} else {
		tmp = 2.0 * (sin((((double) M_PI) * (angle_m / 180.0))) * ((b + a) * (a - 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 / 180.0) <= 1e-206) {
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * Math.PI))) - (Math.PI * (Math.pow(a, 2.0) * angle_m)));
	} else if ((angle_m / 180.0) <= 0.5) {
		tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) + (a * ((angle_m * (Math.PI * (b - b))) - (a * (Math.PI * angle_m)))));
	} else {
		tmp = 2.0 * (Math.sin((Math.PI * (angle_m / 180.0))) * ((b + a) * (a - 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 / 180.0) <= 1e-206:
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * math.pi))) - (math.pi * (math.pow(a, 2.0) * angle_m)))
	elif (angle_m / 180.0) <= 0.5:
		tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) + (a * ((angle_m * (math.pi * (b - b))) - (a * (math.pi * angle_m)))))
	else:
		tmp = 2.0 * (math.sin((math.pi * (angle_m / 180.0))) * ((b + a) * (a - 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 (Float64(angle_m / 180.0) <= 1e-206)
		tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(angle_m * Float64(b * pi))) - Float64(pi * Float64((a ^ 2.0) * angle_m))));
	elseif (Float64(angle_m / 180.0) <= 0.5)
		tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) + Float64(a * Float64(Float64(angle_m * Float64(pi * Float64(b - b))) - Float64(a * Float64(pi * angle_m))))));
	else
		tmp = Float64(2.0 * Float64(sin(Float64(pi * Float64(angle_m / 180.0))) * Float64(Float64(b + a) * Float64(a - 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 / 180.0) <= 1e-206)
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * pi))) - (pi * ((a ^ 2.0) * angle_m)));
	elseif ((angle_m / 180.0) <= 0.5)
		tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) + (a * ((angle_m * (pi * (b - b))) - (a * (pi * angle_m)))));
	else
		tmp = 2.0 * (sin((pi * (angle_m / 180.0))) * ((b + a) * (a - 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[N[(angle$95$m / 180.0), $MachinePrecision], 1e-206], N[(0.011111111111111112 * N[(N[(b * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[(N[Power[a, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 0.5], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(a - 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}\;\frac{angle\_m}{180} \leq 10^{-206}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 0.5:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) + a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\

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


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

    1. Initial program 53.8%

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)\right) \]
    7. Applied egg-rr54.5%

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

      \[\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)} \]
    9. Step-by-step derivation
      1. +-commutative56.5%

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

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

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

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

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

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

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

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

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

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

        \[\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) \]
    10. Simplified56.5%

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

    if 1.00000000000000003e-206 < (/.f64 angle #s(literal 180 binary64)) < 0.5

    1. Initial program 76.1%

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares79.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) \]
    7. Applied egg-rr79.1%

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

      \[\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 0.5 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 30.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 59.3% accurate, 3.2× 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(a - b\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{-139}:\\ \;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+18}:\\ \;\;\;\;2 \cdot \left(\sin \left(angle\_m \cdot \frac{\pi}{-180}\right) \cdot t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sin \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot t\_0\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 (* (+ b a) (- a b))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1.5e-139)
      (*
       0.011111111111111112
       (- (* b (* angle_m (* b PI))) (* PI (* (pow a 2.0) angle_m))))
      (if (<= (/ angle_m 180.0) 4e+18)
        (* 2.0 (* (sin (* angle_m (/ PI -180.0))) t_0))
        (* 2.0 (* (sin (* PI (/ angle_m 180.0))) t_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 = (b + a) * (a - b);
	double tmp;
	if ((angle_m / 180.0) <= 1.5e-139) {
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * ((double) M_PI)))) - (((double) M_PI) * (pow(a, 2.0) * angle_m)));
	} else if ((angle_m / 180.0) <= 4e+18) {
		tmp = 2.0 * (sin((angle_m * (((double) M_PI) / -180.0))) * t_0);
	} else {
		tmp = 2.0 * (sin((((double) M_PI) * (angle_m / 180.0))) * t_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 = (b + a) * (a - b);
	double tmp;
	if ((angle_m / 180.0) <= 1.5e-139) {
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * Math.PI))) - (Math.PI * (Math.pow(a, 2.0) * angle_m)));
	} else if ((angle_m / 180.0) <= 4e+18) {
		tmp = 2.0 * (Math.sin((angle_m * (Math.PI / -180.0))) * t_0);
	} else {
		tmp = 2.0 * (Math.sin((Math.PI * (angle_m / 180.0))) * t_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 = (b + a) * (a - b)
	tmp = 0
	if (angle_m / 180.0) <= 1.5e-139:
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * math.pi))) - (math.pi * (math.pow(a, 2.0) * angle_m)))
	elif (angle_m / 180.0) <= 4e+18:
		tmp = 2.0 * (math.sin((angle_m * (math.pi / -180.0))) * t_0)
	else:
		tmp = 2.0 * (math.sin((math.pi * (angle_m / 180.0))) * t_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(b + a) * Float64(a - b))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1.5e-139)
		tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(angle_m * Float64(b * pi))) - Float64(pi * Float64((a ^ 2.0) * angle_m))));
	elseif (Float64(angle_m / 180.0) <= 4e+18)
		tmp = Float64(2.0 * Float64(sin(Float64(angle_m * Float64(pi / -180.0))) * t_0));
	else
		tmp = Float64(2.0 * Float64(sin(Float64(pi * Float64(angle_m / 180.0))) * t_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 = (b + a) * (a - b);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 1.5e-139)
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * pi))) - (pi * ((a ^ 2.0) * angle_m)));
	elseif ((angle_m / 180.0) <= 4e+18)
		tmp = 2.0 * (sin((angle_m * (pi / -180.0))) * t_0);
	else
		tmp = 2.0 * (sin((pi * (angle_m / 180.0))) * t_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[(N[(b + a), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1.5e-139], N[(0.011111111111111112 * N[(N[(b * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[(N[Power[a, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+18], N[(2.0 * N[(N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$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 := \left(b + a\right) \cdot \left(a - b\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{-139}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot t\_0\right)\\


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

    1. Initial program 54.7%

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares55.5%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)\right) \]
    7. Applied egg-rr55.5%

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

      \[\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)} \]
    9. Step-by-step derivation
      1. +-commutative58.4%

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

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

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

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

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

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

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

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

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

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

        \[\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) \]
    10. Simplified58.4%

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

    if 1.5e-139 < (/.f64 angle #s(literal 180 binary64)) < 4e18

    1. Initial program 76.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. Simplified77.1%

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

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

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

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

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

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

    if 4e18 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 28.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. Simplified30.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 56.9% 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 1.16 \cdot 10^{+100}:\\ \;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(a \cdot \pi\right)\right) \cdot \left(b - a\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.16e+100)
    (*
     0.011111111111111112
     (- (* b (* angle_m (* b PI))) (* PI (* (pow a 2.0) angle_m))))
    (* (* (* angle_m 0.011111111111111112) (* a 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 <= 1.16e+100) {
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * ((double) M_PI)))) - (((double) M_PI) * (pow(a, 2.0) * angle_m)));
	} else {
		tmp = ((angle_m * 0.011111111111111112) * (a * ((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 <= 1.16e+100) {
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * Math.PI))) - (Math.PI * (Math.pow(a, 2.0) * angle_m)));
	} else {
		tmp = ((angle_m * 0.011111111111111112) * (a * 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 <= 1.16e+100:
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * math.pi))) - (math.pi * (math.pow(a, 2.0) * angle_m)))
	else:
		tmp = ((angle_m * 0.011111111111111112) * (a * 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 <= 1.16e+100)
		tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(angle_m * Float64(b * pi))) - Float64(pi * Float64((a ^ 2.0) * angle_m))));
	else
		tmp = Float64(Float64(Float64(angle_m * 0.011111111111111112) * Float64(a * 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 <= 1.16e+100)
		tmp = 0.011111111111111112 * ((b * (angle_m * (b * pi))) - (pi * ((a ^ 2.0) * angle_m)));
	else
		tmp = ((angle_m * 0.011111111111111112) * (a * 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, 1.16e+100], N[(0.011111111111111112 * N[(N[(b * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[(N[Power[a, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $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.16 \cdot 10^{+100}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\\

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


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

    1. Initial program 54.1%

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares54.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) \]
    7. Applied egg-rr54.2%

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

      \[\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)} \]
    9. Step-by-step derivation
      1. +-commutative55.1%

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

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

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

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

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

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

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

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

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

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

        \[\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) \]
    10. Simplified55.0%

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

    if 1.1600000000000001e100 < a

    1. Initial program 44.4%

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares42.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) \]
    7. Applied egg-rr42.6%

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

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

        \[\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*40.2%

        \[\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*40.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} \]
    10. Applied egg-rr40.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}} \]
    11. Step-by-step derivation
      1. unpow140.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*56.4%

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

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

        \[\leadsto \left(\left(angle \cdot 0.011111111111111112\right) \cdot \color{blue}{\left(a \cdot \pi\right)}\right) \cdot \left(b - a\right) \]
    12. Simplified56.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 simplification55.2%

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

Alternative 12: 55.2% 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 7.5 \cdot 10^{+153}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(b \cdot \left(b \cdot \pi\right) - {a}^{2} \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(a \cdot \pi\right)\right) \cdot \left(b - a\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 7.5e+153)
    (* 0.011111111111111112 (* angle_m (- (* b (* b PI)) (* (pow a 2.0) PI))))
    (* (* (* angle_m 0.011111111111111112) (* a 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 <= 7.5e+153) {
		tmp = 0.011111111111111112 * (angle_m * ((b * (b * ((double) M_PI))) - (pow(a, 2.0) * ((double) M_PI))));
	} else {
		tmp = ((angle_m * 0.011111111111111112) * (a * ((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 <= 7.5e+153) {
		tmp = 0.011111111111111112 * (angle_m * ((b * (b * Math.PI)) - (Math.pow(a, 2.0) * Math.PI)));
	} else {
		tmp = ((angle_m * 0.011111111111111112) * (a * 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 <= 7.5e+153:
		tmp = 0.011111111111111112 * (angle_m * ((b * (b * math.pi)) - (math.pow(a, 2.0) * math.pi)))
	else:
		tmp = ((angle_m * 0.011111111111111112) * (a * 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 <= 7.5e+153)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(b * Float64(b * pi)) - Float64((a ^ 2.0) * pi))));
	else
		tmp = Float64(Float64(Float64(angle_m * 0.011111111111111112) * Float64(a * 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 <= 7.5e+153)
		tmp = 0.011111111111111112 * (angle_m * ((b * (b * pi)) - ((a ^ 2.0) * pi)));
	else
		tmp = ((angle_m * 0.011111111111111112) * (a * 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, 7.5e+153], N[(0.011111111111111112 * N[(angle$95$m * N[(N[(b * N[(b * Pi), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $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 7.5 \cdot 10^{+153}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(b \cdot \left(b \cdot \pi\right) - {a}^{2} \cdot \pi\right)\right)\\

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


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

    1. Initial program 54.2%

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares53.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) \]
    7. Applied egg-rr53.6%

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

      \[\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) \]
    9. Step-by-step derivation
      1. +-commutative50.1%

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

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

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

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

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

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

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

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

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

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

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

    if 7.50000000000000065e153 < a

    1. Initial program 40.7%

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)\right) \]
    7. Applied egg-rr43.3%

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{a} \cdot \left(b - a\right)\right)\right)\right) \]
    9. Step-by-step derivation
      1. pow136.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*36.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*36.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} \]
    10. Applied egg-rr36.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}} \]
    11. Step-by-step derivation
      1. unpow136.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*61.1%

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

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

        \[\leadsto \left(\left(angle \cdot 0.011111111111111112\right) \cdot \color{blue}{\left(a \cdot \pi\right)}\right) \cdot \left(b - a\right) \]
    12. Simplified61.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 simplification51.4%

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

Alternative 13: 57.0% accurate, 23.3× 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.2 \cdot 10^{+154}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(a \cdot \pi\right)\right) \cdot \left(b - a\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.2e+154)
    (* 0.011111111111111112 (* (* PI angle_m) (* (+ b a) (- b a))))
    (* (* (* angle_m 0.011111111111111112) (* a 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 <= 1.2e+154) {
		tmp = 0.011111111111111112 * ((((double) M_PI) * angle_m) * ((b + a) * (b - a)));
	} else {
		tmp = ((angle_m * 0.011111111111111112) * (a * ((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 <= 1.2e+154) {
		tmp = 0.011111111111111112 * ((Math.PI * angle_m) * ((b + a) * (b - a)));
	} else {
		tmp = ((angle_m * 0.011111111111111112) * (a * 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 <= 1.2e+154:
		tmp = 0.011111111111111112 * ((math.pi * angle_m) * ((b + a) * (b - a)))
	else:
		tmp = ((angle_m * 0.011111111111111112) * (a * 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 <= 1.2e+154)
		tmp = Float64(0.011111111111111112 * Float64(Float64(pi * angle_m) * Float64(Float64(b + a) * Float64(b - a))));
	else
		tmp = Float64(Float64(Float64(angle_m * 0.011111111111111112) * Float64(a * 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 <= 1.2e+154)
		tmp = 0.011111111111111112 * ((pi * angle_m) * ((b + a) * (b - a)));
	else
		tmp = ((angle_m * 0.011111111111111112) * (a * 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, 1.2e+154], N[(0.011111111111111112 * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $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.2 \cdot 10^{+154}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\

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


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

    1. Initial program 54.2%

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares53.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) \]
    7. Applied egg-rr53.6%

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

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

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

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

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

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

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

    if 1.20000000000000007e154 < a

    1. Initial program 40.7%

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)\right) \]
    7. Applied egg-rr43.3%

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{a} \cdot \left(b - a\right)\right)\right)\right) \]
    9. Step-by-step derivation
      1. pow136.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*36.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*36.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} \]
    10. Applied egg-rr36.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}} \]
    11. Step-by-step derivation
      1. unpow136.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*61.1%

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

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

        \[\leadsto \left(\left(angle \cdot 0.011111111111111112\right) \cdot \color{blue}{\left(a \cdot \pi\right)}\right) \cdot \left(b - a\right) \]
    12. Simplified61.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 simplification54.5%

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

Alternative 14: 56.9% accurate, 23.3× 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 6 \cdot 10^{+153}:\\ \;\;\;\;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(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(a \cdot \pi\right)\right) \cdot \left(b - a\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 6e+153)
    (* 0.011111111111111112 (* angle_m (* PI (* (+ b a) (- b a)))))
    (* (* (* angle_m 0.011111111111111112) (* a 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 <= 6e+153) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * ((b + a) * (b - a))));
	} else {
		tmp = ((angle_m * 0.011111111111111112) * (a * ((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 <= 6e+153) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * ((b + a) * (b - a))));
	} else {
		tmp = ((angle_m * 0.011111111111111112) * (a * 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 <= 6e+153:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * ((b + a) * (b - a))))
	else:
		tmp = ((angle_m * 0.011111111111111112) * (a * 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 <= 6e+153)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(b + a) * Float64(b - a)))));
	else
		tmp = Float64(Float64(Float64(angle_m * 0.011111111111111112) * Float64(a * 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 <= 6e+153)
		tmp = 0.011111111111111112 * (angle_m * (pi * ((b + a) * (b - a))));
	else
		tmp = ((angle_m * 0.011111111111111112) * (a * 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, 6e+153], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $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 6 \cdot 10^{+153}:\\
\;\;\;\;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(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(a \cdot \pi\right)\right) \cdot \left(b - a\right)\\


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

    1. Initial program 54.2%

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares53.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) \]
    7. Applied egg-rr53.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 6.00000000000000037e153 < a

    1. Initial program 40.7%

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)\right) \]
    7. Applied egg-rr43.3%

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{a} \cdot \left(b - a\right)\right)\right)\right) \]
    9. Step-by-step derivation
      1. pow136.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*36.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*36.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} \]
    10. Applied egg-rr36.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}} \]
    11. Step-by-step derivation
      1. unpow136.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*61.1%

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

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

        \[\leadsto \left(\left(angle \cdot 0.011111111111111112\right) \cdot \color{blue}{\left(a \cdot \pi\right)}\right) \cdot \left(b - a\right) \]
    12. Simplified61.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. Add Preprocessing

Alternative 15: 45.5% 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 1000000000000:\\ \;\;\;\;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(b - a\right) \cdot \left(\pi \cdot angle\_m\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 1000000000000.0)
    (* 0.011111111111111112 (* angle_m (* PI (* b (- b a)))))
    (* (* a 0.011111111111111112) (* (- b a) (* PI angle_m))))))
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 <= 1000000000000.0) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b * (b - a))));
	} else {
		tmp = (a * 0.011111111111111112) * ((b - a) * (((double) M_PI) * angle_m));
	}
	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 <= 1000000000000.0) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b * (b - a))));
	} else {
		tmp = (a * 0.011111111111111112) * ((b - a) * (Math.PI * angle_m));
	}
	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 <= 1000000000000.0:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (b * (b - a))))
	else:
		tmp = (a * 0.011111111111111112) * ((b - a) * (math.pi * angle_m))
	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 <= 1000000000000.0)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b * Float64(b - a)))));
	else
		tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(b - a) * Float64(pi * angle_m)));
	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 <= 1000000000000.0)
		tmp = 0.011111111111111112 * (angle_m * (pi * (b * (b - a))));
	else
		tmp = (a * 0.011111111111111112) * ((b - a) * (pi * angle_m));
	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, 1000000000000.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[(b - a), $MachinePrecision] * N[(Pi * angle$95$m), $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 1000000000000:\\
\;\;\;\;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(b - a\right) \cdot \left(\pi \cdot angle\_m\right)\right)\\


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

    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. Step-by-step derivation
      1. associate-*l*53.7%

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares54.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) \]
    7. Applied egg-rr54.7%

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

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

    if 1e12 < a

    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. Step-by-step derivation
      1. associate-*l*49.5%

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares46.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) \]
    7. Applied egg-rr46.2%

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

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

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

        \[\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*52.4%

        \[\leadsto \left(0.011111111111111112 \cdot a\right) \cdot \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(b - a\right)\right)} \]
    11. Simplified52.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 simplification45.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1000000000000:\\ \;\;\;\;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(b - a\right) \cdot \left(\pi \cdot angle\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 45.4% 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 3200000000000:\\ \;\;\;\;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(a \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 (<= a 3200000000000.0)
    (* 0.011111111111111112 (* angle_m (* PI (* b (- b a)))))
    (* 0.011111111111111112 (* (- b a) (* angle_m (* a 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 (a <= 3200000000000.0) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b * (b - a))));
	} else {
		tmp = 0.011111111111111112 * ((b - a) * (angle_m * (a * ((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 (a <= 3200000000000.0) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b * (b - a))));
	} else {
		tmp = 0.011111111111111112 * ((b - a) * (angle_m * (a * 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 a <= 3200000000000.0:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (b * (b - a))))
	else:
		tmp = 0.011111111111111112 * ((b - a) * (angle_m * (a * 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 (a <= 3200000000000.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(a * 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 (a <= 3200000000000.0)
		tmp = 0.011111111111111112 * (angle_m * (pi * (b * (b - a))));
	else
		tmp = 0.011111111111111112 * ((b - a) * (angle_m * (a * 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[a, 3200000000000.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[(a * 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}\;a \leq 3200000000000:\\
\;\;\;\;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(a \cdot \pi\right)\right)\right)\\


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

    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. Step-by-step derivation
      1. associate-*l*53.7%

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares54.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) \]
    7. Applied egg-rr54.7%

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

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

    if 3.2e12 < a

    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. Step-by-step derivation
      1. associate-*l*49.5%

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares46.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) \]
    7. Applied egg-rr46.2%

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

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

        \[\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*44.2%

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

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

        \[\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*52.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 3200000000000:\\ \;\;\;\;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(a \cdot \pi\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}\;a \leq 260000000000:\\ \;\;\;\;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(angle\_m \cdot \left(\pi \cdot \left(a \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 (<= a 260000000000.0)
    (* 0.011111111111111112 (* angle_m (* PI (* b (- b a)))))
    (* 0.011111111111111112 (* angle_m (* PI (* 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 tmp;
	if (a <= 260000000000.0) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b * (b - a))));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (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 tmp;
	if (a <= 260000000000.0) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b * (b - a))));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (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):
	tmp = 0
	if a <= 260000000000.0:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (b * (b - a))))
	else:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (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)
	tmp = 0.0
	if (a <= 260000000000.0)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b * Float64(b - a)))));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(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)
	tmp = 0.0;
	if (a <= 260000000000.0)
		tmp = 0.011111111111111112 * (angle_m * (pi * (b * (b - a))));
	else
		tmp = 0.011111111111111112 * (angle_m * (pi * (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_] := N[(angle$95$s * If[LessEqual[a, 260000000000.0], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a * 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}\;a \leq 260000000000:\\
\;\;\;\;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(angle\_m \cdot \left(\pi \cdot \left(a \cdot \left(b - a\right)\right)\right)\right)\\


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

    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. Step-by-step derivation
      1. associate-*l*53.7%

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares54.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) \]
    7. Applied egg-rr54.7%

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

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

    if 2.6e11 < a

    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. Step-by-step derivation
      1. associate-*l*49.5%

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares46.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) \]
    7. Applied egg-rr46.2%

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

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

Alternative 18: 37.5% 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 4.3 \cdot 10^{+176}:\\ \;\;\;\;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(a \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 4.3e+176)
    (* 0.011111111111111112 (* angle_m (* PI (* a (- b a)))))
    (* 0.011111111111111112 (* angle_m (* a (* 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 <= 4.3e+176) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (a * (b - a))));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (a * (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 <= 4.3e+176) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (a * (b - a))));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (a * (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 <= 4.3e+176:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (a * (b - a))))
	else:
		tmp = 0.011111111111111112 * (angle_m * (a * (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 <= 4.3e+176)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a * Float64(b - a)))));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(a * 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 <= 4.3e+176)
		tmp = 0.011111111111111112 * (angle_m * (pi * (a * (b - a))));
	else
		tmp = 0.011111111111111112 * (angle_m * (a * (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, 4.3e+176], 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[(a * 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 4.3 \cdot 10^{+176}:\\
\;\;\;\;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(a \cdot \left(b \cdot \pi\right)\right)\right)\\


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

    1. Initial program 54.8%

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares56.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) \]
    7. Applied egg-rr56.2%

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

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

    if 4.30000000000000026e176 < angle

    1. Initial program 35.0%

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares22.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) \]
    7. Applied egg-rr22.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;angle \leq 4.3 \cdot 10^{+176}:\\ \;\;\;\;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(angle \cdot \left(a \cdot \left(b \cdot \pi\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 20.9% accurate, 29.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 \leq 9.8 \cdot 10^{+188}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(a \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(b \cdot \pi\right) \cdot \left(a \cdot angle\_m\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 9.8e+188)
    (* 0.011111111111111112 (* angle_m (* a (* b PI))))
    (* 0.011111111111111112 (* (* b PI) (* a angle_m))))))
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 <= 9.8e+188) {
		tmp = 0.011111111111111112 * (angle_m * (a * (b * ((double) M_PI))));
	} else {
		tmp = 0.011111111111111112 * ((b * ((double) M_PI)) * (a * angle_m));
	}
	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 <= 9.8e+188) {
		tmp = 0.011111111111111112 * (angle_m * (a * (b * Math.PI)));
	} else {
		tmp = 0.011111111111111112 * ((b * Math.PI) * (a * angle_m));
	}
	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 <= 9.8e+188:
		tmp = 0.011111111111111112 * (angle_m * (a * (b * math.pi)))
	else:
		tmp = 0.011111111111111112 * ((b * math.pi) * (a * angle_m))
	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 <= 9.8e+188)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(a * Float64(b * pi))));
	else
		tmp = Float64(0.011111111111111112 * Float64(Float64(b * pi) * Float64(a * angle_m)));
	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 <= 9.8e+188)
		tmp = 0.011111111111111112 * (angle_m * (a * (b * pi)));
	else
		tmp = 0.011111111111111112 * ((b * pi) * (a * angle_m));
	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, 9.8e+188], N[(0.011111111111111112 * N[(angle$95$m * N[(a * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(b * Pi), $MachinePrecision] * N[(a * angle$95$m), $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 9.8 \cdot 10^{+188}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(a \cdot \left(b \cdot \pi\right)\right)\right)\\

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


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

    1. Initial program 52.7%

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares52.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) \]
    7. Applied egg-rr52.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) \]
    8. Taylor expanded in b around 0 35.6%

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

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

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

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

    if 9.8e188 < a

    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. Step-by-step derivation
      1. associate-*l*51.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 20: 20.8% 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(angle\_m \cdot \left(a \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 (* angle_m (* a (* 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 * (angle_m * (a * (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 * (angle_m * (a * (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 * (angle_m * (a * (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(angle_m * Float64(a * 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 * (angle_m * (a * (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[(angle$95$m * N[(a * 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(angle\_m \cdot \left(a \cdot \left(b \cdot \pi\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 21: 19.9% 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 52.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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