ab-angle->ABCF B

Percentage Accurate: 53.4% → 66.0%
Time: 6.9s
Alternatives: 17
Speedup: 13.7×

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}

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

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

Initial Program: 53.4% accurate, 1.0× speedup?

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

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

Alternative 1: 66.0% accurate, 1.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 := \left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 6.5 \cdot 10^{+149}:\\ \;\;\;\;\left(\left(\left(\sin t\_0 \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right) \cdot \cos \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos t\_0\\ \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 (* (* angle_m PI) 0.005555555555555556)))
   (*
    angle_s
    (if (<= angle_m 6.5e+149)
      (*
       (*
        (* (* (sin t_0) (+ a_m b)) (- b a_m))
        (cos (* angle_m (* 0.005555555555555556 PI))))
       2.0)
      (*
       (* (* (* PI angle_m) (* (+ b a_m) (- b a_m))) 0.011111111111111112)
       (cos t_0))))))
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 = (angle_m * ((double) M_PI)) * 0.005555555555555556;
	double tmp;
	if (angle_m <= 6.5e+149) {
		tmp = (((sin(t_0) * (a_m + b)) * (b - a_m)) * cos((angle_m * (0.005555555555555556 * ((double) M_PI))))) * 2.0;
	} else {
		tmp = (((((double) M_PI) * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * cos(t_0);
	}
	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 = (angle_m * Math.PI) * 0.005555555555555556;
	double tmp;
	if (angle_m <= 6.5e+149) {
		tmp = (((Math.sin(t_0) * (a_m + b)) * (b - a_m)) * Math.cos((angle_m * (0.005555555555555556 * Math.PI)))) * 2.0;
	} else {
		tmp = (((Math.PI * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * Math.cos(t_0);
	}
	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 = (angle_m * math.pi) * 0.005555555555555556
	tmp = 0
	if angle_m <= 6.5e+149:
		tmp = (((math.sin(t_0) * (a_m + b)) * (b - a_m)) * math.cos((angle_m * (0.005555555555555556 * math.pi)))) * 2.0
	else:
		tmp = (((math.pi * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * math.cos(t_0)
	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(Float64(angle_m * pi) * 0.005555555555555556)
	tmp = 0.0
	if (angle_m <= 6.5e+149)
		tmp = Float64(Float64(Float64(Float64(sin(t_0) * Float64(a_m + b)) * Float64(b - a_m)) * cos(Float64(angle_m * Float64(0.005555555555555556 * pi)))) * 2.0);
	else
		tmp = Float64(Float64(Float64(Float64(pi * angle_m) * Float64(Float64(b + a_m) * Float64(b - a_m))) * 0.011111111111111112) * cos(t_0));
	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 = (angle_m * pi) * 0.005555555555555556;
	tmp = 0.0;
	if (angle_m <= 6.5e+149)
		tmp = (((sin(t_0) * (a_m + b)) * (b - a_m)) * cos((angle_m * (0.005555555555555556 * pi)))) * 2.0;
	else
		tmp = (((pi * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * cos(t_0);
	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[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 6.5e+149], N[(N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * N[Cos[t$95$0], $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 := \left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 6.5 \cdot 10^{+149}:\\
\;\;\;\;\left(\left(\left(\sin t\_0 \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right) \cdot \cos \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right) \cdot 2\\

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


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

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

      \[\leadsto \color{blue}{2 \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
      3. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\color{blue}{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      4. lower-cos.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      9. lift-PI.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      10. lower-*.f64N/A

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

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

      \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)\right) \cdot \color{blue}{2} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
      2. lift-PI.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
      4. associate-*l*N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right)\right)\right) \cdot 2 \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot 2 \]
      6. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot 2 \]
      7. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot 2 \]
      8. lift-PI.f6473.9

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right) \cdot 2 \]
    8. Applied rewrites73.9%

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

    if 6.50000000000000015e149 < angle

    1. Initial program 24.1%

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

      \[\leadsto \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      6. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      7. lift-PI.f64N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      8. unpow2N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      9. unpow2N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      10. difference-of-squaresN/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      12. lower-+.f64N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      13. lower--.f6438.9

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Applied rewrites38.9%

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

      \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{180}}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{180}}\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right) \]
      4. lift-PI.f6449.2

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
    8. Applied rewrites49.2%

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

Alternative 2: 65.4% accurate, 1.7× 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 := \left(b + a\_m\right) \cdot \left(b - a\_m\right)\\ t_1 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 7 \cdot 10^{-42}:\\ \;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\ \mathbf{elif}\;angle\_m \leq 1.25 \cdot 10^{+112}:\\ \;\;\;\;\left(2 \cdot \cos t\_1\right) \cdot \left(\sin t\_1 \cdot t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot t\_0\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\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 (* (+ b a_m) (- b a_m)))
        (t_1 (* (* PI angle_m) 0.005555555555555556)))
   (*
    angle_s
    (if (<= angle_m 7e-42)
      (* (* (* (+ a_m b) PI) angle_m) (* (- b a_m) 0.011111111111111112))
      (if (<= angle_m 1.25e+112)
        (* (* 2.0 (cos t_1)) (* (sin t_1) t_0))
        (*
         (* (* (* PI angle_m) t_0) 0.011111111111111112)
         (cos (* (* angle_m PI) 0.005555555555555556))))))))
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 = (b + a_m) * (b - a_m);
	double t_1 = (((double) M_PI) * angle_m) * 0.005555555555555556;
	double tmp;
	if (angle_m <= 7e-42) {
		tmp = (((a_m + b) * ((double) M_PI)) * angle_m) * ((b - a_m) * 0.011111111111111112);
	} else if (angle_m <= 1.25e+112) {
		tmp = (2.0 * cos(t_1)) * (sin(t_1) * t_0);
	} else {
		tmp = (((((double) M_PI) * angle_m) * t_0) * 0.011111111111111112) * cos(((angle_m * ((double) M_PI)) * 0.005555555555555556));
	}
	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 = (b + a_m) * (b - a_m);
	double t_1 = (Math.PI * angle_m) * 0.005555555555555556;
	double tmp;
	if (angle_m <= 7e-42) {
		tmp = (((a_m + b) * Math.PI) * angle_m) * ((b - a_m) * 0.011111111111111112);
	} else if (angle_m <= 1.25e+112) {
		tmp = (2.0 * Math.cos(t_1)) * (Math.sin(t_1) * t_0);
	} else {
		tmp = (((Math.PI * angle_m) * t_0) * 0.011111111111111112) * Math.cos(((angle_m * Math.PI) * 0.005555555555555556));
	}
	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 = (b + a_m) * (b - a_m)
	t_1 = (math.pi * angle_m) * 0.005555555555555556
	tmp = 0
	if angle_m <= 7e-42:
		tmp = (((a_m + b) * math.pi) * angle_m) * ((b - a_m) * 0.011111111111111112)
	elif angle_m <= 1.25e+112:
		tmp = (2.0 * math.cos(t_1)) * (math.sin(t_1) * t_0)
	else:
		tmp = (((math.pi * angle_m) * t_0) * 0.011111111111111112) * math.cos(((angle_m * math.pi) * 0.005555555555555556))
	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(Float64(b + a_m) * Float64(b - a_m))
	t_1 = Float64(Float64(pi * angle_m) * 0.005555555555555556)
	tmp = 0.0
	if (angle_m <= 7e-42)
		tmp = Float64(Float64(Float64(Float64(a_m + b) * pi) * angle_m) * Float64(Float64(b - a_m) * 0.011111111111111112));
	elseif (angle_m <= 1.25e+112)
		tmp = Float64(Float64(2.0 * cos(t_1)) * Float64(sin(t_1) * t_0));
	else
		tmp = Float64(Float64(Float64(Float64(pi * angle_m) * t_0) * 0.011111111111111112) * cos(Float64(Float64(angle_m * pi) * 0.005555555555555556)));
	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 = (b + a_m) * (b - a_m);
	t_1 = (pi * angle_m) * 0.005555555555555556;
	tmp = 0.0;
	if (angle_m <= 7e-42)
		tmp = (((a_m + b) * pi) * angle_m) * ((b - a_m) * 0.011111111111111112);
	elseif (angle_m <= 1.25e+112)
		tmp = (2.0 * cos(t_1)) * (sin(t_1) * t_0);
	else
		tmp = (((pi * angle_m) * t_0) * 0.011111111111111112) * cos(((angle_m * pi) * 0.005555555555555556));
	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[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 7e-42], N[(N[(N[(N[(a$95$m + b), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 1.25e+112], N[(N[(2.0 * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[t$95$1], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * t$95$0), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * N[Cos[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $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 := \left(b + a\_m\right) \cdot \left(b - a\_m\right)\\
t_1 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 7 \cdot 10^{-42}:\\
\;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\

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

\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot t\_0\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if angle < 7.0000000000000004e-42

    1. Initial program 60.1%

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

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
      2. lower-*.f64N/A

        \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      6. lower-*.f64N/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      7. lift-PI.f64N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      8. unpow2N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      9. unpow2N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
      10. difference-of-squaresN/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      12. lower-+.f64N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      13. lower--.f6459.3

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
    5. Applied rewrites59.3%

      \[\leadsto \color{blue}{\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      2. lift-PI.f64N/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      4. lift-+.f64N/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      5. lift--.f64N/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      6. lift-*.f64N/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      8. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      9. *-commutativeN/A

        \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      10. lower-*.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      12. lift-PI.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      13. +-commutativeN/A

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      14. lower-+.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      15. lift--.f6472.3

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
    7. Applied rewrites72.3%

      \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
      2. lift--.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      4. lift-+.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      6. lift-PI.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      7. lift-*.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      8. associate-*l*N/A

        \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \frac{1}{90}\right)} \]
      9. lower-*.f64N/A

        \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \frac{1}{90}\right)} \]
      10. associate-*r*N/A

        \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right)\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
      11. *-commutativeN/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right) \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
      12. lower-*.f64N/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right) \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
      13. *-commutativeN/A

        \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(\color{blue}{b} - a\right) \cdot \frac{1}{90}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(\color{blue}{b} - a\right) \cdot \frac{1}{90}\right) \]
      15. lift-+.f64N/A

        \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \frac{1}{90}\right) \]
      16. lift-PI.f64N/A

        \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \frac{1}{90}\right) \]
      17. lower-*.f64N/A

        \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\frac{1}{90}}\right) \]
      18. lift--.f6472.8

        \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot 0.011111111111111112\right) \]
    9. Applied rewrites72.8%

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

    if 7.0000000000000004e-42 < angle < 1.25e112

    1. Initial program 55.0%

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

      \[\leadsto \color{blue}{2 \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
      3. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\color{blue}{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      4. lower-cos.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      9. lift-PI.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      10. lower-*.f64N/A

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

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

    if 1.25e112 < angle

    1. Initial program 23.5%

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

      \[\leadsto \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      6. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      7. lift-PI.f64N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      8. unpow2N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      9. unpow2N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      10. difference-of-squaresN/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      12. lower-+.f64N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      13. lower--.f6440.3

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Applied rewrites40.3%

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

      \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{180}}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{180}}\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right) \]
      4. lift-PI.f6447.6

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
    8. Applied rewrites47.6%

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

Alternative 3: 65.6% accurate, 1.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 := \left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 7.2 \cdot 10^{+27}:\\ \;\;\;\;\left(\left(\sin t\_0 \cdot \left(a\_m + b\right)\right) \cdot \left(\left(b - a\_m\right) \cdot \cos t\_0\right)\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\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 (* (* 0.005555555555555556 angle_m) PI)))
   (*
    angle_s
    (if (<= angle_m 7.2e+27)
      (* (* (* (sin t_0) (+ a_m b)) (* (- b a_m) (cos t_0))) 2.0)
      (*
       (* (* (* PI angle_m) (* (+ b a_m) (- b a_m))) 0.011111111111111112)
       (cos (* (* angle_m PI) 0.005555555555555556)))))))
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 = (0.005555555555555556 * angle_m) * ((double) M_PI);
	double tmp;
	if (angle_m <= 7.2e+27) {
		tmp = ((sin(t_0) * (a_m + b)) * ((b - a_m) * cos(t_0))) * 2.0;
	} else {
		tmp = (((((double) M_PI) * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * cos(((angle_m * ((double) M_PI)) * 0.005555555555555556));
	}
	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 = (0.005555555555555556 * angle_m) * Math.PI;
	double tmp;
	if (angle_m <= 7.2e+27) {
		tmp = ((Math.sin(t_0) * (a_m + b)) * ((b - a_m) * Math.cos(t_0))) * 2.0;
	} else {
		tmp = (((Math.PI * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * Math.cos(((angle_m * Math.PI) * 0.005555555555555556));
	}
	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 = (0.005555555555555556 * angle_m) * math.pi
	tmp = 0
	if angle_m <= 7.2e+27:
		tmp = ((math.sin(t_0) * (a_m + b)) * ((b - a_m) * math.cos(t_0))) * 2.0
	else:
		tmp = (((math.pi * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * math.cos(((angle_m * math.pi) * 0.005555555555555556))
	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(Float64(0.005555555555555556 * angle_m) * pi)
	tmp = 0.0
	if (angle_m <= 7.2e+27)
		tmp = Float64(Float64(Float64(sin(t_0) * Float64(a_m + b)) * Float64(Float64(b - a_m) * cos(t_0))) * 2.0);
	else
		tmp = Float64(Float64(Float64(Float64(pi * angle_m) * Float64(Float64(b + a_m) * Float64(b - a_m))) * 0.011111111111111112) * cos(Float64(Float64(angle_m * pi) * 0.005555555555555556)));
	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 = (0.005555555555555556 * angle_m) * pi;
	tmp = 0.0;
	if (angle_m <= 7.2e+27)
		tmp = ((sin(t_0) * (a_m + b)) * ((b - a_m) * cos(t_0))) * 2.0;
	else
		tmp = (((pi * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * cos(((angle_m * pi) * 0.005555555555555556));
	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[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 7.2e+27], N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * N[Cos[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $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 := \left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 7.2 \cdot 10^{+27}:\\
\;\;\;\;\left(\left(\sin t\_0 \cdot \left(a\_m + b\right)\right) \cdot \left(\left(b - a\_m\right) \cdot \cos t\_0\right)\right) \cdot 2\\

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


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

    1. Initial program 61.9%

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

      \[\leadsto \color{blue}{2 \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
      3. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\color{blue}{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      4. lower-cos.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      9. lift-PI.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
      10. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right) \]
    5. Applied rewrites63.8%

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

      \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)\right) \cdot \color{blue}{2} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
      2. lift--.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
      4. lift-+.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
      6. lift-sin.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
      7. lift-*.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
      8. lift-PI.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
      9. lift-*.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
      10. lift-cos.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
      11. lift-*.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
      12. lift-PI.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
      13. lift-*.f64N/A

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot 2 \]
    8. Applied rewrites76.8%

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

    if 7.19999999999999966e27 < angle

    1. Initial program 24.2%

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

      \[\leadsto \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      6. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      7. lift-PI.f64N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      8. unpow2N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      9. unpow2N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      10. difference-of-squaresN/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      12. lower-+.f64N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      13. lower--.f6439.3

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    5. Applied rewrites39.3%

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

      \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{180}}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{180}}\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right) \]
      4. lift-PI.f6444.9

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
    8. Applied rewrites44.9%

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

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

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


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

    1. Initial program 58.3%

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

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
      2. lower-*.f64N/A

        \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      6. lower-*.f64N/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      7. lift-PI.f64N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      8. unpow2N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      9. unpow2N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
      10. difference-of-squaresN/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      12. lower-+.f64N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      13. lower--.f6454.7

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
    5. Applied rewrites54.7%

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

      \[\leadsto \frac{-1}{90} \cdot \color{blue}{\left({a}^{2} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
      4. pow2N/A

        \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
      7. lift-PI.f6454.4

        \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \pi\right) \]
    8. Applied rewrites54.4%

      \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(angle \cdot \pi\right)} \]
    9. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \pi\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \pi\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
      5. lower-*.f6454.3

        \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
    10. Applied rewrites54.3%

      \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
    11. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \color{blue}{\pi}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
      4. lift-PI.f64N/A

        \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right) \]
      7. lower-*.f64N/A

        \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right) \]
      8. lift-*.f64N/A

        \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \left(\color{blue}{angle} \cdot \mathsf{PI}\left(\right)\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \]
      10. lift-*.f64N/A

        \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \]
      11. lift-PI.f64N/A

        \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \pi\right) \cdot a\right) \]
      12. lift-*.f6461.6

        \[\leadsto \left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle \cdot \pi\right) \cdot a\right) \]
    12. Applied rewrites61.6%

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

    if 4.99999999999999998e-306 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))))

    1. Initial program 46.4%

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

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
      2. lower-*.f64N/A

        \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
      3. associate-*r*N/A

        \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      6. lower-*.f64N/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      7. lift-PI.f64N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      8. unpow2N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
      9. unpow2N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
      10. difference-of-squaresN/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      12. lower-+.f64N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      13. lower--.f6450.1

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
    5. Applied rewrites50.1%

      \[\leadsto \color{blue}{\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      2. lift-PI.f64N/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      4. lift-+.f64N/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      5. lift--.f64N/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      6. lift-*.f64N/A

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      8. lower-*.f64N/A

        \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      9. *-commutativeN/A

        \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      10. lower-*.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      12. lift-PI.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      13. +-commutativeN/A

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      14. lower-+.f64N/A

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      15. lift--.f6460.6

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
    7. Applied rewrites60.6%

      \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
    8. Taylor expanded in a around 0

      \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot b\right) \cdot \frac{1}{90} \]
    9. Step-by-step derivation
      1. Applied rewrites58.2%

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot b\right) \cdot 0.011111111111111112 \]
    10. Recombined 2 regimes into one program.
    11. Add Preprocessing

    Alternative 5: 61.5% 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}\;2 \cdot \left({b}^{2} - {a\_m}^{2}\right) \leq 5 \cdot 10^{-306}:\\ \;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\pi \cdot b\right) \cdot angle\_m\right) \cdot \left(b - a\_m\right)\right) \cdot 0.011111111111111112\\ \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 (<= (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) 5e-306)
        (* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m))
        (* (* (* (* PI b) angle_m) (- b a_m)) 0.011111111111111112))))
    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 ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) <= 5e-306) {
    		tmp = (-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m);
    	} else {
    		tmp = (((((double) M_PI) * b) * angle_m) * (b - a_m)) * 0.011111111111111112;
    	}
    	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 ((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) <= 5e-306) {
    		tmp = (-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m);
    	} else {
    		tmp = (((Math.PI * b) * angle_m) * (b - a_m)) * 0.011111111111111112;
    	}
    	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 (2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) <= 5e-306:
    		tmp = (-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m)
    	else:
    		tmp = (((math.pi * b) * angle_m) * (b - a_m)) * 0.011111111111111112
    	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(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) <= 5e-306)
    		tmp = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m));
    	else
    		tmp = Float64(Float64(Float64(Float64(pi * b) * angle_m) * Float64(b - a_m)) * 0.011111111111111112);
    	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 ((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) <= 5e-306)
    		tmp = (-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m);
    	else
    		tmp = (((pi * b) * angle_m) * (b - a_m)) * 0.011111111111111112;
    	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[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e-306], N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(Pi * b), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $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}\;2 \cdot \left({b}^{2} - {a\_m}^{2}\right) \leq 5 \cdot 10^{-306}:\\
    \;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(\left(\pi \cdot b\right) \cdot angle\_m\right) \cdot \left(b - a\_m\right)\right) \cdot 0.011111111111111112\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 4.99999999999999998e-306

      1. Initial program 58.3%

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

        \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        3. associate-*r*N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        4. lower-*.f64N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        5. *-commutativeN/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        6. lower-*.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        7. lift-PI.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        8. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        9. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
        10. difference-of-squaresN/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        11. lower-*.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        12. lower-+.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        13. lower--.f6454.7

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
      5. Applied rewrites54.7%

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

        \[\leadsto \frac{-1}{90} \cdot \color{blue}{\left({a}^{2} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      7. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \]
        3. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        4. pow2N/A

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        6. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        7. lift-PI.f6454.4

          \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \pi\right) \]
      8. Applied rewrites54.4%

        \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(angle \cdot \pi\right)} \]
      9. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \pi\right) \]
        2. lift-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \pi\right) \]
        3. associate-*r*N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
        4. lower-*.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
        5. lower-*.f6454.3

          \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
      10. Applied rewrites54.3%

        \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
      11. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \color{blue}{\pi}\right) \]
        2. lift-*.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
        3. lift-*.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
        4. lift-PI.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        6. associate-*l*N/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right) \]
        7. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right) \]
        8. lift-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \left(\color{blue}{angle} \cdot \mathsf{PI}\left(\right)\right)\right) \]
        9. *-commutativeN/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \]
        10. lift-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \]
        11. lift-PI.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \pi\right) \cdot a\right) \]
        12. lift-*.f6461.6

          \[\leadsto \left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle \cdot \pi\right) \cdot a\right) \]
      12. Applied rewrites61.6%

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

      if 4.99999999999999998e-306 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))))

      1. Initial program 46.4%

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

        \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        3. associate-*r*N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        4. lower-*.f64N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        5. *-commutativeN/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        6. lower-*.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        7. lift-PI.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        8. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        9. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
        10. difference-of-squaresN/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        11. lower-*.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        12. lower-+.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        13. lower--.f6450.1

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
      5. Applied rewrites50.1%

        \[\leadsto \color{blue}{\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
      6. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        2. lift-PI.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        3. lift-*.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        4. lift-+.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        5. lift--.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        6. lift-*.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        7. associate-*r*N/A

          \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        8. lower-*.f64N/A

          \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        9. *-commutativeN/A

          \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        10. lower-*.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        11. lower-*.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        12. lift-PI.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        13. +-commutativeN/A

          \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        14. lower-+.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        15. lift--.f6460.6

          \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
      7. Applied rewrites60.6%

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
      8. Taylor expanded in a around 0

        \[\leadsto \left(\left(angle \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
      9. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        2. lower-*.f64N/A

          \[\leadsto \left(\left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        3. *-commutativeN/A

          \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot b\right) \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        4. lower-*.f64N/A

          \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot b\right) \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        5. lift-PI.f6459.1

          \[\leadsto \left(\left(\left(\pi \cdot b\right) \cdot angle\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
      10. Applied rewrites59.1%

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

    Alternative 6: 56.7% 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}\;2 \cdot \left({b}^{2} - {a\_m}^{2}\right) \leq -1 \cdot 10^{-71}:\\ \;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\\ \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 (<= (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) -1e-71)
        (* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m))
        (* (* (* PI angle_m) (* b b)) 0.011111111111111112))))
    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 ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) <= -1e-71) {
    		tmp = (-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m);
    	} else {
    		tmp = ((((double) M_PI) * angle_m) * (b * b)) * 0.011111111111111112;
    	}
    	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 ((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) <= -1e-71) {
    		tmp = (-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m);
    	} else {
    		tmp = ((Math.PI * angle_m) * (b * b)) * 0.011111111111111112;
    	}
    	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 (2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) <= -1e-71:
    		tmp = (-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m)
    	else:
    		tmp = ((math.pi * angle_m) * (b * b)) * 0.011111111111111112
    	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(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) <= -1e-71)
    		tmp = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m));
    	else
    		tmp = Float64(Float64(Float64(pi * angle_m) * Float64(b * b)) * 0.011111111111111112);
    	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 ((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) <= -1e-71)
    		tmp = (-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m);
    	else
    		tmp = ((pi * angle_m) * (b * b)) * 0.011111111111111112;
    	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[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-71], N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $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}\;2 \cdot \left({b}^{2} - {a\_m}^{2}\right) \leq -1 \cdot 10^{-71}:\\
    \;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -9.9999999999999992e-72

      1. Initial program 52.2%

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

        \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        3. associate-*r*N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        4. lower-*.f64N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        5. *-commutativeN/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        6. lower-*.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        7. lift-PI.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        8. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        9. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
        10. difference-of-squaresN/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        11. lower-*.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        12. lower-+.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        13. lower--.f6449.7

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
      5. Applied rewrites49.7%

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

        \[\leadsto \frac{-1}{90} \cdot \color{blue}{\left({a}^{2} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      7. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \]
        3. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        4. pow2N/A

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        6. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        7. lift-PI.f6449.1

          \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \pi\right) \]
      8. Applied rewrites49.1%

        \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(angle \cdot \pi\right)} \]
      9. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \pi\right) \]
        2. lift-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \pi\right) \]
        3. associate-*r*N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
        4. lower-*.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
        5. lower-*.f6449.1

          \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
      10. Applied rewrites49.1%

        \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
      11. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \color{blue}{\pi}\right) \]
        2. lift-*.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
        3. lift-*.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
        4. lift-PI.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        6. associate-*l*N/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right) \]
        7. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right) \]
        8. lift-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \left(\color{blue}{angle} \cdot \mathsf{PI}\left(\right)\right)\right) \]
        9. *-commutativeN/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \]
        10. lift-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \]
        11. lift-PI.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \pi\right) \cdot a\right) \]
        12. lift-*.f6459.3

          \[\leadsto \left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle \cdot \pi\right) \cdot a\right) \]
      12. Applied rewrites59.3%

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

      if -9.9999999999999992e-72 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))))

      1. Initial program 51.5%

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

        \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        3. associate-*r*N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        4. lower-*.f64N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        5. *-commutativeN/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        6. lower-*.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        7. lift-PI.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        8. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        9. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
        10. difference-of-squaresN/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        11. lower-*.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        12. lower-+.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        13. lower--.f6453.5

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
      5. Applied rewrites53.5%

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

        \[\leadsto \left(\left(\pi \cdot angle\right) \cdot {b}^{2}\right) \cdot \frac{1}{90} \]
      7. Step-by-step derivation
        1. difference-of-squares-revN/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot {b}^{2}\right) \cdot \frac{1}{90} \]
        2. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot {b}^{2}\right) \cdot \frac{1}{90} \]
        3. pow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot {b}^{2}\right) \cdot \frac{1}{90} \]
        4. metadata-evalN/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot {b}^{2}\right) \cdot \frac{1}{90} \]
        5. pow-flipN/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot {b}^{2}\right) \cdot \frac{1}{90} \]
        6. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b\right)\right) \cdot \frac{1}{90} \]
        7. lower-*.f6454.1

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112 \]
      8. Applied rewrites54.1%

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

    Alternative 7: 56.7% 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}\;2 \cdot \left({b}^{2} - {a\_m}^{2}\right) \leq -1 \cdot 10^{-71}:\\ \;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\pi \cdot \left(b \cdot b\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\\ \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 (<= (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) -1e-71)
        (* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m))
        (* (* (* PI (* b b)) angle_m) 0.011111111111111112))))
    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 ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) <= -1e-71) {
    		tmp = (-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m);
    	} else {
    		tmp = ((((double) M_PI) * (b * b)) * angle_m) * 0.011111111111111112;
    	}
    	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 ((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) <= -1e-71) {
    		tmp = (-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m);
    	} else {
    		tmp = ((Math.PI * (b * b)) * angle_m) * 0.011111111111111112;
    	}
    	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 (2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) <= -1e-71:
    		tmp = (-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m)
    	else:
    		tmp = ((math.pi * (b * b)) * angle_m) * 0.011111111111111112
    	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(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) <= -1e-71)
    		tmp = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m));
    	else
    		tmp = Float64(Float64(Float64(pi * Float64(b * b)) * angle_m) * 0.011111111111111112);
    	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 ((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) <= -1e-71)
    		tmp = (-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m);
    	else
    		tmp = ((pi * (b * b)) * angle_m) * 0.011111111111111112;
    	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[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-71], N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision] * angle$95$m), $MachinePrecision] * 0.011111111111111112), $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}\;2 \cdot \left({b}^{2} - {a\_m}^{2}\right) \leq -1 \cdot 10^{-71}:\\
    \;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(\pi \cdot \left(b \cdot b\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -9.9999999999999992e-72

      1. Initial program 52.2%

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

        \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        3. associate-*r*N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        4. lower-*.f64N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        5. *-commutativeN/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        6. lower-*.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        7. lift-PI.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        8. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        9. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
        10. difference-of-squaresN/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        11. lower-*.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        12. lower-+.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        13. lower--.f6449.7

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
      5. Applied rewrites49.7%

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

        \[\leadsto \frac{-1}{90} \cdot \color{blue}{\left({a}^{2} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      7. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \]
        3. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        4. pow2N/A

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        6. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        7. lift-PI.f6449.1

          \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \pi\right) \]
      8. Applied rewrites49.1%

        \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(angle \cdot \pi\right)} \]
      9. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \pi\right) \]
        2. lift-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \pi\right) \]
        3. associate-*r*N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
        4. lower-*.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
        5. lower-*.f6449.1

          \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
      10. Applied rewrites49.1%

        \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
      11. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \color{blue}{\pi}\right) \]
        2. lift-*.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
        3. lift-*.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
        4. lift-PI.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        6. associate-*l*N/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right) \]
        7. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right) \]
        8. lift-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \left(\color{blue}{angle} \cdot \mathsf{PI}\left(\right)\right)\right) \]
        9. *-commutativeN/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \]
        10. lift-*.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \]
        11. lift-PI.f64N/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \pi\right) \cdot a\right) \]
        12. lift-*.f6459.3

          \[\leadsto \left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle \cdot \pi\right) \cdot a\right) \]
      12. Applied rewrites59.3%

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

      if -9.9999999999999992e-72 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))))

      1. Initial program 51.5%

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

        \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        3. associate-*r*N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        4. lower-*.f64N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        5. *-commutativeN/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        6. lower-*.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        7. lift-PI.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        8. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        9. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
        10. difference-of-squaresN/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        11. lower-*.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        12. lower-+.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        13. lower--.f6453.5

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
      5. Applied rewrites53.5%

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

        \[\leadsto \left(angle \cdot \left({b}^{2} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \frac{1}{90} \]
      7. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\left({b}^{2} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \frac{1}{90} \]
        2. lower-*.f64N/A

          \[\leadsto \left(\left({b}^{2} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \frac{1}{90} \]
        3. *-commutativeN/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot {b}^{2}\right) \cdot angle\right) \cdot \frac{1}{90} \]
        4. lower-*.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot {b}^{2}\right) \cdot angle\right) \cdot \frac{1}{90} \]
        5. lift-PI.f64N/A

          \[\leadsto \left(\left(\pi \cdot {b}^{2}\right) \cdot angle\right) \cdot \frac{1}{90} \]
        6. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot \left(b \cdot b\right)\right) \cdot angle\right) \cdot \frac{1}{90} \]
        7. lower-*.f6452.9

          \[\leadsto \left(\left(\pi \cdot \left(b \cdot b\right)\right) \cdot angle\right) \cdot 0.011111111111111112 \]
      8. Applied rewrites52.9%

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

    Alternative 8: 63.9% accurate, 3.1× 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 := \left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 7 \cdot 10^{-42}:\\ \;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\ \mathbf{elif}\;angle\_m \leq 1.8 \cdot 10^{+107}:\\ \;\;\;\;\sin \left(2 \cdot t\_0\right) \cdot \left(\left(a\_m + b\right) \cdot \left(b - a\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\right) \cdot \cos t\_0\\ \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 (* (* angle_m PI) 0.005555555555555556)))
       (*
        angle_s
        (if (<= angle_m 7e-42)
          (* (* (* (+ a_m b) PI) angle_m) (* (- b a_m) 0.011111111111111112))
          (if (<= angle_m 1.8e+107)
            (* (sin (* 2.0 t_0)) (* (+ a_m b) (- b a_m)))
            (* (* (* (* PI angle_m) (* b b)) 0.011111111111111112) (cos t_0)))))))
    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 = (angle_m * ((double) M_PI)) * 0.005555555555555556;
    	double tmp;
    	if (angle_m <= 7e-42) {
    		tmp = (((a_m + b) * ((double) M_PI)) * angle_m) * ((b - a_m) * 0.011111111111111112);
    	} else if (angle_m <= 1.8e+107) {
    		tmp = sin((2.0 * t_0)) * ((a_m + b) * (b - a_m));
    	} else {
    		tmp = (((((double) M_PI) * angle_m) * (b * b)) * 0.011111111111111112) * cos(t_0);
    	}
    	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 = (angle_m * Math.PI) * 0.005555555555555556;
    	double tmp;
    	if (angle_m <= 7e-42) {
    		tmp = (((a_m + b) * Math.PI) * angle_m) * ((b - a_m) * 0.011111111111111112);
    	} else if (angle_m <= 1.8e+107) {
    		tmp = Math.sin((2.0 * t_0)) * ((a_m + b) * (b - a_m));
    	} else {
    		tmp = (((Math.PI * angle_m) * (b * b)) * 0.011111111111111112) * Math.cos(t_0);
    	}
    	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 = (angle_m * math.pi) * 0.005555555555555556
    	tmp = 0
    	if angle_m <= 7e-42:
    		tmp = (((a_m + b) * math.pi) * angle_m) * ((b - a_m) * 0.011111111111111112)
    	elif angle_m <= 1.8e+107:
    		tmp = math.sin((2.0 * t_0)) * ((a_m + b) * (b - a_m))
    	else:
    		tmp = (((math.pi * angle_m) * (b * b)) * 0.011111111111111112) * math.cos(t_0)
    	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(Float64(angle_m * pi) * 0.005555555555555556)
    	tmp = 0.0
    	if (angle_m <= 7e-42)
    		tmp = Float64(Float64(Float64(Float64(a_m + b) * pi) * angle_m) * Float64(Float64(b - a_m) * 0.011111111111111112));
    	elseif (angle_m <= 1.8e+107)
    		tmp = Float64(sin(Float64(2.0 * t_0)) * Float64(Float64(a_m + b) * Float64(b - a_m)));
    	else
    		tmp = Float64(Float64(Float64(Float64(pi * angle_m) * Float64(b * b)) * 0.011111111111111112) * cos(t_0));
    	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 = (angle_m * pi) * 0.005555555555555556;
    	tmp = 0.0;
    	if (angle_m <= 7e-42)
    		tmp = (((a_m + b) * pi) * angle_m) * ((b - a_m) * 0.011111111111111112);
    	elseif (angle_m <= 1.8e+107)
    		tmp = sin((2.0 * t_0)) * ((a_m + b) * (b - a_m));
    	else
    		tmp = (((pi * angle_m) * (b * b)) * 0.011111111111111112) * cos(t_0);
    	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[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 7e-42], N[(N[(N[(N[(a$95$m + b), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 1.8e+107], N[(N[Sin[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[(a$95$m + b), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * N[Cos[t$95$0], $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 := \left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\\
    angle\_s \cdot \begin{array}{l}
    \mathbf{if}\;angle\_m \leq 7 \cdot 10^{-42}:\\
    \;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
    
    \mathbf{elif}\;angle\_m \leq 1.8 \cdot 10^{+107}:\\
    \;\;\;\;\sin \left(2 \cdot t\_0\right) \cdot \left(\left(a\_m + b\right) \cdot \left(b - a\_m\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\right) \cdot \cos t\_0\\
    
    
    \end{array}
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if angle < 7.0000000000000004e-42

      1. Initial program 60.1%

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

        \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        3. associate-*r*N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        4. lower-*.f64N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        5. *-commutativeN/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        6. lower-*.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        7. lift-PI.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        8. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
        9. unpow2N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
        10. difference-of-squaresN/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        11. lower-*.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        12. lower-+.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        13. lower--.f6459.3

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
      5. Applied rewrites59.3%

        \[\leadsto \color{blue}{\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
      6. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        2. lift-PI.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        3. lift-*.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        4. lift-+.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        5. lift--.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        6. lift-*.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        7. associate-*r*N/A

          \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        8. lower-*.f64N/A

          \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        9. *-commutativeN/A

          \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        10. lower-*.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        11. lower-*.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        12. lift-PI.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        13. +-commutativeN/A

          \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        14. lower-+.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        15. lift--.f6472.3

          \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
      7. Applied rewrites72.3%

        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        2. lift--.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        3. lift-*.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        4. lift-+.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        5. lift-*.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        6. lift-PI.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        7. lift-*.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
        8. associate-*l*N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \frac{1}{90}\right)} \]
        9. lower-*.f64N/A

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \frac{1}{90}\right)} \]
        10. associate-*r*N/A

          \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right)\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
        11. *-commutativeN/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right) \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
        12. lower-*.f64N/A

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right) \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
        13. *-commutativeN/A

          \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(\color{blue}{b} - a\right) \cdot \frac{1}{90}\right) \]
        14. lower-*.f64N/A

          \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(\color{blue}{b} - a\right) \cdot \frac{1}{90}\right) \]
        15. lift-+.f64N/A

          \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \frac{1}{90}\right) \]
        16. lift-PI.f64N/A

          \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \frac{1}{90}\right) \]
        17. lower-*.f64N/A

          \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\frac{1}{90}}\right) \]
        18. lift--.f6472.8

          \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot 0.011111111111111112\right) \]
      9. Applied rewrites72.8%

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

      if 7.0000000000000004e-42 < angle < 1.7999999999999999e107

      1. Initial program 55.0%

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

        \[\leadsto \color{blue}{2 \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
      4. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
        2. lower-*.f64N/A

          \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
        3. lower-*.f64N/A

          \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\color{blue}{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
        4. lower-cos.f64N/A

          \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
        5. *-commutativeN/A

          \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
        6. lower-*.f64N/A

          \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
        8. lower-*.f64N/A

          \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
        9. lift-PI.f64N/A

          \[\leadsto \left(2 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
        10. lower-*.f64N/A

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

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

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

      if 1.7999999999999999e107 < angle

      1. Initial program 23.5%

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

        \[\leadsto \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        3. associate-*r*N/A

          \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        4. lower-*.f64N/A

          \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        5. *-commutativeN/A

          \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        6. lower-*.f64N/A

          \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        7. lift-PI.f64N/A

          \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        8. unpow2N/A

          \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        9. unpow2N/A

          \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        10. difference-of-squaresN/A

          \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        11. lower-*.f64N/A

          \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        12. lower-+.f64N/A

          \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        13. lower--.f6440.3

          \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      5. Applied rewrites40.3%

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

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      7. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{180}}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{180}}\right) \]
        3. lower-*.f64N/A

          \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right) \]
        4. lift-PI.f6447.6

          \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
      8. Applied rewrites47.6%

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

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot {b}^{2}\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \]
      10. Step-by-step derivation
        1. pow2N/A

          \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \]
        2. lower-*.f6438.6

          \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
      11. Applied rewrites38.6%

        \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 9: 64.2% accurate, 3.1× 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 := \left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 1.25 \cdot 10^{+36}:\\ \;\;\;\;\left(\left(\left(\sin t\_0 \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right) \cdot 1\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos t\_0\\ \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 (* (* angle_m PI) 0.005555555555555556)))
       (*
        angle_s
        (if (<= angle_m 1.25e+36)
          (* (* (* (* (sin t_0) (+ a_m b)) (- b a_m)) 1.0) 2.0)
          (*
           (* (* (* PI angle_m) (* (+ b a_m) (- b a_m))) 0.011111111111111112)
           (cos t_0))))))
    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 = (angle_m * ((double) M_PI)) * 0.005555555555555556;
    	double tmp;
    	if (angle_m <= 1.25e+36) {
    		tmp = (((sin(t_0) * (a_m + b)) * (b - a_m)) * 1.0) * 2.0;
    	} else {
    		tmp = (((((double) M_PI) * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * cos(t_0);
    	}
    	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 = (angle_m * Math.PI) * 0.005555555555555556;
    	double tmp;
    	if (angle_m <= 1.25e+36) {
    		tmp = (((Math.sin(t_0) * (a_m + b)) * (b - a_m)) * 1.0) * 2.0;
    	} else {
    		tmp = (((Math.PI * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * Math.cos(t_0);
    	}
    	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 = (angle_m * math.pi) * 0.005555555555555556
    	tmp = 0
    	if angle_m <= 1.25e+36:
    		tmp = (((math.sin(t_0) * (a_m + b)) * (b - a_m)) * 1.0) * 2.0
    	else:
    		tmp = (((math.pi * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * math.cos(t_0)
    	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(Float64(angle_m * pi) * 0.005555555555555556)
    	tmp = 0.0
    	if (angle_m <= 1.25e+36)
    		tmp = Float64(Float64(Float64(Float64(sin(t_0) * Float64(a_m + b)) * Float64(b - a_m)) * 1.0) * 2.0);
    	else
    		tmp = Float64(Float64(Float64(Float64(pi * angle_m) * Float64(Float64(b + a_m) * Float64(b - a_m))) * 0.011111111111111112) * cos(t_0));
    	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 = (angle_m * pi) * 0.005555555555555556;
    	tmp = 0.0;
    	if (angle_m <= 1.25e+36)
    		tmp = (((sin(t_0) * (a_m + b)) * (b - a_m)) * 1.0) * 2.0;
    	else
    		tmp = (((pi * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * cos(t_0);
    	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[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 1.25e+36], N[(N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * N[Cos[t$95$0], $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 := \left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\\
    angle\_s \cdot \begin{array}{l}
    \mathbf{if}\;angle\_m \leq 1.25 \cdot 10^{+36}:\\
    \;\;\;\;\left(\left(\left(\sin t\_0 \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right) \cdot 1\right) \cdot 2\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos t\_0\\
    
    
    \end{array}
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if angle < 1.24999999999999994e36

      1. Initial program 61.4%

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

        \[\leadsto \color{blue}{2 \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
      4. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
        2. lower-*.f64N/A

          \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
        3. lower-*.f64N/A

          \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\color{blue}{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
        4. lower-cos.f64N/A

          \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
        5. *-commutativeN/A

          \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
        6. lower-*.f64N/A

          \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
        8. lower-*.f64N/A

          \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
        9. lift-PI.f64N/A

          \[\leadsto \left(2 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
        10. lower-*.f64N/A

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

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

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

        \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 1\right) \cdot 2 \]
      8. Step-by-step derivation
        1. Applied rewrites75.8%

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

        if 1.24999999999999994e36 < angle

        1. Initial program 24.6%

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

          \[\leadsto \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          2. lower-*.f64N/A

            \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          3. associate-*r*N/A

            \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          4. lower-*.f64N/A

            \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          5. *-commutativeN/A

            \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          6. lower-*.f64N/A

            \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          7. lift-PI.f64N/A

            \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          8. unpow2N/A

            \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          9. unpow2N/A

            \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          10. difference-of-squaresN/A

            \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          11. lower-*.f64N/A

            \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          12. lower-+.f64N/A

            \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          13. lower--.f6438.9

            \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        5. Applied rewrites38.9%

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

          \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
        7. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{180}}\right) \]
          2. lower-*.f64N/A

            \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{180}}\right) \]
          3. lower-*.f64N/A

            \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right) \]
          4. lift-PI.f6444.7

            \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
        8. Applied rewrites44.7%

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

      Alternative 10: 64.6% accurate, 3.1× 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^{+222}:\\ \;\;\;\;\left(\left(\left(\sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right) \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right) \cdot 1\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\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+222)
          (*
           (*
            (* (* (sin (* (* angle_m PI) 0.005555555555555556)) (+ a_m b)) (- b a_m))
            1.0)
           2.0)
          (*
           (* (* (* PI angle_m) (* b b)) 0.011111111111111112)
           (cos (* PI (/ angle_m 180.0)))))))
      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+222) {
      		tmp = (((sin(((angle_m * ((double) M_PI)) * 0.005555555555555556)) * (a_m + b)) * (b - a_m)) * 1.0) * 2.0;
      	} else {
      		tmp = (((((double) M_PI) * angle_m) * (b * b)) * 0.011111111111111112) * cos((((double) M_PI) * (angle_m / 180.0)));
      	}
      	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+222) {
      		tmp = (((Math.sin(((angle_m * Math.PI) * 0.005555555555555556)) * (a_m + b)) * (b - a_m)) * 1.0) * 2.0;
      	} else {
      		tmp = (((Math.PI * angle_m) * (b * b)) * 0.011111111111111112) * Math.cos((Math.PI * (angle_m / 180.0)));
      	}
      	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+222:
      		tmp = (((math.sin(((angle_m * math.pi) * 0.005555555555555556)) * (a_m + b)) * (b - a_m)) * 1.0) * 2.0
      	else:
      		tmp = (((math.pi * angle_m) * (b * b)) * 0.011111111111111112) * math.cos((math.pi * (angle_m / 180.0)))
      	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+222)
      		tmp = Float64(Float64(Float64(Float64(sin(Float64(Float64(angle_m * pi) * 0.005555555555555556)) * Float64(a_m + b)) * Float64(b - a_m)) * 1.0) * 2.0);
      	else
      		tmp = Float64(Float64(Float64(Float64(pi * angle_m) * Float64(b * b)) * 0.011111111111111112) * cos(Float64(pi * Float64(angle_m / 180.0))));
      	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+222)
      		tmp = (((sin(((angle_m * pi) * 0.005555555555555556)) * (a_m + b)) * (b - a_m)) * 1.0) * 2.0;
      	else
      		tmp = (((pi * angle_m) * (b * b)) * 0.011111111111111112) * cos((pi * (angle_m / 180.0)));
      	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+222], N[(N[(N[(N[(N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $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^{+222}:\\
      \;\;\;\;\left(\left(\left(\sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right) \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right) \cdot 1\right) \cdot 2\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if b < 2.8000000000000001e222

        1. Initial program 52.3%

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

          \[\leadsto \color{blue}{2 \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
        4. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
          2. lower-*.f64N/A

            \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
          3. lower-*.f64N/A

            \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\color{blue}{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
          4. lower-cos.f64N/A

            \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
          6. lower-*.f64N/A

            \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
          8. lower-*.f64N/A

            \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
          9. lift-PI.f64N/A

            \[\leadsto \left(2 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
          10. lower-*.f64N/A

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

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

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

          \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 1\right) \cdot 2 \]
        8. Step-by-step derivation
          1. Applied rewrites62.6%

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

          if 2.8000000000000001e222 < b

          1. Initial program 44.8%

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

            \[\leadsto \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            2. lower-*.f64N/A

              \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            3. associate-*r*N/A

              \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            4. lower-*.f64N/A

              \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            5. *-commutativeN/A

              \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            6. lower-*.f64N/A

              \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            7. lift-PI.f64N/A

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            8. unpow2N/A

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            9. unpow2N/A

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            10. difference-of-squaresN/A

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            11. lower-*.f64N/A

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            12. lower-+.f64N/A

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            13. lower--.f6461.6

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          5. Applied rewrites61.6%

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

            \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot {b}^{2}\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          7. Step-by-step derivation
            1. difference-of-squares-revN/A

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot {b}^{2}\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            2. unpow2N/A

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot {b}^{2}\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            3. pow2N/A

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot {b}^{2}\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            4. metadata-evalN/A

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot {b}^{2}\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            5. pow-flipN/A

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot {b}^{2}\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            6. unpow2N/A

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            7. lower-*.f6467.1

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          8. Applied rewrites67.1%

            \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        9. Recombined 2 regimes into one program.
        10. Add Preprocessing

        Alternative 11: 64.5% accurate, 3.2× 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 := \left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b \leq 1.15 \cdot 10^{+215}:\\ \;\;\;\;\left(\left(\left(\sin t\_0 \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right) \cdot 1\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\right) \cdot \cos t\_0\\ \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 (* (* angle_m PI) 0.005555555555555556)))
           (*
            angle_s
            (if (<= b 1.15e+215)
              (* (* (* (* (sin t_0) (+ a_m b)) (- b a_m)) 1.0) 2.0)
              (* (* (* (* PI angle_m) (* b b)) 0.011111111111111112) (cos t_0))))))
        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 = (angle_m * ((double) M_PI)) * 0.005555555555555556;
        	double tmp;
        	if (b <= 1.15e+215) {
        		tmp = (((sin(t_0) * (a_m + b)) * (b - a_m)) * 1.0) * 2.0;
        	} else {
        		tmp = (((((double) M_PI) * angle_m) * (b * b)) * 0.011111111111111112) * cos(t_0);
        	}
        	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 = (angle_m * Math.PI) * 0.005555555555555556;
        	double tmp;
        	if (b <= 1.15e+215) {
        		tmp = (((Math.sin(t_0) * (a_m + b)) * (b - a_m)) * 1.0) * 2.0;
        	} else {
        		tmp = (((Math.PI * angle_m) * (b * b)) * 0.011111111111111112) * Math.cos(t_0);
        	}
        	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 = (angle_m * math.pi) * 0.005555555555555556
        	tmp = 0
        	if b <= 1.15e+215:
        		tmp = (((math.sin(t_0) * (a_m + b)) * (b - a_m)) * 1.0) * 2.0
        	else:
        		tmp = (((math.pi * angle_m) * (b * b)) * 0.011111111111111112) * math.cos(t_0)
        	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(Float64(angle_m * pi) * 0.005555555555555556)
        	tmp = 0.0
        	if (b <= 1.15e+215)
        		tmp = Float64(Float64(Float64(Float64(sin(t_0) * Float64(a_m + b)) * Float64(b - a_m)) * 1.0) * 2.0);
        	else
        		tmp = Float64(Float64(Float64(Float64(pi * angle_m) * Float64(b * b)) * 0.011111111111111112) * cos(t_0));
        	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 = (angle_m * pi) * 0.005555555555555556;
        	tmp = 0.0;
        	if (b <= 1.15e+215)
        		tmp = (((sin(t_0) * (a_m + b)) * (b - a_m)) * 1.0) * 2.0;
        	else
        		tmp = (((pi * angle_m) * (b * b)) * 0.011111111111111112) * cos(t_0);
        	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[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b, 1.15e+215], N[(N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * N[Cos[t$95$0], $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 := \left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\\
        angle\_s \cdot \begin{array}{l}
        \mathbf{if}\;b \leq 1.15 \cdot 10^{+215}:\\
        \;\;\;\;\left(\left(\left(\sin t\_0 \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right) \cdot 1\right) \cdot 2\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\right) \cdot \cos t\_0\\
        
        
        \end{array}
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if b < 1.1500000000000001e215

          1. Initial program 52.3%

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

            \[\leadsto \color{blue}{2 \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
          4. Step-by-step derivation
            1. associate-*r*N/A

              \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
            2. lower-*.f64N/A

              \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
            3. lower-*.f64N/A

              \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\color{blue}{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
            4. lower-cos.f64N/A

              \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
            5. *-commutativeN/A

              \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
            6. lower-*.f64N/A

              \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
            7. *-commutativeN/A

              \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
            8. lower-*.f64N/A

              \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
            9. lift-PI.f64N/A

              \[\leadsto \left(2 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
            10. lower-*.f64N/A

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

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

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

            \[\leadsto \left(\left(\left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 1\right) \cdot 2 \]
          8. Step-by-step derivation
            1. Applied rewrites62.6%

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

            if 1.1500000000000001e215 < b

            1. Initial program 44.8%

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

              \[\leadsto \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
              2. lower-*.f64N/A

                \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
              3. associate-*r*N/A

                \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
              4. lower-*.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
              5. *-commutativeN/A

                \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
              6. lower-*.f64N/A

                \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
              7. lift-PI.f64N/A

                \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
              8. unpow2N/A

                \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
              9. unpow2N/A

                \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
              10. difference-of-squaresN/A

                \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
              11. lower-*.f64N/A

                \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
              12. lower-+.f64N/A

                \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
              13. lower--.f6461.6

                \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            5. Applied rewrites61.6%

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

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
            7. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{180}}\right) \]
              2. lower-*.f64N/A

                \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{180}}\right) \]
              3. lower-*.f64N/A

                \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right) \]
              4. lift-PI.f6472.7

                \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
            8. Applied rewrites72.7%

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

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot {b}^{2}\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \]
            10. Step-by-step derivation
              1. pow2N/A

                \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \]
              2. lower-*.f6467.1

                \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
            11. Applied rewrites67.1%

              \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
          9. Recombined 2 regimes into one program.
          10. Add Preprocessing

          Alternative 12: 66.9% accurate, 3.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}\;angle\_m \leq 7 \cdot 10^{-42}:\\ \;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(2 \cdot \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right)\right) \cdot \left(\left(a\_m + b\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 (<= angle_m 7e-42)
              (* (* (* (+ a_m b) PI) angle_m) (* (- b a_m) 0.011111111111111112))
              (*
               (sin (* 2.0 (* (* angle_m PI) 0.005555555555555556)))
               (* (+ a_m b) (- 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 (angle_m <= 7e-42) {
          		tmp = (((a_m + b) * ((double) M_PI)) * angle_m) * ((b - a_m) * 0.011111111111111112);
          	} else {
          		tmp = sin((2.0 * ((angle_m * ((double) M_PI)) * 0.005555555555555556))) * ((a_m + b) * (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 (angle_m <= 7e-42) {
          		tmp = (((a_m + b) * Math.PI) * angle_m) * ((b - a_m) * 0.011111111111111112);
          	} else {
          		tmp = Math.sin((2.0 * ((angle_m * Math.PI) * 0.005555555555555556))) * ((a_m + b) * (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 angle_m <= 7e-42:
          		tmp = (((a_m + b) * math.pi) * angle_m) * ((b - a_m) * 0.011111111111111112)
          	else:
          		tmp = math.sin((2.0 * ((angle_m * math.pi) * 0.005555555555555556))) * ((a_m + b) * (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 (angle_m <= 7e-42)
          		tmp = Float64(Float64(Float64(Float64(a_m + b) * pi) * angle_m) * Float64(Float64(b - a_m) * 0.011111111111111112));
          	else
          		tmp = Float64(sin(Float64(2.0 * Float64(Float64(angle_m * pi) * 0.005555555555555556))) * Float64(Float64(a_m + b) * 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 (angle_m <= 7e-42)
          		tmp = (((a_m + b) * pi) * angle_m) * ((b - a_m) * 0.011111111111111112);
          	else
          		tmp = sin((2.0 * ((angle_m * pi) * 0.005555555555555556))) * ((a_m + b) * (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[angle$95$m, 7e-42], N[(N[(N[(N[(a$95$m + b), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(2.0 * N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a$95$m + b), $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}\;angle\_m \leq 7 \cdot 10^{-42}:\\
          \;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\sin \left(2 \cdot \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right)\right) \cdot \left(\left(a\_m + b\right) \cdot \left(b - a\_m\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if angle < 7.0000000000000004e-42

            1. Initial program 60.1%

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

              \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
              2. lower-*.f64N/A

                \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
              3. associate-*r*N/A

                \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
              4. lower-*.f64N/A

                \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
              5. *-commutativeN/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
              6. lower-*.f64N/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
              7. lift-PI.f64N/A

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
              8. unpow2N/A

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
              9. unpow2N/A

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
              10. difference-of-squaresN/A

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              11. lower-*.f64N/A

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              12. lower-+.f64N/A

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              13. lower--.f6459.3

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
            5. Applied rewrites59.3%

              \[\leadsto \color{blue}{\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
            6. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              2. lift-PI.f64N/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              3. lift-*.f64N/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              4. lift-+.f64N/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              5. lift--.f64N/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              6. lift-*.f64N/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              7. associate-*r*N/A

                \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              8. lower-*.f64N/A

                \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              9. *-commutativeN/A

                \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              10. lower-*.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              11. lower-*.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              12. lift-PI.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              13. +-commutativeN/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              14. lower-+.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              15. lift--.f6472.3

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
            7. Applied rewrites72.3%

              \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
            8. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
              2. lift--.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              3. lift-*.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              4. lift-+.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              5. lift-*.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              6. lift-PI.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              7. lift-*.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              8. associate-*l*N/A

                \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \frac{1}{90}\right)} \]
              9. lower-*.f64N/A

                \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \frac{1}{90}\right)} \]
              10. associate-*r*N/A

                \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right)\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
              11. *-commutativeN/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right) \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
              12. lower-*.f64N/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right) \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
              13. *-commutativeN/A

                \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(\color{blue}{b} - a\right) \cdot \frac{1}{90}\right) \]
              14. lower-*.f64N/A

                \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(\color{blue}{b} - a\right) \cdot \frac{1}{90}\right) \]
              15. lift-+.f64N/A

                \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \frac{1}{90}\right) \]
              16. lift-PI.f64N/A

                \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \frac{1}{90}\right) \]
              17. lower-*.f64N/A

                \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\frac{1}{90}}\right) \]
              18. lift--.f6472.8

                \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot 0.011111111111111112\right) \]
            9. Applied rewrites72.8%

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

            if 7.0000000000000004e-42 < angle

            1. Initial program 35.0%

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

              \[\leadsto \color{blue}{2 \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
            4. Step-by-step derivation
              1. associate-*r*N/A

                \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
              2. lower-*.f64N/A

                \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
              3. lower-*.f64N/A

                \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\color{blue}{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
              4. lower-cos.f64N/A

                \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
              5. *-commutativeN/A

                \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
              6. lower-*.f64N/A

                \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
              7. *-commutativeN/A

                \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
              8. lower-*.f64N/A

                \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
              9. lift-PI.f64N/A

                \[\leadsto \left(2 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
              10. lower-*.f64N/A

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

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

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

          Alternative 13: 64.5% accurate, 3.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}\;angle\_m \leq 1.6 \cdot 10^{+191}:\\ \;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_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 (<= angle_m 1.6e+191)
              (* (* (* (+ a_m b) PI) angle_m) (* (- b a_m) 0.011111111111111112))
              (*
               2.0
               (*
                (sin (* (* PI angle_m) 0.005555555555555556))
                (* (+ b a_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 (angle_m <= 1.6e+191) {
          		tmp = (((a_m + b) * ((double) M_PI)) * angle_m) * ((b - a_m) * 0.011111111111111112);
          	} else {
          		tmp = 2.0 * (sin(((((double) M_PI) * angle_m) * 0.005555555555555556)) * ((b + a_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 (angle_m <= 1.6e+191) {
          		tmp = (((a_m + b) * Math.PI) * angle_m) * ((b - a_m) * 0.011111111111111112);
          	} else {
          		tmp = 2.0 * (Math.sin(((Math.PI * angle_m) * 0.005555555555555556)) * ((b + a_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 angle_m <= 1.6e+191:
          		tmp = (((a_m + b) * math.pi) * angle_m) * ((b - a_m) * 0.011111111111111112)
          	else:
          		tmp = 2.0 * (math.sin(((math.pi * angle_m) * 0.005555555555555556)) * ((b + a_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 (angle_m <= 1.6e+191)
          		tmp = Float64(Float64(Float64(Float64(a_m + b) * pi) * angle_m) * Float64(Float64(b - a_m) * 0.011111111111111112));
          	else
          		tmp = Float64(2.0 * Float64(sin(Float64(Float64(pi * angle_m) * 0.005555555555555556)) * Float64(Float64(b + a_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 (angle_m <= 1.6e+191)
          		tmp = (((a_m + b) * pi) * angle_m) * ((b - a_m) * 0.011111111111111112);
          	else
          		tmp = 2.0 * (sin(((pi * angle_m) * 0.005555555555555556)) * ((b + a_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[angle$95$m, 1.6e+191], N[(N[(N[(N[(a$95$m + b), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
          
          \begin{array}{l}
          a_m = \left|a\right|
          \\
          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.6 \cdot 10^{+191}:\\
          \;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;2 \cdot \left(\sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if angle < 1.6000000000000001e191

            1. Initial program 55.8%

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

              \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
              2. lower-*.f64N/A

                \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
              3. associate-*r*N/A

                \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
              4. lower-*.f64N/A

                \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
              5. *-commutativeN/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
              6. lower-*.f64N/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
              7. lift-PI.f64N/A

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
              8. unpow2N/A

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
              9. unpow2N/A

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
              10. difference-of-squaresN/A

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              11. lower-*.f64N/A

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              12. lower-+.f64N/A

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              13. lower--.f6456.1

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
            5. Applied rewrites56.1%

              \[\leadsto \color{blue}{\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
            6. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              2. lift-PI.f64N/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              3. lift-*.f64N/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              4. lift-+.f64N/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              5. lift--.f64N/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              6. lift-*.f64N/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
              7. associate-*r*N/A

                \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              8. lower-*.f64N/A

                \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              9. *-commutativeN/A

                \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              10. lower-*.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              11. lower-*.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              12. lift-PI.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              13. +-commutativeN/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              14. lower-+.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              15. lift--.f6465.8

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
            7. Applied rewrites65.8%

              \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
            8. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
              2. lift--.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              3. lift-*.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              4. lift-+.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              5. lift-*.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              6. lift-PI.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              7. lift-*.f64N/A

                \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
              8. associate-*l*N/A

                \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \frac{1}{90}\right)} \]
              9. lower-*.f64N/A

                \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \frac{1}{90}\right)} \]
              10. associate-*r*N/A

                \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right)\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
              11. *-commutativeN/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right) \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
              12. lower-*.f64N/A

                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right) \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
              13. *-commutativeN/A

                \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(\color{blue}{b} - a\right) \cdot \frac{1}{90}\right) \]
              14. lower-*.f64N/A

                \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(\color{blue}{b} - a\right) \cdot \frac{1}{90}\right) \]
              15. lift-+.f64N/A

                \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \frac{1}{90}\right) \]
              16. lift-PI.f64N/A

                \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \frac{1}{90}\right) \]
              17. lower-*.f64N/A

                \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\frac{1}{90}}\right) \]
              18. lift--.f6466.2

                \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot 0.011111111111111112\right) \]
            9. Applied rewrites66.2%

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

            if 1.6000000000000001e191 < angle

            1. Initial program 26.3%

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

              \[\leadsto \color{blue}{2 \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
            4. Step-by-step derivation
              1. associate-*r*N/A

                \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
              2. lower-*.f64N/A

                \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \]
              3. lower-*.f64N/A

                \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\color{blue}{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
              4. lower-cos.f64N/A

                \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
              5. *-commutativeN/A

                \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
              6. lower-*.f64N/A

                \[\leadsto \left(2 \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
              7. *-commutativeN/A

                \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
              8. lower-*.f64N/A

                \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
              9. lift-PI.f64N/A

                \[\leadsto \left(2 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
              10. lower-*.f64N/A

                \[\leadsto \left(2 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right) \]
            5. Applied rewrites27.9%

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

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

                \[\leadsto 2 \cdot \left(\color{blue}{\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \]
            8. Recombined 2 regimes into one program.
            9. Add Preprocessing

            Alternative 14: 49.4% accurate, 3.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 \leq 8.8 \cdot 10^{-157}:\\ \;\;\;\;\left(\left(-2 \cdot \left(a\_m \cdot a\_m\right)\right) \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right)\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\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 8.8e-157)
                (*
                 (* (* -2.0 (* a_m a_m)) (sin (* (* angle_m PI) 0.005555555555555556)))
                 1.0)
                (* (* (* (+ a_m b) PI) angle_m) (* (- b a_m) 0.011111111111111112)))))
            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 <= 8.8e-157) {
            		tmp = ((-2.0 * (a_m * a_m)) * sin(((angle_m * ((double) M_PI)) * 0.005555555555555556))) * 1.0;
            	} else {
            		tmp = (((a_m + b) * ((double) M_PI)) * angle_m) * ((b - a_m) * 0.011111111111111112);
            	}
            	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 <= 8.8e-157) {
            		tmp = ((-2.0 * (a_m * a_m)) * Math.sin(((angle_m * Math.PI) * 0.005555555555555556))) * 1.0;
            	} else {
            		tmp = (((a_m + b) * Math.PI) * angle_m) * ((b - a_m) * 0.011111111111111112);
            	}
            	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 <= 8.8e-157:
            		tmp = ((-2.0 * (a_m * a_m)) * math.sin(((angle_m * math.pi) * 0.005555555555555556))) * 1.0
            	else:
            		tmp = (((a_m + b) * math.pi) * angle_m) * ((b - a_m) * 0.011111111111111112)
            	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 <= 8.8e-157)
            		tmp = Float64(Float64(Float64(-2.0 * Float64(a_m * a_m)) * sin(Float64(Float64(angle_m * pi) * 0.005555555555555556))) * 1.0);
            	else
            		tmp = Float64(Float64(Float64(Float64(a_m + b) * pi) * angle_m) * Float64(Float64(b - a_m) * 0.011111111111111112));
            	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 <= 8.8e-157)
            		tmp = ((-2.0 * (a_m * a_m)) * sin(((angle_m * pi) * 0.005555555555555556))) * 1.0;
            	else
            		tmp = (((a_m + b) * pi) * angle_m) * ((b - a_m) * 0.011111111111111112);
            	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, 8.8e-157], N[(N[(N[(-2.0 * N[(a$95$m * a$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[(N[(a$95$m + b), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $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 8.8 \cdot 10^{-157}:\\
            \;\;\;\;\left(\left(-2 \cdot \left(a\_m \cdot a\_m\right)\right) \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right)\right) \cdot 1\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if b < 8.80000000000000041e-157

              1. Initial program 53.5%

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

                \[\leadsto \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
                2. lower-*.f64N/A

                  \[\leadsto \left(\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
                3. associate-*r*N/A

                  \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
                4. lower-*.f64N/A

                  \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
                5. *-commutativeN/A

                  \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
                6. lower-*.f64N/A

                  \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
                7. lift-PI.f64N/A

                  \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
                8. unpow2N/A

                  \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
                9. unpow2N/A

                  \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
                10. difference-of-squaresN/A

                  \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
                11. lower-*.f64N/A

                  \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
                12. lower-+.f64N/A

                  \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
                13. lower--.f6460.6

                  \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
              5. Applied rewrites60.6%

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

                \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
              7. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{180}}\right) \]
                2. lower-*.f64N/A

                  \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{180}}\right) \]
                3. lower-*.f64N/A

                  \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90}\right) \cdot \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right) \]
                4. lift-PI.f6461.0

                  \[\leadsto \left(\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
              8. Applied rewrites61.0%

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

                \[\leadsto \color{blue}{\left(-2 \cdot \left({a}^{2} \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \]
              10. Step-by-step derivation
                1. associate-*r*N/A

                  \[\leadsto \left(\left(-2 \cdot {a}^{2}\right) \cdot \color{blue}{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \]
                2. lower-*.f64N/A

                  \[\leadsto \left(\left(-2 \cdot {a}^{2}\right) \cdot \color{blue}{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \]
                3. lower-*.f64N/A

                  \[\leadsto \left(\left(-2 \cdot {a}^{2}\right) \cdot \sin \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \]
                4. pow2N/A

                  \[\leadsto \left(\left(-2 \cdot \left(a \cdot a\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \]
                5. lift-*.f64N/A

                  \[\leadsto \left(\left(-2 \cdot \left(a \cdot a\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \]
                6. lower-sin.f64N/A

                  \[\leadsto \left(\left(-2 \cdot \left(a \cdot a\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \]
                7. *-commutativeN/A

                  \[\leadsto \left(\left(-2 \cdot \left(a \cdot a\right)\right) \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \]
                8. lift-*.f64N/A

                  \[\leadsto \left(\left(-2 \cdot \left(a \cdot a\right)\right) \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{180}\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \]
                9. lift-PI.f64N/A

                  \[\leadsto \left(\left(-2 \cdot \left(a \cdot a\right)\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right) \]
                10. lift-*.f6437.9

                  \[\leadsto \left(\left(-2 \cdot \left(a \cdot a\right)\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)\right) \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
              11. Applied rewrites37.9%

                \[\leadsto \color{blue}{\left(\left(-2 \cdot \left(a \cdot a\right)\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)\right)} \cdot \cos \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \]
              12. Taylor expanded in angle around 0

                \[\leadsto \left(\left(-2 \cdot \left(a \cdot a\right)\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{180}\right)\right) \cdot \color{blue}{1} \]
              13. Step-by-step derivation
                1. Applied rewrites38.1%

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

                if 8.80000000000000041e-157 < b

                1. Initial program 48.9%

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

                  \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
                  3. associate-*r*N/A

                    \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  4. lower-*.f64N/A

                    \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  5. *-commutativeN/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  6. lower-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  7. lift-PI.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  8. unpow2N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  9. unpow2N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
                  10. difference-of-squaresN/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  11. lower-*.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  12. lower-+.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  13. lower--.f6450.0

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
                5. Applied rewrites50.0%

                  \[\leadsto \color{blue}{\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
                6. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  2. lift-PI.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  3. lift-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  4. lift-+.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  5. lift--.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  6. lift-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  7. associate-*r*N/A

                    \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  8. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  9. *-commutativeN/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  10. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  11. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  12. lift-PI.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  13. +-commutativeN/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  14. lower-+.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  15. lift--.f6462.3

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
                7. Applied rewrites62.3%

                  \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
                8. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
                  2. lift--.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  3. lift-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  4. lift-+.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  5. lift-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  6. lift-PI.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  7. lift-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  8. associate-*l*N/A

                    \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \frac{1}{90}\right)} \]
                  9. lower-*.f64N/A

                    \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \frac{1}{90}\right)} \]
                  10. associate-*r*N/A

                    \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right)\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
                  11. *-commutativeN/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right) \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
                  12. lower-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right) \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
                  13. *-commutativeN/A

                    \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(\color{blue}{b} - a\right) \cdot \frac{1}{90}\right) \]
                  14. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(\color{blue}{b} - a\right) \cdot \frac{1}{90}\right) \]
                  15. lift-+.f64N/A

                    \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \frac{1}{90}\right) \]
                  16. lift-PI.f64N/A

                    \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \frac{1}{90}\right) \]
                  17. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\frac{1}{90}}\right) \]
                  18. lift--.f6462.3

                    \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot 0.011111111111111112\right) \]
                9. Applied rewrites62.3%

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

              Alternative 15: 62.9% accurate, 13.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}\;angle\_m \leq 2.8 \cdot 10^{+206}:\\ \;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot \left(a\_m + b\right)\right) \cdot \left(-a\_m\right)\right) \cdot 0.011111111111111112\\ \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 2.8e+206)
                  (* (* (* (+ a_m b) PI) angle_m) (* (- b a_m) 0.011111111111111112))
                  (* (* (* (* angle_m PI) (+ a_m b)) (- a_m)) 0.011111111111111112))))
              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 <= 2.8e+206) {
              		tmp = (((a_m + b) * ((double) M_PI)) * angle_m) * ((b - a_m) * 0.011111111111111112);
              	} else {
              		tmp = (((angle_m * ((double) M_PI)) * (a_m + b)) * -a_m) * 0.011111111111111112;
              	}
              	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 <= 2.8e+206) {
              		tmp = (((a_m + b) * Math.PI) * angle_m) * ((b - a_m) * 0.011111111111111112);
              	} else {
              		tmp = (((angle_m * Math.PI) * (a_m + b)) * -a_m) * 0.011111111111111112;
              	}
              	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 <= 2.8e+206:
              		tmp = (((a_m + b) * math.pi) * angle_m) * ((b - a_m) * 0.011111111111111112)
              	else:
              		tmp = (((angle_m * math.pi) * (a_m + b)) * -a_m) * 0.011111111111111112
              	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 <= 2.8e+206)
              		tmp = Float64(Float64(Float64(Float64(a_m + b) * pi) * angle_m) * Float64(Float64(b - a_m) * 0.011111111111111112));
              	else
              		tmp = Float64(Float64(Float64(Float64(angle_m * pi) * Float64(a_m + b)) * Float64(-a_m)) * 0.011111111111111112);
              	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 <= 2.8e+206)
              		tmp = (((a_m + b) * pi) * angle_m) * ((b - a_m) * 0.011111111111111112);
              	else
              		tmp = (((angle_m * pi) * (a_m + b)) * -a_m) * 0.011111111111111112;
              	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, 2.8e+206], N[(N[(N[(N[(a$95$m + b), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * (-a$95$m)), $MachinePrecision] * 0.011111111111111112), $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 2.8 \cdot 10^{+206}:\\
              \;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot \left(a\_m + b\right)\right) \cdot \left(-a\_m\right)\right) \cdot 0.011111111111111112\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if angle < 2.7999999999999998e206

                1. Initial program 55.8%

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

                  \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
                  3. associate-*r*N/A

                    \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  4. lower-*.f64N/A

                    \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  5. *-commutativeN/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  6. lower-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  7. lift-PI.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  8. unpow2N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  9. unpow2N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
                  10. difference-of-squaresN/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  11. lower-*.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  12. lower-+.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  13. lower--.f6455.5

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
                5. Applied rewrites55.5%

                  \[\leadsto \color{blue}{\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
                6. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  2. lift-PI.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  3. lift-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  4. lift-+.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  5. lift--.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  6. lift-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  7. associate-*r*N/A

                    \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  8. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  9. *-commutativeN/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  10. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  11. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  12. lift-PI.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  13. +-commutativeN/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  14. lower-+.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  15. lift--.f6464.9

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
                7. Applied rewrites64.9%

                  \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
                8. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
                  2. lift--.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  3. lift-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  4. lift-+.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  5. lift-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  6. lift-PI.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  7. lift-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  8. associate-*l*N/A

                    \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \frac{1}{90}\right)} \]
                  9. lower-*.f64N/A

                    \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \frac{1}{90}\right)} \]
                  10. associate-*r*N/A

                    \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right)\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
                  11. *-commutativeN/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right) \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
                  12. lower-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right) \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \frac{1}{90}\right) \]
                  13. *-commutativeN/A

                    \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(\color{blue}{b} - a\right) \cdot \frac{1}{90}\right) \]
                  14. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(\color{blue}{b} - a\right) \cdot \frac{1}{90}\right) \]
                  15. lift-+.f64N/A

                    \[\leadsto \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \frac{1}{90}\right) \]
                  16. lift-PI.f64N/A

                    \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \frac{1}{90}\right) \]
                  17. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\frac{1}{90}}\right) \]
                  18. lift--.f6465.3

                    \[\leadsto \left(\left(\left(a + b\right) \cdot \pi\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot 0.011111111111111112\right) \]
                9. Applied rewrites65.3%

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

                if 2.7999999999999998e206 < angle

                1. Initial program 20.0%

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

                  \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
                  3. associate-*r*N/A

                    \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  4. lower-*.f64N/A

                    \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  5. *-commutativeN/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  6. lower-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  7. lift-PI.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  8. unpow2N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  9. unpow2N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
                  10. difference-of-squaresN/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  11. lower-*.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  12. lower-+.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  13. lower--.f6425.8

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
                5. Applied rewrites25.8%

                  \[\leadsto \color{blue}{\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
                6. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  2. lift-PI.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  3. lift-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  4. lift-+.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  5. lift--.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  6. lift-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  7. associate-*r*N/A

                    \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  8. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  9. *-commutativeN/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  10. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  11. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  12. lift-PI.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  13. +-commutativeN/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  14. lower-+.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  15. lift--.f6422.5

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
                7. Applied rewrites22.5%

                  \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
                8. Taylor expanded in a around inf

                  \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(-1 \cdot a\right)\right) \cdot \frac{1}{90} \]
                9. Step-by-step derivation
                  1. mul-1-negN/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(\mathsf{neg}\left(a\right)\right)\right) \cdot \frac{1}{90} \]
                  2. lower-neg.f6426.0

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(-a\right)\right) \cdot 0.011111111111111112 \]
                10. Applied rewrites26.0%

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

              Alternative 16: 62.7% accurate, 13.7× 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 := \left(angle\_m \cdot \pi\right) \cdot \left(a\_m + b\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 2.8 \cdot 10^{+206}:\\ \;\;\;\;\left(t\_0 \cdot \left(b - a\_m\right)\right) \cdot 0.011111111111111112\\ \mathbf{else}:\\ \;\;\;\;\left(t\_0 \cdot \left(-a\_m\right)\right) \cdot 0.011111111111111112\\ \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 (* (* angle_m PI) (+ a_m b))))
                 (*
                  angle_s
                  (if (<= angle_m 2.8e+206)
                    (* (* t_0 (- b a_m)) 0.011111111111111112)
                    (* (* t_0 (- a_m)) 0.011111111111111112)))))
              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 = (angle_m * ((double) M_PI)) * (a_m + b);
              	double tmp;
              	if (angle_m <= 2.8e+206) {
              		tmp = (t_0 * (b - a_m)) * 0.011111111111111112;
              	} else {
              		tmp = (t_0 * -a_m) * 0.011111111111111112;
              	}
              	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 = (angle_m * Math.PI) * (a_m + b);
              	double tmp;
              	if (angle_m <= 2.8e+206) {
              		tmp = (t_0 * (b - a_m)) * 0.011111111111111112;
              	} else {
              		tmp = (t_0 * -a_m) * 0.011111111111111112;
              	}
              	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 = (angle_m * math.pi) * (a_m + b)
              	tmp = 0
              	if angle_m <= 2.8e+206:
              		tmp = (t_0 * (b - a_m)) * 0.011111111111111112
              	else:
              		tmp = (t_0 * -a_m) * 0.011111111111111112
              	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(Float64(angle_m * pi) * Float64(a_m + b))
              	tmp = 0.0
              	if (angle_m <= 2.8e+206)
              		tmp = Float64(Float64(t_0 * Float64(b - a_m)) * 0.011111111111111112);
              	else
              		tmp = Float64(Float64(t_0 * Float64(-a_m)) * 0.011111111111111112);
              	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 = (angle_m * pi) * (a_m + b);
              	tmp = 0.0;
              	if (angle_m <= 2.8e+206)
              		tmp = (t_0 * (b - a_m)) * 0.011111111111111112;
              	else
              		tmp = (t_0 * -a_m) * 0.011111111111111112;
              	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[(N[(angle$95$m * Pi), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 2.8e+206], N[(N[(t$95$0 * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(N[(t$95$0 * (-a$95$m)), $MachinePrecision] * 0.011111111111111112), $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 := \left(angle\_m \cdot \pi\right) \cdot \left(a\_m + b\right)\\
              angle\_s \cdot \begin{array}{l}
              \mathbf{if}\;angle\_m \leq 2.8 \cdot 10^{+206}:\\
              \;\;\;\;\left(t\_0 \cdot \left(b - a\_m\right)\right) \cdot 0.011111111111111112\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(t\_0 \cdot \left(-a\_m\right)\right) \cdot 0.011111111111111112\\
              
              
              \end{array}
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if angle < 2.7999999999999998e206

                1. Initial program 55.8%

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

                  \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
                  3. associate-*r*N/A

                    \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  4. lower-*.f64N/A

                    \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  5. *-commutativeN/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  6. lower-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  7. lift-PI.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  8. unpow2N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  9. unpow2N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
                  10. difference-of-squaresN/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  11. lower-*.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  12. lower-+.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  13. lower--.f6455.5

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
                5. Applied rewrites55.5%

                  \[\leadsto \color{blue}{\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
                6. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  2. lift-PI.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  3. lift-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  4. lift-+.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  5. lift--.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  6. lift-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  7. associate-*r*N/A

                    \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  8. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  9. *-commutativeN/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  10. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  11. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  12. lift-PI.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  13. +-commutativeN/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  14. lower-+.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  15. lift--.f6464.9

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
                7. Applied rewrites64.9%

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

                if 2.7999999999999998e206 < angle

                1. Initial program 20.0%

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

                  \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
                  3. associate-*r*N/A

                    \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  4. lower-*.f64N/A

                    \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  5. *-commutativeN/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  6. lower-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  7. lift-PI.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  8. unpow2N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                  9. unpow2N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
                  10. difference-of-squaresN/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  11. lower-*.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  12. lower-+.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  13. lower--.f6425.8

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
                5. Applied rewrites25.8%

                  \[\leadsto \color{blue}{\left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
                6. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  2. lift-PI.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  3. lift-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  4. lift-+.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  5. lift--.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  6. lift-*.f64N/A

                    \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                  7. associate-*r*N/A

                    \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  8. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  9. *-commutativeN/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  10. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  11. lower-*.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  12. lift-PI.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  13. +-commutativeN/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  14. lower-+.f64N/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \frac{1}{90} \]
                  15. lift--.f6422.5

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
                7. Applied rewrites22.5%

                  \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
                8. Taylor expanded in a around inf

                  \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(-1 \cdot a\right)\right) \cdot \frac{1}{90} \]
                9. Step-by-step derivation
                  1. mul-1-negN/A

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(\mathsf{neg}\left(a\right)\right)\right) \cdot \frac{1}{90} \]
                  2. lower-neg.f6426.0

                    \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(-a\right)\right) \cdot 0.011111111111111112 \]
                10. Applied rewrites26.0%

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

              Alternative 17: 38.3% accurate, 21.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(\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\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 PI) 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 * a_m) * ((angle_m * ((double) M_PI)) * 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 * a_m) * ((angle_m * Math.PI) * 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 * a_m) * ((angle_m * math.pi) * 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(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * 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 * a_m) * ((angle_m * pi) * 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[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $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(\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\right)
              \end{array}
              
              Derivation
              1. Initial program 51.8%

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

                \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
                2. lower-*.f64N/A

                  \[\leadsto \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
                3. associate-*r*N/A

                  \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                4. lower-*.f64N/A

                  \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                5. *-commutativeN/A

                  \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                6. lower-*.f64N/A

                  \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                7. lift-PI.f64N/A

                  \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                8. unpow2N/A

                  \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \frac{1}{90} \]
                9. unpow2N/A

                  \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \frac{1}{90} \]
                10. difference-of-squaresN/A

                  \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                11. lower-*.f64N/A

                  \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                12. lower-+.f64N/A

                  \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
                13. lower--.f6452.2

                  \[\leadsto \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
              5. Applied rewrites52.2%

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

                \[\leadsto \frac{-1}{90} \cdot \color{blue}{\left({a}^{2} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
              7. Step-by-step derivation
                1. associate-*r*N/A

                  \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \]
                2. lower-*.f64N/A

                  \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \]
                3. lower-*.f64N/A

                  \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
                4. pow2N/A

                  \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
                5. lift-*.f64N/A

                  \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
                6. lower-*.f64N/A

                  \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
                7. lift-PI.f6430.3

                  \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \pi\right) \]
              8. Applied rewrites30.3%

                \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(angle \cdot \pi\right)} \]
              9. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \pi\right) \]
                2. lift-*.f64N/A

                  \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \pi\right) \]
                3. associate-*r*N/A

                  \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
                4. lower-*.f64N/A

                  \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
                5. lower-*.f6430.3

                  \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
              10. Applied rewrites30.3%

                \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
              11. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \color{blue}{\pi}\right) \]
                2. lift-*.f64N/A

                  \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
                3. lift-*.f64N/A

                  \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \pi\right) \]
                4. lift-PI.f64N/A

                  \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
                5. lift-*.f64N/A

                  \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
                6. associate-*l*N/A

                  \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right) \]
                7. lower-*.f64N/A

                  \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right) \]
                8. lift-*.f64N/A

                  \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \left(\color{blue}{angle} \cdot \mathsf{PI}\left(\right)\right)\right) \]
                9. *-commutativeN/A

                  \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \]
                10. lift-*.f64N/A

                  \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \]
                11. lift-PI.f64N/A

                  \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \pi\right) \cdot a\right) \]
                12. lift-*.f6434.6

                  \[\leadsto \left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle \cdot \pi\right) \cdot a\right) \]
              12. Applied rewrites34.6%

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

              Reproduce

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