ab-angle->ABCF B

Percentage Accurate: 54.1% → 66.0%
Time: 17.6s
Alternatives: 16
Speedup: 3.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 54.1% accurate, 1.0× speedup?

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

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

Alternative 1: 66.0% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a\_m \leq 2 \cdot 10^{+263}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a\_m \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b\_m - a\_m\right)\right)\right)\\

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


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

    1. Initial program 54.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. Simplified53.8%

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

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

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

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

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

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(angle \cdot \left(\pi \cdot \color{blue}{-0.005555555555555556}\right)\right)\right)\right) \cdot \left(2 \cdot \left(\sin \left(\frac{angle \cdot \pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    7. Applied egg-rr55.7%

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

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

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

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

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

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

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

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

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

    if 6.99999999999999978e140 < a < 2.00000000000000003e263

    1. Initial program 27.7%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares38.8%

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

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

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

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

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

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

    if 2.00000000000000003e263 < a

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(\left({a}^{2} \cdot \cos \left(\left(-0.005555555555555556 \cdot angle\right) \cdot \pi\right)\right) \cdot \sin \left(\left(-0.005555555555555556 \cdot angle\right) \cdot \pi\right)\right)} \]
    7. Taylor expanded in a around 0 90.9%

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

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

Alternative 2: 63.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_0 \leq -1 \cdot 10^{-280}:\\
\;\;\;\;{a\_m}^{2} \cdot t\_1\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+290}:\\
\;\;\;\;{b\_m}^{2} \cdot \left(-t\_1\right)\\

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\left({a\_m}^{2} \cdot \left(angle \cdot \pi\right)\right) \cdot -0.011111111111111112 + b\_m \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot b\_m\right)\right) + 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a\_m - a\_m\right)\right)\right)\right)\\

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


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

    1. Initial program 39.3%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares39.6%

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

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

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

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

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

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

    if -5.0000000000000004e283 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -9.9999999999999996e-281

    1. Initial program 51.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. Simplified51.1%

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

      \[\leadsto \color{blue}{{\left(\sqrt{\sin \left(2 \cdot \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right) \cdot \left({a}^{2} - {b}^{2}\right)}\right)}^{2}} \]
    5. Taylor expanded in a around inf 51.8%

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

    if -9.9999999999999996e-281 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000012e290

    1. Initial program 67.9%

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{\sin \left(2 \cdot \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right) \cdot \left({a}^{2} - {b}^{2}\right)}\right)}^{2}} \]
    5. Taylor expanded in a around 0 68.5%

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

        \[\leadsto \color{blue}{\left(-1 \cdot {b}^{2}\right) \cdot \sin \left(-0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)} \]
      2. neg-mul-168.5%

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

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

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

    1. Initial program 48.2%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares37.7%

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

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

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

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

    1. Initial program 0.0%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares45.2%

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

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

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

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

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

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

Alternative 3: 63.6% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+290}:\\
\;\;\;\;\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(\left(\left(a\_m - b\_m\right) \cdot \left(a\_m + b\_m\right)\right) \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)\right)\\

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\left({a\_m}^{2} \cdot \left(angle \cdot \pi\right)\right) \cdot -0.011111111111111112 + b\_m \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot b\_m\right)\right) + 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a\_m - a\_m\right)\right)\right)\right)\\

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


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

    1. Initial program 39.3%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares39.6%

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

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

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

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

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

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

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

    1. Initial program 61.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. Simplified61.5%

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

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

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

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

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

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

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

    1. Initial program 48.2%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares37.7%

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

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

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

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

    1. Initial program 0.0%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares45.2%

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

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

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

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

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

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

Alternative 4: 56.4% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+64}:\\
\;\;\;\;\cos \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(2 \cdot \left(t\_0 \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)\right)\\

\mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+255}:\\
\;\;\;\;\left(2 \cdot \left(\sin \left(\frac{angle \cdot \pi}{-180}\right) \cdot t\_0\right)\right) \cdot \sqrt[3]{{\cos t\_1}^{3}}\\

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


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

    1. Initial program 55.8%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares51.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(\color{blue}{0} \cdot \pi + b \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      10. distribute-rgt-out56.9%

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

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

    if 1e-54 < (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000004e64

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

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

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

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

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

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

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

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

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

    if 2.00000000000000004e64 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000002e255

    1. Initial program 34.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. Simplified31.2%

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

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

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

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

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

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(angle \cdot \left(\pi \cdot \color{blue}{-0.005555555555555556}\right)\right)\right)\right) \cdot \left(2 \cdot \left(\sin \left(\frac{angle \cdot \pi}{-180}\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
    7. Applied egg-rr36.9%

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

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

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

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

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

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

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

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

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

    if 5.0000000000000002e255 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 14.9%

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

        \[\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. sin-cos-mult14.9%

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares20.2%

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

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

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

Alternative 5: 56.2% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+255}:\\
\;\;\;\;\mathsf{log1p}\left(e^{\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)} + -1\right) \cdot \left(2 \cdot \left(\sin \left(\frac{angle \cdot \pi}{-180}\right) \cdot \left(\left(a\_m - b\_m\right) \cdot \left(a\_m + b\_m\right)\right)\right)\right)\\

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


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

    1. Initial program 55.5%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares51.6%

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(b \cdot \left(angle \cdot \left(b \cdot \pi\right) + angle \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right)} \]
      4. distribute-lft-out56.7%

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(\color{blue}{\left(a + -1 \cdot a\right) \cdot \pi} + b \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      7. distribute-rgt1-in56.7%

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(\color{blue}{\left(\left(-1 + 1\right) \cdot a\right)} \cdot \pi + b \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      8. metadata-eval56.7%

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(\left(\color{blue}{0} \cdot a\right) \cdot \pi + b \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      9. mul0-lft56.7%

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(\color{blue}{0} \cdot \pi + b \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      10. distribute-rgt-out56.7%

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \color{blue}{\left(\pi \cdot \left(0 + b\right)\right)}\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
    8. Simplified56.7%

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

    if 9.99999999999999995e-56 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000002e255

    1. Initial program 46.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000002e255 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 14.9%

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

        \[\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. sin-cos-mult14.9%

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares20.2%

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

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

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

Alternative 6: 56.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+255}:\\
\;\;\;\;\left(2 \cdot \left(\sin \left(\frac{angle \cdot \pi}{-180}\right) \cdot \left(\left(a\_m - b\_m\right) \cdot \left(a\_m + b\_m\right)\right)\right)\right) \cdot \log \left(e^{\cos t\_0}\right)\\

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


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

    1. Initial program 55.5%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares51.6%

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(b \cdot \left(angle \cdot \left(b \cdot \pi\right) + angle \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right)} \]
      4. distribute-lft-out56.7%

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(\color{blue}{\left(a + -1 \cdot a\right) \cdot \pi} + b \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      7. distribute-rgt1-in56.7%

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(\color{blue}{\left(\left(-1 + 1\right) \cdot a\right)} \cdot \pi + b \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      8. metadata-eval56.7%

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(\left(\color{blue}{0} \cdot a\right) \cdot \pi + b \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      9. mul0-lft56.7%

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(\color{blue}{0} \cdot \pi + b \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      10. distribute-rgt-out56.7%

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \color{blue}{\left(\pi \cdot \left(0 + b\right)\right)}\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
    8. Simplified56.7%

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

    if 9.99999999999999995e-56 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000002e255

    1. Initial program 46.3%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\right) \cdot \left(2 \cdot \left(\sin \left(\frac{angle \cdot \pi}{-180}\right) \cdot \color{blue}{\left(\left(a + b\right) \cdot \left(a - b\right)\right)}\right)\right) \]
    10. Step-by-step derivation
      1. add-log-exp52.3%

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

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

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

    if 5.0000000000000002e255 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 14.9%

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

        \[\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. sin-cos-mult14.9%

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares20.2%

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

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

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

Alternative 7: 56.5% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;\frac{angle}{180} \leq 10^{+212}:\\
\;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(\left(\left(a\_m - b\_m\right) \cdot \left(a\_m + b\_m\right)\right) \cdot \sin \left(\frac{angle}{\frac{-180}{\pi}}\right)\right)\right)\\

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


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

    1. Initial program 55.8%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares51.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(\color{blue}{0} \cdot \pi + b \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      10. distribute-rgt-out56.9%

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

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

    if 1e-54 < (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999991e211

    1. Initial program 47.9%

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

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

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

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

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

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

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

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

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

    if 9.9999999999999991e211 < (/.f64 angle #s(literal 180 binary64))

    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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l*11.8%

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares16.1%

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

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

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

Alternative 8: 56.5% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;angle \leq 7.5 \cdot 10^{+216}:\\
\;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right) \cdot \left(\left(a\_m - b\_m\right) \cdot \left(a\_m + b\_m\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if angle < 6e-52

    1. Initial program 55.8%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares51.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(\color{blue}{0} \cdot \pi + b \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      10. distribute-rgt-out56.9%

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

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

    if 6e-52 < angle < 7.4999999999999994e216

    1. Initial program 47.9%

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

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

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

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

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

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

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

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

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

    if 7.4999999999999994e216 < angle

    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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l*11.8%

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

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

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

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares16.1%

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

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

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

Alternative 9: 60.7% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 57.5%

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

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

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

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

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

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

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

    if 2.00000000000000003e306 < (pow.f64 a #s(literal 2 binary64))

    1. Initial program 33.0%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares39.8%

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

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

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

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

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

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

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

Alternative 10: 60.9% accurate, 3.0× speedup?

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

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

\mathbf{elif}\;a\_m \leq 9.6 \cdot 10^{+117}:\\
\;\;\;\;\left({a\_m}^{2} \cdot \left(angle \cdot \pi\right)\right) \cdot -0.011111111111111112 + b\_m \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot b\_m\right)\right) + 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a\_m - a\_m\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 1.0999999999999999e-230

    1. Initial program 48.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0999999999999999e-230 < a < 9.5999999999999996e117

    1. Initial program 63.3%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares52.2%

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

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

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

    if 9.5999999999999996e117 < a

    1. Initial program 39.1%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares43.1%

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

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

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

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

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

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

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

Alternative 11: 60.8% accurate, 3.3× speedup?

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

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

\mathbf{elif}\;a\_m \leq 9.6 \cdot 10^{+117}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot \left(angle \cdot \left(\pi \cdot b\_m\right)\right) - {a\_m}^{2} \cdot \left(angle \cdot \pi\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 3.5000000000000001e-231

    1. Initial program 48.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5000000000000001e-231 < a < 9.5999999999999996e117

    1. Initial program 63.3%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares52.2%

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

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \color{blue}{\left(b \cdot \left(angle \cdot \left(b \cdot \pi\right) + angle \cdot \left(\pi \cdot \left(a + -1 \cdot a\right)\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right)} \]
      4. distribute-lft-out60.8%

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(\color{blue}{\left(a + -1 \cdot a\right) \cdot \pi} + b \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      7. distribute-rgt1-in60.8%

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(\color{blue}{0} \cdot \pi + b \cdot \pi\right)\right) - {a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]
      10. distribute-rgt-out60.8%

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

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

    if 9.5999999999999996e117 < a

    1. Initial program 39.1%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares43.1%

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

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

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

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

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

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

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

Alternative 12: 57.5% accurate, 3.5× speedup?

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

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

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


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

    1. Initial program 59.5%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares50.1%

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

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

    if 9.99999999999999983e156 < (pow.f64 a #s(literal 2 binary64))

    1. Initial program 37.1%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares40.8%

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

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

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

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

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

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

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

Alternative 13: 53.3% accurate, 26.2× speedup?

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

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

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


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

    1. Initial program 53.2%

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{b \cdot b} - {a}^{2}\right)\right)\right) \]
      2. unpow245.8%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares46.8%

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

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

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

    if 8.00000000000000043e32 < a

    1. Initial program 47.0%

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{b \cdot b} - {a}^{2}\right)\right)\right) \]
      2. unpow243.8%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares47.1%

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

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

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

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

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

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

Alternative 14: 42.3% accurate, 26.2× speedup?

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

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

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


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

    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. Add Preprocessing
    3. Taylor expanded in angle around 0 46.6%

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares48.3%

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

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

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

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

    if 9.20000000000000024e232 < angle

    1. Initial program 13.6%

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
      3. difference-of-squares18.5%

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

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

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

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

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

Alternative 15: 20.2% accurate, 46.6× speedup?

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

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

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

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

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
    3. difference-of-squares46.9%

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

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

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

    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \color{blue}{\left(a \cdot \left(b \cdot \pi\right)\right)}\right) \]
  8. Final simplification16.3%

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

Alternative 16: 19.4% accurate, 46.6× speedup?

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

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

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

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

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \]
    3. difference-of-squares46.9%

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

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

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

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)} \]
  8. Final simplification16.0%

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

Reproduce

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