ab-angle->ABCF B

Percentage Accurate: 54.3% → 67.8%
Time: 17.3s
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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

Alternative 1: 67.8% accurate, 0.6× speedup?

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

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

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


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

    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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b \cdot b - a \cdot a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, \color{blue}{180}\right)\right)\right)\right) \]
      5. difference-of-squaresN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \color{blue}{\mathsf{/.f64}\left(angle, 180\right)}\right)\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{PI.f64}\left(\right)}, \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      9. *-commutativeN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\frac{angle}{180}\right)\right)\right)\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      14. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \left(\frac{1}{180}\right)\right)\right)\right)\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      16. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \frac{1}{180}\right)\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      18. --lowering--.f6462.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \frac{1}{180}\right)\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \color{blue}{\mathsf{/.f64}\left(angle, 180\right)}\right)\right)\right) \]
    4. Applied egg-rr62.8%

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      6. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      7. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      9. PI-lowering-PI.f6462.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    6. Applied egg-rr62.3%

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\mathsf{PI}\left(\right)}\right), \left(\sqrt{\mathsf{PI}\left(\right)}\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{PI}\left(\right)\right), \left(\sqrt{\mathsf{PI}\left(\right)}\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      4. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \left(\sqrt{\mathsf{PI}\left(\right)}\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{sqrt.f64}\left(\mathsf{PI}\left(\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      6. PI-lowering-PI.f6463.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{PI.f64}\left(\right)\right), \mathsf{sqrt.f64}\left(\mathsf{PI.f64}\left(\right)\right)\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    8. Applied egg-rr63.6%

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

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

    1. Initial program 44.6%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b \cdot b - a \cdot a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, \color{blue}{180}\right)\right)\right)\right) \]
      5. difference-of-squaresN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \color{blue}{\mathsf{/.f64}\left(angle, 180\right)}\right)\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{PI.f64}\left(\right)}, \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      9. *-commutativeN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\frac{angle}{180}\right)\right)\right)\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      14. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \left(\frac{1}{180}\right)\right)\right)\right)\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      16. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \frac{1}{180}\right)\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      18. --lowering--.f6480.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \frac{1}{180}\right)\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \color{blue}{\mathsf{/.f64}\left(angle, 180\right)}\right)\right)\right) \]
    4. Applied egg-rr80.7%

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      6. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      7. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      9. PI-lowering-PI.f6480.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    6. Applied egg-rr80.7%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      2. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      3. add-sqr-sqrtN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right), \left(\sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), \left(\sqrt{\mathsf{PI}\left(\right)}\right)\right)\right), \left(\sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      9. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\sqrt{\mathsf{PI}\left(\right)}\right)\right)\right), \left(\sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{sqrt.f64}\left(\mathsf{PI}\left(\right)\right)\right)\right), \left(\sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      11. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{sqrt.f64}\left(\mathsf{PI.f64}\left(\right)\right)\right)\right), \left(\sqrt{\sqrt{\mathsf{PI}\left(\right)}}\right)\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      12. sqrt-lowering-sqrt.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{sqrt.f64}\left(\mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{PI}\left(\right)\right)\right)\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      14. PI-lowering-PI.f6483.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{sqrt.f64}\left(\mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{PI.f64}\left(\right)\right)\right)\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    8. Applied egg-rr83.0%

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

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

Alternative 2: 67.5% 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) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;a\_m \leq 2 \cdot 10^{+222}:\\ \;\;\;\;\frac{b + a\_m}{\frac{0.5}{\left(b - a\_m\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)}} \cdot \cos \left(\frac{\pi \cdot angle\_m}{-180}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b - a\_m\right) \cdot \left(\left(b + a\_m\right) \cdot \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= a_m 2e+222)
    (*
     (/
      (+ b a_m)
      (/ 0.5 (* (- b a_m) (sin (* 0.005555555555555556 (* PI angle_m))))))
     (cos (/ (* PI angle_m) -180.0)))
    (* (- b a_m) (* (+ b a_m) (* PI (* 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 (a_m <= 2e+222) {
		tmp = ((b + a_m) / (0.5 / ((b - a_m) * sin((0.005555555555555556 * (((double) M_PI) * angle_m)))))) * cos(((((double) M_PI) * angle_m) / -180.0));
	} else {
		tmp = (b - a_m) * ((b + a_m) * (((double) M_PI) * (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 (a_m <= 2e+222) {
		tmp = ((b + a_m) / (0.5 / ((b - a_m) * Math.sin((0.005555555555555556 * (Math.PI * angle_m)))))) * Math.cos(((Math.PI * angle_m) / -180.0));
	} else {
		tmp = (b - a_m) * ((b + a_m) * (Math.PI * (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 a_m <= 2e+222:
		tmp = ((b + a_m) / (0.5 / ((b - a_m) * math.sin((0.005555555555555556 * (math.pi * angle_m)))))) * math.cos(((math.pi * angle_m) / -180.0))
	else:
		tmp = (b - a_m) * ((b + a_m) * (math.pi * (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 (a_m <= 2e+222)
		tmp = Float64(Float64(Float64(b + a_m) / Float64(0.5 / Float64(Float64(b - a_m) * sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))))) * cos(Float64(Float64(pi * angle_m) / -180.0)));
	else
		tmp = Float64(Float64(b - a_m) * Float64(Float64(b + a_m) * Float64(pi * Float64(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 (a_m <= 2e+222)
		tmp = ((b + a_m) / (0.5 / ((b - a_m) * sin((0.005555555555555556 * (pi * angle_m)))))) * cos(((pi * angle_m) / -180.0));
	else
		tmp = (b - a_m) * ((b + a_m) * (pi * (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[a$95$m, 2e+222], N[(N[(N[(b + a$95$m), $MachinePrecision] / N[(0.5 / N[(N[(b - a$95$m), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(Pi * angle$95$m), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


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

    1. Initial program 54.9%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(b, 2\right), \mathsf{pow.f64}\left(a, 2\right)\right)\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), \cos \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right) \]
      2. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(b, 2\right), \mathsf{pow.f64}\left(a, 2\right)\right)\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), \cos \left(\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right) \cdot angle\right)}{\mathsf{neg}\left(180\right)}\right)\right) \]
      3. distribute-frac-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(b, 2\right), \mathsf{pow.f64}\left(a, 2\right)\right)\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), \cos \left(\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{\mathsf{neg}\left(180\right)}\right)\right)\right) \]
      4. cos-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(b, 2\right), \mathsf{pow.f64}\left(a, 2\right)\right)\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), \cos \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{\mathsf{neg}\left(180\right)}\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(b, 2\right), \mathsf{pow.f64}\left(a, 2\right)\right)\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), \mathsf{cos.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{\mathsf{neg}\left(180\right)}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(b, 2\right), \mathsf{pow.f64}\left(a, 2\right)\right)\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{PI}\left(\right) \cdot angle\right), \left(\mathsf{neg}\left(180\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(b, 2\right), \mathsf{pow.f64}\left(a, 2\right)\right)\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right), \left(\mathsf{neg}\left(180\right)\right)\right)\right)\right) \]
      8. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(b, 2\right), \mathsf{pow.f64}\left(a, 2\right)\right)\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), \left(\mathsf{neg}\left(180\right)\right)\right)\right)\right) \]
      9. metadata-eval54.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(b, 2\right), \mathsf{pow.f64}\left(a, 2\right)\right)\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), -180\right)\right)\right) \]
    4. Applied egg-rr54.3%

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\left(b - a\right) \cdot \left(2 \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)}{1}\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(b, a\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right)}, -180\right)\right)\right) \]
      2. clear-numN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right), \left(b - a\right)\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(b, a\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), -180\right)\right)\right) \]
      10. div-invN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right), \left(b - a\right)\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(b, a\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), -180\right)\right)\right) \]
      14. metadata-evalN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(\frac{1}{180}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right)\right)\right), \left(b - a\right)\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(b, a\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), -180\right)\right)\right) \]
      19. --lowering--.f6469.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(\frac{1}{180}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right)\right)\right), \mathsf{\_.f64}\left(b, a\right)\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(b, a\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), -180\right)\right)\right) \]
    7. Applied egg-rr69.0%

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{\frac{1}{b + a} \cdot \frac{1}{2 \cdot \left(\sin \left(\frac{1}{180} \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \left(b - a\right)\right)}}\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), -180\right)}\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{1}{\frac{1}{b + a}}}{\frac{1}{2 \cdot \left(\sin \left(\frac{1}{180} \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \left(b - a\right)\right)}}\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), -180\right)}\right)\right) \]
      3. remove-double-divN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\frac{1}{2 \cdot \left(\sin \left(\frac{1}{180} \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \left(b - a\right)\right)}\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right)}, -180\right)\right)\right) \]
      6. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\frac{\frac{1}{2}}{\sin \left(\frac{1}{180} \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \left(b - a\right)}\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), \color{blue}{-180}\right)\right)\right) \]
      7. metadata-evalN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\sin \left(\frac{1}{180} \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right), \left(b - a\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), -180\right)\right)\right) \]
    9. Applied egg-rr69.0%

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

    if 2.0000000000000001e222 < a

    1. Initial program 43.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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6479.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified79.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(angle \cdot \color{blue}{\frac{1}{90}}\right)\right)\right)\right) \]
      13. *-lowering-*.f6489.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \color{blue}{\frac{1}{90}}\right)\right)\right)\right) \]
    7. Applied egg-rr89.5%

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

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

Alternative 3: 67.8% 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 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+141}:\\ \;\;\;\;\left(\left(\left(2 \cdot \sin t\_0\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right) \cdot \cos t\_0\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\left(b + a\_m\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
 :precision binary64
 (let* ((t_0 (* angle_m (* PI 0.005555555555555556))))
   (*
    angle_s
    (if (<= (/ angle_m 180.0) 1e+141)
      (* (* (* (* 2.0 (sin t_0)) (+ b a_m)) (- b a_m)) (cos t_0))
      (*
       (cos (* PI (/ angle_m 180.0)))
       (*
        (- b a_m)
        (*
         (+ b a_m)
         (* 2.0 (sin (* PI (* angle_m 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 = angle_m * (((double) M_PI) * 0.005555555555555556);
	double tmp;
	if ((angle_m / 180.0) <= 1e+141) {
		tmp = (((2.0 * sin(t_0)) * (b + a_m)) * (b - a_m)) * cos(t_0);
	} else {
		tmp = cos((((double) M_PI) * (angle_m / 180.0))) * ((b - a_m) * ((b + a_m) * (2.0 * sin((((double) M_PI) * (angle_m * 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 = angle_m * (Math.PI * 0.005555555555555556);
	double tmp;
	if ((angle_m / 180.0) <= 1e+141) {
		tmp = (((2.0 * Math.sin(t_0)) * (b + a_m)) * (b - a_m)) * Math.cos(t_0);
	} else {
		tmp = Math.cos((Math.PI * (angle_m / 180.0))) * ((b - a_m) * ((b + a_m) * (2.0 * Math.sin((Math.PI * (angle_m * 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 = angle_m * (math.pi * 0.005555555555555556)
	tmp = 0
	if (angle_m / 180.0) <= 1e+141:
		tmp = (((2.0 * math.sin(t_0)) * (b + a_m)) * (b - a_m)) * math.cos(t_0)
	else:
		tmp = math.cos((math.pi * (angle_m / 180.0))) * ((b - a_m) * ((b + a_m) * (2.0 * math.sin((math.pi * (angle_m * 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(angle_m * Float64(pi * 0.005555555555555556))
	tmp = 0.0
	if (Float64(angle_m / 180.0) <= 1e+141)
		tmp = Float64(Float64(Float64(Float64(2.0 * sin(t_0)) * Float64(b + a_m)) * Float64(b - a_m)) * cos(t_0));
	else
		tmp = Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * Float64(Float64(b - a_m) * Float64(Float64(b + a_m) * Float64(2.0 * sin(Float64(pi * Float64(angle_m * 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 = angle_m * (pi * 0.005555555555555556);
	tmp = 0.0;
	if ((angle_m / 180.0) <= 1e+141)
		tmp = (((2.0 * sin(t_0)) * (b + a_m)) * (b - a_m)) * cos(t_0);
	else
		tmp = cos((pi * (angle_m / 180.0))) * ((b - a_m) * ((b + a_m) * (2.0 * sin((pi * (angle_m * 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[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+141], N[(N[(N[(N[(2.0 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


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

    1. Initial program 58.0%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b \cdot b - a \cdot a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, \color{blue}{180}\right)\right)\right)\right) \]
      5. difference-of-squaresN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \color{blue}{\mathsf{/.f64}\left(angle, 180\right)}\right)\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{PI.f64}\left(\right)}, \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      9. *-commutativeN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\frac{angle}{180}\right)\right)\right)\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      14. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \left(\frac{1}{180}\right)\right)\right)\right)\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      16. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \frac{1}{180}\right)\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      18. --lowering--.f6472.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \frac{1}{180}\right)\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \color{blue}{\mathsf{/.f64}\left(angle, 180\right)}\right)\right)\right) \]
    4. Applied egg-rr72.0%

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      6. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      7. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      9. PI-lowering-PI.f6471.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    6. Applied egg-rr71.8%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \]
      2. metadata-evalN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), \frac{1}{180}\right), angle\right)\right)\right) \]
      7. PI-lowering-PI.f6473.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right) \]
    8. Applied egg-rr73.0%

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

    if 1.00000000000000002e141 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 25.0%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b \cdot b - a \cdot a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, \color{blue}{180}\right)\right)\right)\right) \]
      5. difference-of-squaresN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \color{blue}{\mathsf{/.f64}\left(angle, 180\right)}\right)\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{PI.f64}\left(\right)}, \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      9. *-commutativeN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\frac{angle}{180}\right)\right)\right)\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      14. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \left(\frac{1}{180}\right)\right)\right)\right)\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      16. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \frac{1}{180}\right)\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      18. --lowering--.f6441.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \frac{1}{180}\right)\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \color{blue}{\mathsf{/.f64}\left(angle, 180\right)}\right)\right)\right) \]
    4. Applied egg-rr41.1%

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

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

Alternative 4: 67.8% 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 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\ angle\_s \cdot \left(\left(\left(\left(2 \cdot \sin t\_0\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right) \cdot \cos t\_0\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
 (let* ((t_0 (* angle_m (* PI 0.005555555555555556))))
   (* angle_s (* (* (* (* 2.0 (sin t_0)) (+ b a_m)) (- b a_m)) (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);
	return angle_s * ((((2.0 * sin(t_0)) * (b + a_m)) * (b - a_m)) * cos(t_0));
}
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);
	return angle_s * ((((2.0 * Math.sin(t_0)) * (b + a_m)) * (b - a_m)) * Math.cos(t_0));
}
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)
	return angle_s * ((((2.0 * math.sin(t_0)) * (b + a_m)) * (b - a_m)) * math.cos(t_0))
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(angle_m * Float64(pi * 0.005555555555555556))
	return Float64(angle_s * Float64(Float64(Float64(Float64(2.0 * sin(t_0)) * Float64(b + a_m)) * Float64(b - a_m)) * cos(t_0)))
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)
	t_0 = angle_m * (pi * 0.005555555555555556);
	tmp = angle_s * ((((2.0 * sin(t_0)) * (b + a_m)) * (b - a_m)) * cos(t_0));
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[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * N[(N[(N[(N[(2.0 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $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 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
angle\_s \cdot \left(\left(\left(\left(2 \cdot \sin t\_0\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right) \cdot \cos t\_0\right)
\end{array}
\end{array}
Derivation
  1. Initial program 54.0%

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b \cdot b - a \cdot a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, \color{blue}{180}\right)\right)\right)\right) \]
    5. difference-of-squaresN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \color{blue}{\mathsf{/.f64}\left(angle, 180\right)}\right)\right)\right) \]
    6. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)}\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{PI.f64}\left(\right)}, \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    9. *-commutativeN/A

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\frac{angle}{180}\right)\right)\right)\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    14. div-invN/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \left(\frac{1}{180}\right)\right)\right)\right)\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    16. metadata-evalN/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \frac{1}{180}\right)\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    18. --lowering--.f6468.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \frac{1}{180}\right)\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \color{blue}{\mathsf{/.f64}\left(angle, 180\right)}\right)\right)\right) \]
  4. Applied egg-rr68.2%

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    4. div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    6. div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    7. metadata-evalN/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    9. PI-lowering-PI.f6467.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
  6. Applied egg-rr67.9%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot \frac{1}{180}\right)\right)\right)\right) \]
    2. metadata-evalN/A

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), \frac{1}{180}\right), angle\right)\right)\right) \]
    7. PI-lowering-PI.f6468.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right) \]
  8. Applied egg-rr68.2%

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

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

Alternative 5: 67.7% 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) \\ angle\_s \cdot \left(\left(\left(\left(2 \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right) \cdot \cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right) \end{array} \]
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
 :precision binary64
 (*
  angle_s
  (*
   (*
    (* (* 2.0 (sin (* angle_m (* PI 0.005555555555555556)))) (+ b a_m))
    (- b a_m))
   (cos (* PI (* angle_m 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) {
	return angle_s * ((((2.0 * sin((angle_m * (((double) M_PI) * 0.005555555555555556)))) * (b + a_m)) * (b - a_m)) * cos((((double) M_PI) * (angle_m * 0.005555555555555556))));
}
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 * ((((2.0 * Math.sin((angle_m * (Math.PI * 0.005555555555555556)))) * (b + a_m)) * (b - a_m)) * Math.cos((Math.PI * (angle_m * 0.005555555555555556))));
}
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 * ((((2.0 * math.sin((angle_m * (math.pi * 0.005555555555555556)))) * (b + a_m)) * (b - a_m)) * math.cos((math.pi * (angle_m * 0.005555555555555556))))
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(Float64(Float64(2.0 * sin(Float64(angle_m * Float64(pi * 0.005555555555555556)))) * Float64(b + a_m)) * Float64(b - a_m)) * cos(Float64(pi * Float64(angle_m * 0.005555555555555556)))))
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 * ((((2.0 * sin((angle_m * (pi * 0.005555555555555556)))) * (b + a_m)) * (b - a_m)) * cos((pi * (angle_m * 0.005555555555555556))));
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[(N[(N[(2.0 * N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \left(\left(\left(\left(2 \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right) \cdot \cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)
\end{array}
Derivation
  1. Initial program 54.0%

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b \cdot b - a \cdot a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, \color{blue}{180}\right)\right)\right)\right) \]
    5. difference-of-squaresN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \color{blue}{\mathsf{/.f64}\left(angle, 180\right)}\right)\right)\right) \]
    6. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)}\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{PI.f64}\left(\right)}, \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    9. *-commutativeN/A

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\frac{angle}{180}\right)\right)\right)\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    14. div-invN/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \left(\frac{1}{180}\right)\right)\right)\right)\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    16. metadata-evalN/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \frac{1}{180}\right)\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    18. --lowering--.f6468.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \frac{1}{180}\right)\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \color{blue}{\mathsf{/.f64}\left(angle, 180\right)}\right)\right)\right) \]
  4. Applied egg-rr68.2%

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    4. div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    6. div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    7. metadata-evalN/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    9. PI-lowering-PI.f6467.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
  6. Applied egg-rr67.9%

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\left(\frac{angle}{180}\right), \mathsf{PI}\left(\right)\right)\right)\right) \]
    3. div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\left(angle \cdot \frac{1}{180}\right), \mathsf{PI}\left(\right)\right)\right)\right) \]
    4. metadata-evalN/A

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{180}, angle\right), \mathsf{PI}\left(\right)\right)\right)\right) \]
    7. PI-lowering-PI.f6468.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{180}, angle\right), \mathsf{PI.f64}\left(\right)\right)\right)\right) \]
  8. Applied egg-rr68.2%

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

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

Alternative 6: 67.5% accurate, 3.4× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;a\_m \leq 5.6 \cdot 10^{+221}:\\ \;\;\;\;\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b - a\_m\right) \cdot \left(\left(b + a\_m\right) \cdot \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= a_m 5.6e+221)
    (* (+ b a_m) (* (- b a_m) (sin (* (* PI angle_m) 0.011111111111111112))))
    (* (- b a_m) (* (+ b a_m) (* PI (* 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 (a_m <= 5.6e+221) {
		tmp = (b + a_m) * ((b - a_m) * sin(((((double) M_PI) * angle_m) * 0.011111111111111112)));
	} else {
		tmp = (b - a_m) * ((b + a_m) * (((double) M_PI) * (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 (a_m <= 5.6e+221) {
		tmp = (b + a_m) * ((b - a_m) * Math.sin(((Math.PI * angle_m) * 0.011111111111111112)));
	} else {
		tmp = (b - a_m) * ((b + a_m) * (Math.PI * (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 a_m <= 5.6e+221:
		tmp = (b + a_m) * ((b - a_m) * math.sin(((math.pi * angle_m) * 0.011111111111111112)))
	else:
		tmp = (b - a_m) * ((b + a_m) * (math.pi * (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 (a_m <= 5.6e+221)
		tmp = Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * sin(Float64(Float64(pi * angle_m) * 0.011111111111111112))));
	else
		tmp = Float64(Float64(b - a_m) * Float64(Float64(b + a_m) * Float64(pi * Float64(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 (a_m <= 5.6e+221)
		tmp = (b + a_m) * ((b - a_m) * sin(((pi * angle_m) * 0.011111111111111112)));
	else
		tmp = (b - a_m) * ((b + a_m) * (pi * (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[a$95$m, 5.6e+221], N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


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

    1. Initial program 55.1%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

        \[\leadsto \left(b \cdot b - a \cdot a\right) \cdot \left(2 \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right) \]
      6. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(b + a\right), \color{blue}{\left(\left(b - a\right) \cdot \left(2 \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right)}\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{\left(b - a\right)} \cdot \left(2 \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\left(b - a\right), \color{blue}{\left(2 \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)}\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, a\right), \left(\color{blue}{2} \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right)\right) \]
      12. 2-sinN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, a\right), \sin \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right) \]
      13. count-2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, a\right), \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right) \]
    4. Applied egg-rr66.8%

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

    if 5.59999999999999978e221 < a

    1. Initial program 40.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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6476.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified76.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(angle \cdot \color{blue}{\frac{1}{90}}\right)\right)\right)\right) \]
      13. *-lowering-*.f6489.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \color{blue}{\frac{1}{90}}\right)\right)\right)\right) \]
    7. Applied egg-rr89.9%

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 1.5e-10

    1. Initial program 62.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}{\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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6463.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified63.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(angle \cdot \color{blue}{\frac{1}{90}}\right)\right)\right)\right) \]
      13. *-lowering-*.f6473.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \color{blue}{\frac{1}{90}}\right)\right)\right)\right) \]
    7. Applied egg-rr73.0%

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

    if 1.5e-10 < angle

    1. Initial program 29.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(b \cdot b - a \cdot a\right), \left(2 \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right) \]
      7. difference-of-squaresN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right), \left(\color{blue}{2} \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(b + a\right), \left(b - a\right)\right), \left(\color{blue}{2} \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right) \]
      9. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, a\right)\right), \left(2 \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right) \]
      11. 2-sinN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, a\right)\right), \sin \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right) \]
      12. count-2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, a\right)\right), \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \]
      13. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{sin.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right) \]
      14. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180} + \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right) \]
      15. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180} + \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right) \]
      16. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180} + \frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)\right) \]
      17. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180} + \left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right)\right) \]
    4. Applied egg-rr34.7%

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

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

Alternative 8: 63.8% accurate, 3.5× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;a\_m \leq 3.1 \cdot 10^{-111}:\\ \;\;\;\;\sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right) \cdot \mathsf{fma}\left(b, b, 0\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b - a\_m\right) \cdot \left(\left(b + a\_m\right) \cdot \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= a_m 3.1e-111)
    (* (sin (* (* PI angle_m) 0.011111111111111112)) (fma b b 0.0))
    (* (- b a_m) (* (+ b a_m) (* PI (* 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 (a_m <= 3.1e-111) {
		tmp = sin(((((double) M_PI) * angle_m) * 0.011111111111111112)) * fma(b, b, 0.0);
	} else {
		tmp = (b - a_m) * ((b + a_m) * (((double) M_PI) * (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 (a_m <= 3.1e-111)
		tmp = Float64(sin(Float64(Float64(pi * angle_m) * 0.011111111111111112)) * fma(b, b, 0.0));
	else
		tmp = Float64(Float64(b - a_m) * Float64(Float64(b + a_m) * Float64(pi * Float64(angle_m * 0.011111111111111112))));
	end
	return Float64(angle_s * tmp)
end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a$95$m, 3.1e-111], N[(N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] * N[(b * b + 0.0), $MachinePrecision]), $MachinePrecision], N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 3.1 \cdot 10^{-111}:\\
\;\;\;\;\sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right) \cdot \mathsf{fma}\left(b, b, 0\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 3.10000000000000014e-111

    1. Initial program 53.9%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

        \[\leadsto \frac{{b}^{2} \cdot {b}^{2} - {a}^{2} \cdot {a}^{2}}{{b}^{2} + {a}^{2}} \cdot \left(\color{blue}{2} \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right) \]
      5. div-invN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({b}^{2} \cdot {b}^{2} - {a}^{2} \cdot {a}^{2}\right), \color{blue}{\left(\frac{1}{{b}^{2} + {a}^{2}} \cdot \left(2 \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right)\right)}\right) \]
    4. Applied egg-rr16.7%

      \[\leadsto \color{blue}{\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \mathsf{fma}\left(a, a, b \cdot b\right)\right) \cdot \left(\frac{1}{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)} \]
    5. Taylor expanded in b around inf

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

        \[\leadsto \mathsf{*.f64}\left(\left({b}^{2}\right), \color{blue}{\sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
      2. *-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\left({b}^{2} \cdot 1\right), \sin \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({b}^{2} \cdot \left(1 + 0\right)\right), \sin \left(\frac{1}{90} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)\right) \]
      4. distribute-rgt-inN/A

        \[\leadsto \mathsf{*.f64}\left(\left(1 \cdot {b}^{2} + 0 \cdot {b}^{2}\right), \sin \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
      5. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\left({b}^{2} + 0 \cdot {b}^{2}\right), \sin \left(\color{blue}{\frac{1}{90}} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(b \cdot b + 0 \cdot {b}^{2}\right), \sin \left(\color{blue}{\frac{1}{90}} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      7. mul0-lftN/A

        \[\leadsto \mathsf{*.f64}\left(\left(b \cdot b + 0\right), \sin \left(\frac{1}{90} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)\right) \]
      8. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(b, b, 0\right), \sin \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
      9. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(b, b, 0\right), \mathsf{sin.f64}\left(\left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(b, b, 0\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(b, b, 0\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      12. PI-lowering-PI.f6441.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(b, b, 0\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right)\right)\right) \]
    7. Simplified41.3%

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

    if 3.10000000000000014e-111 < a

    1. Initial program 54.2%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6463.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified63.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(angle \cdot \color{blue}{\frac{1}{90}}\right)\right)\right)\right) \]
      13. *-lowering-*.f6472.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \color{blue}{\frac{1}{90}}\right)\right)\right)\right) \]
    7. Applied egg-rr72.6%

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

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

Alternative 9: 63.7% accurate, 3.6× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;a\_m \leq 2.3 \cdot 10^{-111}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \sin t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(b - a\_m\right) \cdot \left(\left(b + a\_m\right) \cdot t\_0\right)\\ \end{array} \end{array} \end{array} \]
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (* angle_m 0.011111111111111112))))
   (*
    angle_s
    (if (<= a_m 2.3e-111)
      (* (* b b) (sin t_0))
      (* (- b a_m) (* (+ b a_m) 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 = ((double) M_PI) * (angle_m * 0.011111111111111112);
	double tmp;
	if (a_m <= 2.3e-111) {
		tmp = (b * b) * sin(t_0);
	} else {
		tmp = (b - a_m) * ((b + a_m) * 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 = Math.PI * (angle_m * 0.011111111111111112);
	double tmp;
	if (a_m <= 2.3e-111) {
		tmp = (b * b) * Math.sin(t_0);
	} else {
		tmp = (b - a_m) * ((b + a_m) * 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 = math.pi * (angle_m * 0.011111111111111112)
	tmp = 0
	if a_m <= 2.3e-111:
		tmp = (b * b) * math.sin(t_0)
	else:
		tmp = (b - a_m) * ((b + a_m) * 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(pi * Float64(angle_m * 0.011111111111111112))
	tmp = 0.0
	if (a_m <= 2.3e-111)
		tmp = Float64(Float64(b * b) * sin(t_0));
	else
		tmp = Float64(Float64(b - a_m) * Float64(Float64(b + a_m) * 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 = pi * (angle_m * 0.011111111111111112);
	tmp = 0.0;
	if (a_m <= 2.3e-111)
		tmp = (b * b) * sin(t_0);
	else
		tmp = (b - a_m) * ((b + a_m) * 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[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[a$95$m, 2.3e-111], N[(N[(b * b), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * 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 := \pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 2.3 \cdot 10^{-111}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \sin t\_0\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.3e-111

    1. Initial program 53.9%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr9.0%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(b, b \cdot b, a \cdot \left(a \cdot a\right)\right) \cdot \left(b \cdot \left(b \cdot b\right) - a \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\frac{1}{\mathsf{fma}\left(b, b \cdot \left(b \cdot b\right), a \cdot \left(a \cdot \mathsf{fma}\left(a, a, b \cdot b\right)\right)\right)} \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)} \]
    4. Taylor expanded in b around inf

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

        \[\leadsto \mathsf{*.f64}\left(\left({b}^{2}\right), \color{blue}{\sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(b \cdot b\right), \sin \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \sin \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
      4. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{sin.f64}\left(\left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{sin.f64}\left(\left(\left(\frac{1}{90} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{90} \cdot angle\right), \mathsf{PI}\left(\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, angle\right), \mathsf{PI}\left(\right)\right)\right)\right) \]
      8. PI-lowering-PI.f6439.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, angle\right), \mathsf{PI.f64}\left(\right)\right)\right)\right) \]
    6. Simplified39.9%

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

    if 2.3e-111 < a

    1. Initial program 54.2%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6463.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified63.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(angle \cdot \color{blue}{\frac{1}{90}}\right)\right)\right)\right) \]
      13. *-lowering-*.f6472.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \color{blue}{\frac{1}{90}}\right)\right)\right)\right) \]
    7. Applied egg-rr72.6%

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

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

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

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


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

    1. Initial program 59.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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6460.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified60.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(angle \cdot \color{blue}{\frac{1}{90}}\right)\right)\right)\right) \]
      13. *-lowering-*.f6469.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \color{blue}{\frac{1}{90}}\right)\right)\right)\right) \]
    7. Applied egg-rr69.0%

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

    if 2.2999999999999999e89 < angle

    1. Initial program 28.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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6434.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified34.7%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI}\left(\right)\right)\right) \]
      7. PI-lowering-PI.f6433.4%

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    8. Simplified33.4%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{angle}\right)\right)\right)\right) \]
      7. PI-lowering-PI.f6429.1%

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right)\right)\right)\right) \]
    10. Applied egg-rr29.1%

      \[\leadsto -0.011111111111111112 \cdot \color{blue}{\left(a \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), \left(a \cdot a\right)\right)\right) \]
      6. *-lowering-*.f6433.4%

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right), \mathsf{*.f64}\left(a, \color{blue}{a}\right)\right)\right) \]
    12. Applied egg-rr33.4%

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

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

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


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

    1. Initial program 54.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6454.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified54.2%

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

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

        \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
      3. *-commutativeN/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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right), \color{blue}{\frac{1}{90}}\right) \]
      5. difference-of-squaresN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(b \cdot b - a \cdot a\right), \left(\mathsf{PI}\left(\right) \cdot angle\right)\right), \frac{1}{90}\right) \]
      12. difference-of-squaresN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{*.f64}\left(\mathsf{PI}\left(\right), angle\right)\right), \frac{1}{90}\right) \]
      17. PI-lowering-PI.f6454.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right)\right), \frac{1}{90}\right) \]
    7. Applied egg-rr54.2%

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

    if 4.2999999999999997e62 < a

    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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6463.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified63.9%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI}\left(\right)\right)\right) \]
      7. PI-lowering-PI.f6462.1%

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    8. Simplified62.1%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{angle}\right)\right)\right)\right) \]
      7. PI-lowering-PI.f6470.8%

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right)\right)\right)\right) \]
    10. Applied egg-rr70.8%

      \[\leadsto -0.011111111111111112 \cdot \color{blue}{\left(a \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, a\right)\right), \left(a \cdot \color{blue}{\frac{-1}{90}}\right)\right) \]
      10. *-lowering-*.f6470.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, a\right)\right), \mathsf{*.f64}\left(a, \color{blue}{\frac{-1}{90}}\right)\right) \]
    12. Applied egg-rr70.8%

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

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

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

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


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

    1. Initial program 54.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6454.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified54.2%

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

        \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      2. difference-of-squaresN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(b \cdot b - a \cdot a\right), \frac{1}{90}\right), \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \]
      11. difference-of-squaresN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, a\right)\right), \frac{1}{90}\right), \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, a\right)\right), \frac{1}{90}\right), \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{angle}\right)\right) \]
      16. PI-lowering-PI.f6454.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, a\right)\right), \frac{1}{90}\right), \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right)\right) \]
    7. Applied egg-rr54.2%

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

    if 5.60000000000000029e62 < a

    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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6463.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified63.9%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI}\left(\right)\right)\right) \]
      7. PI-lowering-PI.f6462.1%

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    8. Simplified62.1%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{angle}\right)\right)\right)\right) \]
      7. PI-lowering-PI.f6470.8%

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right)\right)\right)\right) \]
    10. Applied egg-rr70.8%

      \[\leadsto -0.011111111111111112 \cdot \color{blue}{\left(a \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, a\right)\right), \left(a \cdot \color{blue}{\frac{-1}{90}}\right)\right) \]
      10. *-lowering-*.f6470.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, a\right)\right), \mathsf{*.f64}\left(a, \color{blue}{\frac{-1}{90}}\right)\right) \]
    12. Applied egg-rr70.8%

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

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

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

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


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

    1. Initial program 54.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6454.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified54.2%

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

    if 5.60000000000000029e62 < a

    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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6463.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified63.9%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI}\left(\right)\right)\right) \]
      7. PI-lowering-PI.f6462.1%

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    8. Simplified62.1%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{angle}\right)\right)\right)\right) \]
      7. PI-lowering-PI.f6470.8%

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right)\right)\right)\right) \]
    10. Applied egg-rr70.8%

      \[\leadsto -0.011111111111111112 \cdot \color{blue}{\left(a \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, a\right)\right), \left(a \cdot \color{blue}{\frac{-1}{90}}\right)\right) \]
      10. *-lowering-*.f6470.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, a\right)\right), \mathsf{*.f64}\left(a, \color{blue}{\frac{-1}{90}}\right)\right) \]
    12. Applied egg-rr70.8%

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

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

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

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


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

    1. Initial program 54.7%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b \cdot b - a \cdot a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, \color{blue}{180}\right)\right)\right)\right) \]
      5. difference-of-squaresN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \color{blue}{\mathsf{/.f64}\left(angle, 180\right)}\right)\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right) \cdot \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{PI.f64}\left(\right)}, \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      9. *-commutativeN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(\frac{angle}{180}\right)\right)\right)\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      14. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \left(\frac{1}{180}\right)\right)\right)\right)\right), \left(b + a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      16. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \frac{1}{180}\right)\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \left(b - a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      18. --lowering--.f6467.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, \frac{1}{180}\right)\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \color{blue}{\mathsf{/.f64}\left(angle, 180\right)}\right)\right)\right) \]
    4. Applied egg-rr67.3%

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180} \cdot angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\frac{\mathsf{PI}\left(\right)}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      6. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      7. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
      9. PI-lowering-PI.f6466.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sin.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \frac{1}{180}\right), angle\right)\right)\right), \mathsf{+.f64}\left(b, a\right)\right), \mathsf{\_.f64}\left(b, a\right)\right), \mathsf{cos.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{/.f64}\left(angle, 180\right)\right)\right)\right) \]
    6. Applied egg-rr66.1%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, angle\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), \left(a + b\right)\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      7. PI-lowering-PI.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, angle\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{+.f64}\left(a, b\right)\right), \left(b - a\right)\right)\right) \]
      9. --lowering--.f6454.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, angle\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{+.f64}\left(a, b\right)\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    9. Simplified54.2%

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

    if 5.60000000000000029e62 < a

    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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6463.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified63.9%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI}\left(\right)\right)\right) \]
      7. PI-lowering-PI.f6462.1%

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    8. Simplified62.1%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{angle}\right)\right)\right)\right) \]
      7. PI-lowering-PI.f6470.8%

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right)\right)\right)\right) \]
    10. Applied egg-rr70.8%

      \[\leadsto -0.011111111111111112 \cdot \color{blue}{\left(a \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, a\right)\right), \left(a \cdot \color{blue}{\frac{-1}{90}}\right)\right) \]
      10. *-lowering-*.f6470.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, a\right)\right), \mathsf{*.f64}\left(a, \color{blue}{\frac{-1}{90}}\right)\right) \]
    12. Applied egg-rr70.8%

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

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

Alternative 15: 52.2% accurate, 16.8× speedup?

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

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


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

    1. Initial program 54.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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6454.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified54.0%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{\left({b}^{2}\right)}\right)\right)\right) \]
      5. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left({\color{blue}{b}}^{2}\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(b \cdot \color{blue}{b}\right)\right)\right)\right) \]
      7. *-lowering-*.f6438.5%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right)\right) \]
    8. Simplified38.5%

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

    if 1.16e20 < a

    1. Initial program 52.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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6464.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified64.1%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI}\left(\right)\right)\right) \]
      7. PI-lowering-PI.f6459.0%

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    8. Simplified59.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{angle}\right)\right)\right)\right) \]
      7. PI-lowering-PI.f6467.2%

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right)\right)\right)\right) \]
    10. Applied egg-rr67.2%

      \[\leadsto -0.011111111111111112 \cdot \color{blue}{\left(a \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, a\right)\right), \left(a \cdot \color{blue}{\frac{-1}{90}}\right)\right) \]
      10. *-lowering-*.f6467.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(angle, a\right)\right), \mathsf{*.f64}\left(a, \color{blue}{\frac{-1}{90}}\right)\right) \]
    12. Applied egg-rr67.2%

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

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

Alternative 16: 52.2% accurate, 16.8× speedup?

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

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


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

    1. Initial program 54.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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6454.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified54.0%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{\left({b}^{2}\right)}\right)\right)\right) \]
      5. PI-lowering-PI.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left({\color{blue}{b}}^{2}\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(b \cdot \color{blue}{b}\right)\right)\right)\right) \]
      7. *-lowering-*.f6438.5%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right)\right) \]
    8. Simplified38.5%

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

    if 9.5e19 < a

    1. Initial program 52.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. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
      7. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
      12. --lowering--.f6464.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
    5. Simplified64.1%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI}\left(\right)\right)\right) \]
      7. PI-lowering-PI.f6459.0%

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    8. Simplified59.0%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(angle \cdot a\right), a\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
      5. *-lowering-*.f6467.2%

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(angle, a\right), a\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
    10. Applied egg-rr67.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 9.5 \cdot 10^{+19}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot \left(a \cdot angle\right)\right)\right)\\ \end{array} \]
  5. 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(-0.011111111111111112 \cdot \left(a\_m \cdot \left(a\_m \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right) \end{array} \]
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
 :precision binary64
 (* angle_s (* -0.011111111111111112 (* a_m (* a_m (* PI angle_m))))))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
	return angle_s * (-0.011111111111111112 * (a_m * (a_m * (((double) M_PI) * angle_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 * (a_m * (Math.PI * angle_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 * (a_m * (math.pi * angle_m))))
a_m = abs(a)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b, angle_m)
	return Float64(angle_s * Float64(-0.011111111111111112 * Float64(a_m * Float64(a_m * Float64(pi * angle_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 * (a_m * (pi * angle_m))));
end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * N[(-0.011111111111111112 * N[(a$95$m * N[(a$95$m * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \left(-0.011111111111111112 \cdot \left(a\_m \cdot \left(a\_m \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 54.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. associate-*r*N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left({b}^{2} - {a}^{2}\right)\right) \]
    7. unpow2N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \left(b \cdot b - a \cdot \color{blue}{a}\right)\right) \]
    9. difference-of-squaresN/A

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \left(\color{blue}{b} - a\right)\right)\right) \]
    12. --lowering--.f6456.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{90}, \mathsf{*.f64}\left(angle, \mathsf{PI.f64}\left(\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(b, a\right), \mathsf{\_.f64}\left(b, \color{blue}{a}\right)\right)\right) \]
  5. Simplified56.2%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI}\left(\right)\right)\right) \]
    7. PI-lowering-PI.f6440.8%

      \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), angle\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
  8. Simplified40.8%

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \color{blue}{angle}\right)\right)\right)\right) \]
    7. PI-lowering-PI.f6444.1%

      \[\leadsto \mathsf{*.f64}\left(\frac{-1}{90}, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), angle\right)\right)\right)\right) \]
  10. Applied egg-rr44.1%

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

Reproduce

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