ab-angle->ABCF B

Percentage Accurate: 54.0% → 68.1%
Time: 14.3s
Alternatives: 18
Speedup: 6.6×

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}

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 18 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.0% 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: 68.1% accurate, 0.9× speedup?

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

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 3.3 \cdot 10^{+164}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right), \sin \left(\pi \cdot \mathsf{fma}\left(angle\_m, 0.005555555555555556, 0.5\right)\right), \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right) \cdot 0.5\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(\cos \left(0 - 0.5 \cdot \pi\right) - \cos \left(\mathsf{fma}\left(angle\_m \cdot \pi, 0.011111111111111112, 0.5 \cdot \pi\right)\right)\right) \cdot \left(2 \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\right)}{2}\\


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

    1. Initial program 54.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. Applied rewrites68.0%

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

      \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\mathsf{fma}\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right) + \sin 0\right) \cdot 0.5\right)}\right) \]
    4. Applied rewrites68.1%

      \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \color{blue}{\sin \left(\pi \cdot \mathsf{fma}\left(angle, 0.005555555555555556, 0.5\right)\right)}, \left(\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right) + \sin 0\right) \cdot 0.5\right)\right) \]
    5. Applied rewrites68.1%

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

    if 3.29999999999999995e164 < angle

    1. Initial program 54.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. Applied rewrites26.5%

      \[\leadsto \color{blue}{\frac{\left(\cos \left(0 - 0.5 \cdot \pi\right) - \cos \left(\mathsf{fma}\left(angle \cdot \pi, 0.011111111111111112, 0.5 \cdot \pi\right)\right)\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}{2}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 67.9% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right), 1, \left(\sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right) + \sin 0\right) \cdot 0.5\right)\right)\\


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

    1. Initial program 54.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. Applied rewrites68.0%

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

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

    if 9.199999999999999e72 < angle

    1. Initial program 54.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. Applied rewrites68.0%

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

      \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\mathsf{fma}\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right) + \sin 0\right) \cdot 0.5\right)}\right) \]
    4. Taylor expanded in angle around 0

      \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(angle \cdot \frac{1}{180}\right)\right), \color{blue}{1}, \left(\sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{90}\right) + \sin 0\right) \cdot \frac{1}{2}\right)\right) \]
    5. Applied rewrites66.4%

      \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \mathsf{fma}\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \color{blue}{1}, \left(\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right) + \sin 0\right) \cdot 0.5\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 67.9% accurate, 1.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\left(\cos \left(0 - 0.5 \cdot \pi\right) - \cos \left(\mathsf{fma}\left(angle\_m \cdot \pi, 0.011111111111111112, 0.5 \cdot \pi\right)\right)\right) \cdot \left(2 \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\right)}{2}\\


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

    1. Initial program 54.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. Applied rewrites68.0%

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

    if 7.30000000000000047e164 < angle

    1. Initial program 54.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. Applied rewrites26.5%

      \[\leadsto \color{blue}{\frac{\left(\cos \left(0 - 0.5 \cdot \pi\right) - \cos \left(\mathsf{fma}\left(angle \cdot \pi, 0.011111111111111112, 0.5 \cdot \pi\right)\right)\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)}{2}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 67.9% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 54.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. Applied rewrites68.0%

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

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

    if 1.3e73 < angle

    1. Initial program 54.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. Applied rewrites67.9%

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

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

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

Alternative 5: 67.7% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;angle\_m \leq 1.1 \cdot 10^{+217}:\\
\;\;\;\;\left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right) \cdot \sin t\_0\\

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


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

    1. Initial program 54.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. Taylor expanded in angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    3. Applied rewrites50.4%

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

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

    if 2.40000000000000022e-41 < angle < 1.1e217

    1. Initial program 54.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. Applied rewrites57.6%

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

    if 1.1e217 < angle

    1. Initial program 54.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. Taylor expanded in angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    3. Applied rewrites50.4%

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

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

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

Alternative 6: 67.4% accurate, 2.2× speedup?

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

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

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


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

    1. Initial program 54.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. Applied rewrites68.0%

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

    if 1.1e217 < angle

    1. Initial program 54.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. Taylor expanded in angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    3. Applied rewrites50.4%

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

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

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

Alternative 7: 66.5% accurate, 2.2× speedup?

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

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

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


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

    1. Initial program 54.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. Applied rewrites68.0%

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

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

    if 1.1e217 < angle

    1. Initial program 54.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. Taylor expanded in angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    3. Applied rewrites50.4%

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

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

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

Alternative 8: 66.5% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 1.0000000000000001e289

    1. Initial program 54.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. Applied rewrites68.0%

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

      \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\mathsf{fma}\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right), \left(\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right) + \sin 0\right) \cdot 0.5\right)}\right) \]
    4. Applied rewrites68.3%

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

    if 1.0000000000000001e289 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64)))))

    1. Initial program 54.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. Taylor expanded in angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    3. Applied rewrites50.4%

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

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

Alternative 9: 66.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left(t\_0 \cdot b\_m\right) \cdot b\_m\\

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


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

    1. Initial program 54.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. Applied rewrites68.0%

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

      \[\leadsto \left(b + a\right) \cdot \left(\color{blue}{\left(-1 \cdot a\right)} \cdot \sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{90}\right)\right) \]
    4. Applied rewrites42.0%

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

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

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

    1. Initial program 54.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. Taylor expanded in a around 0

      \[\leadsto \color{blue}{2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
    3. Applied rewrites35.5%

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

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

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

    1. Initial program 54.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. Taylor expanded in angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    3. Applied rewrites50.4%

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

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

Alternative 10: 64.3% accurate, 2.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.20000000000000002e-68

    1. Initial program 54.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. Applied rewrites68.0%

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

      \[\leadsto \color{blue}{b} \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot \frac{1}{90}\right)\right) \]
    4. Applied rewrites42.5%

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

      \[\leadsto b \cdot \color{blue}{\left(\sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)} \]
    6. Applied rewrites42.5%

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

    if 2.20000000000000002e-68 < a

    1. Initial program 54.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. Taylor expanded in angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    3. Applied rewrites50.4%

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

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

Alternative 11: 62.8% accurate, 2.5× speedup?

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

\\
\begin{array}{l}
t_0 := \left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 2.2 \cdot 10^{-68}:\\
\;\;\;\;\left(\sin t\_0 \cdot b\_m\right) \cdot b\_m\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.20000000000000002e-68

    1. Initial program 54.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. Taylor expanded in a around 0

      \[\leadsto \color{blue}{2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
    3. Applied rewrites35.5%

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

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

    if 2.20000000000000002e-68 < a

    1. Initial program 54.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. Taylor expanded in angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    3. Applied rewrites50.4%

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

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

Alternative 12: 62.7% accurate, 3.2× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 3 \cdot 10^{+215}:\\ \;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right) \cdot \left(b\_m + a\right)\right) \cdot \left(b\_m - a\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(b\_m - a\right) \cdot \left(\left(b\_m + a\right) \cdot \mathsf{fma}\left(angle\_m \cdot \pi, 0.005555555555555556, \mathsf{fma}\left(angle\_m \cdot \pi, -0.005555555555555556, \pi\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= angle_m 3e+215)
    (* (* (* (* angle_m PI) 0.011111111111111112) (+ b_m a)) (- b_m a))
    (*
     0.011111111111111112
     (*
      angle_m
      (*
       (- b_m a)
       (*
        (+ b_m a)
        (fma
         (* angle_m PI)
         0.005555555555555556
         (fma (* angle_m PI) -0.005555555555555556 PI)))))))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
	double tmp;
	if (angle_m <= 3e+215) {
		tmp = (((angle_m * ((double) M_PI)) * 0.011111111111111112) * (b_m + a)) * (b_m - a);
	} else {
		tmp = 0.011111111111111112 * (angle_m * ((b_m - a) * ((b_m + a) * fma((angle_m * ((double) M_PI)), 0.005555555555555556, fma((angle_m * ((double) M_PI)), -0.005555555555555556, ((double) M_PI))))));
	}
	return angle_s * tmp;
}
b_m = abs(b)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b_m, angle_m)
	tmp = 0.0
	if (angle_m <= 3e+215)
		tmp = Float64(Float64(Float64(Float64(angle_m * pi) * 0.011111111111111112) * Float64(b_m + a)) * Float64(b_m - a));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(b_m - a) * Float64(Float64(b_m + a) * fma(Float64(angle_m * pi), 0.005555555555555556, fma(Float64(angle_m * pi), -0.005555555555555556, pi))))));
	end
	return Float64(angle_s * tmp)
end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 3e+215], N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556 + N[(N[(angle$95$m * Pi), $MachinePrecision] * -0.005555555555555556 + Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


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

    1. Initial program 54.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. Taylor expanded in angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    3. Applied rewrites50.4%

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

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

    if 2.9999999999999999e215 < angle

    1. Initial program 54.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. Taylor expanded in angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    3. Applied rewrites50.4%

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

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

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

Alternative 13: 62.7% accurate, 4.7× speedup?

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

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

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


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

    1. Initial program 54.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. Taylor expanded in angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    3. Applied rewrites50.4%

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

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

    if 2.1999999999999999e96 < angle

    1. Initial program 54.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. Taylor expanded in angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    3. Applied rewrites50.4%

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

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

      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(a \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right) \]
    6. Applied rewrites36.8%

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

      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(a \cdot \left(\frac{b}{a} - 1\right)\right) \cdot \left(\color{blue}{a} \cdot \pi\right)\right)\right) \]
    8. Applied rewrites39.9%

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

Alternative 14: 54.1% accurate, 6.6× speedup?

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

\\
angle\_s \cdot \left(\left(\left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right) \cdot \left(b\_m + a\right)\right) \cdot \left(b\_m - a\right)\right)
\end{array}
Derivation
  1. Initial program 54.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. Taylor expanded in angle around 0

    \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
  3. Applied rewrites50.4%

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

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

Alternative 15: 53.5% accurate, 6.6× speedup?

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

\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(\left(b\_m + a\right) \cdot \left(\left(\left(b\_m - a\right) \cdot \pi\right) \cdot angle\_m\right)\right)\right)
\end{array}
Derivation
  1. Initial program 54.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. Taylor expanded in angle around 0

    \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
  3. Applied rewrites50.4%

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

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

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

Alternative 16: 53.4% accurate, 6.6× speedup?

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

\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(b\_m - a\right) \cdot \left(\left(b\_m + a\right) \cdot \pi\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 54.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. Taylor expanded in angle around 0

    \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
  3. Applied rewrites50.4%

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

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

Alternative 17: 53.2% accurate, 2.1× speedup?

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

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

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


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

    1. Initial program 54.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. Taylor expanded in angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    3. Applied rewrites50.4%

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

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

      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(a \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right) \]
    6. Applied rewrites36.8%

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

    if 3.9999999999988e-312 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))))

    1. Initial program 54.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. Taylor expanded in angle around 0

      \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    3. Applied rewrites50.4%

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

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

      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(b \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right) \]
    6. Applied rewrites37.4%

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

Alternative 18: 36.8% accurate, 7.8× speedup?

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

\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(b\_m - a\right) \cdot \left(a \cdot \pi\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 54.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. Taylor expanded in angle around 0

    \[\leadsto \color{blue}{\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
  3. Applied rewrites50.4%

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

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

    \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(a \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right) \]
  6. Applied rewrites36.8%

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

Reproduce

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