ab-angle->ABCF B

Percentage Accurate: 53.6% → 66.7%
Time: 24.0s
Alternatives: 16
Speedup: 23.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

Alternative 1: 66.7% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 57.2%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative30.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right) \]
    11. Step-by-step derivation
      1. add-cube-cbrt73.0%

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

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

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

    if 4.6000000000000002e218 < b

    1. Initial program 36.6%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative14.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\color{blue}{\left({\left(\left(\sqrt{\pi} \cdot \sqrt{\pi}\right) \cdot \sqrt{\pi}\right)}^{0.3333333333333333}\right)}}^{2} \cdot \frac{angle}{180}\right) \]
      3. add-sqr-sqrt63.8%

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\left({\left(\color{blue}{{\pi}^{1}} \cdot \sqrt{\pi}\right)}^{0.3333333333333333}\right)}^{2} \cdot \frac{angle}{180}\right) \]
      5. pow1/263.8%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\left({\left({\pi}^{1} \cdot \color{blue}{{\pi}^{0.5}}\right)}^{0.3333333333333333}\right)}^{2} \cdot \frac{angle}{180}\right) \]
      6. pow-prod-up63.8%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\left({\color{blue}{\left({\pi}^{\left(1 + 0.5\right)}\right)}}^{0.3333333333333333}\right)}^{2} \cdot \frac{angle}{180}\right) \]
      7. metadata-eval63.8%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\left({\left({\pi}^{\color{blue}{1.5}}\right)}^{0.3333333333333333}\right)}^{2} \cdot \frac{angle}{180}\right) \]
    12. Applied egg-rr63.8%

      \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\color{blue}{\left({\left({\pi}^{1.5}\right)}^{0.3333333333333333}\right)}}^{2} \cdot \frac{angle}{180}\right) \]
    13. Step-by-step derivation
      1. unpow1/385.2%

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

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

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

Alternative 2: 63.8% accurate, 0.7× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ t_1 := \left(b\_m - a\right) \cdot \left(\left(2 \cdot \left(b\_m + a\right)\right) \cdot \sin t\_0\right)\\ \mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -500000:\\ \;\;\;\;t\_1 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot {\left(\sqrt[3]{\cos t\_0}\right)}^{3}\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
 :precision binary64
 (let* ((t_0 (* 0.005555555555555556 (* angle PI)))
        (t_1 (* (- b_m a) (* (* 2.0 (+ b_m a)) (sin t_0)))))
   (if (<= (- (pow b_m 2.0) (pow a 2.0)) -500000.0)
     (* t_1 (cos (expm1 (log1p (* PI (* 0.005555555555555556 angle))))))
     (* t_1 (pow (cbrt (cos t_0)) 3.0)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
	double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
	double t_1 = (b_m - a) * ((2.0 * (b_m + a)) * sin(t_0));
	double tmp;
	if ((pow(b_m, 2.0) - pow(a, 2.0)) <= -500000.0) {
		tmp = t_1 * cos(expm1(log1p((((double) M_PI) * (0.005555555555555556 * angle)))));
	} else {
		tmp = t_1 * pow(cbrt(cos(t_0)), 3.0);
	}
	return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
	double t_0 = 0.005555555555555556 * (angle * Math.PI);
	double t_1 = (b_m - a) * ((2.0 * (b_m + a)) * Math.sin(t_0));
	double tmp;
	if ((Math.pow(b_m, 2.0) - Math.pow(a, 2.0)) <= -500000.0) {
		tmp = t_1 * Math.cos(Math.expm1(Math.log1p((Math.PI * (0.005555555555555556 * angle)))));
	} else {
		tmp = t_1 * Math.pow(Math.cbrt(Math.cos(t_0)), 3.0);
	}
	return tmp;
}
b_m = abs(b)
function code(a, b_m, angle)
	t_0 = Float64(0.005555555555555556 * Float64(angle * pi))
	t_1 = Float64(Float64(b_m - a) * Float64(Float64(2.0 * Float64(b_m + a)) * sin(t_0)))
	tmp = 0.0
	if (Float64((b_m ^ 2.0) - (a ^ 2.0)) <= -500000.0)
		tmp = Float64(t_1 * cos(expm1(log1p(Float64(pi * Float64(0.005555555555555556 * angle))))));
	else
		tmp = Float64(t_1 * (cbrt(cos(t_0)) ^ 3.0));
	end
	return tmp
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -500000.0], N[(t$95$1 * N[Cos[N[(Exp[N[Log[1 + N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[N[Power[N[Cos[t$95$0], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|

\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \left(b\_m - a\right) \cdot \left(\left(2 \cdot \left(b\_m + a\right)\right) \cdot \sin t\_0\right)\\
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -500000:\\
\;\;\;\;t\_1 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot {\left(\sqrt[3]{\cos t\_0}\right)}^{3}\\


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

    1. Initial program 48.0%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative19.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. expm1-log1p-u64.4%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)} \]
      4. expm1-undefine63.2%

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot 0.005555555555555556\right) \cdot \pi}\right)} - 1\right) \]
      6. associate-*l*61.9%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(e^{\mathsf{log1p}\left(\color{blue}{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)} - 1\right) \]
    10. Applied egg-rr61.9%

      \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)} - 1\right)} \]
    11. Step-by-step derivation
      1. expm1-define63.2%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)} \]
      2. associate-*r*64.4%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(angle \cdot 0.005555555555555556\right) \cdot \pi}\right)\right)\right) \]
      3. *-commutative64.4%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(0.005555555555555556 \cdot angle\right)} \cdot \pi\right)\right)\right) \]
      4. *-commutative64.4%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\pi \cdot \left(0.005555555555555556 \cdot angle\right)}\right)\right)\right) \]
    12. Simplified64.4%

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

    if -5e5 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (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. Add Preprocessing
    3. Step-by-step derivation
      1. add-exp-log34.3%

        \[\leadsto \color{blue}{e^{\log \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. *-commutative34.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt70.0%

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. *-commutative71.2%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right) \cdot \pi}}\right)}^{3}\right) \]
      6. associate-*l*71.4%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}}\right)}^{3}\right) \]
    10. Applied egg-rr71.4%

      \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right)} \]
    11. Step-by-step derivation
      1. rem-cube-cbrt71.5%

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \]
      6. add-sqr-sqrt70.3%

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

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

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

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

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

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

Alternative 3: 63.8% accurate, 0.7× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ t_1 := \left(b\_m - a\right) \cdot \left(\left(2 \cdot \left(b\_m + a\right)\right) \cdot \sin t\_0\right)\\ \mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -500000:\\ \;\;\;\;t\_1 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \log \left(e^{\cos t\_0}\right)\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
 :precision binary64
 (let* ((t_0 (* 0.005555555555555556 (* angle PI)))
        (t_1 (* (- b_m a) (* (* 2.0 (+ b_m a)) (sin t_0)))))
   (if (<= (- (pow b_m 2.0) (pow a 2.0)) -500000.0)
     (* t_1 (cos (expm1 (log1p (* PI (* 0.005555555555555556 angle))))))
     (* t_1 (log (exp (cos t_0)))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
	double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
	double t_1 = (b_m - a) * ((2.0 * (b_m + a)) * sin(t_0));
	double tmp;
	if ((pow(b_m, 2.0) - pow(a, 2.0)) <= -500000.0) {
		tmp = t_1 * cos(expm1(log1p((((double) M_PI) * (0.005555555555555556 * angle)))));
	} else {
		tmp = t_1 * log(exp(cos(t_0)));
	}
	return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
	double t_0 = 0.005555555555555556 * (angle * Math.PI);
	double t_1 = (b_m - a) * ((2.0 * (b_m + a)) * Math.sin(t_0));
	double tmp;
	if ((Math.pow(b_m, 2.0) - Math.pow(a, 2.0)) <= -500000.0) {
		tmp = t_1 * Math.cos(Math.expm1(Math.log1p((Math.PI * (0.005555555555555556 * angle)))));
	} else {
		tmp = t_1 * Math.log(Math.exp(Math.cos(t_0)));
	}
	return tmp;
}
b_m = math.fabs(b)
def code(a, b_m, angle):
	t_0 = 0.005555555555555556 * (angle * math.pi)
	t_1 = (b_m - a) * ((2.0 * (b_m + a)) * math.sin(t_0))
	tmp = 0
	if (math.pow(b_m, 2.0) - math.pow(a, 2.0)) <= -500000.0:
		tmp = t_1 * math.cos(math.expm1(math.log1p((math.pi * (0.005555555555555556 * angle)))))
	else:
		tmp = t_1 * math.log(math.exp(math.cos(t_0)))
	return tmp
b_m = abs(b)
function code(a, b_m, angle)
	t_0 = Float64(0.005555555555555556 * Float64(angle * pi))
	t_1 = Float64(Float64(b_m - a) * Float64(Float64(2.0 * Float64(b_m + a)) * sin(t_0)))
	tmp = 0.0
	if (Float64((b_m ^ 2.0) - (a ^ 2.0)) <= -500000.0)
		tmp = Float64(t_1 * cos(expm1(log1p(Float64(pi * Float64(0.005555555555555556 * angle))))));
	else
		tmp = Float64(t_1 * log(exp(cos(t_0))));
	end
	return tmp
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -500000.0], N[(t$95$1 * N[Cos[N[(Exp[N[Log[1 + N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Log[N[Exp[N[Cos[t$95$0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|

\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \left(b\_m - a\right) \cdot \left(\left(2 \cdot \left(b\_m + a\right)\right) \cdot \sin t\_0\right)\\
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -500000:\\
\;\;\;\;t\_1 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \log \left(e^{\cos t\_0}\right)\\


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

    1. Initial program 48.0%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative19.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. expm1-log1p-u64.4%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)} \]
      4. expm1-undefine63.2%

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot 0.005555555555555556\right) \cdot \pi}\right)} - 1\right) \]
      6. associate-*l*61.9%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(e^{\mathsf{log1p}\left(\color{blue}{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)} - 1\right) \]
    10. Applied egg-rr61.9%

      \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)} - 1\right)} \]
    11. Step-by-step derivation
      1. expm1-define63.2%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)} \]
      2. associate-*r*64.4%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(angle \cdot 0.005555555555555556\right) \cdot \pi}\right)\right)\right) \]
      3. *-commutative64.4%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(0.005555555555555556 \cdot angle\right)} \cdot \pi\right)\right)\right) \]
      4. *-commutative64.4%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\pi \cdot \left(0.005555555555555556 \cdot angle\right)}\right)\right)\right) \]
    12. Simplified64.4%

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

    if -5e5 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (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. Add Preprocessing
    3. Step-by-step derivation
      1. add-exp-log34.3%

        \[\leadsto \color{blue}{e^{\log \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. *-commutative34.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)\right) \]
      3. add-cube-cbrt70.0%

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. *-commutative71.2%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right) \cdot \pi}}\right)}^{3}\right) \]
      6. associate-*l*71.4%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}}\right)}^{3}\right) \]
    10. Applied egg-rr71.4%

      \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right)} \]
    11. Step-by-step derivation
      1. add-log-exp71.4%

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \log \left(e^{\cos \color{blue}{\left(\left(0.005555555555555556 \cdot \pi\right) \cdot angle\right)}}\right) \]
      4. associate-*l*73.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq -500000:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(\left(2 \cdot \left(b + a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(\left(2 \cdot \left(b + a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \log \left(e^{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 63.8% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 47.5%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative20.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)} \]
      4. expm1-undefine64.2%

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot 0.005555555555555556\right) \cdot \pi}\right)} - 1\right) \]
      6. associate-*l*62.8%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(e^{\mathsf{log1p}\left(\color{blue}{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)} - 1\right) \]
    10. Applied egg-rr62.8%

      \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)} - 1\right)} \]
    11. Step-by-step derivation
      1. expm1-define64.2%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)} \]
      2. associate-*r*65.6%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(angle \cdot 0.005555555555555556\right) \cdot \pi}\right)\right)\right) \]
      3. *-commutative65.6%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(0.005555555555555556 \cdot angle\right)} \cdot \pi\right)\right)\right) \]
      4. *-commutative65.6%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\pi \cdot \left(0.005555555555555556 \cdot angle\right)}\right)\right)\right) \]
    12. Simplified65.6%

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

    if -5.0000000000000001e114 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 59.4%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative33.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 61.1% accurate, 0.8× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \left(b\_m - a\right) \cdot \left(\left(2 \cdot \left(b\_m + a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\ \mathbf{if}\;b\_m \leq 1.55 \cdot 10^{+148}:\\ \;\;\;\;t\_0 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \cos \left(\frac{angle}{180} \cdot {\left(\sqrt[3]{{\pi}^{1.5}}\right)}^{2}\right)\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
 :precision binary64
 (let* ((t_0
         (*
          (- b_m a)
          (* (* 2.0 (+ b_m a)) (sin (* 0.005555555555555556 (* angle PI)))))))
   (if (<= b_m 1.55e+148)
     (* t_0 (cos (expm1 (log1p (* PI (* 0.005555555555555556 angle))))))
     (* t_0 (cos (* (/ angle 180.0) (pow (cbrt (pow PI 1.5)) 2.0)))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
	double t_0 = (b_m - a) * ((2.0 * (b_m + a)) * sin((0.005555555555555556 * (angle * ((double) M_PI)))));
	double tmp;
	if (b_m <= 1.55e+148) {
		tmp = t_0 * cos(expm1(log1p((((double) M_PI) * (0.005555555555555556 * angle)))));
	} else {
		tmp = t_0 * cos(((angle / 180.0) * pow(cbrt(pow(((double) M_PI), 1.5)), 2.0)));
	}
	return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
	double t_0 = (b_m - a) * ((2.0 * (b_m + a)) * Math.sin((0.005555555555555556 * (angle * Math.PI))));
	double tmp;
	if (b_m <= 1.55e+148) {
		tmp = t_0 * Math.cos(Math.expm1(Math.log1p((Math.PI * (0.005555555555555556 * angle)))));
	} else {
		tmp = t_0 * Math.cos(((angle / 180.0) * Math.pow(Math.cbrt(Math.pow(Math.PI, 1.5)), 2.0)));
	}
	return tmp;
}
b_m = abs(b)
function code(a, b_m, angle)
	t_0 = Float64(Float64(b_m - a) * Float64(Float64(2.0 * Float64(b_m + a)) * sin(Float64(0.005555555555555556 * Float64(angle * pi)))))
	tmp = 0.0
	if (b_m <= 1.55e+148)
		tmp = Float64(t_0 * cos(expm1(log1p(Float64(pi * Float64(0.005555555555555556 * angle))))));
	else
		tmp = Float64(t_0 * cos(Float64(Float64(angle / 180.0) * (cbrt((pi ^ 1.5)) ^ 2.0))));
	end
	return tmp
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(2.0 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 1.55e+148], N[(t$95$0 * N[Cos[N[(Exp[N[Log[1 + N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * N[Power[N[Power[N[Power[Pi, 1.5], $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|

\\
\begin{array}{l}
t_0 := \left(b\_m - a\right) \cdot \left(\left(2 \cdot \left(b\_m + a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\mathbf{if}\;b\_m \leq 1.55 \cdot 10^{+148}:\\
\;\;\;\;t\_0 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(\frac{angle}{180} \cdot {\left(\sqrt[3]{{\pi}^{1.5}}\right)}^{2}\right)\\


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

    1. Initial program 58.0%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative31.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)} \]
      4. expm1-undefine60.7%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left(e^{\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)} - 1\right)} \]
      5. *-commutative60.7%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(e^{\mathsf{log1p}\left(\color{blue}{\left(angle \cdot 0.005555555555555556\right) \cdot \pi}\right)} - 1\right) \]
      6. associate-*l*60.3%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(e^{\mathsf{log1p}\left(\color{blue}{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)} - 1\right) \]
    10. Applied egg-rr60.3%

      \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)} - 1\right)} \]
    11. Step-by-step derivation
      1. expm1-define60.7%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)} \]
      2. associate-*r*61.2%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(angle \cdot 0.005555555555555556\right) \cdot \pi}\right)\right)\right) \]
      3. *-commutative61.2%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(0.005555555555555556 \cdot angle\right)} \cdot \pi\right)\right)\right) \]
      4. *-commutative61.2%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\pi \cdot \left(0.005555555555555556 \cdot angle\right)}\right)\right)\right) \]
    12. Simplified61.2%

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

    if 1.54999999999999988e148 < b

    1. Initial program 41.4%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative13.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right) \]
    11. Step-by-step derivation
      1. add-cbrt-cube79.6%

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\color{blue}{\left({\left(\left(\sqrt{\pi} \cdot \sqrt{\pi}\right) \cdot \sqrt{\pi}\right)}^{0.3333333333333333}\right)}}^{2} \cdot \frac{angle}{180}\right) \]
      3. add-sqr-sqrt79.6%

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\left({\left(\color{blue}{{\pi}^{1}} \cdot \sqrt{\pi}\right)}^{0.3333333333333333}\right)}^{2} \cdot \frac{angle}{180}\right) \]
      5. pow1/279.6%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\left({\left({\pi}^{1} \cdot \color{blue}{{\pi}^{0.5}}\right)}^{0.3333333333333333}\right)}^{2} \cdot \frac{angle}{180}\right) \]
      6. pow-prod-up79.6%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\left({\color{blue}{\left({\pi}^{\left(1 + 0.5\right)}\right)}}^{0.3333333333333333}\right)}^{2} \cdot \frac{angle}{180}\right) \]
      7. metadata-eval79.6%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\left({\left({\pi}^{\color{blue}{1.5}}\right)}^{0.3333333333333333}\right)}^{2} \cdot \frac{angle}{180}\right) \]
    12. Applied egg-rr79.6%

      \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\color{blue}{\left({\left({\pi}^{1.5}\right)}^{0.3333333333333333}\right)}}^{2} \cdot \frac{angle}{180}\right) \]
    13. Step-by-step derivation
      1. unpow1/389.6%

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

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

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

Alternative 6: 66.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 47.5%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative19.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999984e134 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 59.2%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative33.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 66.4% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 43.3%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative22.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 59.4%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative31.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)} \]
      5. *-commutative69.3%

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\left(angle \cdot 0.005555555555555556\right) \cdot \pi}}\right)}^{3}\right) \]
      6. associate-*l*69.6%

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

      \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \color{blue}{\left({\left(\sqrt[3]{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{3}\right)} \]
    11. Step-by-step derivation
      1. rem-cube-cbrt69.7%

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\frac{1}{\frac{180}{angle}}}\right) \]
      7. un-div-inv69.9%

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

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

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

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

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

Alternative 8: 66.9% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 42.5%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative21.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000003e299 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (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. Add Preprocessing
    3. Step-by-step derivation
      1. add-exp-log31.8%

        \[\leadsto \color{blue}{e^{\log \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. *-commutative31.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)} \cdot 1 \]
      3. add-sqr-sqrt40.9%

        \[\leadsto \left(\color{blue}{\left(\sqrt{2 \cdot \left({b}^{2} - {a}^{2}\right)} \cdot \sqrt{2 \cdot \left({b}^{2} - {a}^{2}\right)}\right)} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      4. add-sqr-sqrt55.5%

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

        \[\leadsto \left(\left(2 \cdot \left(\color{blue}{b \cdot b} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      6. unpow255.5%

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      7. difference-of-squares58.0%

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

        \[\leadsto \left(\color{blue}{\left(\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      9. associate-*l*64.9%

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

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

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

Alternative 9: 64.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 56.6%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative36.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)} \cdot 1 \]
      3. add-sqr-sqrt18.8%

        \[\leadsto \left(\color{blue}{\left(\sqrt{2 \cdot \left({b}^{2} - {a}^{2}\right)} \cdot \sqrt{2 \cdot \left({b}^{2} - {a}^{2}\right)}\right)} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      4. add-sqr-sqrt61.8%

        \[\leadsto \left(\color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      5. unpow261.8%

        \[\leadsto \left(\left(2 \cdot \left(\color{blue}{b \cdot b} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      6. unpow261.8%

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      7. difference-of-squares61.8%

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

        \[\leadsto \left(\color{blue}{\left(\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      9. associate-*l*70.2%

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

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

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

    1. Initial program 55.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 66.0% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 57.1%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative40.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)} \cdot 1 \]
      3. add-sqr-sqrt24.2%

        \[\leadsto \left(\color{blue}{\left(\sqrt{2 \cdot \left({b}^{2} - {a}^{2}\right)} \cdot \sqrt{2 \cdot \left({b}^{2} - {a}^{2}\right)}\right)} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      4. add-sqr-sqrt62.9%

        \[\leadsto \left(\color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      5. unpow262.9%

        \[\leadsto \left(\left(2 \cdot \left(\color{blue}{b \cdot b} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      6. unpow262.9%

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      7. difference-of-squares62.9%

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

        \[\leadsto \left(\color{blue}{\left(\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      9. associate-*l*71.3%

        \[\leadsto \color{blue}{\left(\left(2 \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)} \cdot 1 \]
    7. Applied egg-rr71.3%

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

    if 4.9999999999999995e-97 < (pow.f64 b #s(literal 2 binary64))

    1. Initial program 55.3%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative21.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(a + b\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\frac{1}{\frac{180}{angle}}}\right) \]
      2. un-div-inv72.9%

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

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

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

Alternative 11: 65.5% accurate, 3.4× speedup?

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

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

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


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

    1. Initial program 63.5%

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

        \[\leadsto \color{blue}{e^{\log \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. *-commutative33.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)} \cdot 1 \]
      3. add-sqr-sqrt36.0%

        \[\leadsto \left(\color{blue}{\left(\sqrt{2 \cdot \left({b}^{2} - {a}^{2}\right)} \cdot \sqrt{2 \cdot \left({b}^{2} - {a}^{2}\right)}\right)} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      4. add-sqr-sqrt62.7%

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

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

        \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      7. difference-of-squares64.2%

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

        \[\leadsto \left(\color{blue}{\left(\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
      9. associate-*l*76.8%

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

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

    if 1.99999999999999989e58 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 26.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 65.0% accurate, 3.6× speedup?

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

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

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

      \[\leadsto \color{blue}{e^{\log \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. *-commutative29.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 65.4% accurate, 3.6× speedup?

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

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

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

      \[\leadsto \color{blue}{e^{\log \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. *-commutative29.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)} \cdot 1 \]
    3. add-sqr-sqrt32.2%

      \[\leadsto \left(\color{blue}{\left(\sqrt{2 \cdot \left({b}^{2} - {a}^{2}\right)} \cdot \sqrt{2 \cdot \left({b}^{2} - {a}^{2}\right)}\right)} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
    4. add-sqr-sqrt55.9%

      \[\leadsto \left(\color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
    5. unpow255.9%

      \[\leadsto \left(\left(2 \cdot \left(\color{blue}{b \cdot b} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
    6. unpow255.9%

      \[\leadsto \left(\left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
    7. difference-of-squares57.9%

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

      \[\leadsto \left(\color{blue}{\left(\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot 1 \]
    9. associate-*l*68.0%

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

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

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

Alternative 14: 58.1% accurate, 23.3× speedup?

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

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

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


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

    1. Initial program 58.0%

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999e148 < b

    1. Initial program 41.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*41.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 40.0% accurate, 29.9× speedup?

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

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

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


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

    1. Initial program 57.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999949e60 < b

    1. Initial program 50.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*50.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 35.1% accurate, 46.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \color{blue}{\left(\pi \cdot b\right)}\right)\right) \]
  12. Simplified38.5%

    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \color{blue}{\left(\pi \cdot b\right)}\right)\right) \]
  13. Final simplification38.5%

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

Reproduce

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