ab-angle->ABCF B

Percentage Accurate: 54.1% → 67.0%
Time: 16.0s
Alternatives: 14
Speedup: 23.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 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.1% accurate, 1.0× speedup?

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

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

Alternative 1: 67.0% accurate, 0.8× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;b \cdot \left(\left(\left(b + a\_m\right) \cdot \left(1 - \frac{a\_m}{b}\right)\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\_m\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))))) < 2.0000000000000001e-293

    1. Initial program 61.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*61.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. *-commutative61.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*61.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. Simplified61.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. unpow261.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. unpow261.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-squares61.0%

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

      \[\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 b around inf 59.6%

      \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b \cdot \left(1 + -1 \cdot \frac{a}{b}\right)\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) \]
    8. Step-by-step derivation
      1. mul-1-neg59.6%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b \cdot \left(1 + \color{blue}{\left(-\frac{a}{b}\right)}\right)\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) \]
      2. unsub-neg59.6%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b \cdot \color{blue}{\left(1 - \frac{a}{b}\right)}\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) \]
    9. Simplified59.6%

      \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b \cdot \left(1 - \frac{a}{b}\right)\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) \]
    10. Step-by-step derivation
      1. pow159.6%

        \[\leadsto \color{blue}{{\left(\left(\left(b + a\right) \cdot \left(b \cdot \left(1 - \frac{a}{b}\right)\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)\right)}^{1}} \]
    11. Applied egg-rr73.4%

      \[\leadsto \color{blue}{{\left(\left(b + a\right) \cdot \left(\left(b \cdot \left(1 - \frac{a}{b}\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)}^{1}} \]
    12. Taylor expanded in a around inf 72.6%

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

    if 2.0000000000000001e-293 < (*.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 46.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*46.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. *-commutative46.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*46.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. Simplified46.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. unpow246.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. unpow246.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.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-rr54.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. Taylor expanded in b around inf 50.5%

      \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b \cdot \left(1 + -1 \cdot \frac{a}{b}\right)\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) \]
    8. Step-by-step derivation
      1. mul-1-neg50.5%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b \cdot \left(1 + \color{blue}{\left(-\frac{a}{b}\right)}\right)\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) \]
      2. unsub-neg50.5%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b \cdot \color{blue}{\left(1 - \frac{a}{b}\right)}\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) \]
    9. Simplified50.5%

      \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b \cdot \left(1 - \frac{a}{b}\right)\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) \]
    10. Step-by-step derivation
      1. pow150.5%

        \[\leadsto \color{blue}{{\left(\left(\left(b + a\right) \cdot \left(b \cdot \left(1 - \frac{a}{b}\right)\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)\right)}^{1}} \]
    11. Applied egg-rr56.5%

      \[\leadsto \color{blue}{{\left(\left(b + a\right) \cdot \left(\left(b \cdot \left(1 - \frac{a}{b}\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)}^{1}} \]
    12. Taylor expanded in angle around inf 58.1%

      \[\leadsto {\color{blue}{\left(b \cdot \left(\sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(a + b\right) \cdot \left(1 - \frac{a}{b}\right)\right)\right)\right)}}^{1} \]
    13. Step-by-step derivation
      1. +-commutative58.1%

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

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

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

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

Alternative 2: 66.1% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 62.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*62.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. *-commutative62.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*62.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. Simplified62.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. unpow262.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. unpow262.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-squares62.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-rr62.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. Taylor expanded in angle around 0 53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000024e25 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 50.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*50.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. *-commutative50.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*50.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. Simplified50.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. Step-by-step derivation
      1. unpow250.3%

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

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

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

      \[\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 b around inf 56.0%

      \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b \cdot \left(1 + -1 \cdot \frac{a}{b}\right)\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) \]
    8. Step-by-step derivation
      1. mul-1-neg56.0%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b \cdot \left(1 + \color{blue}{\left(-\frac{a}{b}\right)}\right)\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) \]
      2. unsub-neg56.0%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b \cdot \color{blue}{\left(1 - \frac{a}{b}\right)}\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) \]
    9. Simplified56.0%

      \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b \cdot \left(1 - \frac{a}{b}\right)\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) \]
    10. Step-by-step derivation
      1. pow156.0%

        \[\leadsto \color{blue}{{\left(\left(\left(b + a\right) \cdot \left(b \cdot \left(1 - \frac{a}{b}\right)\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)\right)}^{1}} \]
    11. Applied egg-rr68.9%

      \[\leadsto \color{blue}{{\left(\left(b + a\right) \cdot \left(\left(b \cdot \left(1 - \frac{a}{b}\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)}^{1}} \]
    12. Taylor expanded in angle around inf 70.6%

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

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

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

        \[\leadsto {\left(b \cdot \left(\sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(1 - \frac{a}{b}\right) \cdot \color{blue}{\left(a + b\right)}\right)\right)\right)}^{1} \]
    14. Simplified70.6%

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

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

Alternative 3: 63.9% accurate, 1.9× speedup?

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

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

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


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

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

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

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

    if 2.0000000000000001e-61 < (pow.f64 b #s(literal 2 binary64))

    1. Initial program 48.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*48.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. *-commutative48.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*48.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. Simplified48.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. unpow248.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. unpow248.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-squares54.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-rr54.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. Taylor expanded in b around inf 54.8%

      \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b \cdot \left(1 + -1 \cdot \frac{a}{b}\right)\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) \]
    8. Step-by-step derivation
      1. mul-1-neg54.8%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b \cdot \left(1 + \color{blue}{\left(-\frac{a}{b}\right)}\right)\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) \]
      2. unsub-neg54.8%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b \cdot \color{blue}{\left(1 - \frac{a}{b}\right)}\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) \]
    9. Simplified54.8%

      \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b \cdot \left(1 - \frac{a}{b}\right)\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) \]
    10. Step-by-step derivation
      1. pow154.8%

        \[\leadsto \color{blue}{{\left(\left(\left(b + a\right) \cdot \left(b \cdot \left(1 - \frac{a}{b}\right)\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)\right)}^{1}} \]
    11. Applied egg-rr73.3%

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

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

        \[\leadsto \left(b + a\right) \cdot \color{blue}{\left(\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \left(b \cdot \left(1 - \frac{a}{b}\right)\right)\right)} \]
    13. Applied egg-rr73.3%

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

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

Alternative 4: 59.2% accurate, 3.6× speedup?

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

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

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


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

    1. Initial program 57.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*57.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. *-commutative57.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*57.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. Simplified57.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. unpow257.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. unpow257.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-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. pow158.4%

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

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

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

        \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot {\sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right)\right)}^{1} \]
    8. Applied egg-rr58.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.79999999999999993e178 < b

    1. Initial program 33.1%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*33.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. *-commutative33.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*33.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. Simplified33.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. unpow233.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. unpow233.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-squares54.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-rr54.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. Taylor expanded in b around inf 54.5%

      \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b \cdot \left(1 + -1 \cdot \frac{a}{b}\right)\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) \]
    8. Step-by-step derivation
      1. mul-1-neg54.5%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b \cdot \left(1 + \color{blue}{\left(-\frac{a}{b}\right)}\right)\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) \]
      2. unsub-neg54.5%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b \cdot \color{blue}{\left(1 - \frac{a}{b}\right)}\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) \]
    9. Simplified54.5%

      \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b \cdot \left(1 - \frac{a}{b}\right)\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) \]
    10. Taylor expanded in angle around 0 57.1%

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

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

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

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

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

Alternative 5: 47.5% accurate, 3.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 7.8000000000000004e-230

    1. Initial program 58.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*58.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. *-commutative58.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*58.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. Simplified58.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. unpow258.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. unpow258.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-squares59.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-rr59.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 56.2%

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

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

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

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

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

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

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

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

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

    if 7.8000000000000004e-230 < b < 4.5000000000000001e-64

    1. Initial program 62.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*62.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. *-commutative62.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*62.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. Simplified62.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. unpow262.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. unpow262.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.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-rr62.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. Taylor expanded in angle around 0 56.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)} \]
    8. Step-by-step derivation
      1. +-commutative56.1%

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

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

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

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

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

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

    if 4.5000000000000001e-64 < b

    1. Initial program 44.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*44.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. *-commutative44.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*44.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. Simplified44.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. Step-by-step derivation
      1. unpow244.3%

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

        \[\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-squares53.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-rr53.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 b around inf 53.2%

      \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b \cdot \left(1 + -1 \cdot \frac{a}{b}\right)\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) \]
    8. Step-by-step derivation
      1. mul-1-neg53.2%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b \cdot \left(1 + \color{blue}{\left(-\frac{a}{b}\right)}\right)\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) \]
      2. unsub-neg53.2%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b \cdot \color{blue}{\left(1 - \frac{a}{b}\right)}\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) \]
    9. Simplified53.2%

      \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b \cdot \left(1 - \frac{a}{b}\right)\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) \]
    10. Taylor expanded in angle around 0 50.2%

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

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

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

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

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

Alternative 6: 48.0% accurate, 15.5× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b \leq 4 \cdot 10^{-224}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a\_m \cdot \left(b - a\_m\right)\right)\right)\right)\\ \mathbf{elif}\;b \leq 9 \cdot 10^{-64}:\\ \;\;\;\;0.011111111111111112 \cdot \left(a\_m \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - a\_m\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(b \cdot angle\_m\right) \cdot \left(\left(1 - \frac{a\_m}{b}\right) \cdot \left(\pi \cdot \left(b + a\_m\right)\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= b 4e-224)
    (* 0.011111111111111112 (* angle_m (* PI (* a_m (- b a_m)))))
    (if (<= b 9e-64)
      (* 0.011111111111111112 (* a_m (* angle_m (* PI (- b a_m)))))
      (*
       0.011111111111111112
       (* (* b angle_m) (* (- 1.0 (/ a_m b)) (* PI (+ b a_m)))))))))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
	double tmp;
	if (b <= 4e-224) {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (a_m * (b - a_m))));
	} else if (b <= 9e-64) {
		tmp = 0.011111111111111112 * (a_m * (angle_m * (((double) M_PI) * (b - a_m))));
	} else {
		tmp = 0.011111111111111112 * ((b * angle_m) * ((1.0 - (a_m / b)) * (((double) M_PI) * (b + a_m))));
	}
	return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
	double tmp;
	if (b <= 4e-224) {
		tmp = 0.011111111111111112 * (angle_m * (Math.PI * (a_m * (b - a_m))));
	} else if (b <= 9e-64) {
		tmp = 0.011111111111111112 * (a_m * (angle_m * (Math.PI * (b - a_m))));
	} else {
		tmp = 0.011111111111111112 * ((b * angle_m) * ((1.0 - (a_m / b)) * (Math.PI * (b + a_m))));
	}
	return angle_s * tmp;
}
a_m = math.fabs(a)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b, angle_m):
	tmp = 0
	if b <= 4e-224:
		tmp = 0.011111111111111112 * (angle_m * (math.pi * (a_m * (b - a_m))))
	elif b <= 9e-64:
		tmp = 0.011111111111111112 * (a_m * (angle_m * (math.pi * (b - a_m))))
	else:
		tmp = 0.011111111111111112 * ((b * angle_m) * ((1.0 - (a_m / b)) * (math.pi * (b + a_m))))
	return angle_s * tmp
a_m = abs(a)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b, angle_m)
	tmp = 0.0
	if (b <= 4e-224)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a_m * Float64(b - a_m)))));
	elseif (b <= 9e-64)
		tmp = Float64(0.011111111111111112 * Float64(a_m * Float64(angle_m * Float64(pi * Float64(b - a_m)))));
	else
		tmp = Float64(0.011111111111111112 * Float64(Float64(b * angle_m) * Float64(Float64(1.0 - Float64(a_m / b)) * Float64(pi * Float64(b + a_m)))));
	end
	return Float64(angle_s * tmp)
end
a_m = abs(a);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a_m, b, angle_m)
	tmp = 0.0;
	if (b <= 4e-224)
		tmp = 0.011111111111111112 * (angle_m * (pi * (a_m * (b - a_m))));
	elseif (b <= 9e-64)
		tmp = 0.011111111111111112 * (a_m * (angle_m * (pi * (b - a_m))));
	else
		tmp = 0.011111111111111112 * ((b * angle_m) * ((1.0 - (a_m / b)) * (pi * (b + a_m))));
	end
	tmp_2 = angle_s * tmp;
end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 4e-224], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a$95$m * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9e-64], N[(0.011111111111111112 * N[(a$95$m * N[(angle$95$m * N[(Pi * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(b * angle$95$m), $MachinePrecision] * N[(N[(1.0 - N[(a$95$m / b), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 4.0000000000000001e-224

    1. Initial program 58.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*58.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. *-commutative58.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*58.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. Simplified58.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. unpow258.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. unpow258.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-squares59.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-rr59.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 56.2%

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

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

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

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

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

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

    if 4.0000000000000001e-224 < b < 9.00000000000000019e-64

    1. Initial program 62.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*62.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. *-commutative62.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*62.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. Simplified62.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. unpow262.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. unpow262.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.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-rr62.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. Taylor expanded in angle around 0 56.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)} \]
    8. Step-by-step derivation
      1. +-commutative56.1%

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

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

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

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

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

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

    if 9.00000000000000019e-64 < b

    1. Initial program 44.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*44.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. *-commutative44.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*44.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. Simplified44.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. Step-by-step derivation
      1. unpow244.3%

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

        \[\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-squares53.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-rr53.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 b around inf 53.2%

      \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b \cdot \left(1 + -1 \cdot \frac{a}{b}\right)\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) \]
    8. Step-by-step derivation
      1. mul-1-neg53.2%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b \cdot \left(1 + \color{blue}{\left(-\frac{a}{b}\right)}\right)\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) \]
      2. unsub-neg53.2%

        \[\leadsto \left(\left(b + a\right) \cdot \left(b \cdot \color{blue}{\left(1 - \frac{a}{b}\right)}\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) \]
    9. Simplified53.2%

      \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b \cdot \left(1 - \frac{a}{b}\right)\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) \]
    10. Taylor expanded in angle around 0 50.2%

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

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

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

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

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

Alternative 7: 58.8% accurate, 23.3× speedup?

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

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

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


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

    1. Initial program 56.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*56.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. *-commutative56.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*56.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. Simplified56.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. unpow256.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. unpow256.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-squares58.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-rr58.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 55.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(angle \cdot \color{blue}{\left(\left(\pi \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right)}\right) \cdot 0.011111111111111112 \]
      5. associate-*l*55.3%

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

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

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

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

    if 3.99999999999999992e150 < a

    1. Initial program 39.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*39.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. *-commutative39.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*39.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. Simplified39.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. unpow239.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. unpow239.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-squares55.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 58.4% accurate, 23.3× speedup?

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

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

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


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

    1. Initial program 55.6%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*55.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. *-commutative55.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*55.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. Simplified55.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. Step-by-step derivation
      1. unpow255.6%

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

        \[\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. Taylor expanded in angle around 0 55.3%

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

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

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

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

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

    if 6.0999999999999998e121 < a

    1. Initial program 43.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*43.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. *-commutative43.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*43.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. Simplified43.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. unpow243.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. unpow243.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-squares57.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-rr57.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. Taylor expanded in angle around 0 46.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 41.7% accurate, 26.2× speedup?

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

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

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


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

    1. Initial program 56.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*56.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. *-commutative56.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*56.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. Simplified56.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. unpow256.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. unpow256.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-squares58.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-rr58.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 55.2%

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

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

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

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

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

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

    if 6.9999999999999998e153 < a

    1. Initial program 39.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*39.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. *-commutative39.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*39.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. Simplified39.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. unpow239.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. unpow239.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-squares55.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 41.7% accurate, 26.2× speedup?

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

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

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


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

    1. Initial program 56.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*56.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. *-commutative56.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*56.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. Simplified56.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. unpow256.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. unpow256.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-squares58.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-rr58.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 55.2%

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

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

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

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

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

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

    if 1.05999999999999995e153 < a

    1. Initial program 39.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*39.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. *-commutative39.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*39.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. Simplified39.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. unpow239.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. unpow239.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-squares55.0%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 40.9% accurate, 26.2× speedup?

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

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

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


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

    1. Initial program 56.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*56.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. *-commutative56.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*56.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. Simplified56.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. unpow256.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. unpow256.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-squares60.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-rr60.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 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)} \]
    8. Step-by-step derivation
      1. +-commutative57.1%

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

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

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

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

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

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

    if 1.39999999999999991e173 < angle

    1. Initial program 30.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*30.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. *-commutative30.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*30.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. Simplified30.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. unpow230.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. unpow230.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-squares30.0%

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

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

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

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

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

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

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

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

Alternative 12: 21.0% accurate, 46.6× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ 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(b \cdot a\_m\right)\right)\right)\right) \end{array} \]
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
 :precision binary64
 (* angle_s (* 0.011111111111111112 (* angle_m (* PI (* b a_m))))))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (angle_m * (((double) M_PI) * (b * a_m))));
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (angle_m * (Math.PI * (b * a_m))));
}
a_m = math.fabs(a)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a_m, b, angle_m):
	return angle_s * (0.011111111111111112 * (angle_m * (math.pi * (b * a_m))))
a_m = abs(a)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b, angle_m)
	return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b * a_m)))))
end
a_m = abs(a);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a_m, b, angle_m)
	tmp = angle_s * (0.011111111111111112 * (angle_m * (pi * (b * a_m))));
end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
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(b \cdot a\_m\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 53.9%

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. Step-by-step derivation
    1. associate-*l*53.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. *-commutative53.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*53.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. Simplified53.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. unpow253.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. unpow253.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.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-rr57.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 54.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)} \]
  8. Step-by-step derivation
    1. +-commutative54.0%

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

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

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

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

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

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

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

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

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

Alternative 13: 21.0% accurate, 46.6× speedup?

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

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

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. Step-by-step derivation
    1. associate-*l*53.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. *-commutative53.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*53.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. Simplified53.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. unpow253.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. unpow253.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.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-rr57.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 54.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)} \]
  8. Step-by-step derivation
    1. +-commutative54.0%

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

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

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

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

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

    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\left(a \cdot \left(b \cdot \pi\right)\right)}\right) \]
  12. Add Preprocessing

Alternative 14: 19.8% accurate, 46.6× speedup?

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

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

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. Step-by-step derivation
    1. associate-*l*53.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. *-commutative53.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*53.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. Simplified53.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. unpow253.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. unpow253.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.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-rr57.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 54.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)} \]
  8. Step-by-step derivation
    1. +-commutative54.0%

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

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

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

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

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

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

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

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

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

Reproduce

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