ab-angle->ABCF B

Percentage Accurate: 54.0% → 66.9%
Time: 15.8s
Alternatives: 12
Speedup: 16.8×

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 12 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.0% accurate, 1.0× speedup?

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

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

Alternative 1: 66.9% accurate, 0.9× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} \mathbf{if}\;{a\_m}^{2} \leq 2 \cdot 10^{+92}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \left(\sqrt{\sqrt{\pi} \cdot \pi} \cdot \sqrt{\sqrt{\pi}}\right)\right) \cdot \left(\left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(\left(\sin \left(\left(\sqrt{\pi} \cdot angle\right) \cdot {\left(\frac{180}{\sqrt{\pi}}\right)}^{-1}\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\right)\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
 :precision binary64
 (if (<= (pow a_m 2.0) 2e+92)
   (*
    (cos (* (/ angle 180.0) (* (sqrt (* (sqrt PI) PI)) (sqrt (sqrt PI)))))
    (*
     (* (* (sin (* PI (* angle 0.005555555555555556))) 2.0) (- b a_m))
     (+ b a_m)))
   (*
    (cos (* (/ angle 180.0) PI))
    (*
     (*
      (* (sin (* (* (sqrt PI) angle) (pow (/ 180.0 (sqrt PI)) -1.0))) 2.0)
      (- b a_m))
     (+ b a_m)))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
	double tmp;
	if (pow(a_m, 2.0) <= 2e+92) {
		tmp = cos(((angle / 180.0) * (sqrt((sqrt(((double) M_PI)) * ((double) M_PI))) * sqrt(sqrt(((double) M_PI)))))) * (((sin((((double) M_PI) * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m));
	} else {
		tmp = cos(((angle / 180.0) * ((double) M_PI))) * (((sin(((sqrt(((double) M_PI)) * angle) * pow((180.0 / sqrt(((double) M_PI))), -1.0))) * 2.0) * (b - a_m)) * (b + a_m));
	}
	return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
	double tmp;
	if (Math.pow(a_m, 2.0) <= 2e+92) {
		tmp = Math.cos(((angle / 180.0) * (Math.sqrt((Math.sqrt(Math.PI) * Math.PI)) * Math.sqrt(Math.sqrt(Math.PI))))) * (((Math.sin((Math.PI * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m));
	} else {
		tmp = Math.cos(((angle / 180.0) * Math.PI)) * (((Math.sin(((Math.sqrt(Math.PI) * angle) * Math.pow((180.0 / Math.sqrt(Math.PI)), -1.0))) * 2.0) * (b - a_m)) * (b + a_m));
	}
	return tmp;
}
a_m = math.fabs(a)
def code(a_m, b, angle):
	tmp = 0
	if math.pow(a_m, 2.0) <= 2e+92:
		tmp = math.cos(((angle / 180.0) * (math.sqrt((math.sqrt(math.pi) * math.pi)) * math.sqrt(math.sqrt(math.pi))))) * (((math.sin((math.pi * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m))
	else:
		tmp = math.cos(((angle / 180.0) * math.pi)) * (((math.sin(((math.sqrt(math.pi) * angle) * math.pow((180.0 / math.sqrt(math.pi)), -1.0))) * 2.0) * (b - a_m)) * (b + a_m))
	return tmp
a_m = abs(a)
function code(a_m, b, angle)
	tmp = 0.0
	if ((a_m ^ 2.0) <= 2e+92)
		tmp = Float64(cos(Float64(Float64(angle / 180.0) * Float64(sqrt(Float64(sqrt(pi) * pi)) * sqrt(sqrt(pi))))) * Float64(Float64(Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * 2.0) * Float64(b - a_m)) * Float64(b + a_m)));
	else
		tmp = Float64(cos(Float64(Float64(angle / 180.0) * pi)) * Float64(Float64(Float64(sin(Float64(Float64(sqrt(pi) * angle) * (Float64(180.0 / sqrt(pi)) ^ -1.0))) * 2.0) * Float64(b - a_m)) * Float64(b + a_m)));
	end
	return tmp
end
a_m = abs(a);
function tmp_2 = code(a_m, b, angle)
	tmp = 0.0;
	if ((a_m ^ 2.0) <= 2e+92)
		tmp = cos(((angle / 180.0) * (sqrt((sqrt(pi) * pi)) * sqrt(sqrt(pi))))) * (((sin((pi * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m));
	else
		tmp = cos(((angle / 180.0) * pi)) * (((sin(((sqrt(pi) * angle) * ((180.0 / sqrt(pi)) ^ -1.0))) * 2.0) * (b - a_m)) * (b + a_m));
	end
	tmp_2 = tmp;
end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := If[LessEqual[N[Power[a$95$m, 2.0], $MachinePrecision], 2e+92], N[(N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * N[(N[Sqrt[N[(N[Sqrt[Pi], $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Sqrt[Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[Sin[N[(N[(N[Sqrt[Pi], $MachinePrecision] * angle), $MachinePrecision] * N[Power[N[(180.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|

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

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


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

    1. Initial program 57.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
      18. lower-*.f6463.2

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

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

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\sqrt{\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right) \]
      4. add-sqr-sqrtN/A

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\sqrt{\sqrt{\mathsf{PI}\left(\right)} \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right) \]
      7. add-sqr-sqrtN/A

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\sqrt{\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}} \cdot \frac{angle}{180}\right) \]
      10. add-sqr-sqrtN/A

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\left(\sqrt{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \frac{angle}{180}\right) \]
      19. add-sqr-sqrtN/A

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

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

    if 2.0000000000000001e92 < (pow.f64 a #s(literal 2 binary64))

    1. Initial program 52.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
      18. lower-*.f6472.4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left({\left(\frac{180 \cdot \frac{1}{angle}}{\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}}\right)}^{-1}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
      9. times-fracN/A

        \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left({\color{blue}{\left(\frac{180}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \frac{\frac{1}{angle}}{\sqrt{\mathsf{PI}\left(\right)}}\right)}}^{-1}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
      10. unpow-prod-downN/A

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

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

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

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

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

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left({\left(\frac{180}{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{-1} \cdot {\left(\frac{1}{\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\frac{angle}{1}}}\right)}^{-1}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
      18. /-rgt-identityN/A

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

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

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

      \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \color{blue}{\left({\left(\frac{180}{\sqrt{\pi}}\right)}^{-1} \cdot {\left(\frac{1}{\sqrt{\pi} \cdot angle}\right)}^{-1}\right)} \cdot 2\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    9. Step-by-step derivation
      1. lift-pow.f64N/A

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

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

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

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

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

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

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

Alternative 2: 67.1% accurate, 1.5× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ \cos \left(\frac{angle}{180} \cdot \left(\sqrt{\sqrt{\pi} \cdot \pi} \cdot \sqrt{\sqrt{\pi}}\right)\right) \cdot \left(\left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\right) \end{array} \]
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
 :precision binary64
 (*
  (cos (* (/ angle 180.0) (* (sqrt (* (sqrt PI) PI)) (sqrt (sqrt PI)))))
  (*
   (* (* (sin (* PI (* angle 0.005555555555555556))) 2.0) (- b a_m))
   (+ b a_m))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
	return cos(((angle / 180.0) * (sqrt((sqrt(((double) M_PI)) * ((double) M_PI))) * sqrt(sqrt(((double) M_PI)))))) * (((sin((((double) M_PI) * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m));
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
	return Math.cos(((angle / 180.0) * (Math.sqrt((Math.sqrt(Math.PI) * Math.PI)) * Math.sqrt(Math.sqrt(Math.PI))))) * (((Math.sin((Math.PI * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m));
}
a_m = math.fabs(a)
def code(a_m, b, angle):
	return math.cos(((angle / 180.0) * (math.sqrt((math.sqrt(math.pi) * math.pi)) * math.sqrt(math.sqrt(math.pi))))) * (((math.sin((math.pi * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m))
a_m = abs(a)
function code(a_m, b, angle)
	return Float64(cos(Float64(Float64(angle / 180.0) * Float64(sqrt(Float64(sqrt(pi) * pi)) * sqrt(sqrt(pi))))) * Float64(Float64(Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * 2.0) * Float64(b - a_m)) * Float64(b + a_m)))
end
a_m = abs(a);
function tmp = code(a_m, b, angle)
	tmp = cos(((angle / 180.0) * (sqrt((sqrt(pi) * pi)) * sqrt(sqrt(pi))))) * (((sin((pi * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m));
end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := N[(N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * N[(N[Sqrt[N[(N[Sqrt[Pi], $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Sqrt[Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(a + b\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    18. lower-*.f6467.4

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

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

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

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

      \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\sqrt{\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right) \]
    4. add-sqr-sqrtN/A

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

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

      \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\sqrt{\sqrt{\mathsf{PI}\left(\right)} \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right) \]
    7. add-sqr-sqrtN/A

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

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

      \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\sqrt{\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}} \cdot \frac{angle}{180}\right) \]
    10. add-sqr-sqrtN/A

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\left(\sqrt{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \frac{angle}{180}\right) \]
    19. add-sqr-sqrtN/A

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

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

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

Alternative 3: 67.1% accurate, 1.5× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} t_0 := \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\ \mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+122}:\\ \;\;\;\;\cos \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\left(\sqrt{\pi} \cdot \sqrt{\pi}\right) \cdot \frac{angle}{180}\right) \cdot t\_0\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
 :precision binary64
 (let* ((t_0
         (*
          (* (* (sin (* PI (* angle 0.005555555555555556))) 2.0) (- b a_m))
          (+ b a_m))))
   (if (<= (/ angle 180.0) 5e+122)
     (* (cos (* (* PI angle) 0.005555555555555556)) t_0)
     (* (cos (* (* (sqrt PI) (sqrt PI)) (/ angle 180.0))) t_0))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
	double t_0 = ((sin((((double) M_PI) * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m);
	double tmp;
	if ((angle / 180.0) <= 5e+122) {
		tmp = cos(((((double) M_PI) * angle) * 0.005555555555555556)) * t_0;
	} else {
		tmp = cos(((sqrt(((double) M_PI)) * sqrt(((double) M_PI))) * (angle / 180.0))) * t_0;
	}
	return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
	double t_0 = ((Math.sin((Math.PI * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m);
	double tmp;
	if ((angle / 180.0) <= 5e+122) {
		tmp = Math.cos(((Math.PI * angle) * 0.005555555555555556)) * t_0;
	} else {
		tmp = Math.cos(((Math.sqrt(Math.PI) * Math.sqrt(Math.PI)) * (angle / 180.0))) * t_0;
	}
	return tmp;
}
a_m = math.fabs(a)
def code(a_m, b, angle):
	t_0 = ((math.sin((math.pi * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m)
	tmp = 0
	if (angle / 180.0) <= 5e+122:
		tmp = math.cos(((math.pi * angle) * 0.005555555555555556)) * t_0
	else:
		tmp = math.cos(((math.sqrt(math.pi) * math.sqrt(math.pi)) * (angle / 180.0))) * t_0
	return tmp
a_m = abs(a)
function code(a_m, b, angle)
	t_0 = Float64(Float64(Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * 2.0) * Float64(b - a_m)) * Float64(b + a_m))
	tmp = 0.0
	if (Float64(angle / 180.0) <= 5e+122)
		tmp = Float64(cos(Float64(Float64(pi * angle) * 0.005555555555555556)) * t_0);
	else
		tmp = Float64(cos(Float64(Float64(sqrt(pi) * sqrt(pi)) * Float64(angle / 180.0))) * t_0);
	end
	return tmp
end
a_m = abs(a);
function tmp_2 = code(a_m, b, angle)
	t_0 = ((sin((pi * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m);
	tmp = 0.0;
	if ((angle / 180.0) <= 5e+122)
		tmp = cos(((pi * angle) * 0.005555555555555556)) * t_0;
	else
		tmp = cos(((sqrt(pi) * sqrt(pi)) * (angle / 180.0))) * t_0;
	end
	tmp_2 = tmp;
end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[(N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+122], N[(N[Cos[N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Cos[N[(N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|

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

\mathbf{else}:\\
\;\;\;\;\cos \left(\left(\sqrt{\pi} \cdot \sqrt{\pi}\right) \cdot \frac{angle}{180}\right) \cdot t\_0\\


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

    1. Initial program 59.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
      18. lower-*.f6473.6

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

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

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

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

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

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)} \cdot \frac{1}{180}\right) \]
      6. lower-PI.f6474.6

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

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

    if 4.99999999999999989e122 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 21.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right) \]
      2. add-sqr-sqrtN/A

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

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

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right) \cdot \frac{angle}{180}\right) \]
      7. lower-sqrt.f6440.9

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

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

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

Alternative 4: 57.3% accurate, 2.0× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} \mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -2 \cdot 10^{-198}:\\ \;\;\;\;\left(\left(\left(\pi \cdot angle\right) \cdot a\_m\right) \cdot -0.011111111111111112\right) \cdot a\_m\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(b \cdot b\right) \cdot \pi\right) \cdot angle\right) \cdot 0.011111111111111112\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
 :precision binary64
 (if (<= (- (pow b 2.0) (pow a_m 2.0)) -2e-198)
   (* (* (* (* PI angle) a_m) -0.011111111111111112) a_m)
   (* (* (* (* b b) PI) angle) 0.011111111111111112)))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
	double tmp;
	if ((pow(b, 2.0) - pow(a_m, 2.0)) <= -2e-198) {
		tmp = (((((double) M_PI) * angle) * a_m) * -0.011111111111111112) * a_m;
	} else {
		tmp = (((b * b) * ((double) M_PI)) * angle) * 0.011111111111111112;
	}
	return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
	double tmp;
	if ((Math.pow(b, 2.0) - Math.pow(a_m, 2.0)) <= -2e-198) {
		tmp = (((Math.PI * angle) * a_m) * -0.011111111111111112) * a_m;
	} else {
		tmp = (((b * b) * Math.PI) * angle) * 0.011111111111111112;
	}
	return tmp;
}
a_m = math.fabs(a)
def code(a_m, b, angle):
	tmp = 0
	if (math.pow(b, 2.0) - math.pow(a_m, 2.0)) <= -2e-198:
		tmp = (((math.pi * angle) * a_m) * -0.011111111111111112) * a_m
	else:
		tmp = (((b * b) * math.pi) * angle) * 0.011111111111111112
	return tmp
a_m = abs(a)
function code(a_m, b, angle)
	tmp = 0.0
	if (Float64((b ^ 2.0) - (a_m ^ 2.0)) <= -2e-198)
		tmp = Float64(Float64(Float64(Float64(pi * angle) * a_m) * -0.011111111111111112) * a_m);
	else
		tmp = Float64(Float64(Float64(Float64(b * b) * pi) * angle) * 0.011111111111111112);
	end
	return tmp
end
a_m = abs(a);
function tmp_2 = code(a_m, b, angle)
	tmp = 0.0;
	if (((b ^ 2.0) - (a_m ^ 2.0)) <= -2e-198)
		tmp = (((pi * angle) * a_m) * -0.011111111111111112) * a_m;
	else
		tmp = (((b * b) * pi) * angle) * 0.011111111111111112;
	end
	tmp_2 = tmp;
end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision], -2e-198], N[(N[(N[(N[(Pi * angle), $MachinePrecision] * a$95$m), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] * a$95$m), $MachinePrecision], N[(N[(N[(N[(b * b), $MachinePrecision] * Pi), $MachinePrecision] * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|

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

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


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

    1. Initial program 57.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
      15. lower--.f6452.0

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

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

      \[\leadsto \frac{-1}{90} \cdot \color{blue}{\left({a}^{2} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
    7. Step-by-step derivation
      1. Applied rewrites51.8%

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

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

            \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot a\right) \cdot -0.011111111111111112\right) \cdot a \]

          if -1.9999999999999998e-198 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

          1. Initial program 52.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\left(\left(b \cdot b\right) \cdot 2\right) \cdot \cos \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{1}{180}\right) \cdot angle\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \]
          5. Applied rewrites55.9%

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

            \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left({b}^{2} \cdot \mathsf{PI}\left(\right)\right)\right)} \]
          7. Step-by-step derivation
            1. Applied rewrites50.0%

              \[\leadsto \left(\left(\left(b \cdot b\right) \cdot \pi\right) \cdot angle\right) \cdot \color{blue}{0.011111111111111112} \]
          8. Recombined 2 regimes into one program.
          9. Final simplification55.9%

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

          Alternative 5: 67.3% accurate, 2.8× speedup?

          \[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 2.5 \cdot 10^{+173}:\\ \;\;\;\;\left(\sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -1.54320987654321 \cdot 10^{-5}, \pi \cdot \pi, 1\right) \cdot \left(\left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\right)\\ \end{array} \end{array} \]
          a_m = (fabs.f64 a)
          (FPCore (a_m b angle)
           :precision binary64
           (if (<= b 2.5e+173)
             (* (* (sin (* (* 0.011111111111111112 PI) angle)) (- b a_m)) (+ b a_m))
             (*
              (fma (* (* angle angle) -1.54320987654321e-5) (* PI PI) 1.0)
              (*
               (* (* (sin (* PI (* angle 0.005555555555555556))) 2.0) (- b a_m))
               (+ b a_m)))))
          a_m = fabs(a);
          double code(double a_m, double b, double angle) {
          	double tmp;
          	if (b <= 2.5e+173) {
          		tmp = (sin(((0.011111111111111112 * ((double) M_PI)) * angle)) * (b - a_m)) * (b + a_m);
          	} else {
          		tmp = fma(((angle * angle) * -1.54320987654321e-5), (((double) M_PI) * ((double) M_PI)), 1.0) * (((sin((((double) M_PI) * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m));
          	}
          	return tmp;
          }
          
          a_m = abs(a)
          function code(a_m, b, angle)
          	tmp = 0.0
          	if (b <= 2.5e+173)
          		tmp = Float64(Float64(sin(Float64(Float64(0.011111111111111112 * pi) * angle)) * Float64(b - a_m)) * Float64(b + a_m));
          	else
          		tmp = Float64(fma(Float64(Float64(angle * angle) * -1.54320987654321e-5), Float64(pi * pi), 1.0) * Float64(Float64(Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * 2.0) * Float64(b - a_m)) * Float64(b + a_m)));
          	end
          	return tmp
          end
          
          a_m = N[Abs[a], $MachinePrecision]
          code[a$95$m_, b_, angle_] := If[LessEqual[b, 2.5e+173], N[(N[(N[Sin[N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision]], $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(angle * angle), $MachinePrecision] * -1.54320987654321e-5), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          a_m = \left|a\right|
          
          \\
          \begin{array}{l}
          \mathbf{if}\;b \leq 2.5 \cdot 10^{+173}:\\
          \;\;\;\;\left(\sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -1.54320987654321 \cdot 10^{-5}, \pi \cdot \pi, 1\right) \cdot \left(\left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if b < 2.50000000000000017e173

            1. Initial program 56.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. lift-*.f64N/A

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

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

                \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \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)} \]
              4. lift-*.f64N/A

                \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)} \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) \]
              5. *-commutativeN/A

                \[\leadsto \color{blue}{\left(\left({b}^{2} - {a}^{2}\right) \cdot 2\right)} \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) \]
              6. associate-*l*N/A

                \[\leadsto \color{blue}{\left({b}^{2} - {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)} \]
              7. lift--.f64N/A

                \[\leadsto \color{blue}{\left({b}^{2} - {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) \]
              8. flip--N/A

                \[\leadsto \color{blue}{\frac{{b}^{2} \cdot {b}^{2} - {a}^{2} \cdot {a}^{2}}{{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) \]
              9. clear-numN/A

                \[\leadsto \color{blue}{\frac{1}{\frac{{b}^{2} + {a}^{2}}{{b}^{2} \cdot {b}^{2} - {a}^{2} \cdot {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) \]
              10. associate-*l/N/A

                \[\leadsto \color{blue}{\frac{1 \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)}{\frac{{b}^{2} + {a}^{2}}{{b}^{2} \cdot {b}^{2} - {a}^{2} \cdot {a}^{2}}}} \]
            4. Applied rewrites56.6%

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

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{1 \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{90}\right)}{\frac{1}{b - a}} \cdot \left(a + b\right)} \]
            6. Applied rewrites67.9%

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

            if 2.50000000000000017e173 < b

            1. Initial program 32.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(\left(a + b\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
              18. lower-*.f6475.0

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

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

              \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \color{blue}{\left(1 + \frac{-1}{64800} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
            6. Step-by-step derivation
              1. +-commutativeN/A

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

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

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

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

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

                \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \mathsf{fma}\left(\frac{-1}{64800} \cdot \color{blue}{\left(angle \cdot angle\right)}, {\mathsf{PI}\left(\right)}^{2}, 1\right) \]
              7. unpow2N/A

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

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

                \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \mathsf{fma}\left(\frac{-1}{64800} \cdot \left(angle \cdot angle\right), \color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right), 1\right) \]
              10. lower-PI.f6480.0

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

              \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \color{blue}{\mathsf{fma}\left(-1.54320987654321 \cdot 10^{-5} \cdot \left(angle \cdot angle\right), \pi \cdot \pi, 1\right)} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification68.8%

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

          Alternative 6: 67.1% accurate, 3.4× speedup?

          \[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 3.8 \cdot 10^{+265}:\\ \;\;\;\;\left(\sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \left(\pi \cdot \pi\right) \cdot \pi, 0.011111111111111112 \cdot \pi\right) \cdot angle}{\frac{1}{\left(b - a\_m\right) \cdot \left(b + a\_m\right)}}\\ \end{array} \end{array} \]
          a_m = (fabs.f64 a)
          (FPCore (a_m b angle)
           :precision binary64
           (if (<= b 3.8e+265)
             (* (* (sin (* (* 0.011111111111111112 PI) angle)) (- b a_m)) (+ b a_m))
             (/
              (*
               (fma
                (* -2.2862368541380886e-7 (* angle angle))
                (* (* PI PI) PI)
                (* 0.011111111111111112 PI))
               angle)
              (/ 1.0 (* (- b a_m) (+ b a_m))))))
          a_m = fabs(a);
          double code(double a_m, double b, double angle) {
          	double tmp;
          	if (b <= 3.8e+265) {
          		tmp = (sin(((0.011111111111111112 * ((double) M_PI)) * angle)) * (b - a_m)) * (b + a_m);
          	} else {
          		tmp = (fma((-2.2862368541380886e-7 * (angle * angle)), ((((double) M_PI) * ((double) M_PI)) * ((double) M_PI)), (0.011111111111111112 * ((double) M_PI))) * angle) / (1.0 / ((b - a_m) * (b + a_m)));
          	}
          	return tmp;
          }
          
          a_m = abs(a)
          function code(a_m, b, angle)
          	tmp = 0.0
          	if (b <= 3.8e+265)
          		tmp = Float64(Float64(sin(Float64(Float64(0.011111111111111112 * pi) * angle)) * Float64(b - a_m)) * Float64(b + a_m));
          	else
          		tmp = Float64(Float64(fma(Float64(-2.2862368541380886e-7 * Float64(angle * angle)), Float64(Float64(pi * pi) * pi), Float64(0.011111111111111112 * pi)) * angle) / Float64(1.0 / Float64(Float64(b - a_m) * Float64(b + a_m))));
          	end
          	return tmp
          end
          
          a_m = N[Abs[a], $MachinePrecision]
          code[a$95$m_, b_, angle_] := If[LessEqual[b, 3.8e+265], N[(N[(N[Sin[N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision]], $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-2.2862368541380886e-7 * N[(angle * angle), $MachinePrecision]), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision] + N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision] / N[(1.0 / N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          a_m = \left|a\right|
          
          \\
          \begin{array}{l}
          \mathbf{if}\;b \leq 3.8 \cdot 10^{+265}:\\
          \;\;\;\;\left(\sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \left(\pi \cdot \pi\right) \cdot \pi, 0.011111111111111112 \cdot \pi\right) \cdot angle}{\frac{1}{\left(b - a\_m\right) \cdot \left(b + a\_m\right)}}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if b < 3.80000000000000015e265

            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. lift-*.f64N/A

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

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

                \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \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)} \]
              4. lift-*.f64N/A

                \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)} \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) \]
              5. *-commutativeN/A

                \[\leadsto \color{blue}{\left(\left({b}^{2} - {a}^{2}\right) \cdot 2\right)} \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) \]
              6. associate-*l*N/A

                \[\leadsto \color{blue}{\left({b}^{2} - {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)} \]
              7. lift--.f64N/A

                \[\leadsto \color{blue}{\left({b}^{2} - {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) \]
              8. flip--N/A

                \[\leadsto \color{blue}{\frac{{b}^{2} \cdot {b}^{2} - {a}^{2} \cdot {a}^{2}}{{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) \]
              9. clear-numN/A

                \[\leadsto \color{blue}{\frac{1}{\frac{{b}^{2} + {a}^{2}}{{b}^{2} \cdot {b}^{2} - {a}^{2} \cdot {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) \]
              10. associate-*l/N/A

                \[\leadsto \color{blue}{\frac{1 \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)}{\frac{{b}^{2} + {a}^{2}}{{b}^{2} \cdot {b}^{2} - {a}^{2} \cdot {a}^{2}}}} \]
            4. Applied rewrites56.1%

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

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{1 \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{90}\right)}{\frac{1}{b - a}} \cdot \left(a + b\right)} \]
            6. Applied rewrites68.5%

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

            if 3.80000000000000015e265 < b

            1. Initial program 33.3%

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

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

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

                \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \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)} \]
              4. lift-*.f64N/A

                \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)} \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) \]
              5. *-commutativeN/A

                \[\leadsto \color{blue}{\left(\left({b}^{2} - {a}^{2}\right) \cdot 2\right)} \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) \]
              6. associate-*l*N/A

                \[\leadsto \color{blue}{\left({b}^{2} - {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)} \]
              7. lift--.f64N/A

                \[\leadsto \color{blue}{\left({b}^{2} - {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) \]
              8. flip--N/A

                \[\leadsto \color{blue}{\frac{{b}^{2} \cdot {b}^{2} - {a}^{2} \cdot {a}^{2}}{{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) \]
              9. clear-numN/A

                \[\leadsto \color{blue}{\frac{1}{\frac{{b}^{2} + {a}^{2}}{{b}^{2} \cdot {b}^{2} - {a}^{2} \cdot {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) \]
              10. associate-*l/N/A

                \[\leadsto \color{blue}{\frac{1 \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)}{\frac{{b}^{2} + {a}^{2}}{{b}^{2} \cdot {b}^{2} - {a}^{2} \cdot {a}^{2}}}} \]
            4. Applied rewrites33.3%

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

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

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

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

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

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

                \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{-1}{4374000} \cdot {angle}^{2}}, {\mathsf{PI}\left(\right)}^{3}, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot angle}{\frac{1}{\left(b - a\right) \cdot \left(a + b\right)}} \]
              6. unpow2N/A

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

                \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{4374000} \cdot \color{blue}{\left(angle \cdot angle\right)}, {\mathsf{PI}\left(\right)}^{3}, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot angle}{\frac{1}{\left(b - a\right) \cdot \left(a + b\right)}} \]
              8. unpow3N/A

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{4374000} \cdot \left(angle \cdot angle\right), \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), \color{blue}{\frac{1}{90} \cdot \mathsf{PI}\left(\right)}\right) \cdot angle}{\frac{1}{\left(b - a\right) \cdot \left(a + b\right)}} \]
              17. lower-PI.f6466.7

                \[\leadsto \frac{\mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \left(\pi \cdot \pi\right) \cdot \pi, 0.011111111111111112 \cdot \color{blue}{\pi}\right) \cdot angle}{\frac{1}{\left(b - a\right) \cdot \left(a + b\right)}} \]
            7. Applied rewrites66.7%

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

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

          Alternative 7: 61.8% accurate, 5.2× speedup?

          \[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{+14}:\\ \;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \left(\pi \cdot \pi\right) \cdot \pi, 0.011111111111111112 \cdot \pi\right) \cdot angle}{\frac{1}{\left(b - a\_m\right) \cdot \left(b + a\_m\right)}}\\ \end{array} \end{array} \]
          a_m = (fabs.f64 a)
          (FPCore (a_m b angle)
           :precision binary64
           (if (<= (/ angle 180.0) 1e+14)
             (* (* (* (* 0.011111111111111112 PI) angle) (- b a_m)) (+ b a_m))
             (/
              (*
               (fma
                (* -2.2862368541380886e-7 (* angle angle))
                (* (* PI PI) PI)
                (* 0.011111111111111112 PI))
               angle)
              (/ 1.0 (* (- b a_m) (+ b a_m))))))
          a_m = fabs(a);
          double code(double a_m, double b, double angle) {
          	double tmp;
          	if ((angle / 180.0) <= 1e+14) {
          		tmp = (((0.011111111111111112 * ((double) M_PI)) * angle) * (b - a_m)) * (b + a_m);
          	} else {
          		tmp = (fma((-2.2862368541380886e-7 * (angle * angle)), ((((double) M_PI) * ((double) M_PI)) * ((double) M_PI)), (0.011111111111111112 * ((double) M_PI))) * angle) / (1.0 / ((b - a_m) * (b + a_m)));
          	}
          	return tmp;
          }
          
          a_m = abs(a)
          function code(a_m, b, angle)
          	tmp = 0.0
          	if (Float64(angle / 180.0) <= 1e+14)
          		tmp = Float64(Float64(Float64(Float64(0.011111111111111112 * pi) * angle) * Float64(b - a_m)) * Float64(b + a_m));
          	else
          		tmp = Float64(Float64(fma(Float64(-2.2862368541380886e-7 * Float64(angle * angle)), Float64(Float64(pi * pi) * pi), Float64(0.011111111111111112 * pi)) * angle) / Float64(1.0 / Float64(Float64(b - a_m) * Float64(b + a_m))));
          	end
          	return tmp
          end
          
          a_m = N[Abs[a], $MachinePrecision]
          code[a$95$m_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+14], N[(N[(N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-2.2862368541380886e-7 * N[(angle * angle), $MachinePrecision]), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision] + N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision] / N[(1.0 / N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          a_m = \left|a\right|
          
          \\
          \begin{array}{l}
          \mathbf{if}\;\frac{angle}{180} \leq 10^{+14}:\\
          \;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \left(\pi \cdot \pi\right) \cdot \pi, 0.011111111111111112 \cdot \pi\right) \cdot angle}{\frac{1}{\left(b - a\_m\right) \cdot \left(b + a\_m\right)}}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (/.f64 angle #s(literal 180 binary64)) < 1e14

            1. Initial program 64.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
              15. lower--.f6462.2

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

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

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

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

              1. Initial program 26.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. lift-*.f64N/A

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

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

                  \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \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)} \]
                4. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)} \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) \]
                5. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\left({b}^{2} - {a}^{2}\right) \cdot 2\right)} \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) \]
                6. associate-*l*N/A

                  \[\leadsto \color{blue}{\left({b}^{2} - {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)} \]
                7. lift--.f64N/A

                  \[\leadsto \color{blue}{\left({b}^{2} - {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) \]
                8. flip--N/A

                  \[\leadsto \color{blue}{\frac{{b}^{2} \cdot {b}^{2} - {a}^{2} \cdot {a}^{2}}{{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) \]
                9. clear-numN/A

                  \[\leadsto \color{blue}{\frac{1}{\frac{{b}^{2} + {a}^{2}}{{b}^{2} \cdot {b}^{2} - {a}^{2} \cdot {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) \]
                10. associate-*l/N/A

                  \[\leadsto \color{blue}{\frac{1 \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)}{\frac{{b}^{2} + {a}^{2}}{{b}^{2} \cdot {b}^{2} - {a}^{2} \cdot {a}^{2}}}} \]
              4. Applied rewrites26.0%

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

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

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

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

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

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

                  \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{-1}{4374000} \cdot {angle}^{2}}, {\mathsf{PI}\left(\right)}^{3}, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot angle}{\frac{1}{\left(b - a\right) \cdot \left(a + b\right)}} \]
                6. unpow2N/A

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

                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{4374000} \cdot \color{blue}{\left(angle \cdot angle\right)}, {\mathsf{PI}\left(\right)}^{3}, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot angle}{\frac{1}{\left(b - a\right) \cdot \left(a + b\right)}} \]
                8. unpow3N/A

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{4374000} \cdot \left(angle \cdot angle\right), \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), \color{blue}{\frac{1}{90} \cdot \mathsf{PI}\left(\right)}\right) \cdot angle}{\frac{1}{\left(b - a\right) \cdot \left(a + b\right)}} \]
                17. lower-PI.f6433.4

                  \[\leadsto \frac{\mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \left(\pi \cdot \pi\right) \cdot \pi, 0.011111111111111112 \cdot \color{blue}{\pi}\right) \cdot angle}{\frac{1}{\left(b - a\right) \cdot \left(a + b\right)}} \]
              7. Applied rewrites33.4%

                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \left(\pi \cdot \pi\right) \cdot \pi, 0.011111111111111112 \cdot \pi\right) \cdot angle}}{\frac{1}{\left(b - a\right) \cdot \left(a + b\right)}} \]
            7. Recombined 2 regimes into one program.
            8. Final simplification65.3%

              \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{+14}:\\ \;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \left(\pi \cdot \pi\right) \cdot \pi, 0.011111111111111112 \cdot \pi\right) \cdot angle}{\frac{1}{\left(b - a\right) \cdot \left(b + a\right)}}\\ \end{array} \]
            9. Add Preprocessing

            Alternative 8: 57.9% accurate, 13.7× speedup?

            \[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} \mathbf{if}\;a\_m \leq 1.55 \cdot 10^{+140}:\\ \;\;\;\;\left(\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \left(0.011111111111111112 \cdot \pi\right)\right) \cdot angle\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\pi \cdot angle\right) \cdot a\_m\right) \cdot -0.011111111111111112\right) \cdot a\_m\\ \end{array} \end{array} \]
            a_m = (fabs.f64 a)
            (FPCore (a_m b angle)
             :precision binary64
             (if (<= a_m 1.55e+140)
               (* (* (* (- b a_m) (+ b a_m)) (* 0.011111111111111112 PI)) angle)
               (* (* (* (* PI angle) a_m) -0.011111111111111112) a_m)))
            a_m = fabs(a);
            double code(double a_m, double b, double angle) {
            	double tmp;
            	if (a_m <= 1.55e+140) {
            		tmp = (((b - a_m) * (b + a_m)) * (0.011111111111111112 * ((double) M_PI))) * angle;
            	} else {
            		tmp = (((((double) M_PI) * angle) * a_m) * -0.011111111111111112) * a_m;
            	}
            	return tmp;
            }
            
            a_m = Math.abs(a);
            public static double code(double a_m, double b, double angle) {
            	double tmp;
            	if (a_m <= 1.55e+140) {
            		tmp = (((b - a_m) * (b + a_m)) * (0.011111111111111112 * Math.PI)) * angle;
            	} else {
            		tmp = (((Math.PI * angle) * a_m) * -0.011111111111111112) * a_m;
            	}
            	return tmp;
            }
            
            a_m = math.fabs(a)
            def code(a_m, b, angle):
            	tmp = 0
            	if a_m <= 1.55e+140:
            		tmp = (((b - a_m) * (b + a_m)) * (0.011111111111111112 * math.pi)) * angle
            	else:
            		tmp = (((math.pi * angle) * a_m) * -0.011111111111111112) * a_m
            	return tmp
            
            a_m = abs(a)
            function code(a_m, b, angle)
            	tmp = 0.0
            	if (a_m <= 1.55e+140)
            		tmp = Float64(Float64(Float64(Float64(b - a_m) * Float64(b + a_m)) * Float64(0.011111111111111112 * pi)) * angle);
            	else
            		tmp = Float64(Float64(Float64(Float64(pi * angle) * a_m) * -0.011111111111111112) * a_m);
            	end
            	return tmp
            end
            
            a_m = abs(a);
            function tmp_2 = code(a_m, b, angle)
            	tmp = 0.0;
            	if (a_m <= 1.55e+140)
            		tmp = (((b - a_m) * (b + a_m)) * (0.011111111111111112 * pi)) * angle;
            	else
            		tmp = (((pi * angle) * a_m) * -0.011111111111111112) * a_m;
            	end
            	tmp_2 = tmp;
            end
            
            a_m = N[Abs[a], $MachinePrecision]
            code[a$95$m_, b_, angle_] := If[LessEqual[a$95$m, 1.55e+140], N[(N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision], N[(N[(N[(N[(Pi * angle), $MachinePrecision] * a$95$m), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] * a$95$m), $MachinePrecision]]
            
            \begin{array}{l}
            a_m = \left|a\right|
            
            \\
            \begin{array}{l}
            \mathbf{if}\;a\_m \leq 1.55 \cdot 10^{+140}:\\
            \;\;\;\;\left(\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \left(0.011111111111111112 \cdot \pi\right)\right) \cdot angle\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(\left(\left(\pi \cdot angle\right) \cdot a\_m\right) \cdot -0.011111111111111112\right) \cdot a\_m\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < 1.55e140

              1. Initial program 56.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                15. lower--.f6451.7

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

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

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

                if 1.55e140 < a

                1. Initial program 43.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                  15. lower--.f6448.7

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

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

                  \[\leadsto \frac{-1}{90} \cdot \color{blue}{\left({a}^{2} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
                7. Step-by-step derivation
                  1. Applied rewrites51.3%

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

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

                        \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot a\right) \cdot -0.011111111111111112\right) \cdot a \]
                    3. Recombined 2 regimes into one program.
                    4. Final simplification54.6%

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

                    Alternative 9: 57.8% accurate, 13.7× speedup?

                    \[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} \mathbf{if}\;a\_m \leq 1.55 \cdot 10^{+140}:\\ \;\;\;\;\left(\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot angle\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\pi \cdot angle\right) \cdot a\_m\right) \cdot -0.011111111111111112\right) \cdot a\_m\\ \end{array} \end{array} \]
                    a_m = (fabs.f64 a)
                    (FPCore (a_m b angle)
                     :precision binary64
                     (if (<= a_m 1.55e+140)
                       (* (* (* (- b a_m) (+ b a_m)) PI) (* 0.011111111111111112 angle))
                       (* (* (* (* PI angle) a_m) -0.011111111111111112) a_m)))
                    a_m = fabs(a);
                    double code(double a_m, double b, double angle) {
                    	double tmp;
                    	if (a_m <= 1.55e+140) {
                    		tmp = (((b - a_m) * (b + a_m)) * ((double) M_PI)) * (0.011111111111111112 * angle);
                    	} else {
                    		tmp = (((((double) M_PI) * angle) * a_m) * -0.011111111111111112) * a_m;
                    	}
                    	return tmp;
                    }
                    
                    a_m = Math.abs(a);
                    public static double code(double a_m, double b, double angle) {
                    	double tmp;
                    	if (a_m <= 1.55e+140) {
                    		tmp = (((b - a_m) * (b + a_m)) * Math.PI) * (0.011111111111111112 * angle);
                    	} else {
                    		tmp = (((Math.PI * angle) * a_m) * -0.011111111111111112) * a_m;
                    	}
                    	return tmp;
                    }
                    
                    a_m = math.fabs(a)
                    def code(a_m, b, angle):
                    	tmp = 0
                    	if a_m <= 1.55e+140:
                    		tmp = (((b - a_m) * (b + a_m)) * math.pi) * (0.011111111111111112 * angle)
                    	else:
                    		tmp = (((math.pi * angle) * a_m) * -0.011111111111111112) * a_m
                    	return tmp
                    
                    a_m = abs(a)
                    function code(a_m, b, angle)
                    	tmp = 0.0
                    	if (a_m <= 1.55e+140)
                    		tmp = Float64(Float64(Float64(Float64(b - a_m) * Float64(b + a_m)) * pi) * Float64(0.011111111111111112 * angle));
                    	else
                    		tmp = Float64(Float64(Float64(Float64(pi * angle) * a_m) * -0.011111111111111112) * a_m);
                    	end
                    	return tmp
                    end
                    
                    a_m = abs(a);
                    function tmp_2 = code(a_m, b, angle)
                    	tmp = 0.0;
                    	if (a_m <= 1.55e+140)
                    		tmp = (((b - a_m) * (b + a_m)) * pi) * (0.011111111111111112 * angle);
                    	else
                    		tmp = (((pi * angle) * a_m) * -0.011111111111111112) * a_m;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    a_m = N[Abs[a], $MachinePrecision]
                    code[a$95$m_, b_, angle_] := If[LessEqual[a$95$m, 1.55e+140], N[(N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision] * N[(0.011111111111111112 * angle), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(Pi * angle), $MachinePrecision] * a$95$m), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] * a$95$m), $MachinePrecision]]
                    
                    \begin{array}{l}
                    a_m = \left|a\right|
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;a\_m \leq 1.55 \cdot 10^{+140}:\\
                    \;\;\;\;\left(\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot angle\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(\left(\left(\pi \cdot angle\right) \cdot a\_m\right) \cdot -0.011111111111111112\right) \cdot a\_m\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if a < 1.55e140

                      1. Initial program 56.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                        15. lower--.f6451.7

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

                        \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
                      6. Step-by-step derivation
                        1. Applied rewrites51.7%

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

                        if 1.55e140 < a

                        1. Initial program 43.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                          15. lower--.f6448.7

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

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

                          \[\leadsto \frac{-1}{90} \cdot \color{blue}{\left({a}^{2} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
                        7. Step-by-step derivation
                          1. Applied rewrites51.3%

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

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

                                \[\leadsto \left(\left(\left(angle \cdot \pi\right) \cdot a\right) \cdot -0.011111111111111112\right) \cdot a \]
                            3. Recombined 2 regimes into one program.
                            4. Final simplification54.6%

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

                            Alternative 10: 62.2% accurate, 16.8× speedup?

                            \[\begin{array}{l} a_m = \left|a\right| \\ \left(\left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right) \end{array} \]
                            a_m = (fabs.f64 a)
                            (FPCore (a_m b angle)
                             :precision binary64
                             (* (* (* (* 0.011111111111111112 PI) angle) (- b a_m)) (+ b a_m)))
                            a_m = fabs(a);
                            double code(double a_m, double b, double angle) {
                            	return (((0.011111111111111112 * ((double) M_PI)) * angle) * (b - a_m)) * (b + a_m);
                            }
                            
                            a_m = Math.abs(a);
                            public static double code(double a_m, double b, double angle) {
                            	return (((0.011111111111111112 * Math.PI) * angle) * (b - a_m)) * (b + a_m);
                            }
                            
                            a_m = math.fabs(a)
                            def code(a_m, b, angle):
                            	return (((0.011111111111111112 * math.pi) * angle) * (b - a_m)) * (b + a_m)
                            
                            a_m = abs(a)
                            function code(a_m, b, angle)
                            	return Float64(Float64(Float64(Float64(0.011111111111111112 * pi) * angle) * Float64(b - a_m)) * Float64(b + a_m))
                            end
                            
                            a_m = abs(a);
                            function tmp = code(a_m, b, angle)
                            	tmp = (((0.011111111111111112 * pi) * angle) * (b - a_m)) * (b + a_m);
                            end
                            
                            a_m = N[Abs[a], $MachinePrecision]
                            code[a$95$m_, b_, angle_] := N[(N[(N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]
                            
                            \begin{array}{l}
                            a_m = \left|a\right|
                            
                            \\
                            \left(\left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)
                            \end{array}
                            
                            Derivation
                            1. Initial program 54.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                              15. lower--.f6451.3

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

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

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

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

                              Alternative 11: 39.3% accurate, 21.6× speedup?

                              \[\begin{array}{l} a_m = \left|a\right| \\ \left(\left(-0.011111111111111112 \cdot a\_m\right) \cdot angle\right) \cdot \left(\pi \cdot a\_m\right) \end{array} \]
                              a_m = (fabs.f64 a)
                              (FPCore (a_m b angle)
                               :precision binary64
                               (* (* (* -0.011111111111111112 a_m) angle) (* PI a_m)))
                              a_m = fabs(a);
                              double code(double a_m, double b, double angle) {
                              	return ((-0.011111111111111112 * a_m) * angle) * (((double) M_PI) * a_m);
                              }
                              
                              a_m = Math.abs(a);
                              public static double code(double a_m, double b, double angle) {
                              	return ((-0.011111111111111112 * a_m) * angle) * (Math.PI * a_m);
                              }
                              
                              a_m = math.fabs(a)
                              def code(a_m, b, angle):
                              	return ((-0.011111111111111112 * a_m) * angle) * (math.pi * a_m)
                              
                              a_m = abs(a)
                              function code(a_m, b, angle)
                              	return Float64(Float64(Float64(-0.011111111111111112 * a_m) * angle) * Float64(pi * a_m))
                              end
                              
                              a_m = abs(a);
                              function tmp = code(a_m, b, angle)
                              	tmp = ((-0.011111111111111112 * a_m) * angle) * (pi * a_m);
                              end
                              
                              a_m = N[Abs[a], $MachinePrecision]
                              code[a$95$m_, b_, angle_] := N[(N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * angle), $MachinePrecision] * N[(Pi * a$95$m), $MachinePrecision]), $MachinePrecision]
                              
                              \begin{array}{l}
                              a_m = \left|a\right|
                              
                              \\
                              \left(\left(-0.011111111111111112 \cdot a\_m\right) \cdot angle\right) \cdot \left(\pi \cdot a\_m\right)
                              \end{array}
                              
                              Derivation
                              1. Initial program 54.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                                15. lower--.f6451.3

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

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

                                \[\leadsto \frac{-1}{90} \cdot \color{blue}{\left({a}^{2} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
                              7. Step-by-step derivation
                                1. Applied rewrites37.3%

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

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

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

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

                                    Alternative 12: 39.3% accurate, 21.6× speedup?

                                    \[\begin{array}{l} a_m = \left|a\right| \\ \left(\left(\pi \cdot angle\right) \cdot a\_m\right) \cdot \left(-0.011111111111111112 \cdot a\_m\right) \end{array} \]
                                    a_m = (fabs.f64 a)
                                    (FPCore (a_m b angle)
                                     :precision binary64
                                     (* (* (* PI angle) a_m) (* -0.011111111111111112 a_m)))
                                    a_m = fabs(a);
                                    double code(double a_m, double b, double angle) {
                                    	return ((((double) M_PI) * angle) * a_m) * (-0.011111111111111112 * a_m);
                                    }
                                    
                                    a_m = Math.abs(a);
                                    public static double code(double a_m, double b, double angle) {
                                    	return ((Math.PI * angle) * a_m) * (-0.011111111111111112 * a_m);
                                    }
                                    
                                    a_m = math.fabs(a)
                                    def code(a_m, b, angle):
                                    	return ((math.pi * angle) * a_m) * (-0.011111111111111112 * a_m)
                                    
                                    a_m = abs(a)
                                    function code(a_m, b, angle)
                                    	return Float64(Float64(Float64(pi * angle) * a_m) * Float64(-0.011111111111111112 * a_m))
                                    end
                                    
                                    a_m = abs(a);
                                    function tmp = code(a_m, b, angle)
                                    	tmp = ((pi * angle) * a_m) * (-0.011111111111111112 * a_m);
                                    end
                                    
                                    a_m = N[Abs[a], $MachinePrecision]
                                    code[a$95$m_, b_, angle_] := N[(N[(N[(Pi * angle), $MachinePrecision] * a$95$m), $MachinePrecision] * N[(-0.011111111111111112 * a$95$m), $MachinePrecision]), $MachinePrecision]
                                    
                                    \begin{array}{l}
                                    a_m = \left|a\right|
                                    
                                    \\
                                    \left(\left(\pi \cdot angle\right) \cdot a\_m\right) \cdot \left(-0.011111111111111112 \cdot a\_m\right)
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 54.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                                      15. lower--.f6451.3

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

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

                                      \[\leadsto \frac{-1}{90} \cdot \color{blue}{\left({a}^{2} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites37.3%

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

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

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

                                        Reproduce

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