ab-angle->ABCF B

Percentage Accurate: 53.3% → 57.8%
Time: 26.5s
Alternatives: 11
Speedup: 5.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 53.3% accurate, 1.0× speedup?

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

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

Alternative 1: 57.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt[3]{\cos \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)}\\ t_1 := \left(b + a\right) \cdot \left(a - b\right)\\ \mathbf{if}\;{b}^{2} - {a}^{2} \leq -\infty:\\ \;\;\;\;\left(2 \cdot \sin \left(angle \cdot \frac{\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}}{-180}\right)\right) \cdot \left(\cos \left(\frac{angle \cdot \sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot t_1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right) \cdot \left(t_1 \cdot \left(t_0 \cdot {t_0}^{2}\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (cbrt (cos (* PI (* angle -0.005555555555555556)))))
        (t_1 (* (+ b a) (- a b))))
   (if (<= (- (pow b 2.0) (pow a 2.0)) (- INFINITY))
     (*
      (* 2.0 (sin (* angle (/ (* (cbrt PI) (pow (cbrt PI) 2.0)) -180.0))))
      (* (cos (/ (* angle (cbrt (pow PI 3.0))) -180.0)) t_1))
     (* (* 2.0 (sin (* angle (/ PI -180.0)))) (* t_1 (* t_0 (pow t_0 2.0)))))))
double code(double a, double b, double angle) {
	double t_0 = cbrt(cos((((double) M_PI) * (angle * -0.005555555555555556))));
	double t_1 = (b + a) * (a - b);
	double tmp;
	if ((pow(b, 2.0) - pow(a, 2.0)) <= -((double) INFINITY)) {
		tmp = (2.0 * sin((angle * ((cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0)) / -180.0)))) * (cos(((angle * cbrt(pow(((double) M_PI), 3.0))) / -180.0)) * t_1);
	} else {
		tmp = (2.0 * sin((angle * (((double) M_PI) / -180.0)))) * (t_1 * (t_0 * pow(t_0, 2.0)));
	}
	return tmp;
}
public static double code(double a, double b, double angle) {
	double t_0 = Math.cbrt(Math.cos((Math.PI * (angle * -0.005555555555555556))));
	double t_1 = (b + a) * (a - b);
	double tmp;
	if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -Double.POSITIVE_INFINITY) {
		tmp = (2.0 * Math.sin((angle * ((Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0)) / -180.0)))) * (Math.cos(((angle * Math.cbrt(Math.pow(Math.PI, 3.0))) / -180.0)) * t_1);
	} else {
		tmp = (2.0 * Math.sin((angle * (Math.PI / -180.0)))) * (t_1 * (t_0 * Math.pow(t_0, 2.0)));
	}
	return tmp;
}
function code(a, b, angle)
	t_0 = cbrt(cos(Float64(pi * Float64(angle * -0.005555555555555556))))
	t_1 = Float64(Float64(b + a) * Float64(a - b))
	tmp = 0.0
	if (Float64((b ^ 2.0) - (a ^ 2.0)) <= Float64(-Inf))
		tmp = Float64(Float64(2.0 * sin(Float64(angle * Float64(Float64(cbrt(pi) * (cbrt(pi) ^ 2.0)) / -180.0)))) * Float64(cos(Float64(Float64(angle * cbrt((pi ^ 3.0))) / -180.0)) * t_1));
	else
		tmp = Float64(Float64(2.0 * sin(Float64(angle * Float64(pi / -180.0)))) * Float64(t_1 * Float64(t_0 * (t_0 ^ 2.0))));
	end
	return tmp
end
code[a_, b_, angle_] := Block[{t$95$0 = N[Power[N[Cos[N[(Pi * N[(angle * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $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], (-Infinity)], N[(N[(2.0 * N[Sin[N[(angle * N[(N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[N[(N[(angle * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sin[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(t$95$0 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right) \cdot \left(t_1 \cdot \left(t_0 \cdot {t_0}^{2}\right)\right)\\


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

    1. Initial program 52.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (pow.f64 b 2) (pow.f64 a 2))

    1. Initial program 49.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 56.2% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < -2.0000000000000001e-286

    1. Initial program 53.6%

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

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

      \[\leadsto \color{blue}{\frac{\sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left({a}^{4} - {b}^{4}\right)}{\mathsf{fma}\left(b, b, {a}^{2}\right)}} \]
    4. Simplified15.8%

      \[\leadsto \color{blue}{\frac{{b}^{4} - {a}^{4}}{\mathsf{fma}\left(a, a, {b}^{2}\right)} \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)} \]
    5. Taylor expanded in b around 0 53.3%

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

        \[\leadsto \color{blue}{-{a}^{2} \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)} \]
      2. *-commutative53.3%

        \[\leadsto -{a}^{2} \cdot \sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)} \]
      3. associate-*r*54.9%

        \[\leadsto -{a}^{2} \cdot \sin \color{blue}{\left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)} \]
      4. distribute-rgt-neg-in54.9%

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

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

    if -2.0000000000000001e-286 < (-.f64 (pow.f64 b 2) (pow.f64 a 2))

    1. Initial program 46.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. Simplified50.0%

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

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

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

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

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

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

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

Alternative 3: 57.3% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_0 := -0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
2 \cdot \left(\cos t_0 \cdot \left(\left(\left(b + a\right) \cdot \left(a - b\right)\right) \cdot \sin t_0\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 49.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. Simplified52.2%

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

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

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

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

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

    \[\leadsto \color{blue}{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(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)} \]
  6. Final simplification55.0%

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

Alternative 4: 57.5% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot -0.005555555555555556\right)\\
2 \cdot \left(\sin t_0 \cdot \left(\left(a - b\right) \cdot \left(\left(b + a\right) \cdot \cos t_0\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 49.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. Simplified52.2%

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

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

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

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

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

    \[\leadsto \color{blue}{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(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)} \]
  6. Step-by-step derivation
    1. associate-*r*55.0%

      \[\leadsto 2 \cdot \color{blue}{\left(\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) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)} \]
    2. *-commutative55.0%

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

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

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

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

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

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

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

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

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

Alternative 5: 57.6% accurate, 1.5× speedup?

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

\\
\left(2 \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(a - b\right)\right) \cdot \cos \left(\frac{angle \cdot \pi}{-180}\right)\right)
\end{array}
Derivation
  1. Initial program 49.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. Simplified52.2%

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

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

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

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

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

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

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

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

Alternative 6: 54.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 3 \cdot 10^{+156}:\\ \;\;\;\;2 \cdot \left(\frac{{b}^{2} - {a}^{2}}{2} \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{+199}:\\ \;\;\;\;{a}^{2} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} \cdot \left(-\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (if (<= a 3e+156)
   (*
    2.0
    (*
     (/ (- (pow b 2.0) (pow a 2.0)) 2.0)
     (sin (* (* angle PI) 0.011111111111111112))))
   (if (<= a 1.85e+199)
     (* (pow a 2.0) (sin (* PI (* angle 0.011111111111111112))))
     (* (pow a 2.0) (- (sin (* angle (* PI 0.011111111111111112))))))))
double code(double a, double b, double angle) {
	double tmp;
	if (a <= 3e+156) {
		tmp = 2.0 * (((pow(b, 2.0) - pow(a, 2.0)) / 2.0) * sin(((angle * ((double) M_PI)) * 0.011111111111111112)));
	} else if (a <= 1.85e+199) {
		tmp = pow(a, 2.0) * sin((((double) M_PI) * (angle * 0.011111111111111112)));
	} else {
		tmp = pow(a, 2.0) * -sin((angle * (((double) M_PI) * 0.011111111111111112)));
	}
	return tmp;
}
public static double code(double a, double b, double angle) {
	double tmp;
	if (a <= 3e+156) {
		tmp = 2.0 * (((Math.pow(b, 2.0) - Math.pow(a, 2.0)) / 2.0) * Math.sin(((angle * Math.PI) * 0.011111111111111112)));
	} else if (a <= 1.85e+199) {
		tmp = Math.pow(a, 2.0) * Math.sin((Math.PI * (angle * 0.011111111111111112)));
	} else {
		tmp = Math.pow(a, 2.0) * -Math.sin((angle * (Math.PI * 0.011111111111111112)));
	}
	return tmp;
}
def code(a, b, angle):
	tmp = 0
	if a <= 3e+156:
		tmp = 2.0 * (((math.pow(b, 2.0) - math.pow(a, 2.0)) / 2.0) * math.sin(((angle * math.pi) * 0.011111111111111112)))
	elif a <= 1.85e+199:
		tmp = math.pow(a, 2.0) * math.sin((math.pi * (angle * 0.011111111111111112)))
	else:
		tmp = math.pow(a, 2.0) * -math.sin((angle * (math.pi * 0.011111111111111112)))
	return tmp
function code(a, b, angle)
	tmp = 0.0
	if (a <= 3e+156)
		tmp = Float64(2.0 * Float64(Float64(Float64((b ^ 2.0) - (a ^ 2.0)) / 2.0) * sin(Float64(Float64(angle * pi) * 0.011111111111111112))));
	elseif (a <= 1.85e+199)
		tmp = Float64((a ^ 2.0) * sin(Float64(pi * Float64(angle * 0.011111111111111112))));
	else
		tmp = Float64((a ^ 2.0) * Float64(-sin(Float64(angle * Float64(pi * 0.011111111111111112)))));
	end
	return tmp
end
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if (a <= 3e+156)
		tmp = 2.0 * ((((b ^ 2.0) - (a ^ 2.0)) / 2.0) * sin(((angle * pi) * 0.011111111111111112)));
	elseif (a <= 1.85e+199)
		tmp = (a ^ 2.0) * sin((pi * (angle * 0.011111111111111112)));
	else
		tmp = (a ^ 2.0) * -sin((angle * (pi * 0.011111111111111112)));
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_] := If[LessEqual[a, 3e+156], N[(2.0 * N[(N[(N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] * N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.85e+199], N[(N[Power[a, 2.0], $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] * (-N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 3 \cdot 10^{+156}:\\
\;\;\;\;2 \cdot \left(\frac{{b}^{2} - {a}^{2}}{2} \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\\

\mathbf{elif}\;a \leq 1.85 \cdot 10^{+199}:\\
\;\;\;\;{a}^{2} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\

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


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

    1. Initial program 50.1%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. associate-*l*50.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. associate-*l*50.1%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\frac{\left({b}^{2} - {a}^{2}\right) \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right) - \pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) + \sin \left(\mathsf{fma}\left(\pi, angle \cdot 0.005555555555555556, \pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}{2}} \]
    5. Step-by-step derivation
      1. associate-/l*51.8%

        \[\leadsto 2 \cdot \color{blue}{\frac{{b}^{2} - {a}^{2}}{\frac{2}{\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right) - \pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) + \sin \left(\mathsf{fma}\left(\pi, angle \cdot 0.005555555555555556, \pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}}} \]
      2. associate-/r/51.8%

        \[\leadsto 2 \cdot \color{blue}{\left(\frac{{b}^{2} - {a}^{2}}{2} \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right) - \pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) + \sin \left(\mathsf{fma}\left(\pi, angle \cdot 0.005555555555555556, \pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)} \]
      3. +-commutative51.8%

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

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

    if 3e156 < a < 1.85000000000000011e199

    1. Initial program 11.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. Simplified11.8%

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

      \[\leadsto \color{blue}{\frac{\sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left({a}^{4} - {b}^{4}\right)}{\mathsf{fma}\left(b, b, {a}^{2}\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*0.0%

        \[\leadsto \color{blue}{\frac{\sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}{\frac{\mathsf{fma}\left(b, b, {a}^{2}\right)}{{a}^{4} - {b}^{4}}}} \]
      2. count-20.0%

        \[\leadsto \frac{\sin \color{blue}{\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right) + \pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}}{\frac{\mathsf{fma}\left(b, b, {a}^{2}\right)}{{a}^{4} - {b}^{4}}} \]
      3. *-commutative0.0%

        \[\leadsto \frac{\sin \left(\color{blue}{\left(angle \cdot 0.005555555555555556\right) \cdot \pi} + \pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}{\frac{\mathsf{fma}\left(b, b, {a}^{2}\right)}{{a}^{4} - {b}^{4}}} \]
      4. *-commutative0.0%

        \[\leadsto \frac{\sin \left(\color{blue}{\left(0.005555555555555556 \cdot angle\right)} \cdot \pi + \pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}{\frac{\mathsf{fma}\left(b, b, {a}^{2}\right)}{{a}^{4} - {b}^{4}}} \]
      5. associate-*r*0.0%

        \[\leadsto \frac{\sin \left(\color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)} + \pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}{\frac{\mathsf{fma}\left(b, b, {a}^{2}\right)}{{a}^{4} - {b}^{4}}} \]
      6. *-commutative0.0%

        \[\leadsto \frac{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right) + \color{blue}{\left(angle \cdot 0.005555555555555556\right) \cdot \pi}\right)}{\frac{\mathsf{fma}\left(b, b, {a}^{2}\right)}{{a}^{4} - {b}^{4}}} \]
      7. *-commutative0.0%

        \[\leadsto \frac{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right) + \color{blue}{\left(0.005555555555555556 \cdot angle\right)} \cdot \pi\right)}{\frac{\mathsf{fma}\left(b, b, {a}^{2}\right)}{{a}^{4} - {b}^{4}}} \]
      8. associate-*r*0.0%

        \[\leadsto \frac{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right) + \color{blue}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}\right)}{\frac{\mathsf{fma}\left(b, b, {a}^{2}\right)}{{a}^{4} - {b}^{4}}} \]
      9. distribute-rgt-out0.0%

        \[\leadsto \frac{\sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(0.005555555555555556 + 0.005555555555555556\right)\right)}}{\frac{\mathsf{fma}\left(b, b, {a}^{2}\right)}{{a}^{4} - {b}^{4}}} \]
      10. metadata-eval0.0%

        \[\leadsto \frac{\sin \left(\left(angle \cdot \pi\right) \cdot \color{blue}{0.011111111111111112}\right)}{\frac{\mathsf{fma}\left(b, b, {a}^{2}\right)}{{a}^{4} - {b}^{4}}} \]
      11. fma-udef0.0%

        \[\leadsto \frac{\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)}{\frac{\color{blue}{b \cdot b + {a}^{2}}}{{a}^{4} - {b}^{4}}} \]
      12. unpow20.0%

        \[\leadsto \frac{\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)}{\frac{\color{blue}{{b}^{2}} + {a}^{2}}{{a}^{4} - {b}^{4}}} \]
      13. +-commutative0.0%

        \[\leadsto \frac{\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)}{\frac{\color{blue}{{a}^{2} + {b}^{2}}}{{a}^{4} - {b}^{4}}} \]
      14. unpow20.0%

        \[\leadsto \frac{\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)}{\frac{\color{blue}{a \cdot a} + {b}^{2}}{{a}^{4} - {b}^{4}}} \]
      15. fma-udef0.0%

        \[\leadsto \frac{\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)}{\frac{\color{blue}{\mathsf{fma}\left(a, a, {b}^{2}\right)}}{{a}^{4} - {b}^{4}}} \]
    5. Simplified0.0%

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

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

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

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

        \[\leadsto {a}^{2} \cdot \sin \left(\pi \cdot \color{blue}{\left(angle \cdot 0.011111111111111112\right)}\right) \]
    8. Simplified50.1%

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

    if 1.85000000000000011e199 < a

    1. Initial program 64.1%

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

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

      \[\leadsto \color{blue}{\frac{\sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left({a}^{4} - {b}^{4}\right)}{\mathsf{fma}\left(b, b, {a}^{2}\right)}} \]
    4. Simplified0.0%

      \[\leadsto \color{blue}{\frac{{b}^{4} - {a}^{4}}{\mathsf{fma}\left(a, a, {b}^{2}\right)} \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)} \]
    5. Taylor expanded in b around 0 68.7%

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

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

        \[\leadsto -{a}^{2} \cdot \sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)} \]
      3. associate-*r*73.2%

        \[\leadsto -{a}^{2} \cdot \sin \color{blue}{\left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)} \]
      4. distribute-rgt-neg-in73.2%

        \[\leadsto \color{blue}{{a}^{2} \cdot \left(-\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)} \]
    7. Simplified73.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 3 \cdot 10^{+156}:\\ \;\;\;\;2 \cdot \left(\frac{{b}^{2} - {a}^{2}}{2} \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{+199}:\\ \;\;\;\;{a}^{2} \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{a}^{2} \cdot \left(-\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\ \end{array} \]

Alternative 7: 54.5% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(b + a\right) \cdot \left(a - b\right)\\ \mathbf{if}\;angle \leq -1.9 \cdot 10^{+38} \lor \neg \left(angle \leq 3 \cdot 10^{+107}\right):\\ \;\;\;\;\left|angle \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot t_0\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(t_0 \cdot \left(angle \cdot \pi\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (+ b a) (- a b))))
   (if (or (<= angle -1.9e+38) (not (<= angle 3e+107)))
     (fabs (* angle (* -0.011111111111111112 (* PI t_0))))
     (* -0.011111111111111112 (* t_0 (* angle PI))))))
double code(double a, double b, double angle) {
	double t_0 = (b + a) * (a - b);
	double tmp;
	if ((angle <= -1.9e+38) || !(angle <= 3e+107)) {
		tmp = fabs((angle * (-0.011111111111111112 * (((double) M_PI) * t_0))));
	} else {
		tmp = -0.011111111111111112 * (t_0 * (angle * ((double) M_PI)));
	}
	return tmp;
}
public static double code(double a, double b, double angle) {
	double t_0 = (b + a) * (a - b);
	double tmp;
	if ((angle <= -1.9e+38) || !(angle <= 3e+107)) {
		tmp = Math.abs((angle * (-0.011111111111111112 * (Math.PI * t_0))));
	} else {
		tmp = -0.011111111111111112 * (t_0 * (angle * Math.PI));
	}
	return tmp;
}
def code(a, b, angle):
	t_0 = (b + a) * (a - b)
	tmp = 0
	if (angle <= -1.9e+38) or not (angle <= 3e+107):
		tmp = math.fabs((angle * (-0.011111111111111112 * (math.pi * t_0))))
	else:
		tmp = -0.011111111111111112 * (t_0 * (angle * math.pi))
	return tmp
function code(a, b, angle)
	t_0 = Float64(Float64(b + a) * Float64(a - b))
	tmp = 0.0
	if ((angle <= -1.9e+38) || !(angle <= 3e+107))
		tmp = abs(Float64(angle * Float64(-0.011111111111111112 * Float64(pi * t_0))));
	else
		tmp = Float64(-0.011111111111111112 * Float64(t_0 * Float64(angle * pi)));
	end
	return tmp
end
function tmp_2 = code(a, b, angle)
	t_0 = (b + a) * (a - b);
	tmp = 0.0;
	if ((angle <= -1.9e+38) || ~((angle <= 3e+107)))
		tmp = abs((angle * (-0.011111111111111112 * (pi * t_0))));
	else
		tmp = -0.011111111111111112 * (t_0 * (angle * pi));
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(b + a), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[angle, -1.9e+38], N[Not[LessEqual[angle, 3e+107]], $MachinePrecision]], N[Abs[N[(angle * N[(-0.011111111111111112 * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(-0.011111111111111112 * N[(t$95$0 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(a - b\right)\\
\mathbf{if}\;angle \leq -1.9 \cdot 10^{+38} \lor \neg \left(angle \leq 3 \cdot 10^{+107}\right):\\
\;\;\;\;\left|angle \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot t_0\right)\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < -1.8999999999999999e38 or 3.00000000000000023e107 < angle

    1. Initial program 26.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{{\color{blue}{\left(\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \cdot -0.011111111111111112\right)}}^{2}} \]
      5. associate-*r*35.6%

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

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

        \[\leadsto \sqrt{\color{blue}{\left(\left(angle \cdot \left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)\right) \cdot -0.011111111111111112\right) \cdot \left(\left(angle \cdot \left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)\right) \cdot -0.011111111111111112\right)}} \]
      2. rem-sqrt-square34.9%

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

        \[\leadsto \left|\color{blue}{angle \cdot \left(\left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right) \cdot -0.011111111111111112\right)}\right| \]
      4. *-commutative34.9%

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

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

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

    if -1.8999999999999999e38 < angle < 3.00000000000000023e107

    1. Initial program 64.7%

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

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

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

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

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

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

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

        \[\leadsto -0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)\right)} \]
      2. expm1-udef27.6%

        \[\leadsto -0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)} - 1\right)} \]
      3. associate-*r*27.6%

        \[\leadsto -0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(angle \cdot \color{blue}{\left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)}\right)} - 1\right) \]
    7. Applied egg-rr27.6%

      \[\leadsto -0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)\right)} - 1\right)} \]
    8. Step-by-step derivation
      1. expm1-def45.3%

        \[\leadsto -0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)\right)\right)} \]
      2. expm1-log1p65.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;angle \leq -1.9 \cdot 10^{+38} \lor \neg \left(angle \leq 3 \cdot 10^{+107}\right):\\ \;\;\;\;\left|angle \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(a - b\right)\right)\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(\left(b + a\right) \cdot \left(a - b\right)\right) \cdot \left(angle \cdot \pi\right)\right)\\ \end{array} \]

Alternative 8: 55.4% accurate, 2.9× speedup?

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

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

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


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

    1. Initial program 56.7%

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

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

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

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

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

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

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

    if 4.8e114 < angle

    1. Initial program 19.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. Simplified25.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{{\color{blue}{\left(\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right) \cdot -0.011111111111111112\right)}}^{2}} \]
      5. associate-*r*35.5%

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

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

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

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

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

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

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

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

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

Alternative 9: 54.4% accurate, 5.5× 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 49.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. Simplified52.2%

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

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

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

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

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

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

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

Alternative 10: 54.4% accurate, 5.5× speedup?

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

\\
-0.011111111111111112 \cdot \left(angle \cdot \left(\left(a - b\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 49.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. Simplified52.2%

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

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

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

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

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

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

      \[\leadsto -0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)}\right) \]
    2. expm1-udef28.6%

      \[\leadsto -0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\pi \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)} - 1\right)}\right) \]
    3. associate-*r*28.6%

      \[\leadsto -0.011111111111111112 \cdot \left(angle \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)}\right)} - 1\right)\right) \]
  7. Applied egg-rr28.6%

    \[\leadsto -0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)} - 1\right)}\right) \]
  8. Step-by-step derivation
    1. expm1-def32.1%

      \[\leadsto -0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)\right)}\right) \]
    2. expm1-log1p-u49.8%

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

      \[\leadsto -0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\left(\left(a - b\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)}\right) \]
  9. Applied egg-rr49.8%

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

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

Alternative 11: 54.4% accurate, 5.5× speedup?

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

\\
-0.011111111111111112 \cdot \left(\left(\left(b + a\right) \cdot \left(a - b\right)\right) \cdot \left(angle \cdot \pi\right)\right)
\end{array}
Derivation
  1. Initial program 49.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. Simplified52.2%

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

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

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

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

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

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

      \[\leadsto -0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)\right)} \]
    2. expm1-udef21.6%

      \[\leadsto -0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)} - 1\right)} \]
    3. associate-*r*21.6%

      \[\leadsto -0.011111111111111112 \cdot \left(e^{\mathsf{log1p}\left(angle \cdot \color{blue}{\left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)}\right)} - 1\right) \]
  7. Applied egg-rr21.6%

    \[\leadsto -0.011111111111111112 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(angle \cdot \left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)\right)} - 1\right)} \]
  8. Step-by-step derivation
    1. expm1-def32.1%

      \[\leadsto -0.011111111111111112 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(a - b\right)\right)\right)\right)} \]
    2. expm1-log1p49.8%

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

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

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

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

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

Reproduce

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