ab-angle->ABCF B

Percentage Accurate: 53.9% → 65.6%
Time: 17.7s
Alternatives: 11
Speedup: 3.5×

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

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

Initial Program: 53.9% accurate, 1.0× speedup?

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

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

Alternative 1: 65.6% accurate, 0.6× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\\ t_1 := \cos \left(e^{\log \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b\_m \leq 2.2 \cdot 10^{+140}:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \left(a \cdot \left(a \cdot t\_0\right) - t\_0 \cdot {b\_m}^{2}\right)\right)\\ \mathbf{elif}\;b\_m \leq 2.5 \cdot 10^{+248}:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \mathsf{fma}\left(b\_m, b\_m \cdot \left(-t\_0\right), {a}^{2} \cdot t\_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(2 \cdot \left(\sin \left(angle\_m \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(\left(a + b\_m\right) \cdot \left(a - b\_m\right)\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
 :precision binary64
 (let* ((t_0 (sin (* -0.005555555555555556 (* PI angle_m))))
        (t_1 (cos (exp (log (* PI (* angle_m 0.005555555555555556)))))))
   (*
    angle_s
    (if (<= b_m 2.2e+140)
      (* t_1 (* 2.0 (- (* a (* a t_0)) (* t_0 (pow b_m 2.0)))))
      (if (<= b_m 2.5e+248)
        (* t_1 (* 2.0 (fma b_m (* b_m (- t_0)) (* (pow a 2.0) t_0))))
        (*
         t_1
         (*
          2.0
          (*
           (sin (* angle_m (/ (cbrt (pow PI 3.0)) -180.0)))
           (* (+ a b_m) (- a b_m))))))))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
	double t_0 = sin((-0.005555555555555556 * (((double) M_PI) * angle_m)));
	double t_1 = cos(exp(log((((double) M_PI) * (angle_m * 0.005555555555555556)))));
	double tmp;
	if (b_m <= 2.2e+140) {
		tmp = t_1 * (2.0 * ((a * (a * t_0)) - (t_0 * pow(b_m, 2.0))));
	} else if (b_m <= 2.5e+248) {
		tmp = t_1 * (2.0 * fma(b_m, (b_m * -t_0), (pow(a, 2.0) * t_0)));
	} else {
		tmp = t_1 * (2.0 * (sin((angle_m * (cbrt(pow(((double) M_PI), 3.0)) / -180.0))) * ((a + b_m) * (a - b_m))));
	}
	return angle_s * tmp;
}
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b_m, angle_m)
	t_0 = sin(Float64(-0.005555555555555556 * Float64(pi * angle_m)))
	t_1 = cos(exp(log(Float64(pi * Float64(angle_m * 0.005555555555555556)))))
	tmp = 0.0
	if (b_m <= 2.2e+140)
		tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(a * Float64(a * t_0)) - Float64(t_0 * (b_m ^ 2.0)))));
	elseif (b_m <= 2.5e+248)
		tmp = Float64(t_1 * Float64(2.0 * fma(b_m, Float64(b_m * Float64(-t_0)), Float64((a ^ 2.0) * t_0))));
	else
		tmp = Float64(t_1 * Float64(2.0 * Float64(sin(Float64(angle_m * Float64(cbrt((pi ^ 3.0)) / -180.0))) * Float64(Float64(a + b_m) * Float64(a - b_m)))));
	end
	return Float64(angle_s * tmp)
end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[Exp[N[Log[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b$95$m, 2.2e+140], N[(t$95$1 * N[(2.0 * N[(N[(a * N[(a * t$95$0), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[Power[b$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 2.5e+248], N[(t$95$1 * N[(2.0 * N[(b$95$m * N[(b$95$m * (-t$95$0)), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(N[Sin[N[(angle$95$m * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a + b$95$m), $MachinePrecision] * N[(a - b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{elif}\;b\_m \leq 2.5 \cdot 10^{+248}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \mathsf{fma}\left(b\_m, b\_m \cdot \left(-t\_0\right), {a}^{2} \cdot t\_0\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\sin \left(angle\_m \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(\left(a + b\_m\right) \cdot \left(a - b\_m\right)\right)\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 2.1999999999999998e140

    1. Initial program 62.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. Simplified62.8%

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

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

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      4. associate-*r/56.0%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{angle \cdot \pi}{-180}} \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      5. associate-*r/56.0%

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot angle\right)}}{-180 \cdot -180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      9. metadata-eval55.6%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      10. metadata-eval55.6%

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{\pi \cdot angle}{180} \cdot \frac{\pi \cdot angle}{180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      12. associate-*r/56.0%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \frac{\pi \cdot angle}{180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      13. associate-*r/56.0%

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      15. add-sqr-sqrt31.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \color{blue}{\left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) + \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + -1 \cdot b\right)\right) + -1 \cdot \left({b}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)}\right) \]
      2. mul-1-neg34.5%

        \[\leadsto \cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) + \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + -1 \cdot b\right)\right) + \color{blue}{\left(-{b}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)\right) \]
      3. unsub-neg34.5%

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

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

    if 2.1999999999999998e140 < b < 2.4999999999999998e248

    1. Initial program 33.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. Simplified38.4%

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

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

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      4. associate-*r/37.6%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{angle \cdot \pi}{-180}} \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      5. associate-*r/37.6%

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot angle\right)}}{-180 \cdot -180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      9. metadata-eval37.6%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      10. metadata-eval37.6%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{180 \cdot 180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      11. frac-times37.6%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{\pi \cdot angle}{180} \cdot \frac{\pi \cdot angle}{180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      12. associate-*r/37.6%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \frac{\pi \cdot angle}{180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      13. associate-*r/37.6%

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      15. add-sqr-sqrt24.8%

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

        \[\leadsto \cos \left(e^{\log \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      17. metadata-eval24.8%

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

      \[\leadsto \cos \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)} \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    6. Step-by-step derivation
      1. unpow224.8%

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

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

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

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

      \[\leadsto \cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \color{blue}{\left(b \cdot \left(-1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) + \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + -1 \cdot a\right)\right) + {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
    9. Step-by-step derivation
      1. fma-define49.6%

        \[\leadsto \cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) + \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + -1 \cdot a\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
    10. Simplified49.6%

      \[\leadsto \cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b, b \cdot \left(-\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right), \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {a}^{2}\right)}\right) \]

    if 2.4999999999999998e248 < b

    1. Initial program 50.0%

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

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

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

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      4. associate-*r/50.0%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{angle \cdot \pi}{-180}} \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      5. associate-*r/50.0%

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot angle\right)}}{-180 \cdot -180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      9. metadata-eval50.0%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      10. metadata-eval50.0%

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{\pi \cdot angle}{180} \cdot \frac{\pi \cdot angle}{180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      12. associate-*r/50.0%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \frac{\pi \cdot angle}{180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      13. associate-*r/50.0%

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      15. add-sqr-sqrt8.3%

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

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

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

      \[\leadsto \cos \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)} \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    6. Step-by-step derivation
      1. unpow28.3%

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

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

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

      \[\leadsto \cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \color{blue}{\left(\left(a + b\right) \cdot \left(a - b\right)\right)}\right)\right) \]
    8. Step-by-step derivation
      1. add-cbrt-cube33.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.2 \cdot 10^{+140}:\\ \;\;\;\;\cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot {b}^{2}\right)\right)\\ \mathbf{elif}\;b \leq 2.5 \cdot 10^{+248}:\\ \;\;\;\;\cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, b \cdot \left(-\sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 60.9% accurate, 0.4× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \sin \left(angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{a}^{2} \leq \infty:\\ \;\;\;\;\cos \left(e^{\log \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b\_m, \mathsf{fma}\left(-1, b\_m \cdot t\_0, t\_0 \cdot \left(a \cdot 0\right)\right), {a}^{2} \cdot t\_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot {\left(a \cdot \sqrt{\pi \cdot angle\_m}\right)}^{2}\\ \end{array} \end{array} \end{array} \]
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
 :precision binary64
 (let* ((t_0 (sin (* angle_m (* PI -0.005555555555555556)))))
   (*
    angle_s
    (if (<= (pow a 2.0) INFINITY)
      (*
       (cos (exp (log (* PI (* angle_m 0.005555555555555556)))))
       (*
        2.0
        (fma
         b_m
         (fma -1.0 (* b_m t_0) (* t_0 (* a 0.0)))
         (* (pow a 2.0) t_0))))
      (* -0.011111111111111112 (pow (* a (sqrt (* PI angle_m))) 2.0))))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
	double t_0 = sin((angle_m * (((double) M_PI) * -0.005555555555555556)));
	double tmp;
	if (pow(a, 2.0) <= ((double) INFINITY)) {
		tmp = cos(exp(log((((double) M_PI) * (angle_m * 0.005555555555555556))))) * (2.0 * fma(b_m, fma(-1.0, (b_m * t_0), (t_0 * (a * 0.0))), (pow(a, 2.0) * t_0)));
	} else {
		tmp = -0.011111111111111112 * pow((a * sqrt((((double) M_PI) * angle_m))), 2.0);
	}
	return angle_s * tmp;
}
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b_m, angle_m)
	t_0 = sin(Float64(angle_m * Float64(pi * -0.005555555555555556)))
	tmp = 0.0
	if ((a ^ 2.0) <= Inf)
		tmp = Float64(cos(exp(log(Float64(pi * Float64(angle_m * 0.005555555555555556))))) * Float64(2.0 * fma(b_m, fma(-1.0, Float64(b_m * t_0), Float64(t_0 * Float64(a * 0.0))), Float64((a ^ 2.0) * t_0))));
	else
		tmp = Float64(-0.011111111111111112 * (Float64(a * sqrt(Float64(pi * angle_m))) ^ 2.0));
	end
	return Float64(angle_s * tmp)
end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], Infinity], N[(N[Cos[N[Exp[N[Log[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(b$95$m * N[(-1.0 * N[(b$95$m * t$95$0), $MachinePrecision] + N[(t$95$0 * N[(a * 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[Power[N[(a * N[Sqrt[N[(Pi * angle$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \sin \left(angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq \infty:\\
\;\;\;\;\cos \left(e^{\log \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b\_m, \mathsf{fma}\left(-1, b\_m \cdot t\_0, t\_0 \cdot \left(a \cdot 0\right)\right), {a}^{2} \cdot t\_0\right)\right)\\

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


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

    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. Simplified60.1%

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

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

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      4. associate-*r/54.1%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{angle \cdot \pi}{-180}} \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      5. associate-*r/54.1%

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot angle\right)}}{-180 \cdot -180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      9. metadata-eval53.8%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      10. metadata-eval53.8%

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{\pi \cdot angle}{180} \cdot \frac{\pi \cdot angle}{180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      12. associate-*r/54.1%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \frac{\pi \cdot angle}{180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      13. associate-*r/54.1%

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      15. add-sqr-sqrt29.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) + \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + -1 \cdot a\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
    10. Simplified32.9%

      \[\leadsto \cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b, \mathsf{fma}\left(-1, b \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right), \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \left(0 \cdot a\right)\right), \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot {a}^{2}\right)}\right) \]

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

    1. Initial program 59.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{a}^{2} \leq \infty:\\ \;\;\;\;\cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(-1, b \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right), \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \left(a \cdot 0\right)\right), {a}^{2} \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot {\left(a \cdot \sqrt{\pi \cdot angle}\right)}^{2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 64.0% accurate, 0.7× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \sin \left(angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\\ t_1 := \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\\ t_2 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b\_m \leq 1.25 \cdot 10^{+135}:\\ \;\;\;\;\cos \left(e^{\log t\_2}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot t\_1\right) - t\_1 \cdot {b\_m}^{2}\right)\right)\\ \mathbf{elif}\;b\_m \leq 1.4 \cdot 10^{+202}:\\ \;\;\;\;\left(2 \cdot \cos t\_2\right) \cdot \mathsf{fma}\left(b\_m, b\_m \cdot \left(-t\_0\right), {a}^{2} \cdot t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(e^{\log \left(\pi \cdot angle\_m\right) - \log 180}\right) \cdot \left(2 \cdot \left(\left(\left(a + b\_m\right) \cdot \left(a - b\_m\right)\right) \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
 :precision binary64
 (let* ((t_0 (sin (* angle_m (* PI -0.005555555555555556))))
        (t_1 (sin (* -0.005555555555555556 (* PI angle_m))))
        (t_2 (* PI (* angle_m 0.005555555555555556))))
   (*
    angle_s
    (if (<= b_m 1.25e+135)
      (*
       (cos (exp (log t_2)))
       (* 2.0 (- (* a (* a t_1)) (* t_1 (pow b_m 2.0)))))
      (if (<= b_m 1.4e+202)
        (* (* 2.0 (cos t_2)) (fma b_m (* b_m (- t_0)) (* (pow a 2.0) t_0)))
        (*
         (cos (exp (- (log (* PI angle_m)) (log 180.0))))
         (*
          2.0
          (* (* (+ a b_m) (- a b_m)) (sin (* angle_m (/ PI -180.0)))))))))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
	double t_0 = sin((angle_m * (((double) M_PI) * -0.005555555555555556)));
	double t_1 = sin((-0.005555555555555556 * (((double) M_PI) * angle_m)));
	double t_2 = ((double) M_PI) * (angle_m * 0.005555555555555556);
	double tmp;
	if (b_m <= 1.25e+135) {
		tmp = cos(exp(log(t_2))) * (2.0 * ((a * (a * t_1)) - (t_1 * pow(b_m, 2.0))));
	} else if (b_m <= 1.4e+202) {
		tmp = (2.0 * cos(t_2)) * fma(b_m, (b_m * -t_0), (pow(a, 2.0) * t_0));
	} else {
		tmp = cos(exp((log((((double) M_PI) * angle_m)) - log(180.0)))) * (2.0 * (((a + b_m) * (a - b_m)) * sin((angle_m * (((double) M_PI) / -180.0)))));
	}
	return angle_s * tmp;
}
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b_m, angle_m)
	t_0 = sin(Float64(angle_m * Float64(pi * -0.005555555555555556)))
	t_1 = sin(Float64(-0.005555555555555556 * Float64(pi * angle_m)))
	t_2 = Float64(pi * Float64(angle_m * 0.005555555555555556))
	tmp = 0.0
	if (b_m <= 1.25e+135)
		tmp = Float64(cos(exp(log(t_2))) * Float64(2.0 * Float64(Float64(a * Float64(a * t_1)) - Float64(t_1 * (b_m ^ 2.0)))));
	elseif (b_m <= 1.4e+202)
		tmp = Float64(Float64(2.0 * cos(t_2)) * fma(b_m, Float64(b_m * Float64(-t_0)), Float64((a ^ 2.0) * t_0)));
	else
		tmp = Float64(cos(exp(Float64(log(Float64(pi * angle_m)) - log(180.0)))) * Float64(2.0 * Float64(Float64(Float64(a + b_m) * Float64(a - b_m)) * sin(Float64(angle_m * Float64(pi / -180.0))))));
	end
	return Float64(angle_s * tmp)
end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b$95$m, 1.25e+135], N[(N[Cos[N[Exp[N[Log[t$95$2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(a * N[(a * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[Power[b$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 1.4e+202], N[(N[(2.0 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] * N[(b$95$m * N[(b$95$m * (-t$95$0)), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[Exp[N[(N[Log[N[(Pi * angle$95$m), $MachinePrecision]], $MachinePrecision] - N[Log[180.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(N[(a + b$95$m), $MachinePrecision] * N[(a - b$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \sin \left(angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\\
t_1 := \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\\
t_2 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b\_m \leq 1.25 \cdot 10^{+135}:\\
\;\;\;\;\cos \left(e^{\log t\_2}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot t\_1\right) - t\_1 \cdot {b\_m}^{2}\right)\right)\\

\mathbf{elif}\;b\_m \leq 1.4 \cdot 10^{+202}:\\
\;\;\;\;\left(2 \cdot \cos t\_2\right) \cdot \mathsf{fma}\left(b\_m, b\_m \cdot \left(-t\_0\right), {a}^{2} \cdot t\_0\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 1.25000000000000007e135

    1. Initial program 63.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. Simplified63.1%

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

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

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      4. associate-*r/56.3%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{angle \cdot \pi}{-180}} \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      5. associate-*r/56.3%

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot angle\right)}}{-180 \cdot -180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      9. metadata-eval55.8%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      10. metadata-eval55.8%

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{\pi \cdot angle}{180} \cdot \frac{\pi \cdot angle}{180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      12. associate-*r/56.3%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \frac{\pi \cdot angle}{180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      13. associate-*r/56.3%

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      15. add-sqr-sqrt31.3%

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

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

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

      \[\leadsto \cos \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)} \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    6. Step-by-step derivation
      1. unpow231.3%

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

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

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \color{blue}{\left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) + \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + -1 \cdot b\right)\right) + -1 \cdot \left({b}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)}\right) \]
      2. mul-1-neg34.6%

        \[\leadsto \cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) + \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + -1 \cdot b\right)\right) + \color{blue}{\left(-{b}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)\right) \]
      3. unsub-neg34.6%

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

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

    if 1.25000000000000007e135 < b < 1.40000000000000008e202

    1. Initial program 34.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. Simplified40.3%

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

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

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      4. associate-*r/33.0%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{angle \cdot \pi}{-180}} \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      5. associate-*r/33.0%

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot angle\right)}}{-180 \cdot -180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      9. metadata-eval33.0%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      10. metadata-eval33.0%

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{\pi \cdot angle}{180} \cdot \frac{\pi \cdot angle}{180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      12. associate-*r/33.0%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \frac{\pi \cdot angle}{180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      13. associate-*r/33.0%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\left(\pi \cdot \frac{angle}{180}\right) \cdot \color{blue}{\left(\pi \cdot \frac{angle}{180}\right)}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      14. sqrt-unprod21.6%

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      15. add-sqr-sqrt21.6%

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\pi \cdot \frac{angle}{180}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      16. div-inv21.6%

        \[\leadsto \cos \left(e^{\log \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      17. metadata-eval21.6%

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

      \[\leadsto \cos \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)} \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    6. Step-by-step derivation
      1. unpow221.6%

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

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

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

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

      \[\leadsto \cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \color{blue}{\left(b \cdot \left(-1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) + \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + -1 \cdot a\right)\right) + {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
    9. Step-by-step derivation
      1. fma-define49.4%

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

      \[\leadsto \cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b, \mathsf{fma}\left(-1, b \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right), \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \left(0 \cdot a\right)\right), \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot {a}^{2}\right)}\right) \]
    11. Step-by-step derivation
      1. pow151.0%

        \[\leadsto \color{blue}{{\left(\cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(-1, b \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right), \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \left(0 \cdot a\right)\right), \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot {a}^{2}\right)\right)\right)}^{1}} \]
    12. Applied egg-rr75.5%

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

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

        \[\leadsto \color{blue}{\left(2 \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)} \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(-1, b \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right), 0\right), \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot {a}^{2}\right) \]
    14. Simplified75.5%

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

    if 1.40000000000000008e202 < b

    1. Initial program 42.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. Simplified42.1%

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

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

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      4. associate-*r/47.4%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{angle \cdot \pi}{-180}} \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      5. associate-*r/47.4%

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot angle\right)}}{-180 \cdot -180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      9. metadata-eval47.4%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      10. metadata-eval47.4%

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{\pi \cdot angle}{180} \cdot \frac{\pi \cdot angle}{180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      12. associate-*r/47.4%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \frac{\pi \cdot angle}{180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      13. associate-*r/47.4%

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      15. add-sqr-sqrt15.8%

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

        \[\leadsto \cos \left(e^{\log \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      17. metadata-eval15.8%

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

      \[\leadsto \cos \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)} \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    6. Step-by-step derivation
      1. unpow215.8%

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

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

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

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

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

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

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

        \[\leadsto \cos \left(e^{\color{blue}{\log \left(\pi \cdot \frac{angle}{180}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      5. associate-*r/21.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.25 \cdot 10^{+135}:\\ \;\;\;\;\cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \left(a \cdot \left(a \cdot \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) - \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot {b}^{2}\right)\right)\\ \mathbf{elif}\;b \leq 1.4 \cdot 10^{+202}:\\ \;\;\;\;\left(2 \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \mathsf{fma}\left(b, b \cdot \left(-\sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right), {a}^{2} \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(e^{\log \left(\pi \cdot angle\right) - \log 180}\right) \cdot \left(2 \cdot \left(\left(\left(a + b\right) \cdot \left(a - b\right)\right) \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 61.3% accurate, 0.7× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \sin \left(angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{a}^{2} \leq \infty:\\ \;\;\;\;\left(2 \cdot \cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right) \cdot \mathsf{fma}\left(b\_m, b\_m \cdot \left(-t\_0\right), {a}^{2} \cdot t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot {\left(a \cdot \sqrt{\pi \cdot angle\_m}\right)}^{2}\\ \end{array} \end{array} \end{array} \]
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
 :precision binary64
 (let* ((t_0 (sin (* angle_m (* PI -0.005555555555555556)))))
   (*
    angle_s
    (if (<= (pow a 2.0) INFINITY)
      (*
       (* 2.0 (cos (* PI (* angle_m 0.005555555555555556))))
       (fma b_m (* b_m (- t_0)) (* (pow a 2.0) t_0)))
      (* -0.011111111111111112 (pow (* a (sqrt (* PI angle_m))) 2.0))))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
	double t_0 = sin((angle_m * (((double) M_PI) * -0.005555555555555556)));
	double tmp;
	if (pow(a, 2.0) <= ((double) INFINITY)) {
		tmp = (2.0 * cos((((double) M_PI) * (angle_m * 0.005555555555555556)))) * fma(b_m, (b_m * -t_0), (pow(a, 2.0) * t_0));
	} else {
		tmp = -0.011111111111111112 * pow((a * sqrt((((double) M_PI) * angle_m))), 2.0);
	}
	return angle_s * tmp;
}
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b_m, angle_m)
	t_0 = sin(Float64(angle_m * Float64(pi * -0.005555555555555556)))
	tmp = 0.0
	if ((a ^ 2.0) <= Inf)
		tmp = Float64(Float64(2.0 * cos(Float64(pi * Float64(angle_m * 0.005555555555555556)))) * fma(b_m, Float64(b_m * Float64(-t_0)), Float64((a ^ 2.0) * t_0)));
	else
		tmp = Float64(-0.011111111111111112 * (Float64(a * sqrt(Float64(pi * angle_m))) ^ 2.0));
	end
	return Float64(angle_s * tmp)
end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], Infinity], N[(N[(2.0 * N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(b$95$m * N[(b$95$m * (-t$95$0)), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[Power[N[(a * N[Sqrt[N[(Pi * angle$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \sin \left(angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq \infty:\\
\;\;\;\;\left(2 \cdot \cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right) \cdot \mathsf{fma}\left(b\_m, b\_m \cdot \left(-t\_0\right), {a}^{2} \cdot t\_0\right)\\

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


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

    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. Simplified60.1%

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

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

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      4. associate-*r/54.1%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{angle \cdot \pi}{-180}} \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      5. associate-*r/54.1%

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot angle\right)}}{-180 \cdot -180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      9. metadata-eval53.8%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      10. metadata-eval53.8%

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{\pi \cdot angle}{180} \cdot \frac{\pi \cdot angle}{180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      12. associate-*r/54.1%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \frac{\pi \cdot angle}{180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      13. associate-*r/54.1%

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      15. add-sqr-sqrt29.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b, -1 \cdot \left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) + \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a + -1 \cdot a\right), {a}^{2} \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right) \]
    10. Simplified32.9%

      \[\leadsto \cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \color{blue}{\mathsf{fma}\left(b, \mathsf{fma}\left(-1, b \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right), \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \left(0 \cdot a\right)\right), \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot {a}^{2}\right)}\right) \]
    11. Step-by-step derivation
      1. pow132.9%

        \[\leadsto \color{blue}{{\left(\cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(-1, b \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right), \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \left(0 \cdot a\right)\right), \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot {a}^{2}\right)\right)\right)}^{1}} \]
    12. Applied egg-rr64.8%

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

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

        \[\leadsto \color{blue}{\left(2 \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)} \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(-1, b \cdot \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right), 0\right), \sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot {a}^{2}\right) \]
    14. Simplified64.8%

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

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

    1. Initial program 59.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 58.9% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 60.6%

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

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

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

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      4. associate-*r/55.4%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{angle \cdot \pi}{-180}} \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      5. associate-*r/55.4%

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot angle\right)}}{-180 \cdot -180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      9. metadata-eval55.0%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      10. metadata-eval55.0%

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{\pi \cdot angle}{180} \cdot \frac{\pi \cdot angle}{180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      12. associate-*r/55.4%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \frac{\pi \cdot angle}{180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      13. associate-*r/55.4%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\left(\pi \cdot \frac{angle}{180}\right) \cdot \color{blue}{\left(\pi \cdot \frac{angle}{180}\right)}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      14. sqrt-unprod30.6%

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      15. add-sqr-sqrt30.6%

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\pi \cdot \frac{angle}{180}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      16. div-inv30.6%

        \[\leadsto \cos \left(e^{\log \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      17. metadata-eval30.6%

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

      \[\leadsto \cos \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)} \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    6. Step-by-step derivation
      1. unpow230.6%

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

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

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

      \[\leadsto \cos \left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \color{blue}{\left(\left(a + b\right) \cdot \left(a - b\right)\right)}\right)\right) \]
    8. Step-by-step derivation
      1. log-prod30.9%

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

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

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

        \[\leadsto \cos \left(e^{\color{blue}{\log \left(\pi \cdot \frac{angle}{180}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \]
      5. associate-*r/31.4%

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

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

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

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

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

    if 2.1e185 < a

    1. Initial program 48.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 58.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 60.6%

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

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

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

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      4. associate-*r/55.4%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{angle \cdot \pi}{-180}} \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      5. associate-*r/55.4%

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot angle\right)}}{-180 \cdot -180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      9. metadata-eval55.0%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      10. metadata-eval55.0%

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{\pi \cdot angle}{180} \cdot \frac{\pi \cdot angle}{180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      12. associate-*r/55.4%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \frac{\pi \cdot angle}{180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      13. associate-*r/55.4%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\left(\pi \cdot \frac{angle}{180}\right) \cdot \color{blue}{\left(\pi \cdot \frac{angle}{180}\right)}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      14. sqrt-unprod30.6%

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      15. add-sqr-sqrt30.6%

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\pi \cdot \frac{angle}{180}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      16. div-inv30.6%

        \[\leadsto \cos \left(e^{\log \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      17. metadata-eval30.6%

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

      \[\leadsto \cos \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)} \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    6. Step-by-step derivation
      1. unpow230.6%

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

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

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

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

    if 1.9499999999999999e185 < a

    1. Initial program 48.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 57.5% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\log \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}} \]
    7. Step-by-step derivation
      1. rem-exp-log62.7%

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

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

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

    if 1.4e154 < a

    1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 57.7% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 61.6%

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

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

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

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      4. associate-*r/55.9%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{angle \cdot \pi}{-180}} \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      5. associate-*r/55.9%

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot angle\right)}}{-180 \cdot -180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      9. metadata-eval55.5%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      10. metadata-eval55.5%

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{\pi \cdot angle}{180} \cdot \frac{\pi \cdot angle}{180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      12. associate-*r/55.9%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \frac{\pi \cdot angle}{180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      13. associate-*r/55.9%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\left(\pi \cdot \frac{angle}{180}\right) \cdot \color{blue}{\left(\pi \cdot \frac{angle}{180}\right)}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      14. sqrt-unprod30.6%

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      15. add-sqr-sqrt30.6%

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\pi \cdot \frac{angle}{180}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      16. div-inv30.6%

        \[\leadsto \cos \left(e^{\log \left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      17. metadata-eval30.6%

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

      \[\leadsto \cos \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)} \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    6. Step-by-step derivation
      1. unpow230.6%

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

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

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

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

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

    if 1.4e154 < a

    1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 55.6% accurate, 3.5× speedup?

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

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

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


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

    1. Initial program 60.1%

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

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

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

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      4. associate-*r/55.0%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{angle \cdot \pi}{-180}} \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      5. associate-*r/55.0%

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

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

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot angle\right)}}{-180 \cdot -180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      9. metadata-eval54.6%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      10. metadata-eval54.6%

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

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{\pi \cdot angle}{180} \cdot \frac{\pi \cdot angle}{180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      12. associate-*r/55.0%

        \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \frac{\pi \cdot angle}{180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      13. associate-*r/55.0%

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

        \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
      15. add-sqr-sqrt30.4%

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

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

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

      \[\leadsto \cos \color{blue}{\left(e^{\log \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)} \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    6. Step-by-step derivation
      1. unpow230.4%

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

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

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

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

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

    if 5.0000000000000001e187 < a

    1. Initial program 53.7%

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

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

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

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

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

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

        \[\leadsto -0.011111111111111112 \cdot \left(\color{blue}{\left(a \cdot a\right)} \cdot \left(angle \cdot \pi\right)\right) \]
    8. Applied egg-rr71.3%

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

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

Alternative 10: 53.9% accurate, 32.2× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(-0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(a + b\_m\right) \cdot \left(a - b\_m\right)\right)\right)\right)\right) \end{array} \]
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
 :precision binary64
 (*
  angle_s
  (* -0.011111111111111112 (* angle_m (* PI (* (+ a b_m) (- a b_m)))))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
	return angle_s * (-0.011111111111111112 * (angle_m * (((double) M_PI) * ((a + b_m) * (a - b_m)))));
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
	return angle_s * (-0.011111111111111112 * (angle_m * (Math.PI * ((a + b_m) * (a - b_m)))));
}
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b_m, angle_m):
	return angle_s * (-0.011111111111111112 * (angle_m * (math.pi * ((a + b_m) * (a - b_m)))))
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b_m, angle_m)
	return Float64(angle_s * Float64(-0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(a + b_m) * Float64(a - b_m))))))
end
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b_m, angle_m)
	tmp = angle_s * (-0.011111111111111112 * (angle_m * (pi * ((a + b_m) * (a - b_m)))));
end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(-0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(a + b$95$m), $MachinePrecision] * N[(a - b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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

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

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

      \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    4. associate-*r/54.1%

      \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{angle \cdot \pi}{-180}} \cdot \left(angle \cdot \frac{\pi}{-180}\right)}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    5. associate-*r/54.1%

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

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

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

      \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\pi \cdot angle\right)}}{-180 \cdot -180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    9. metadata-eval53.8%

      \[\leadsto \cos \left(e^{\log \left(\sqrt{\frac{\left(\pi \cdot angle\right) \cdot \left(\pi \cdot angle\right)}{\color{blue}{32400}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    10. metadata-eval53.8%

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

      \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\frac{\pi \cdot angle}{180} \cdot \frac{\pi \cdot angle}{180}}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    12. associate-*r/54.1%

      \[\leadsto \cos \left(e^{\log \left(\sqrt{\color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \frac{\pi \cdot angle}{180}}\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    13. associate-*r/54.1%

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

      \[\leadsto \cos \left(e^{\log \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}}\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    15. add-sqr-sqrt29.5%

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

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

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

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

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

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

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

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

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

Alternative 11: 35.7% accurate, 46.6× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(-0.011111111111111112 \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(a \cdot a\right)\right)\right) \end{array} \]
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
 :precision binary64
 (* angle_s (* -0.011111111111111112 (* (* PI angle_m) (* a a)))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
	return angle_s * (-0.011111111111111112 * ((((double) M_PI) * angle_m) * (a * a)));
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
	return angle_s * (-0.011111111111111112 * ((Math.PI * angle_m) * (a * a)));
}
b_m = math.fabs(b)
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b_m, angle_m):
	return angle_s * (-0.011111111111111112 * ((math.pi * angle_m) * (a * a)))
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b_m, angle_m)
	return Float64(angle_s * Float64(-0.011111111111111112 * Float64(Float64(pi * angle_m) * Float64(a * a))))
end
b_m = abs(b);
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b_m, angle_m)
	tmp = angle_s * (-0.011111111111111112 * ((pi * angle_m) * (a * a)));
end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(-0.011111111111111112 * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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

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

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

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

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

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

      \[\leadsto -0.011111111111111112 \cdot \left(\color{blue}{\left(a \cdot a\right)} \cdot \left(angle \cdot \pi\right)\right) \]
  8. Applied egg-rr37.5%

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

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

Reproduce

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