ab-angle->ABCF B

Percentage Accurate: 53.9% → 61.6%
Time: 26.2s
Alternatives: 12
Speedup: 32.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 53.9% accurate, 1.0× speedup?

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

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

Alternative 1: 61.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\ t_1 := \cos t\_0\\ t_2 := \sin t\_0\\ \mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+276}:\\ \;\;\;\;\mathsf{fma}\left(b, 2 \cdot \left(b \cdot \left(t\_2 \cdot t\_1\right)\right), {a}^{2} \cdot \left(t\_1 \cdot \left(t\_2 \cdot -2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \left(2 \cdot \left(\sin \left(\frac{\sqrt{\pi}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* PI (* angle 0.005555555555555556)))
        (t_1 (cos t_0))
        (t_2 (sin t_0)))
   (if (<= (pow a 2.0) 5e+276)
     (fma b (* 2.0 (* b (* t_2 t_1))) (* (pow a 2.0) (* t_1 (* t_2 -2.0))))
     (*
      (* (- b a) (+ a b))
      (*
       2.0
       (*
        (sin (* (/ (sqrt PI) 180.0) (/ (sqrt PI) (/ 1.0 angle))))
        (cos (* PI (/ angle 180.0)))))))))
double code(double a, double b, double angle) {
	double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
	double t_1 = cos(t_0);
	double t_2 = sin(t_0);
	double tmp;
	if (pow(a, 2.0) <= 5e+276) {
		tmp = fma(b, (2.0 * (b * (t_2 * t_1))), (pow(a, 2.0) * (t_1 * (t_2 * -2.0))));
	} else {
		tmp = ((b - a) * (a + b)) * (2.0 * (sin(((sqrt(((double) M_PI)) / 180.0) * (sqrt(((double) M_PI)) / (1.0 / angle)))) * cos((((double) M_PI) * (angle / 180.0)))));
	}
	return tmp;
}
function code(a, b, angle)
	t_0 = Float64(pi * Float64(angle * 0.005555555555555556))
	t_1 = cos(t_0)
	t_2 = sin(t_0)
	tmp = 0.0
	if ((a ^ 2.0) <= 5e+276)
		tmp = fma(b, Float64(2.0 * Float64(b * Float64(t_2 * t_1))), Float64((a ^ 2.0) * Float64(t_1 * Float64(t_2 * -2.0))));
	else
		tmp = Float64(Float64(Float64(b - a) * Float64(a + b)) * Float64(2.0 * Float64(sin(Float64(Float64(sqrt(pi) / 180.0) * Float64(sqrt(pi) / Float64(1.0 / angle)))) * cos(Float64(pi * Float64(angle / 180.0))))));
	end
	return tmp
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+276], N[(b * N[(2.0 * N[(b * N[(t$95$2 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * N[(t$95$1 * N[(t$95$2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(N[(N[Sqrt[Pi], $MachinePrecision] / 180.0), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] / N[(1.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+276}:\\
\;\;\;\;\mathsf{fma}\left(b, 2 \cdot \left(b \cdot \left(t\_2 \cdot t\_1\right)\right), {a}^{2} \cdot \left(t\_1 \cdot \left(t\_2 \cdot -2\right)\right)\right)\\

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


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

    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. Step-by-step derivation
      1. associate-*l*59.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. *-commutative59.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*59.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. Simplified59.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. unpow259.4%

        \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
      2. unpow259.4%

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares59.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) \]
    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. Step-by-step derivation
      1. add-sqr-sqrt59.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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
      2. pow259.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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
    8. Applied egg-rr59.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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
    9. Taylor expanded in b around 0 65.3%

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

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

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

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

    if 5.00000000000000001e276 < (pow.f64 a #s(literal 2 binary64))

    1. Initial program 34.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. Step-by-step derivation
      1. associate-*l*34.3%

        \[\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. *-commutative34.3%

        \[\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*34.3%

        \[\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. Simplified34.3%

      \[\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. unpow234.3%

        \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
      2. unpow234.3%

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares52.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) \]
    6. Applied egg-rr52.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. Step-by-step derivation
      1. add-sqr-sqrt60.9%

        \[\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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
      2. pow260.9%

        \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
    8. Applied egg-rr67.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 37.8% accurate, 0.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\cos t\_0 \cdot \sin \left({\left(\frac{\frac{180}{angle}}{\pi}\right)}^{-1}\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))) < 2.00000000000000012e136

    1. Initial program 61.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*61.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. *-commutative61.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*61.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. Simplified61.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. unpow261.1%

        \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
      2. unpow261.1%

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares61.1%

        \[\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) \]
    6. Applied egg-rr61.1%

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt64.0%

        \[\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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
      2. pow264.0%

        \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
    8. Applied egg-rr64.0%

      \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
    9. Step-by-step derivation
      1. unpow264.0%

        \[\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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
      2. add-sqr-sqrt61.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 \cos \left(\color{blue}{\pi} \cdot \frac{angle}{180}\right)\right)\right) \]
      3. add-sqr-sqrt29.9%

        \[\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 \cos \color{blue}{\left(\sqrt{\pi \cdot \frac{angle}{180}} \cdot \sqrt{\pi \cdot \frac{angle}{180}}\right)}\right)\right) \]
      4. pow229.9%

        \[\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 \cos \color{blue}{\left({\left(\sqrt{\pi \cdot \frac{angle}{180}}\right)}^{2}\right)}\right)\right) \]
      5. *-commutative29.9%

        \[\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 \cos \left({\left(\sqrt{\color{blue}{\frac{angle}{180} \cdot \pi}}\right)}^{2}\right)\right)\right) \]
      6. div-inv29.9%

        \[\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 \cos \left({\left(\sqrt{\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \pi}\right)}^{2}\right)\right)\right) \]
      7. metadata-eval29.9%

        \[\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 \cos \left({\left(\sqrt{\left(angle \cdot \color{blue}{0.005555555555555556}\right) \cdot \pi}\right)}^{2}\right)\right)\right) \]
      8. associate-*l*30.0%

        \[\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 \cos \left({\left(\sqrt{\color{blue}{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}}\right)}^{2}\right)\right)\right) \]
    10. Applied egg-rr30.0%

      \[\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 \cos \color{blue}{\left({\left(\sqrt{angle \cdot \left(0.005555555555555556 \cdot \pi\right)}\right)}^{2}\right)}\right)\right) \]

    if 2.00000000000000012e136 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 38.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. Step-by-step derivation
      1. associate-*l*38.3%

        \[\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. *-commutative38.3%

        \[\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*38.3%

        \[\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. Simplified38.3%

      \[\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. unpow238.3%

        \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
      2. unpow238.3%

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares51.7%

        \[\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) \]
    6. Applied egg-rr51.7%

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt52.6%

        \[\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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
      2. pow252.6%

        \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
    8. Applied egg-rr62.3%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 61.6% accurate, 0.8× speedup?

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

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

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


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

    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. Step-by-step derivation
      1. associate-*l*59.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. *-commutative59.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*59.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. Simplified59.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. unpow259.4%

        \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
      2. unpow259.4%

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares59.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) \]
    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. Step-by-step derivation
      1. add-sqr-sqrt59.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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
      2. pow259.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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
    8. Applied egg-rr59.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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
    9. Taylor expanded in b around 0 65.3%

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

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

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

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

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

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

    if 5.00000000000000001e276 < (pow.f64 a #s(literal 2 binary64))

    1. Initial program 34.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. Step-by-step derivation
      1. associate-*l*34.3%

        \[\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. *-commutative34.3%

        \[\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*34.3%

        \[\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. Simplified34.3%

      \[\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. unpow234.3%

        \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
      2. unpow234.3%

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares52.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) \]
    6. Applied egg-rr52.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. Step-by-step derivation
      1. add-sqr-sqrt60.9%

        \[\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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
      2. pow260.9%

        \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
    8. Applied egg-rr67.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 57.1% accurate, 1.0× speedup?

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

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

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

      \[\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. *-commutative52.3%

      \[\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*52.3%

      \[\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. Simplified52.3%

    \[\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. unpow252.3%

      \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
    2. unpow252.3%

      \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares57.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) \]
  6. Applied egg-rr57.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. Step-by-step derivation
    1. add-sqr-sqrt59.6%

      \[\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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
    2. pow259.6%

      \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
  8. Applied egg-rr63.1%

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

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

Alternative 5: 57.4% accurate, 1.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \sin \left({\left(\frac{\frac{180}{angle}}{\pi}\right)}^{-1}\right)\right)\right)\\


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

    1. Initial program 58.8%

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

        \[\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.8%

        \[\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.8%

        \[\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.8%

      \[\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.8%

        \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
      2. unpow258.8%

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares64.2%

        \[\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) \]
    6. Applied egg-rr64.2%

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt65.4%

        \[\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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
      2. pow265.4%

        \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
    8. Applied egg-rr64.7%

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

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

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

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

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

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

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

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

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

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

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

    if 2e65 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 25.8%

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

        \[\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. *-commutative25.8%

        \[\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*25.8%

        \[\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. Simplified25.8%

      \[\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. unpow225.8%

        \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
      2. unpow225.8%

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares29.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) \]
    6. Applied egg-rr29.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. Step-by-step derivation
      1. add-sqr-sqrt35.7%

        \[\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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
      2. pow235.7%

        \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
    8. Applied egg-rr56.2%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 57.5% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 58.8%

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

        \[\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.8%

        \[\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.8%

        \[\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.8%

      \[\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.8%

        \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
      2. unpow258.8%

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares64.2%

        \[\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) \]
    6. Applied egg-rr64.2%

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt65.4%

        \[\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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
      2. pow265.4%

        \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
    8. Applied egg-rr64.7%

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

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

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

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

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

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

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

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

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

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

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

    if 2e65 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 25.8%

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

        \[\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. *-commutative25.8%

        \[\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*25.8%

        \[\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. Simplified25.8%

      \[\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. unpow225.8%

        \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
      2. unpow225.8%

        \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares29.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) \]
    6. Applied egg-rr29.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. Step-by-step derivation
      1. add-sqr-sqrt35.7%

        \[\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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
      2. pow235.7%

        \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
    8. Applied egg-rr56.2%

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

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

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

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

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

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

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

Alternative 7: 57.6% accurate, 1.9× speedup?

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

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

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

      \[\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. *-commutative52.3%

      \[\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*52.3%

      \[\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. Simplified52.3%

    \[\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. unpow252.3%

      \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
    2. unpow252.3%

      \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares57.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) \]
  6. Applied egg-rr57.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. Step-by-step derivation
    1. add-sqr-sqrt59.6%

      \[\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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
    2. pow259.6%

      \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
  8. Applied egg-rr63.1%

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

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

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

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

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

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

Alternative 8: 57.5% accurate, 1.9× speedup?

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

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

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

      \[\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. *-commutative52.3%

      \[\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*52.3%

      \[\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. Simplified52.3%

    \[\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. unpow252.3%

      \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
    2. unpow252.3%

      \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares57.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) \]
  6. Applied egg-rr57.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 inf 59.4%

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

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

Alternative 9: 57.6% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (* (* (- b a) (+ a b)) (sin (* PI (* angle 0.011111111111111112)))))
double code(double a, double b, double angle) {
	return ((b - a) * (a + b)) * sin((((double) M_PI) * (angle * 0.011111111111111112)));
}
public static double code(double a, double b, double angle) {
	return ((b - a) * (a + b)) * Math.sin((Math.PI * (angle * 0.011111111111111112)));
}
def code(a, b, angle):
	return ((b - a) * (a + b)) * math.sin((math.pi * (angle * 0.011111111111111112)))
function code(a, b, angle)
	return Float64(Float64(Float64(b - a) * Float64(a + b)) * sin(Float64(pi * Float64(angle * 0.011111111111111112))))
end
function tmp = code(a, b, angle)
	tmp = ((b - a) * (a + b)) * sin((pi * (angle * 0.011111111111111112)));
end
code[a_, b_, angle_] := N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)
\end{array}
Derivation
  1. Initial program 52.3%

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

      \[\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. *-commutative52.3%

      \[\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*52.3%

      \[\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. Simplified52.3%

    \[\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. unpow252.3%

      \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
    2. unpow252.3%

      \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares57.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) \]
  6. Applied egg-rr57.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. Step-by-step derivation
    1. add-sqr-sqrt59.6%

      \[\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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
    2. pow259.6%

      \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
  8. Applied egg-rr63.1%

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

    \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) + \sin 0\right) \cdot 0.5 + \left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) + \sin 0\right) \cdot 0.5\right)} \]
  10. Step-by-step derivation
    1. distribute-lft-out56.7%

      \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) + \sin 0\right) \cdot \left(0.5 + 0.5\right)\right)} \]
    2. sin-056.7%

      \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) + \color{blue}{0}\right) \cdot \left(0.5 + 0.5\right)\right) \]
    3. +-rgt-identity56.7%

      \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\color{blue}{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)} \cdot \left(0.5 + 0.5\right)\right) \]
    4. metadata-eval56.7%

      \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \color{blue}{1}\right) \]
    5. *-rgt-identity56.7%

      \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)} \]
    6. associate-*l*58.6%

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

    \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)} \]
  12. Final simplification58.6%

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

Alternative 10: 57.6% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (* (* (- b a) (+ a b)) (sin (* angle (* PI 0.011111111111111112)))))
double code(double a, double b, double angle) {
	return ((b - a) * (a + b)) * sin((angle * (((double) M_PI) * 0.011111111111111112)));
}
public static double code(double a, double b, double angle) {
	return ((b - a) * (a + b)) * Math.sin((angle * (Math.PI * 0.011111111111111112)));
}
def code(a, b, angle):
	return ((b - a) * (a + b)) * math.sin((angle * (math.pi * 0.011111111111111112)))
function code(a, b, angle)
	return Float64(Float64(Float64(b - a) * Float64(a + b)) * sin(Float64(angle * Float64(pi * 0.011111111111111112))))
end
function tmp = code(a, b, angle)
	tmp = ((b - a) * (a + b)) * sin((angle * (pi * 0.011111111111111112)));
end
code[a_, b_, angle_] := N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)
\end{array}
Derivation
  1. Initial program 52.3%

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

      \[\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. *-commutative52.3%

      \[\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*52.3%

      \[\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. Simplified52.3%

    \[\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. unpow252.3%

      \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
    2. unpow252.3%

      \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares57.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) \]
  6. Applied egg-rr57.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. Step-by-step derivation
    1. add-sqr-sqrt59.6%

      \[\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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
    2. pow259.6%

      \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
  8. Applied egg-rr63.1%

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

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

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

      \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \log \left(1 + \mathsf{expm1}\left(\color{blue}{\frac{\sin \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle}{180} - \pi \cdot \frac{angle}{180}\right) + \sin \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle}{180} + \pi \cdot \frac{angle}{180}\right)}{2}}\right)\right)\right) \]
    4. div-inv27.8%

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

    \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \color{blue}{\log \left(1 + \mathsf{expm1}\left(\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) + \sin 0\right) \cdot 0.5\right)\right)}\right) \]
  11. Taylor expanded in angle around inf 56.7%

    \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)} \]
  12. Step-by-step derivation
    1. associate-*r*58.6%

      \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \pi\right)} \]
    2. *-commutative58.6%

      \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)} \]
    3. *-commutative58.6%

      \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \color{blue}{\left(angle \cdot 0.011111111111111112\right)}\right) \]
    4. associate-*r*56.7%

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

      \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.011111111111111112\right) \]
    6. associate-*r*57.8%

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

    \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)} \]
  14. Final simplification57.8%

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

Alternative 11: 54.0% accurate, 32.2× speedup?

\[\begin{array}{l} \\ \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right) \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (* (* (- b a) (+ a b)) (* (* PI angle) 0.011111111111111112)))
double code(double a, double b, double angle) {
	return ((b - a) * (a + b)) * ((((double) M_PI) * angle) * 0.011111111111111112);
}
public static double code(double a, double b, double angle) {
	return ((b - a) * (a + b)) * ((Math.PI * angle) * 0.011111111111111112);
}
def code(a, b, angle):
	return ((b - a) * (a + b)) * ((math.pi * angle) * 0.011111111111111112)
function code(a, b, angle)
	return Float64(Float64(Float64(b - a) * Float64(a + b)) * Float64(Float64(pi * angle) * 0.011111111111111112))
end
function tmp = code(a, b, angle)
	tmp = ((b - a) * (a + b)) * ((pi * angle) * 0.011111111111111112);
end
code[a_, b_, angle_] := N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)
\end{array}
Derivation
  1. Initial program 52.3%

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

      \[\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. *-commutative52.3%

      \[\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*52.3%

      \[\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. Simplified52.3%

    \[\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. unpow252.3%

      \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
    2. unpow252.3%

      \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares57.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) \]
  6. Applied egg-rr57.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. Step-by-step derivation
    1. add-sqr-sqrt59.6%

      \[\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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
    2. pow259.6%

      \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
  8. Applied egg-rr63.1%

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

    \[\leadsto \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)} \]
  10. Final simplification54.8%

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

Alternative 12: 54.0% accurate, 32.2× speedup?

\[\begin{array}{l} \\ 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right)\right) \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (* 0.011111111111111112 (* angle (* PI (* (- b a) (+ a b))))))
double code(double a, double b, double angle) {
	return 0.011111111111111112 * (angle * (((double) M_PI) * ((b - a) * (a + b))));
}
public static double code(double a, double b, double angle) {
	return 0.011111111111111112 * (angle * (Math.PI * ((b - a) * (a + b))));
}
def code(a, b, angle):
	return 0.011111111111111112 * (angle * (math.pi * ((b - a) * (a + b))))
function code(a, b, angle)
	return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b - a) * Float64(a + b)))))
end
function tmp = code(a, b, angle)
	tmp = 0.011111111111111112 * (angle * (pi * ((b - a) * (a + b))));
end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 52.3%

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

      \[\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. *-commutative52.3%

      \[\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*52.3%

      \[\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. Simplified52.3%

    \[\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. unpow252.3%

      \[\leadsto \left(\color{blue}{b \cdot b} - {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) \]
    2. unpow252.3%

      \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\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. difference-of-squares57.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) \]
  6. Applied egg-rr57.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. Step-by-step derivation
    1. add-sqr-sqrt59.6%

      \[\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 \cos \left(\color{blue}{\left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \cdot \frac{angle}{180}\right)\right)\right) \]
    2. pow259.6%

      \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
  8. Applied egg-rr59.6%

    \[\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 \cos \left(\color{blue}{{\left(\sqrt{\pi}\right)}^{2}} \cdot \frac{angle}{180}\right)\right)\right) \]
  9. Taylor expanded in angle around 0 54.8%

    \[\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)} \]
  10. Final simplification54.8%

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

Reproduce

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