ab-angle->ABCF B

Percentage Accurate: 54.1% → 68.0%
Time: 15.9s
Alternatives: 15
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 15 alternatives:

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

Initial Program: 54.1% accurate, 1.0× speedup?

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

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

Alternative 1: 68.0% accurate, 0.8× speedup?

\[\begin{array}{l} 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.2 \cdot 10^{+197}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(\left(\left(b - a\right) \cdot 2\right) \cdot \sin \left(\mathsf{fma}\left(\frac{\pi}{180}, angle\_m, \frac{\pi}{2}\right)\right)\right) \cdot \sin \left(\frac{180 \cdot \left(\left(\pi + \pi\right) \cdot angle\_m\right)}{\left(180 \cdot 180\right) \cdot 2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \frac{\sin \left(\frac{angle\_m}{180} \cdot \left(\pi + \pi\right)\right) + \left(\cos \left(0 - \frac{\pi}{2}\right) - \cos \left(\mathsf{fma}\left(\pi + \pi, \frac{angle\_m}{180}, \frac{\pi}{2}\right)\right)\right)}{2}\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= angle_m 1.2e+197)
    (*
     (+ b a)
     (*
      (* (* (- b a) 2.0) (sin (fma (/ PI 180.0) angle_m (/ PI 2.0))))
      (sin (/ (* 180.0 (* (+ PI PI) angle_m)) (* (* 180.0 180.0) 2.0)))))
    (*
     (+ b a)
     (*
      (- b a)
      (/
       (+
        (sin (* (/ angle_m 180.0) (+ PI PI)))
        (-
         (cos (- 0.0 (/ PI 2.0)))
         (cos (fma (+ PI PI) (/ angle_m 180.0) (/ PI 2.0)))))
       2.0))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (angle_m <= 1.2e+197) {
		tmp = (b + a) * ((((b - a) * 2.0) * sin(fma((((double) M_PI) / 180.0), angle_m, (((double) M_PI) / 2.0)))) * sin(((180.0 * ((((double) M_PI) + ((double) M_PI)) * angle_m)) / ((180.0 * 180.0) * 2.0))));
	} else {
		tmp = (b + a) * ((b - a) * ((sin(((angle_m / 180.0) * (((double) M_PI) + ((double) M_PI)))) + (cos((0.0 - (((double) M_PI) / 2.0))) - cos(fma((((double) M_PI) + ((double) M_PI)), (angle_m / 180.0), (((double) M_PI) / 2.0))))) / 2.0));
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (angle_m <= 1.2e+197)
		tmp = Float64(Float64(b + a) * Float64(Float64(Float64(Float64(b - a) * 2.0) * sin(fma(Float64(pi / 180.0), angle_m, Float64(pi / 2.0)))) * sin(Float64(Float64(180.0 * Float64(Float64(pi + pi) * angle_m)) / Float64(Float64(180.0 * 180.0) * 2.0)))));
	else
		tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(Float64(sin(Float64(Float64(angle_m / 180.0) * Float64(pi + pi))) + Float64(cos(Float64(0.0 - Float64(pi / 2.0))) - cos(fma(Float64(pi + pi), Float64(angle_m / 180.0), Float64(pi / 2.0))))) / 2.0)));
	end
	return Float64(angle_s * tmp)
end
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_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 1.2e+197], N[(N[(b + a), $MachinePrecision] * N[(N[(N[(N[(b - a), $MachinePrecision] * 2.0), $MachinePrecision] * N[Sin[N[(N[(Pi / 180.0), $MachinePrecision] * angle$95$m + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(180.0 * N[(N[(Pi + Pi), $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(180.0 * 180.0), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[(Pi + Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Cos[N[(0.0 - N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[Cos[N[(N[(Pi + Pi), $MachinePrecision] * N[(angle$95$m / 180.0), $MachinePrecision] + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
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.2 \cdot 10^{+197}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(\left(\left(b - a\right) \cdot 2\right) \cdot \sin \left(\mathsf{fma}\left(\frac{\pi}{180}, angle\_m, \frac{\pi}{2}\right)\right)\right) \cdot \sin \left(\frac{180 \cdot \left(\left(\pi + \pi\right) \cdot angle\_m\right)}{\left(180 \cdot 180\right) \cdot 2}\right)\right)\\

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


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

    1. Initial program 54.1%

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

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

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

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

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

    if 1.1999999999999999e197 < angle

    1. Initial program 54.1%

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

      \[\leadsto \color{blue}{\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\frac{angle}{180} \cdot \left(\pi + \pi\right)\right)\right)} \]
    3. Applied rewrites42.9%

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

Alternative 2: 67.5% accurate, 1.0× speedup?

\[\begin{array}{l} 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.05 \cdot 10^{+269}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(\left(\left(b - a\right) \cdot 2\right) \cdot \sin \left(\mathsf{fma}\left(\frac{\pi}{180}, angle\_m, \frac{\pi}{2}\right)\right)\right) \cdot \sin \left(\frac{180 \cdot \left(\left(\pi + \pi\right) \cdot angle\_m\right)}{\left(180 \cdot 180\right) \cdot 2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(-1 \cdot \mathsf{fma}\left(\frac{1}{b}, a \cdot b, -b\right)\right) \cdot \sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \left(\pi + \pi\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= angle_m 1.05e+269)
    (*
     (+ b a)
     (*
      (* (* (- b a) 2.0) (sin (fma (/ PI 180.0) angle_m (/ PI 2.0))))
      (sin (/ (* 180.0 (* (+ PI PI) angle_m)) (* (* 180.0 180.0) 2.0)))))
    (*
     (+ b a)
     (*
      (* -1.0 (fma (/ 1.0 b) (* a b) (- b)))
      (sin (* (* 0.005555555555555556 angle_m) (+ PI PI))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (angle_m <= 1.05e+269) {
		tmp = (b + a) * ((((b - a) * 2.0) * sin(fma((((double) M_PI) / 180.0), angle_m, (((double) M_PI) / 2.0)))) * sin(((180.0 * ((((double) M_PI) + ((double) M_PI)) * angle_m)) / ((180.0 * 180.0) * 2.0))));
	} else {
		tmp = (b + a) * ((-1.0 * fma((1.0 / b), (a * b), -b)) * sin(((0.005555555555555556 * angle_m) * (((double) M_PI) + ((double) M_PI)))));
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (angle_m <= 1.05e+269)
		tmp = Float64(Float64(b + a) * Float64(Float64(Float64(Float64(b - a) * 2.0) * sin(fma(Float64(pi / 180.0), angle_m, Float64(pi / 2.0)))) * sin(Float64(Float64(180.0 * Float64(Float64(pi + pi) * angle_m)) / Float64(Float64(180.0 * 180.0) * 2.0)))));
	else
		tmp = Float64(Float64(b + a) * Float64(Float64(-1.0 * fma(Float64(1.0 / b), Float64(a * b), Float64(-b))) * sin(Float64(Float64(0.005555555555555556 * angle_m) * Float64(pi + pi)))));
	end
	return Float64(angle_s * tmp)
end
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_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 1.05e+269], N[(N[(b + a), $MachinePrecision] * N[(N[(N[(N[(b - a), $MachinePrecision] * 2.0), $MachinePrecision] * N[Sin[N[(N[(Pi / 180.0), $MachinePrecision] * angle$95$m + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(180.0 * N[(N[(Pi + Pi), $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(180.0 * 180.0), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + a), $MachinePrecision] * N[(N[(-1.0 * N[(N[(1.0 / b), $MachinePrecision] * N[(a * b), $MachinePrecision] + (-b)), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * N[(Pi + Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
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.05 \cdot 10^{+269}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(\left(\left(b - a\right) \cdot 2\right) \cdot \sin \left(\mathsf{fma}\left(\frac{\pi}{180}, angle\_m, \frac{\pi}{2}\right)\right)\right) \cdot \sin \left(\frac{180 \cdot \left(\left(\pi + \pi\right) \cdot angle\_m\right)}{\left(180 \cdot 180\right) \cdot 2}\right)\right)\\

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


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

    1. Initial program 54.1%

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

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

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

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

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

    if 1.05e269 < angle

    1. Initial program 54.1%

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

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

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

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

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

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

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

Alternative 3: 67.4% accurate, 1.2× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 8 \cdot 10^{+108}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\frac{angle\_m \cdot \pi}{180}\right) \cdot 2\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(\frac{\pi}{180}, angle\_m, \frac{\pi}{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\frac{angle\_m}{180} \cdot \left(\pi + \pi\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= angle_m 8e+108)
    (*
     (* (- b a) (* (+ b a) (* (sin (/ (* angle_m PI) 180.0)) 2.0)))
     (sin (fma (/ PI 180.0) angle_m (/ PI 2.0))))
    (* (+ b a) (* (- b a) (sin (* (/ angle_m 180.0) (+ PI PI))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (angle_m <= 8e+108) {
		tmp = ((b - a) * ((b + a) * (sin(((angle_m * ((double) M_PI)) / 180.0)) * 2.0))) * sin(fma((((double) M_PI) / 180.0), angle_m, (((double) M_PI) / 2.0)));
	} else {
		tmp = (b + a) * ((b - a) * sin(((angle_m / 180.0) * (((double) M_PI) + ((double) M_PI)))));
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (angle_m <= 8e+108)
		tmp = Float64(Float64(Float64(b - a) * Float64(Float64(b + a) * Float64(sin(Float64(Float64(angle_m * pi) / 180.0)) * 2.0))) * sin(fma(Float64(pi / 180.0), angle_m, Float64(pi / 2.0))));
	else
		tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * sin(Float64(Float64(angle_m / 180.0) * Float64(pi + pi)))));
	end
	return Float64(angle_s * tmp)
end
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_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 8e+108], N[(N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(Pi / 180.0), $MachinePrecision] * angle$95$m + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[(Pi + Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


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

    1. Initial program 54.1%

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

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

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

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

    if 8.0000000000000003e108 < angle

    1. Initial program 54.1%

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

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

Alternative 4: 67.4% accurate, 1.5× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b \leq 3 \cdot 10^{+157}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\frac{angle\_m}{180} \cdot \left(\pi + \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(-1 \cdot \left(b \cdot \left(\frac{a}{b} - \mathsf{fma}\left(\frac{1}{180}, \mathsf{fma}\left(angle\_m, \pi, -angle\_m \cdot \pi\right), 1\right)\right)\right)\right) \cdot \sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \left(\pi + \pi\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= b 3e+157)
    (* (+ b a) (* (- b a) (sin (* (/ angle_m 180.0) (+ PI PI)))))
    (*
     (+ b a)
     (*
      (*
       -1.0
       (*
        b
        (-
         (/ a b)
         (fma (/ 1.0 180.0) (fma angle_m PI (- (* angle_m PI))) 1.0))))
      (sin (* (* 0.005555555555555556 angle_m) (+ PI PI))))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (b <= 3e+157) {
		tmp = (b + a) * ((b - a) * sin(((angle_m / 180.0) * (((double) M_PI) + ((double) M_PI)))));
	} else {
		tmp = (b + a) * ((-1.0 * (b * ((a / b) - fma((1.0 / 180.0), fma(angle_m, ((double) M_PI), -(angle_m * ((double) M_PI))), 1.0)))) * sin(((0.005555555555555556 * angle_m) * (((double) M_PI) + ((double) M_PI)))));
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (b <= 3e+157)
		tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * sin(Float64(Float64(angle_m / 180.0) * Float64(pi + pi)))));
	else
		tmp = Float64(Float64(b + a) * Float64(Float64(-1.0 * Float64(b * Float64(Float64(a / b) - fma(Float64(1.0 / 180.0), fma(angle_m, pi, Float64(-Float64(angle_m * pi))), 1.0)))) * sin(Float64(Float64(0.005555555555555556 * angle_m) * Float64(pi + pi)))));
	end
	return Float64(angle_s * tmp)
end
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_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 3e+157], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[(Pi + Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + a), $MachinePrecision] * N[(N[(-1.0 * N[(b * N[(N[(a / b), $MachinePrecision] - N[(N[(1.0 / 180.0), $MachinePrecision] * N[(angle$95$m * Pi + (-N[(angle$95$m * Pi), $MachinePrecision])), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * N[(Pi + Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


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

    1. Initial program 54.1%

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

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

    if 3.0000000000000001e157 < b

    1. Initial program 54.1%

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

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

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

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

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

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

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

Alternative 5: 67.3% accurate, 2.1× speedup?

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

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

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


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

    1. Initial program 54.1%

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

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

    if 3.89999999999999971e157 < b

    1. Initial program 54.1%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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.6%

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

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

Alternative 6: 67.3% accurate, 2.1× speedup?

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

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

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


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

    1. Initial program 54.1%

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

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

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

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

    if 2.24999999999999992e157 < b

    1. Initial program 54.1%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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.6%

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

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

Alternative 7: 67.2% accurate, 2.2× speedup?

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

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

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


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

    1. Initial program 54.1%

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

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

      \[\leadsto \left(b + a\right) \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)} \]
    4. Applied rewrites67.6%

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

    if 2.2000000000000002e155 < b

    1. Initial program 54.1%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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.6%

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

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

Alternative 8: 65.6% accurate, 2.2× speedup?

\[\begin{array}{l} 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.8 \cdot 10^{+96}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= angle_m 9.8e+96)
    (* (+ b a) (* (- b a) (* 0.011111111111111112 (* angle_m PI))))
    (* (sin (* (* angle_m 0.011111111111111112) PI)) (* (+ a b) (- b a))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (angle_m <= 9.8e+96) {
		tmp = (b + a) * ((b - a) * (0.011111111111111112 * (angle_m * ((double) M_PI))));
	} else {
		tmp = sin(((angle_m * 0.011111111111111112) * ((double) M_PI))) * ((a + b) * (b - a));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if (angle_m <= 9.8e+96) {
		tmp = (b + a) * ((b - a) * (0.011111111111111112 * (angle_m * Math.PI)));
	} else {
		tmp = Math.sin(((angle_m * 0.011111111111111112) * Math.PI)) * ((a + b) * (b - a));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if angle_m <= 9.8e+96:
		tmp = (b + a) * ((b - a) * (0.011111111111111112 * (angle_m * math.pi)))
	else:
		tmp = math.sin(((angle_m * 0.011111111111111112) * math.pi)) * ((a + b) * (b - a))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (angle_m <= 9.8e+96)
		tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(0.011111111111111112 * Float64(angle_m * pi))));
	else
		tmp = Float64(sin(Float64(Float64(angle_m * 0.011111111111111112) * pi)) * Float64(Float64(a + b) * Float64(b - a)));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if (angle_m <= 9.8e+96)
		tmp = (b + a) * ((b - a) * (0.011111111111111112 * (angle_m * pi)));
	else
		tmp = sin(((angle_m * 0.011111111111111112) * pi)) * ((a + b) * (b - a));
	end
	tmp_2 = angle_s * tmp;
end
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_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 9.8e+96], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
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.8 \cdot 10^{+96}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\

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


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

    1. Initial program 54.1%

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

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

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

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

    if 9.7999999999999993e96 < angle

    1. Initial program 54.1%

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

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

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

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

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

Alternative 9: 62.3% accurate, 6.6× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* (+ b a) (* (- b a) (* 0.011111111111111112 (* angle_m PI))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * ((b + a) * ((b - a) * (0.011111111111111112 * (angle_m * ((double) M_PI)))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * ((b + a) * ((b - a) * (0.011111111111111112 * (angle_m * Math.PI))));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * ((b + a) * ((b - a) * (0.011111111111111112 * (angle_m * math.pi))))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(0.011111111111111112 * Float64(angle_m * pi)))))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * ((b + a) * ((b - a) * (0.011111111111111112 * (angle_m * pi))));
end
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_, angle$95$m_] := N[(angle$95$s * N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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

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

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

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

Alternative 10: 62.3% accurate, 6.6× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(\left(\left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\_m\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* (* (* (* 0.011111111111111112 PI) angle_m) (- b a)) (+ b a))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * ((((0.011111111111111112 * ((double) M_PI)) * angle_m) * (b - a)) * (b + a));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * ((((0.011111111111111112 * Math.PI) * angle_m) * (b - a)) * (b + a));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * ((((0.011111111111111112 * math.pi) * angle_m) * (b - a)) * (b + a))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(Float64(Float64(Float64(0.011111111111111112 * pi) * angle_m) * Float64(b - a)) * Float64(b + a)))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * ((((0.011111111111111112 * pi) * angle_m) * (b - a)) * (b + a));
end
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_, angle$95$m_] := N[(angle$95$s * N[(N[(N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. 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.6%

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

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

Alternative 11: 54.2% accurate, 6.6× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(\pi \cdot \left(\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* PI (* (* (* (+ b a) (- b a)) angle_m) 0.011111111111111112))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (((double) M_PI) * ((((b + a) * (b - a)) * angle_m) * 0.011111111111111112));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (Math.PI * ((((b + a) * (b - a)) * angle_m) * 0.011111111111111112));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (math.pi * ((((b + a) * (b - a)) * angle_m) * 0.011111111111111112))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(pi * Float64(Float64(Float64(Float64(b + a) * Float64(b - a)) * angle_m) * 0.011111111111111112)))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (pi * ((((b + a) * (b - a)) * angle_m) * 0.011111111111111112));
end
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_, angle$95$m_] := N[(angle$95$s * N[(Pi * N[(N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. 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.6%

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

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

Alternative 12: 54.2% accurate, 6.6× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(0.011111111111111112 \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(angle\_m \cdot \pi\right)\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* 0.011111111111111112 (* (* (+ b a) (- b a)) (* angle_m PI)))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (((b + a) * (b - a)) * (angle_m * ((double) M_PI))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (((b + a) * (b - a)) * (angle_m * Math.PI)));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (0.011111111111111112 * (((b + a) * (b - a)) * (angle_m * math.pi)))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(0.011111111111111112 * Float64(Float64(Float64(b + a) * Float64(b - a)) * Float64(angle_m * pi))))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (0.011111111111111112 * (((b + a) * (b - a)) * (angle_m * pi)));
end
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_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. 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.6%

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

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

Alternative 13: 54.2% accurate, 6.6× speedup?

\[\begin{array}{l} 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 - a\right) \cdot \left(\left(b + a\right) \cdot \pi\right)\right)\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* 0.011111111111111112 (* angle_m (* (- b a) (* (+ b a) PI))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (angle_m * ((b - a) * ((b + a) * ((double) M_PI)))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (angle_m * ((b - a) * ((b + a) * Math.PI))));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (0.011111111111111112 * (angle_m * ((b - a) * ((b + a) * math.pi))))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(b - a) * Float64(Float64(b + a) * pi)))))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (0.011111111111111112 * (angle_m * ((b - a) * ((b + a) * pi))));
end
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_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
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 - a\right) \cdot \left(\left(b + a\right) \cdot \pi\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 54.1%

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. 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.6%

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

    \[\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 14: 53.5% accurate, 2.1× speedup?

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

\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(b - a\right) \cdot \left(b \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)))) < 9.99999999999999977e-257

    1. Initial program 54.1%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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.6%

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

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

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

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

    1. Initial program 54.1%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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.6%

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

      \[\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 \pi\right)\right)\right) \]
    6. Applied rewrites37.9%

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

Alternative 15: 37.6% accurate, 7.8× speedup?

\[\begin{array}{l} 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 - a\right) \cdot \left(a \cdot \pi\right)\right)\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* 0.011111111111111112 (* angle_m (* (- b a) (* a PI))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (angle_m * ((b - a) * (a * ((double) M_PI)))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (angle_m * ((b - a) * (a * Math.PI))));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (0.011111111111111112 * (angle_m * ((b - a) * (a * math.pi))))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(b - a) * Float64(a * pi)))))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (0.011111111111111112 * (angle_m * ((b - a) * (a * pi))));
end
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_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(N[(b - a), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
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 - a\right) \cdot \left(a \cdot \pi\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 54.1%

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. 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.6%

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

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

    \[\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 2025153 
(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)))))