ab-angle->ABCF B

Percentage Accurate: 54.8% → 65.2%
Time: 32.9s
Alternatives: 14
Speedup: 32.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 54.8% accurate, 1.0× speedup?

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

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

Alternative 1: 65.2% accurate, 0.4× speedup?

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

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


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

    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({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      2. *-commutative54.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    10. Taylor expanded in a around 0 59.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)} \]
    11. Step-by-step derivation
      1. +-commutative59.9%

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(angle \cdot \left({b}^{2} \cdot \pi\right) + 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)\right)} \]
      2. *-commutative59.9%

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

      \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot {b}^{2}\right) \cdot \pi - \left(a \cdot \left(angle \cdot \pi\right)\right) \cdot a\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 51.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*51.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, 2 \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \left(b + 0\right)\right), -2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left({a}^{2} \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.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:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left({b}^{2} \cdot angle\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, 2 \cdot \left(b \cdot \left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right)\right), -2 \cdot \left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left({a}^{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 66.5% accurate, 0.2× 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 := \left(b - a\right) \cdot \left(b + a\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 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\ t_4 := \cos t\_3\\ t_5 := \sin t\_3\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left({b}^{2} \cdot angle\_m\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\ \mathbf{elif}\;t\_2 \leq 10^{+302}:\\ \;\;\;\;\left(2 \cdot t\_4\right) \cdot \left(t\_5 \cdot t\_1\right)\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(b, 2 \cdot \left(b \cdot \left(t\_5 \cdot t\_4\right)\right), -2 \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left({a}^{2} \cdot 0.005555555555555556\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \left(\sin \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right) \cdot \sqrt[3]{{\cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}^{3}}\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 (* (- b a) (+ b a)))
        (t_2 (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0)))
        (t_3 (* (* PI angle_m) 0.005555555555555556))
        (t_4 (cos t_3))
        (t_5 (sin t_3)))
   (*
    angle_s
    (if (<= t_2 (- INFINITY))
      (*
       0.011111111111111112
       (- (* PI (* (pow b 2.0) angle_m)) (* a (* a (* PI angle_m)))))
      (if (<= t_2 1e+302)
        (* (* 2.0 t_4) (* t_5 t_1))
        (if (<= t_2 INFINITY)
          (fma
           b
           (* 2.0 (* b (* t_5 t_4)))
           (* -2.0 (* (* PI angle_m) (* (pow a 2.0) 0.005555555555555556))))
          (*
           t_1
           (*
            2.0
            (*
             (sin (/ 1.0 (/ 180.0 (* PI angle_m))))
             (cbrt
              (pow (cos (* PI (* angle_m 0.005555555555555556))) 3.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 = ((double) M_PI) * (angle_m / 180.0);
	double t_1 = (b - a) * (b + a);
	double t_2 = ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
	double t_3 = (((double) M_PI) * angle_m) * 0.005555555555555556;
	double t_4 = cos(t_3);
	double t_5 = sin(t_3);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = 0.011111111111111112 * ((((double) M_PI) * (pow(b, 2.0) * angle_m)) - (a * (a * (((double) M_PI) * angle_m))));
	} else if (t_2 <= 1e+302) {
		tmp = (2.0 * t_4) * (t_5 * t_1);
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = fma(b, (2.0 * (b * (t_5 * t_4))), (-2.0 * ((((double) M_PI) * angle_m) * (pow(a, 2.0) * 0.005555555555555556))));
	} else {
		tmp = t_1 * (2.0 * (sin((1.0 / (180.0 / (((double) M_PI) * angle_m)))) * cbrt(pow(cos((((double) M_PI) * (angle_m * 0.005555555555555556))), 3.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(pi * Float64(angle_m / 180.0))
	t_1 = Float64(Float64(b - a) * Float64(b + a))
	t_2 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0))
	t_3 = Float64(Float64(pi * angle_m) * 0.005555555555555556)
	t_4 = cos(t_3)
	t_5 = sin(t_3)
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64((b ^ 2.0) * angle_m)) - Float64(a * Float64(a * Float64(pi * angle_m)))));
	elseif (t_2 <= 1e+302)
		tmp = Float64(Float64(2.0 * t_4) * Float64(t_5 * t_1));
	elseif (t_2 <= Inf)
		tmp = fma(b, Float64(2.0 * Float64(b * Float64(t_5 * t_4))), Float64(-2.0 * Float64(Float64(pi * angle_m) * Float64((a ^ 2.0) * 0.005555555555555556))));
	else
		tmp = Float64(t_1 * Float64(2.0 * Float64(sin(Float64(1.0 / Float64(180.0 / Float64(pi * angle_m)))) * cbrt((cos(Float64(pi * Float64(angle_m * 0.005555555555555556))) ^ 3.0)))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $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[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, Block[{t$95$4 = N[Cos[t$95$3], $MachinePrecision]}, Block[{t$95$5 = N[Sin[t$95$3], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, (-Infinity)], N[(0.011111111111111112 * N[(N[(Pi * N[(N[Power[b, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+302], N[(N[(2.0 * t$95$4), $MachinePrecision] * N[(t$95$5 * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(b * N[(2.0 * N[(b * N[(t$95$5 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(N[Power[a, 2.0], $MachinePrecision] * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(N[Sin[N[(1.0 / N[(180.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Power[N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $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 := \left(b - a\right) \cdot \left(b + a\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 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
t_4 := \cos t\_3\\
t_5 := \sin t\_3\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left({b}^{2} \cdot angle\_m\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\

\mathbf{elif}\;t\_2 \leq 10^{+302}:\\
\;\;\;\;\left(2 \cdot t\_4\right) \cdot \left(t\_5 \cdot t\_1\right)\\

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(b, 2 \cdot \left(b \cdot \left(t\_5 \cdot t\_4\right)\right), -2 \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left({a}^{2} \cdot 0.005555555555555556\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\sin \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right) \cdot \sqrt[3]{{\cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}^{3}}\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 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({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      2. *-commutative54.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    10. Taylor expanded in a around 0 59.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)} \]
    11. Step-by-step derivation
      1. +-commutative59.9%

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(angle \cdot \left({b}^{2} \cdot \pi\right) + 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)\right)} \]
      2. *-commutative59.9%

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

      \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot {b}^{2}\right) \cdot \pi - \left(a \cdot \left(angle \cdot \pi\right)\right) \cdot a\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.0000000000000001e302

    1. Initial program 58.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e302 < (*.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 40.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*40.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(b, 2 \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \left(b + 0\right)\right), -2 \cdot \color{blue}{\left(\left(0.005555555555555556 \cdot {a}^{2}\right) \cdot \left(angle \cdot \pi\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. Step-by-step derivation
      1. associate-*l*0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t\_1 \leq 10^{+302}:\\
\;\;\;\;\left(2 \cdot t\_3\right) \cdot \left(t\_4 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, 2 \cdot \left(b \cdot \left(t\_3 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right), -2 \cdot \left(t\_4 \cdot \left({a}^{2} \cdot t\_3\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))))) < -inf.0

    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({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      2. *-commutative54.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    10. Taylor expanded in a around 0 59.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)} \]
    11. Step-by-step derivation
      1. +-commutative59.9%

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(angle \cdot \left({b}^{2} \cdot \pi\right) + 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)\right)} \]
      2. *-commutative59.9%

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

      \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(\left(angle \cdot {b}^{2}\right) \cdot \pi - \left(a \cdot \left(angle \cdot \pi\right)\right) \cdot a\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.0000000000000001e302

    1. Initial program 58.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e302 < (*.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 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. Step-by-step derivation
      1. associate-*l*31.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left({b}^{2} \cdot angle\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\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 10^{+302}:\\ \;\;\;\;\left(2 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right) \cdot \left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, 2 \cdot \left(b \cdot \left(\cos \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right), -2 \cdot \left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left({a}^{2} \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 66.6% accurate, 0.4× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \left(b - a\right) \cdot \left(b + a\right)\\ t_1 := {b}^{2} - {a}^{2}\\ t_2 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+306}:\\ \;\;\;\;-0.011111111111111112 \cdot {\left(a \cdot \sqrt{\pi \cdot angle\_m}\right)}^{2}\\ \mathbf{elif}\;t\_1 \leq 10^{+306}:\\ \;\;\;\;\left(2 \cdot \cos t\_2\right) \cdot \left(\sin t\_2 \cdot t\_0\right)\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right) + angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(2 \cdot \left(\sin \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right) \cdot \sqrt[3]{{\cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}^{3}}\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 (* (- b a) (+ b a)))
        (t_1 (- (pow b 2.0) (pow a 2.0)))
        (t_2 (* (* PI angle_m) 0.005555555555555556)))
   (*
    angle_s
    (if (<= t_1 -1e+306)
      (* -0.011111111111111112 (pow (* a (sqrt (* PI angle_m))) 2.0))
      (if (<= t_1 1e+306)
        (* (* 2.0 (cos t_2)) (* (sin t_2) t_0))
        (if (<= t_1 INFINITY)
          (*
           0.011111111111111112
           (-
            (* b (+ (* angle_m (* b PI)) (* angle_m (* PI (- a a)))))
            (* (pow a 2.0) (* PI angle_m))))
          (*
           t_0
           (*
            2.0
            (*
             (sin (/ 1.0 (/ 180.0 (* PI angle_m))))
             (cbrt
              (pow (cos (* PI (* angle_m 0.005555555555555556))) 3.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) * (b + a);
	double t_1 = pow(b, 2.0) - pow(a, 2.0);
	double t_2 = (((double) M_PI) * angle_m) * 0.005555555555555556;
	double tmp;
	if (t_1 <= -1e+306) {
		tmp = -0.011111111111111112 * pow((a * sqrt((((double) M_PI) * angle_m))), 2.0);
	} else if (t_1 <= 1e+306) {
		tmp = (2.0 * cos(t_2)) * (sin(t_2) * t_0);
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = 0.011111111111111112 * ((b * ((angle_m * (b * ((double) M_PI))) + (angle_m * (((double) M_PI) * (a - a))))) - (pow(a, 2.0) * (((double) M_PI) * angle_m)));
	} else {
		tmp = t_0 * (2.0 * (sin((1.0 / (180.0 / (((double) M_PI) * angle_m)))) * cbrt(pow(cos((((double) M_PI) * (angle_m * 0.005555555555555556))), 3.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) * (b + a);
	double t_1 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
	double t_2 = (Math.PI * angle_m) * 0.005555555555555556;
	double tmp;
	if (t_1 <= -1e+306) {
		tmp = -0.011111111111111112 * Math.pow((a * Math.sqrt((Math.PI * angle_m))), 2.0);
	} else if (t_1 <= 1e+306) {
		tmp = (2.0 * Math.cos(t_2)) * (Math.sin(t_2) * t_0);
	} else if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = 0.011111111111111112 * ((b * ((angle_m * (b * Math.PI)) + (angle_m * (Math.PI * (a - a))))) - (Math.pow(a, 2.0) * (Math.PI * angle_m)));
	} else {
		tmp = t_0 * (2.0 * (Math.sin((1.0 / (180.0 / (Math.PI * angle_m)))) * Math.cbrt(Math.pow(Math.cos((Math.PI * (angle_m * 0.005555555555555556))), 3.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(b + a))
	t_1 = Float64((b ^ 2.0) - (a ^ 2.0))
	t_2 = Float64(Float64(pi * angle_m) * 0.005555555555555556)
	tmp = 0.0
	if (t_1 <= -1e+306)
		tmp = Float64(-0.011111111111111112 * (Float64(a * sqrt(Float64(pi * angle_m))) ^ 2.0));
	elseif (t_1 <= 1e+306)
		tmp = Float64(Float64(2.0 * cos(t_2)) * Float64(sin(t_2) * t_0));
	elseif (t_1 <= Inf)
		tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(b * pi)) + Float64(angle_m * Float64(pi * Float64(a - a))))) - Float64((a ^ 2.0) * Float64(pi * angle_m))));
	else
		tmp = Float64(t_0 * Float64(2.0 * Float64(sin(Float64(1.0 / Float64(180.0 / Float64(pi * angle_m)))) * cbrt((cos(Float64(pi * Float64(angle_m * 0.005555555555555556))) ^ 3.0)))));
	end
	return Float64(angle_s * tmp)
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $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[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, -1e+306], N[(-0.011111111111111112 * N[Power[N[(a * N[Sqrt[N[(Pi * angle$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+306], N[(N[(2.0 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[t$95$2], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(N[Sin[N[(1.0 / N[(180.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Power[N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $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 := \left(b - a\right) \cdot \left(b + a\right)\\
t_1 := {b}^{2} - {a}^{2}\\
t_2 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+306}:\\
\;\;\;\;-0.011111111111111112 \cdot {\left(a \cdot \sqrt{\pi \cdot angle\_m}\right)}^{2}\\

\mathbf{elif}\;t\_1 \leq 10^{+306}:\\
\;\;\;\;\left(2 \cdot \cos t\_2\right) \cdot \left(\sin t\_2 \cdot t\_0\right)\\

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

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(\sin \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right) \cdot \sqrt[3]{{\cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}^{3}}\right)\right)\\


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

    1. Initial program 60.3%

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

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

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

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

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

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

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

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

        \[\leadsto -0.011111111111111112 \cdot \color{blue}{{\left(\sqrt{{a}^{2} \cdot \left(angle \cdot \pi\right)}\right)}^{2}} \]
      3. *-commutative31.5%

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

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

        \[\leadsto -0.011111111111111112 \cdot {\left(\color{blue}{{a}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\pi \cdot angle}\right)}^{2} \]
      6. metadata-eval43.6%

        \[\leadsto -0.011111111111111112 \cdot {\left({a}^{\color{blue}{1}} \cdot \sqrt{\pi \cdot angle}\right)}^{2} \]
      7. pow143.6%

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

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

    if -1.00000000000000002e306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.00000000000000002e306

    1. Initial program 57.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    10. Taylor expanded in b around 0 83.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 65.0% accurate, 0.4× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := {b}^{2} - {a}^{2}\\ t_1 := \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\_m\right)\right)\\ t_2 := {a}^{2} \cdot \left(-t\_1\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -1 \cdot 10^{+306}:\\ \;\;\;\;-0.011111111111111112 \cdot {\left(a \cdot \sqrt{\pi \cdot angle\_m}\right)}^{2}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-256}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_0 \leq 10^{+306}:\\ \;\;\;\;{b}^{2} \cdot t\_1\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right) + angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (- (pow b 2.0) (pow a 2.0)))
        (t_1 (sin (* 0.011111111111111112 (* PI angle_m))))
        (t_2 (* (pow a 2.0) (- t_1))))
   (*
    angle_s
    (if (<= t_0 -1e+306)
      (* -0.011111111111111112 (pow (* a (sqrt (* PI angle_m))) 2.0))
      (if (<= t_0 2e-256)
        t_2
        (if (<= t_0 1e+306)
          (* (pow b 2.0) t_1)
          (if (<= t_0 INFINITY)
            (*
             0.011111111111111112
             (-
              (* b (+ (* angle_m (* b PI)) (* angle_m (* PI (- a a)))))
              (* (pow a 2.0) (* PI angle_m))))
            t_2)))))))
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 = pow(b, 2.0) - pow(a, 2.0);
	double t_1 = sin((0.011111111111111112 * (((double) M_PI) * angle_m)));
	double t_2 = pow(a, 2.0) * -t_1;
	double tmp;
	if (t_0 <= -1e+306) {
		tmp = -0.011111111111111112 * pow((a * sqrt((((double) M_PI) * angle_m))), 2.0);
	} else if (t_0 <= 2e-256) {
		tmp = t_2;
	} else if (t_0 <= 1e+306) {
		tmp = pow(b, 2.0) * t_1;
	} else if (t_0 <= ((double) INFINITY)) {
		tmp = 0.011111111111111112 * ((b * ((angle_m * (b * ((double) M_PI))) + (angle_m * (((double) M_PI) * (a - a))))) - (pow(a, 2.0) * (((double) M_PI) * angle_m)));
	} else {
		tmp = t_2;
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
	double t_1 = Math.sin((0.011111111111111112 * (Math.PI * angle_m)));
	double t_2 = Math.pow(a, 2.0) * -t_1;
	double tmp;
	if (t_0 <= -1e+306) {
		tmp = -0.011111111111111112 * Math.pow((a * Math.sqrt((Math.PI * angle_m))), 2.0);
	} else if (t_0 <= 2e-256) {
		tmp = t_2;
	} else if (t_0 <= 1e+306) {
		tmp = Math.pow(b, 2.0) * t_1;
	} else if (t_0 <= Double.POSITIVE_INFINITY) {
		tmp = 0.011111111111111112 * ((b * ((angle_m * (b * Math.PI)) + (angle_m * (Math.PI * (a - a))))) - (Math.pow(a, 2.0) * (Math.PI * angle_m)));
	} else {
		tmp = t_2;
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = math.pow(b, 2.0) - math.pow(a, 2.0)
	t_1 = math.sin((0.011111111111111112 * (math.pi * angle_m)))
	t_2 = math.pow(a, 2.0) * -t_1
	tmp = 0
	if t_0 <= -1e+306:
		tmp = -0.011111111111111112 * math.pow((a * math.sqrt((math.pi * angle_m))), 2.0)
	elif t_0 <= 2e-256:
		tmp = t_2
	elif t_0 <= 1e+306:
		tmp = math.pow(b, 2.0) * t_1
	elif t_0 <= math.inf:
		tmp = 0.011111111111111112 * ((b * ((angle_m * (b * math.pi)) + (angle_m * (math.pi * (a - a))))) - (math.pow(a, 2.0) * (math.pi * angle_m)))
	else:
		tmp = t_2
	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((b ^ 2.0) - (a ^ 2.0))
	t_1 = sin(Float64(0.011111111111111112 * Float64(pi * angle_m)))
	t_2 = Float64((a ^ 2.0) * Float64(-t_1))
	tmp = 0.0
	if (t_0 <= -1e+306)
		tmp = Float64(-0.011111111111111112 * (Float64(a * sqrt(Float64(pi * angle_m))) ^ 2.0));
	elseif (t_0 <= 2e-256)
		tmp = t_2;
	elseif (t_0 <= 1e+306)
		tmp = Float64((b ^ 2.0) * t_1);
	elseif (t_0 <= Inf)
		tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(b * pi)) + Float64(angle_m * Float64(pi * Float64(a - a))))) - Float64((a ^ 2.0) * Float64(pi * angle_m))));
	else
		tmp = t_2;
	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 ^ 2.0) - (a ^ 2.0);
	t_1 = sin((0.011111111111111112 * (pi * angle_m)));
	t_2 = (a ^ 2.0) * -t_1;
	tmp = 0.0;
	if (t_0 <= -1e+306)
		tmp = -0.011111111111111112 * ((a * sqrt((pi * angle_m))) ^ 2.0);
	elseif (t_0 <= 2e-256)
		tmp = t_2;
	elseif (t_0 <= 1e+306)
		tmp = (b ^ 2.0) * t_1;
	elseif (t_0 <= Inf)
		tmp = 0.011111111111111112 * ((b * ((angle_m * (b * pi)) + (angle_m * (pi * (a - a))))) - ((a ^ 2.0) * (pi * angle_m)));
	else
		tmp = t_2;
	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[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(0.011111111111111112 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[a, 2.0], $MachinePrecision] * (-t$95$1)), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, -1e+306], N[(-0.011111111111111112 * N[Power[N[(a * N[Sqrt[N[(Pi * angle$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e-256], t$95$2, If[LessEqual[t$95$0, 1e+306], N[(N[Power[b, 2.0], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]), $MachinePrecision]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := {b}^{2} - {a}^{2}\\
t_1 := \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\_m\right)\right)\\
t_2 := {a}^{2} \cdot \left(-t\_1\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+306}:\\
\;\;\;\;-0.011111111111111112 \cdot {\left(a \cdot \sqrt{\pi \cdot angle\_m}\right)}^{2}\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-256}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_0 \leq 10^{+306}:\\
\;\;\;\;{b}^{2} \cdot t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_2\\


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

    1. Initial program 60.3%

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

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

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

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

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

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

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

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

        \[\leadsto -0.011111111111111112 \cdot \color{blue}{{\left(\sqrt{{a}^{2} \cdot \left(angle \cdot \pi\right)}\right)}^{2}} \]
      3. *-commutative31.5%

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

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

        \[\leadsto -0.011111111111111112 \cdot {\left(\color{blue}{{a}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\pi \cdot angle}\right)}^{2} \]
      6. metadata-eval43.6%

        \[\leadsto -0.011111111111111112 \cdot {\left({a}^{\color{blue}{1}} \cdot \sqrt{\pi \cdot angle}\right)}^{2} \]
      7. pow143.6%

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

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

    if -1.00000000000000002e306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.99999999999999995e-256 or +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 56.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*56.5%

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

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

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

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

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

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

        \[\leadsto \log \left(1 + \mathsf{expm1}\left(\left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\sin \left(2 \cdot \left(\pi \cdot \frac{angle}{180}\right)\right)}\right)\right) \]
      4. associate-*r*26.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot {a}^{2}\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)} \]
      2. neg-mul-167.8%

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

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

    if 1.99999999999999995e-256 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.00000000000000002e306

    1. Initial program 50.0%

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

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

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

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

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

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

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

        \[\leadsto \log \left(1 + \mathsf{expm1}\left(\left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\sin \left(2 \cdot \left(\pi \cdot \frac{angle}{180}\right)\right)}\right)\right) \]
      4. associate-*r*12.3%

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

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

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

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

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

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

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    10. Taylor expanded in b around 0 83.9%

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

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

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

\mathbf{elif}\;t\_1 \leq 10^{+306}:\\
\;\;\;\;\left(2 \cdot \cos t\_2\right) \cdot \left(\sin t\_2 \cdot t\_0\right)\\

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

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


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

    1. Initial program 60.3%

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

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

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

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

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

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

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

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

        \[\leadsto -0.011111111111111112 \cdot \color{blue}{{\left(\sqrt{{a}^{2} \cdot \left(angle \cdot \pi\right)}\right)}^{2}} \]
      3. *-commutative31.5%

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

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

        \[\leadsto -0.011111111111111112 \cdot {\left(\color{blue}{{a}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\pi \cdot angle}\right)}^{2} \]
      6. metadata-eval43.6%

        \[\leadsto -0.011111111111111112 \cdot {\left({a}^{\color{blue}{1}} \cdot \sqrt{\pi \cdot angle}\right)}^{2} \]
      7. pow143.6%

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

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

    if -1.00000000000000002e306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.00000000000000002e306

    1. Initial program 57.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    10. Taylor expanded in b around 0 83.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 66.5% 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 := \pi \cdot \frac{angle\_m}{180}\\ t_1 := {b}^{2} - {a}^{2}\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+306}:\\ \;\;\;\;-0.011111111111111112 \cdot {\left(a \cdot \sqrt{\pi \cdot angle\_m}\right)}^{2}\\ \mathbf{elif}\;t\_1 \leq 10^{+306} \lor \neg \left(t\_1 \leq \infty\right):\\ \;\;\;\;2 \cdot \left(\cos t\_0 \cdot \left(\sin t\_0 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right) + angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\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 (- (pow b 2.0) (pow a 2.0))))
   (*
    angle_s
    (if (<= t_1 -1e+306)
      (* -0.011111111111111112 (pow (* a (sqrt (* PI angle_m))) 2.0))
      (if (or (<= t_1 1e+306) (not (<= t_1 INFINITY)))
        (* 2.0 (* (cos t_0) (* (sin t_0) (* (- b a) (+ b a)))))
        (*
         0.011111111111111112
         (-
          (* b (+ (* angle_m (* b PI)) (* angle_m (* PI (- a a)))))
          (* (pow a 2.0) (* 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 t_0 = ((double) M_PI) * (angle_m / 180.0);
	double t_1 = pow(b, 2.0) - pow(a, 2.0);
	double tmp;
	if (t_1 <= -1e+306) {
		tmp = -0.011111111111111112 * pow((a * sqrt((((double) M_PI) * angle_m))), 2.0);
	} else if ((t_1 <= 1e+306) || !(t_1 <= ((double) INFINITY))) {
		tmp = 2.0 * (cos(t_0) * (sin(t_0) * ((b - a) * (b + a))));
	} else {
		tmp = 0.011111111111111112 * ((b * ((angle_m * (b * ((double) M_PI))) + (angle_m * (((double) M_PI) * (a - a))))) - (pow(a, 2.0) * (((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 t_0 = Math.PI * (angle_m / 180.0);
	double t_1 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
	double tmp;
	if (t_1 <= -1e+306) {
		tmp = -0.011111111111111112 * Math.pow((a * Math.sqrt((Math.PI * angle_m))), 2.0);
	} else if ((t_1 <= 1e+306) || !(t_1 <= Double.POSITIVE_INFINITY)) {
		tmp = 2.0 * (Math.cos(t_0) * (Math.sin(t_0) * ((b - a) * (b + a))));
	} else {
		tmp = 0.011111111111111112 * ((b * ((angle_m * (b * Math.PI)) + (angle_m * (Math.PI * (a - a))))) - (Math.pow(a, 2.0) * (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):
	t_0 = math.pi * (angle_m / 180.0)
	t_1 = math.pow(b, 2.0) - math.pow(a, 2.0)
	tmp = 0
	if t_1 <= -1e+306:
		tmp = -0.011111111111111112 * math.pow((a * math.sqrt((math.pi * angle_m))), 2.0)
	elif (t_1 <= 1e+306) or not (t_1 <= math.inf):
		tmp = 2.0 * (math.cos(t_0) * (math.sin(t_0) * ((b - a) * (b + a))))
	else:
		tmp = 0.011111111111111112 * ((b * ((angle_m * (b * math.pi)) + (angle_m * (math.pi * (a - a))))) - (math.pow(a, 2.0) * (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)
	t_0 = Float64(pi * Float64(angle_m / 180.0))
	t_1 = Float64((b ^ 2.0) - (a ^ 2.0))
	tmp = 0.0
	if (t_1 <= -1e+306)
		tmp = Float64(-0.011111111111111112 * (Float64(a * sqrt(Float64(pi * angle_m))) ^ 2.0));
	elseif ((t_1 <= 1e+306) || !(t_1 <= Inf))
		tmp = Float64(2.0 * Float64(cos(t_0) * Float64(sin(t_0) * Float64(Float64(b - a) * Float64(b + a)))));
	else
		tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(b * pi)) + Float64(angle_m * Float64(pi * Float64(a - a))))) - Float64((a ^ 2.0) * 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)
	t_0 = pi * (angle_m / 180.0);
	t_1 = (b ^ 2.0) - (a ^ 2.0);
	tmp = 0.0;
	if (t_1 <= -1e+306)
		tmp = -0.011111111111111112 * ((a * sqrt((pi * angle_m))) ^ 2.0);
	elseif ((t_1 <= 1e+306) || ~((t_1 <= Inf)))
		tmp = 2.0 * (cos(t_0) * (sin(t_0) * ((b - a) * (b + a))));
	else
		tmp = 0.011111111111111112 * ((b * ((angle_m * (b * pi)) + (angle_m * (pi * (a - a))))) - ((a ^ 2.0) * (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_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, -1e+306], N[(-0.011111111111111112 * N[Power[N[(a * N[Sqrt[N[(Pi * angle$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, 1e+306], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $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 := {b}^{2} - {a}^{2}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+306}:\\
\;\;\;\;-0.011111111111111112 \cdot {\left(a \cdot \sqrt{\pi \cdot angle\_m}\right)}^{2}\\

\mathbf{elif}\;t\_1 \leq 10^{+306} \lor \neg \left(t\_1 \leq \infty\right):\\
\;\;\;\;2 \cdot \left(\cos t\_0 \cdot \left(\sin t\_0 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right) + angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\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))) < -1.00000000000000002e306

    1. Initial program 60.3%

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

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

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

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

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

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

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

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

        \[\leadsto -0.011111111111111112 \cdot \color{blue}{{\left(\sqrt{{a}^{2} \cdot \left(angle \cdot \pi\right)}\right)}^{2}} \]
      3. *-commutative31.5%

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

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

        \[\leadsto -0.011111111111111112 \cdot {\left(\color{blue}{{a}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\pi \cdot angle}\right)}^{2} \]
      6. metadata-eval43.6%

        \[\leadsto -0.011111111111111112 \cdot {\left({a}^{\color{blue}{1}} \cdot \sqrt{\pi \cdot angle}\right)}^{2} \]
      7. pow143.6%

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

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

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

    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. Step-by-step derivation
      1. unpow253.7%

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

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

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

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

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

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    10. Taylor expanded in b around 0 83.9%

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

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

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

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

\mathbf{elif}\;t\_2 \leq 10^{+306}:\\
\;\;\;\;\left(2 \cdot \cos t\_3\right) \cdot \left(\sin t\_3 \cdot t\_0\right)\\

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

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


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

    1. Initial program 60.3%

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

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

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

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

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

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

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

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

        \[\leadsto -0.011111111111111112 \cdot \color{blue}{{\left(\sqrt{{a}^{2} \cdot \left(angle \cdot \pi\right)}\right)}^{2}} \]
      3. *-commutative31.5%

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

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

        \[\leadsto -0.011111111111111112 \cdot {\left(\color{blue}{{a}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\pi \cdot angle}\right)}^{2} \]
      6. metadata-eval43.6%

        \[\leadsto -0.011111111111111112 \cdot {\left({a}^{\color{blue}{1}} \cdot \sqrt{\pi \cdot angle}\right)}^{2} \]
      7. pow143.6%

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

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

    if -1.00000000000000002e306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.00000000000000002e306

    1. Initial program 57.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 36.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    10. Taylor expanded in b around 0 83.9%

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

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

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

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

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

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

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

Alternative 9: 59.2% accurate, 1.9× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+16}:\\ \;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right) + angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+243}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left|-0.011111111111111112 \cdot \left(\pi \cdot \left({a}^{2} \cdot angle\_m\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) 4e+16)
    (*
     0.011111111111111112
     (-
      (* b (+ (* angle_m (* b PI)) (* angle_m (* PI (- a a)))))
      (* (pow a 2.0) (* PI angle_m))))
    (if (<= (/ angle_m 180.0) 4e+243)
      (* (* (- b a) (+ b a)) (* 2.0 (sin (* PI (/ angle_m 180.0)))))
      (fabs (* -0.011111111111111112 (* PI (* (pow a 2.0) 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 ((angle_m / 180.0) <= 4e+16) {
		tmp = 0.011111111111111112 * ((b * ((angle_m * (b * ((double) M_PI))) + (angle_m * (((double) M_PI) * (a - a))))) - (pow(a, 2.0) * (((double) M_PI) * angle_m)));
	} else if ((angle_m / 180.0) <= 4e+243) {
		tmp = ((b - a) * (b + a)) * (2.0 * sin((((double) M_PI) * (angle_m / 180.0))));
	} else {
		tmp = fabs((-0.011111111111111112 * (((double) M_PI) * (pow(a, 2.0) * 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 ((angle_m / 180.0) <= 4e+16) {
		tmp = 0.011111111111111112 * ((b * ((angle_m * (b * Math.PI)) + (angle_m * (Math.PI * (a - a))))) - (Math.pow(a, 2.0) * (Math.PI * angle_m)));
	} else if ((angle_m / 180.0) <= 4e+243) {
		tmp = ((b - a) * (b + a)) * (2.0 * Math.sin((Math.PI * (angle_m / 180.0))));
	} else {
		tmp = Math.abs((-0.011111111111111112 * (Math.PI * (Math.pow(a, 2.0) * 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 (angle_m / 180.0) <= 4e+16:
		tmp = 0.011111111111111112 * ((b * ((angle_m * (b * math.pi)) + (angle_m * (math.pi * (a - a))))) - (math.pow(a, 2.0) * (math.pi * angle_m)))
	elif (angle_m / 180.0) <= 4e+243:
		tmp = ((b - a) * (b + a)) * (2.0 * math.sin((math.pi * (angle_m / 180.0))))
	else:
		tmp = math.fabs((-0.011111111111111112 * (math.pi * (math.pow(a, 2.0) * 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 (Float64(angle_m / 180.0) <= 4e+16)
		tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(b * pi)) + Float64(angle_m * Float64(pi * Float64(a - a))))) - Float64((a ^ 2.0) * Float64(pi * angle_m))));
	elseif (Float64(angle_m / 180.0) <= 4e+243)
		tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(2.0 * sin(Float64(pi * Float64(angle_m / 180.0)))));
	else
		tmp = abs(Float64(-0.011111111111111112 * Float64(pi * Float64((a ^ 2.0) * 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 ((angle_m / 180.0) <= 4e+16)
		tmp = 0.011111111111111112 * ((b * ((angle_m * (b * pi)) + (angle_m * (pi * (a - a))))) - ((a ^ 2.0) * (pi * angle_m)));
	elseif ((angle_m / 180.0) <= 4e+243)
		tmp = ((b - a) * (b + a)) * (2.0 * sin((pi * (angle_m / 180.0))));
	else
		tmp = abs((-0.011111111111111112 * (pi * ((a ^ 2.0) * 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[N[(angle$95$m / 180.0), $MachinePrecision], 4e+16], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+243], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(-0.011111111111111112 * N[(Pi * N[(N[Power[a, 2.0], $MachinePrecision] * angle$95$m), $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 4 \cdot 10^{+16}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right) + angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}\right)\right) \]
    9. Taylor expanded in angle around 0 58.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)} \]
    10. Taylor expanded in b around 0 63.7%

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

    if 4e16 < (/.f64 angle #s(literal 180 binary64)) < 4.0000000000000003e243

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

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

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

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

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

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

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

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

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

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

    if 4.0000000000000003e243 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.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*24.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\left(-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \left(-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right)}} \]
      3. *-commutative40.5%

        \[\leadsto \sqrt{\color{blue}{\left(\left({a}^{2} \cdot \left(angle \cdot \pi\right)\right) \cdot -0.011111111111111112\right)} \cdot \left(-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\right)} \]
      4. *-commutative40.5%

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

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

        \[\leadsto \sqrt{\color{blue}{{\left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)}^{2}} \cdot \left(-0.011111111111111112 \cdot -0.011111111111111112\right)} \]
      7. *-commutative40.5%

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

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

        \[\leadsto \sqrt{{\left(\color{blue}{\left(angle \cdot \pi\right)} \cdot {a}^{2}\right)}^{2} \cdot \left(-0.011111111111111112 \cdot -0.011111111111111112\right)} \]
      10. associate-*l*40.5%

        \[\leadsto \sqrt{{\color{blue}{\left(angle \cdot \left(\pi \cdot {a}^{2}\right)\right)}}^{2} \cdot \left(-0.011111111111111112 \cdot -0.011111111111111112\right)} \]
      11. metadata-eval40.5%

        \[\leadsto \sqrt{{\left(angle \cdot \left(\pi \cdot {a}^{2}\right)\right)}^{2} \cdot \color{blue}{0.0001234567901234568}} \]
    8. Applied egg-rr40.5%

      \[\leadsto \color{blue}{\sqrt{{\left(angle \cdot \left(\pi \cdot {a}^{2}\right)\right)}^{2} \cdot 0.0001234567901234568}} \]
    9. Step-by-step derivation
      1. unpow240.5%

        \[\leadsto \sqrt{\color{blue}{\left(\left(angle \cdot \left(\pi \cdot {a}^{2}\right)\right) \cdot \left(angle \cdot \left(\pi \cdot {a}^{2}\right)\right)\right)} \cdot 0.0001234567901234568} \]
      2. metadata-eval40.5%

        \[\leadsto \sqrt{\left(\left(angle \cdot \left(\pi \cdot {a}^{2}\right)\right) \cdot \left(angle \cdot \left(\pi \cdot {a}^{2}\right)\right)\right) \cdot \color{blue}{\left(-0.011111111111111112 \cdot -0.011111111111111112\right)}} \]
      3. swap-sqr40.5%

        \[\leadsto \sqrt{\color{blue}{\left(\left(angle \cdot \left(\pi \cdot {a}^{2}\right)\right) \cdot -0.011111111111111112\right) \cdot \left(\left(angle \cdot \left(\pi \cdot {a}^{2}\right)\right) \cdot -0.011111111111111112\right)}} \]
      4. rem-sqrt-square40.5%

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

        \[\leadsto \left|\color{blue}{\left(\left(angle \cdot \pi\right) \cdot {a}^{2}\right)} \cdot -0.011111111111111112\right| \]
      6. *-commutative40.5%

        \[\leadsto \left|\left(\color{blue}{\left(\pi \cdot angle\right)} \cdot {a}^{2}\right) \cdot -0.011111111111111112\right| \]
      7. associate-*l*40.5%

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    10. Taylor expanded in b around 0 63.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)} \]

    if 1e21 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 28.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*28.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    10. Taylor expanded in a around 0 60.2%

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(angle \cdot \left({b}^{2} \cdot \pi\right) + 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)\right)} \]
      2. *-commutative60.2%

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

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

    if 1e21 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 28.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*28.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}\right)\right) \]
    9. Taylor expanded in angle around 0 58.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)} \]
    10. Taylor expanded in a around 0 60.3%

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(angle \cdot \left({b}^{2} \cdot \pi\right) + 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)\right)} \]
      2. *-commutative60.3%

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

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

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

    1. Initial program 29.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*29.8%

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

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

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

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

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

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

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

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

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

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

Alternative 13: 55.7% accurate, 3.5× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 4.7 \cdot 10^{+61}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left({b}^{2} \cdot angle\_m\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\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.7e+61)
    (*
     0.011111111111111112
     (- (* PI (* (pow b 2.0) angle_m)) (* a (* a (* PI angle_m)))))
    (* 0.011111111111111112 (* angle_m (* (pow b 2.0) 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.7e+61) {
		tmp = 0.011111111111111112 * ((((double) M_PI) * (pow(b, 2.0) * angle_m)) - (a * (a * (((double) M_PI) * angle_m))));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (pow(b, 2.0) * ((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.7e+61) {
		tmp = 0.011111111111111112 * ((Math.PI * (Math.pow(b, 2.0) * angle_m)) - (a * (a * (Math.PI * angle_m))));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (Math.pow(b, 2.0) * 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.7e+61:
		tmp = 0.011111111111111112 * ((math.pi * (math.pow(b, 2.0) * angle_m)) - (a * (a * (math.pi * angle_m))))
	else:
		tmp = 0.011111111111111112 * (angle_m * (math.pow(b, 2.0) * 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.7e+61)
		tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64((b ^ 2.0) * angle_m)) - Float64(a * Float64(a * Float64(pi * angle_m)))));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64((b ^ 2.0) * 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.7e+61)
		tmp = 0.011111111111111112 * ((pi * ((b ^ 2.0) * angle_m)) - (a * (a * (pi * angle_m))));
	else
		tmp = 0.011111111111111112 * (angle_m * ((b ^ 2.0) * 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.7e+61], N[(0.011111111111111112 * N[(N[(Pi * N[(N[Power[b, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $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.7 \cdot 10^{+61}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left({b}^{2} \cdot angle\_m\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\

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


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

    1. Initial program 58.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    10. Taylor expanded in a around 0 58.2%

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(angle \cdot \left({b}^{2} \cdot \pi\right) + 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)\right)} \]
      2. *-commutative58.2%

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

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

    if 4.6999999999999998e61 < angle

    1. Initial program 28.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*28.6%

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

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

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

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

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

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

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

Alternative 14: 55.9% accurate, 32.2× 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(\pi \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\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 (* PI (* (- b a) (+ b a)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (angle_m * (((double) M_PI) * ((b - a) * (b + a)))));
}
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 * (Math.PI * ((b - a) * (b + a)))));
}
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 * (math.pi * ((b - a) * (b + a)))))
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(pi * Float64(Float64(b - a) * Float64(b + a))))))
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 * (pi * ((b - a) * (b + a)))));
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[(Pi * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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