ab-angle->ABCF B

Percentage Accurate: 53.3% → 67.3%
Time: 9.5s
Alternatives: 20
Speedup: 5.5×

Specification

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

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

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 20 alternatives:

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

Initial Program: 53.3% accurate, 1.0× speedup?

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

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

Alternative 1: 67.3% accurate, 1.1× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \sin \left(\left(0.011111111111111112 \cdot angle\_m\right) \cdot \pi\right)\\ t_1 := 2 \cdot \left(b - a\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 2.8 \cdot 10^{+142}:\\ \;\;\;\;\left(a + b\right) \cdot \left(t\_1 \cdot \frac{t\_0 + \sin \left(\mathsf{fma}\left(\pi \cdot 0.005555555555555556, angle\_m, -0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}{2}\right)\\ \mathbf{elif}\;angle\_m \leq 2.1 \cdot 10^{+286}:\\ \;\;\;\;\left(\left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot 2\right) \cdot \mathsf{fma}\left(b, b, a \cdot a\right)\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a + b\right) \cdot \left(t\_1 \cdot \frac{t\_0 + \sin \left(-1 \cdot \left(angle\_m \cdot \mathsf{fma}\left(-0.005555555555555556, \pi, 0.005555555555555556 \cdot \pi\right)\right)\right)}{2}\right)\\ \end{array} \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
 (let* ((t_0 (sin (* (* 0.011111111111111112 angle_m) PI)))
        (t_1 (* 2.0 (- b a))))
   (*
    angle_s
    (if (<= angle_m 2.8e+142)
      (*
       (+ a b)
       (*
        t_1
        (/
         (+
          t_0
          (sin
           (fma
            (* PI 0.005555555555555556)
            angle_m
            (* -0.005555555555555556 (* PI angle_m)))))
         2.0)))
      (if (<= angle_m 2.1e+286)
        (*
         (*
          (* (sin (* PI (* 0.005555555555555556 angle_m))) 2.0)
          (fma b b (* a a)))
         (cos (/ PI (/ 180.0 angle_m))))
        (*
         (+ a b)
         (*
          t_1
          (/
           (+
            t_0
            (sin
             (*
              -1.0
              (*
               angle_m
               (fma -0.005555555555555556 PI (* 0.005555555555555556 PI))))))
           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 t_0 = sin(((0.011111111111111112 * angle_m) * ((double) M_PI)));
	double t_1 = 2.0 * (b - a);
	double tmp;
	if (angle_m <= 2.8e+142) {
		tmp = (a + b) * (t_1 * ((t_0 + sin(fma((((double) M_PI) * 0.005555555555555556), angle_m, (-0.005555555555555556 * (((double) M_PI) * angle_m))))) / 2.0));
	} else if (angle_m <= 2.1e+286) {
		tmp = ((sin((((double) M_PI) * (0.005555555555555556 * angle_m))) * 2.0) * fma(b, b, (a * a))) * cos((((double) M_PI) / (180.0 / angle_m)));
	} else {
		tmp = (a + b) * (t_1 * ((t_0 + sin((-1.0 * (angle_m * fma(-0.005555555555555556, ((double) M_PI), (0.005555555555555556 * ((double) M_PI))))))) / 2.0));
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = sin(Float64(Float64(0.011111111111111112 * angle_m) * pi))
	t_1 = Float64(2.0 * Float64(b - a))
	tmp = 0.0
	if (angle_m <= 2.8e+142)
		tmp = Float64(Float64(a + b) * Float64(t_1 * Float64(Float64(t_0 + sin(fma(Float64(pi * 0.005555555555555556), angle_m, Float64(-0.005555555555555556 * Float64(pi * angle_m))))) / 2.0)));
	elseif (angle_m <= 2.1e+286)
		tmp = Float64(Float64(Float64(sin(Float64(pi * Float64(0.005555555555555556 * angle_m))) * 2.0) * fma(b, b, Float64(a * a))) * cos(Float64(pi / Float64(180.0 / angle_m))));
	else
		tmp = Float64(Float64(a + b) * Float64(t_1 * Float64(Float64(t_0 + sin(Float64(-1.0 * Float64(angle_m * fma(-0.005555555555555556, pi, Float64(0.005555555555555556 * pi)))))) / 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_] := Block[{t$95$0 = N[Sin[N[(N[(0.011111111111111112 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 2.8e+142], N[(N[(a + b), $MachinePrecision] * N[(t$95$1 * N[(N[(t$95$0 + N[Sin[N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * angle$95$m + N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 2.1e+286], N[(N[(N[(N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * N[(b * b + N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(a + b), $MachinePrecision] * N[(t$95$1 * N[(N[(t$95$0 + N[Sin[N[(-1.0 * N[(angle$95$m * N[(-0.005555555555555556 * Pi + N[(0.005555555555555556 * Pi), $MachinePrecision]), $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)

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

\mathbf{elif}\;angle\_m \leq 2.1 \cdot 10^{+286}:\\
\;\;\;\;\left(\left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot 2\right) \cdot \mathsf{fma}\left(b, b, a \cdot a\right)\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if angle < 2.8e142

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

    if 2.8e142 < angle < 2.1000000000000001e286

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

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

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

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \color{blue}{\frac{1}{\frac{180}{angle}}}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      4. mult-flip-revN/A

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \color{blue}{\left(\frac{\pi}{\frac{180}{angle}}\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      5. lower-/.f64N/A

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

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

      \[\leadsto \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \color{blue}{\left(\frac{\pi}{\frac{180}{angle}}\right)}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

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

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

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\frac{1}{\frac{180}{angle}}}\right) \]
      4. mult-flip-revN/A

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \cos \color{blue}{\left(\frac{\pi}{\frac{180}{angle}}\right)} \]
      5. lower-/.f64N/A

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \cos \color{blue}{\left(\frac{\pi}{\frac{180}{angle}}\right)} \]
      6. lower-/.f6453.5

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

      \[\leadsto \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \cos \color{blue}{\left(\frac{\pi}{\frac{180}{angle}}\right)} \]
    6. Step-by-step derivation
      1. lift-pow.f64N/A

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

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - \color{blue}{a \cdot a}\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right) \]
      3. sqr-neg-revN/A

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(\mathsf{neg}\left(a\right)\right)}\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right) \]
      4. lift-neg.f64N/A

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - \color{blue}{\left(-a\right)} \cdot \left(\mathsf{neg}\left(a\right)\right)\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right) \]
      5. lift-neg.f64N/A

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

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - \color{blue}{{\left(-a\right)}^{2}}\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right) \]
      7. pow-to-expN/A

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - \color{blue}{e^{\log \left(-a\right) \cdot 2}}\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right) \]
      8. lower-exp.f64N/A

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - \color{blue}{e^{\log \left(-a\right) \cdot 2}}\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right) \]
      9. lower-*.f64N/A

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

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

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

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

    if 2.1000000000000001e286 < angle

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

      \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \frac{\sin \left(\left(\frac{1}{90} \cdot angle\right) \cdot \pi\right) + \sin \color{blue}{\left(-1 \cdot \left(angle \cdot \left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)\right)}}{2}\right) \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \frac{\sin \left(\left(\frac{1}{90} \cdot angle\right) \cdot \pi\right) + \sin \left(-1 \cdot \color{blue}{\left(angle \cdot \left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{2}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \frac{\sin \left(\left(\frac{1}{90} \cdot angle\right) \cdot \pi\right) + \sin \left(-1 \cdot \left(angle \cdot \color{blue}{\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)\right)}{2}\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \frac{\sin \left(\left(\frac{1}{90} \cdot angle\right) \cdot \pi\right) + \sin \left(-1 \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{180}, \color{blue}{\mathsf{PI}\left(\right)}, \frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)\right)}{2}\right) \]
      4. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \frac{\sin \left(\left(\frac{1}{90} \cdot angle\right) \cdot \pi\right) + \sin \left(-1 \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{180}, \pi, \frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)\right)}{2}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \frac{\sin \left(\left(\frac{1}{90} \cdot angle\right) \cdot \pi\right) + \sin \left(-1 \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{180}, \pi, \frac{1}{180} \cdot \mathsf{PI}\left(\right)\right)\right)\right)}{2}\right) \]
      6. lower-PI.f6466.7

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \frac{\sin \left(\left(0.011111111111111112 \cdot angle\right) \cdot \pi\right) + \sin \left(-1 \cdot \left(angle \cdot \mathsf{fma}\left(-0.005555555555555556, \pi, 0.005555555555555556 \cdot \pi\right)\right)\right)}{2}\right) \]
    8. Applied rewrites66.7%

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

Alternative 2: 67.2% accurate, 0.5× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\pi \cdot angle\_m, 0.011111111111111112, 0\right) \cdot 0.5\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 8.5 \cdot 10^{+158}:\\ \;\;\;\;\left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \frac{\mathsf{fma}\left(2, \left(\cos t\_0 \cdot \sin t\_0\right) \cdot 0.5, 0.5 \cdot \left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right) - \sin 0\right)\right) + \sin \left(\mathsf{fma}\left(\pi \cdot 0.005555555555555556, angle\_m, -0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sin \left(\mathsf{fma}\left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \sqrt{\pi}, \sqrt{\pi}, 0.5 \cdot \pi\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right)\\ \end{array} \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
 (let* ((t_0 (* (fma (* PI angle_m) 0.011111111111111112 0.0) 0.5)))
   (*
    angle_s
    (if (<= angle_m 8.5e+158)
      (*
       (+ a b)
       (*
        (* 2.0 (- b a))
        (/
         (+
          (fma
           2.0
           (* (* (cos t_0) (sin t_0)) 0.5)
           (* 0.5 (- (sin (* PI (* angle_m 0.011111111111111112))) (sin 0.0))))
          (sin
           (fma
            (* PI 0.005555555555555556)
            angle_m
            (* -0.005555555555555556 (* PI angle_m)))))
         2.0)))
      (*
       (*
        (sin
         (fma
          (* (* 0.005555555555555556 angle_m) (sqrt PI))
          (sqrt PI)
          (* 0.5 PI)))
        (* (* (+ b a) (- b a)) 2.0))
       (sin (* (* 0.005555555555555556 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) {
	double t_0 = fma((((double) M_PI) * angle_m), 0.011111111111111112, 0.0) * 0.5;
	double tmp;
	if (angle_m <= 8.5e+158) {
		tmp = (a + b) * ((2.0 * (b - a)) * ((fma(2.0, ((cos(t_0) * sin(t_0)) * 0.5), (0.5 * (sin((((double) M_PI) * (angle_m * 0.011111111111111112))) - sin(0.0)))) + sin(fma((((double) M_PI) * 0.005555555555555556), angle_m, (-0.005555555555555556 * (((double) M_PI) * angle_m))))) / 2.0));
	} else {
		tmp = (sin(fma(((0.005555555555555556 * angle_m) * sqrt(((double) M_PI))), sqrt(((double) M_PI)), (0.5 * ((double) M_PI)))) * (((b + a) * (b - a)) * 2.0)) * sin(((0.005555555555555556 * angle_m) * ((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)
	t_0 = Float64(fma(Float64(pi * angle_m), 0.011111111111111112, 0.0) * 0.5)
	tmp = 0.0
	if (angle_m <= 8.5e+158)
		tmp = Float64(Float64(a + b) * Float64(Float64(2.0 * Float64(b - a)) * Float64(Float64(fma(2.0, Float64(Float64(cos(t_0) * sin(t_0)) * 0.5), Float64(0.5 * Float64(sin(Float64(pi * Float64(angle_m * 0.011111111111111112))) - sin(0.0)))) + sin(fma(Float64(pi * 0.005555555555555556), angle_m, Float64(-0.005555555555555556 * Float64(pi * angle_m))))) / 2.0)));
	else
		tmp = Float64(Float64(sin(fma(Float64(Float64(0.005555555555555556 * angle_m) * sqrt(pi)), sqrt(pi), Float64(0.5 * pi))) * Float64(Float64(Float64(b + a) * Float64(b - a)) * 2.0)) * sin(Float64(Float64(0.005555555555555556 * angle_m) * 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_] := Block[{t$95$0 = N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.011111111111111112 + 0.0), $MachinePrecision] * 0.5), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 8.5e+158], N[(N[(a + b), $MachinePrecision] * N[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(2.0 * N[(N[(N[Cos[t$95$0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] + N[(0.5 * N[(N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[Sin[0.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Sin[N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * angle$95$m + N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[N[(N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision] + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\pi \cdot angle\_m, 0.011111111111111112, 0\right) \cdot 0.5\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 8.5 \cdot 10^{+158}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \frac{\mathsf{fma}\left(2, \left(\cos t\_0 \cdot \sin t\_0\right) \cdot 0.5, 0.5 \cdot \left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right) - \sin 0\right)\right) + \sin \left(\mathsf{fma}\left(\pi \cdot 0.005555555555555556, angle\_m, -0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}{2}\right)\\

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


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

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

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

    if 8.49999999999999978e158 < angle

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

      \[\leadsto \color{blue}{\left(\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)} \]
    4. Step-by-step derivation
      1. lift-cos.f64N/A

        \[\leadsto \left(\color{blue}{\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left(\cos \color{blue}{\left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(\cos \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \pi\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      4. *-commutativeN/A

        \[\leadsto \left(\cos \left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \pi\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      5. metadata-evalN/A

        \[\leadsto \left(\cos \left(\left(angle \cdot \color{blue}{\frac{1}{180}}\right) \cdot \pi\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      6. mult-flipN/A

        \[\leadsto \left(\cos \left(\color{blue}{\frac{angle}{180}} \cdot \pi\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      7. lift-/.f64N/A

        \[\leadsto \left(\cos \left(\color{blue}{\frac{angle}{180}} \cdot \pi\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      8. *-commutativeN/A

        \[\leadsto \left(\cos \color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left(\cos \color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      10. cos-fabs-revN/A

        \[\leadsto \left(\color{blue}{\cos \left(\left|\pi \cdot \frac{angle}{180}\right|\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      11. sin-+PI/2-revN/A

        \[\leadsto \left(\color{blue}{\sin \left(\left|\pi \cdot \frac{angle}{180}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      12. lower-sin.f64N/A

        \[\leadsto \left(\color{blue}{\sin \left(\left|\pi \cdot \frac{angle}{180}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      13. lift-*.f64N/A

        \[\leadsto \left(\sin \left(\left|\color{blue}{\pi \cdot \frac{angle}{180}}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      14. *-commutativeN/A

        \[\leadsto \left(\sin \left(\left|\color{blue}{\frac{angle}{180} \cdot \pi}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      15. fabs-mulN/A

        \[\leadsto \left(\sin \left(\color{blue}{\left|\frac{angle}{180}\right| \cdot \left|\pi\right|} + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      16. lift-PI.f64N/A

        \[\leadsto \left(\sin \left(\left|\frac{angle}{180}\right| \cdot \left|\color{blue}{\mathsf{PI}\left(\right)}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      17. add-exp-logN/A

        \[\leadsto \left(\sin \left(\left|\frac{angle}{180}\right| \cdot \left|\color{blue}{e^{\log \mathsf{PI}\left(\right)}}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      18. exp-fabsN/A

        \[\leadsto \left(\sin \left(\left|\frac{angle}{180}\right| \cdot \color{blue}{e^{\log \mathsf{PI}\left(\right)}} + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      19. add-exp-logN/A

        \[\leadsto \left(\sin \left(\left|\frac{angle}{180}\right| \cdot \color{blue}{\mathsf{PI}\left(\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      20. lift-PI.f64N/A

        \[\leadsto \left(\sin \left(\left|\frac{angle}{180}\right| \cdot \color{blue}{\pi} + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      21. lower-fma.f64N/A

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

      \[\leadsto \left(\color{blue}{\sin \left(\mathsf{fma}\left(\left|angle \cdot 0.005555555555555556\right|, \pi, \pi \cdot 0.5\right)\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \]
    6. Step-by-step derivation
      1. lift-fma.f64N/A

        \[\leadsto \left(\sin \color{blue}{\left(\left|angle \cdot \frac{1}{180}\right| \cdot \pi + \pi \cdot \frac{1}{2}\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      2. lift-PI.f64N/A

        \[\leadsto \left(\sin \left(\left|angle \cdot \frac{1}{180}\right| \cdot \color{blue}{\mathsf{PI}\left(\right)} + \pi \cdot \frac{1}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      3. add-sqr-sqrtN/A

        \[\leadsto \left(\sin \left(\left|angle \cdot \frac{1}{180}\right| \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} + \pi \cdot \frac{1}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      4. associate-*r*N/A

        \[\leadsto \left(\sin \left(\color{blue}{\left(\left|angle \cdot \frac{1}{180}\right| \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} + \pi \cdot \frac{1}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \left(\sin \color{blue}{\left(\mathsf{fma}\left(\left|angle \cdot \frac{1}{180}\right| \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      6. lift-fabs.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\left|angle \cdot \frac{1}{180}\right|} \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      7. rem-sqrt-square-revN/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\sqrt{\left(angle \cdot \frac{1}{180}\right) \cdot \left(angle \cdot \frac{1}{180}\right)}} \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      8. sqrt-prodN/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\left(\sqrt{angle \cdot \frac{1}{180}} \cdot \sqrt{angle \cdot \frac{1}{180}}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      9. rem-square-sqrtN/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      10. lower-*.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\left(angle \cdot \frac{1}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      11. lift-*.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      12. *-commutativeN/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      13. lift-*.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      14. lift-PI.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\left(\frac{1}{180} \cdot angle\right) \cdot \sqrt{\color{blue}{\pi}}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      15. lower-sqrt.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\left(\frac{1}{180} \cdot angle\right) \cdot \color{blue}{\sqrt{\pi}}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      16. lift-PI.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\left(\frac{1}{180} \cdot angle\right) \cdot \sqrt{\pi}, \sqrt{\color{blue}{\pi}}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      17. lower-sqrt.f6457.0

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\pi}, \color{blue}{\sqrt{\pi}}, \pi \cdot 0.5\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \]
      18. lift-*.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\left(\frac{1}{180} \cdot angle\right) \cdot \sqrt{\pi}, \sqrt{\pi}, \color{blue}{\pi \cdot \frac{1}{2}}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      19. *-commutativeN/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\left(\frac{1}{180} \cdot angle\right) \cdot \sqrt{\pi}, \sqrt{\pi}, \color{blue}{\frac{1}{2} \cdot \pi}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      20. lower-*.f6457.0

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\pi}, \sqrt{\pi}, \color{blue}{0.5 \cdot \pi}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \]
    7. Applied rewrites57.0%

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

Alternative 3: 67.2% accurate, 1.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}\;angle\_m \leq 8.5 \cdot 10^{+158}:\\ \;\;\;\;\left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \frac{\sin \left(\left(0.011111111111111112 \cdot angle\_m\right) \cdot \pi\right) + \sin \left(\mathsf{fma}\left(\pi \cdot 0.005555555555555556, angle\_m, -0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sin \left(\mathsf{fma}\left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \sqrt{\pi}, \sqrt{\pi}, 0.5 \cdot \pi\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\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 8.5e+158)
    (*
     (+ a b)
     (*
      (* 2.0 (- b a))
      (/
       (+
        (sin (* (* 0.011111111111111112 angle_m) PI))
        (sin
         (fma
          (* PI 0.005555555555555556)
          angle_m
          (* -0.005555555555555556 (* PI angle_m)))))
       2.0)))
    (*
     (*
      (sin
       (fma
        (* (* 0.005555555555555556 angle_m) (sqrt PI))
        (sqrt PI)
        (* 0.5 PI)))
      (* (* (+ b a) (- b a)) 2.0))
     (sin (* (* 0.005555555555555556 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) {
	double tmp;
	if (angle_m <= 8.5e+158) {
		tmp = (a + b) * ((2.0 * (b - a)) * ((sin(((0.011111111111111112 * angle_m) * ((double) M_PI))) + sin(fma((((double) M_PI) * 0.005555555555555556), angle_m, (-0.005555555555555556 * (((double) M_PI) * angle_m))))) / 2.0));
	} else {
		tmp = (sin(fma(((0.005555555555555556 * angle_m) * sqrt(((double) M_PI))), sqrt(((double) M_PI)), (0.5 * ((double) M_PI)))) * (((b + a) * (b - a)) * 2.0)) * sin(((0.005555555555555556 * angle_m) * ((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 <= 8.5e+158)
		tmp = Float64(Float64(a + b) * Float64(Float64(2.0 * Float64(b - a)) * Float64(Float64(sin(Float64(Float64(0.011111111111111112 * angle_m) * pi)) + sin(fma(Float64(pi * 0.005555555555555556), angle_m, Float64(-0.005555555555555556 * Float64(pi * angle_m))))) / 2.0)));
	else
		tmp = Float64(Float64(sin(fma(Float64(Float64(0.005555555555555556 * angle_m) * sqrt(pi)), sqrt(pi), Float64(0.5 * pi))) * Float64(Float64(Float64(b + a) * Float64(b - a)) * 2.0)) * sin(Float64(Float64(0.005555555555555556 * angle_m) * 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, 8.5e+158], N[(N[(a + b), $MachinePrecision] * N[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[N[(N[(0.011111111111111112 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] + N[Sin[N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * angle$95$m + N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[N[(N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision] + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $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.5 \cdot 10^{+158}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \frac{\sin \left(\left(0.011111111111111112 \cdot angle\_m\right) \cdot \pi\right) + \sin \left(\mathsf{fma}\left(\pi \cdot 0.005555555555555556, angle\_m, -0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}{2}\right)\\

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


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

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

    if 8.49999999999999978e158 < angle

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

      \[\leadsto \color{blue}{\left(\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)} \]
    4. Step-by-step derivation
      1. lift-cos.f64N/A

        \[\leadsto \left(\color{blue}{\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left(\cos \color{blue}{\left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(\cos \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \pi\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      4. *-commutativeN/A

        \[\leadsto \left(\cos \left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \pi\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      5. metadata-evalN/A

        \[\leadsto \left(\cos \left(\left(angle \cdot \color{blue}{\frac{1}{180}}\right) \cdot \pi\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      6. mult-flipN/A

        \[\leadsto \left(\cos \left(\color{blue}{\frac{angle}{180}} \cdot \pi\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      7. lift-/.f64N/A

        \[\leadsto \left(\cos \left(\color{blue}{\frac{angle}{180}} \cdot \pi\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      8. *-commutativeN/A

        \[\leadsto \left(\cos \color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left(\cos \color{blue}{\left(\pi \cdot \frac{angle}{180}\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      10. cos-fabs-revN/A

        \[\leadsto \left(\color{blue}{\cos \left(\left|\pi \cdot \frac{angle}{180}\right|\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      11. sin-+PI/2-revN/A

        \[\leadsto \left(\color{blue}{\sin \left(\left|\pi \cdot \frac{angle}{180}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      12. lower-sin.f64N/A

        \[\leadsto \left(\color{blue}{\sin \left(\left|\pi \cdot \frac{angle}{180}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      13. lift-*.f64N/A

        \[\leadsto \left(\sin \left(\left|\color{blue}{\pi \cdot \frac{angle}{180}}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      14. *-commutativeN/A

        \[\leadsto \left(\sin \left(\left|\color{blue}{\frac{angle}{180} \cdot \pi}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      15. fabs-mulN/A

        \[\leadsto \left(\sin \left(\color{blue}{\left|\frac{angle}{180}\right| \cdot \left|\pi\right|} + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      16. lift-PI.f64N/A

        \[\leadsto \left(\sin \left(\left|\frac{angle}{180}\right| \cdot \left|\color{blue}{\mathsf{PI}\left(\right)}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      17. add-exp-logN/A

        \[\leadsto \left(\sin \left(\left|\frac{angle}{180}\right| \cdot \left|\color{blue}{e^{\log \mathsf{PI}\left(\right)}}\right| + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      18. exp-fabsN/A

        \[\leadsto \left(\sin \left(\left|\frac{angle}{180}\right| \cdot \color{blue}{e^{\log \mathsf{PI}\left(\right)}} + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      19. add-exp-logN/A

        \[\leadsto \left(\sin \left(\left|\frac{angle}{180}\right| \cdot \color{blue}{\mathsf{PI}\left(\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      20. lift-PI.f64N/A

        \[\leadsto \left(\sin \left(\left|\frac{angle}{180}\right| \cdot \color{blue}{\pi} + \frac{\mathsf{PI}\left(\right)}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      21. lower-fma.f64N/A

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

      \[\leadsto \left(\color{blue}{\sin \left(\mathsf{fma}\left(\left|angle \cdot 0.005555555555555556\right|, \pi, \pi \cdot 0.5\right)\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \]
    6. Step-by-step derivation
      1. lift-fma.f64N/A

        \[\leadsto \left(\sin \color{blue}{\left(\left|angle \cdot \frac{1}{180}\right| \cdot \pi + \pi \cdot \frac{1}{2}\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      2. lift-PI.f64N/A

        \[\leadsto \left(\sin \left(\left|angle \cdot \frac{1}{180}\right| \cdot \color{blue}{\mathsf{PI}\left(\right)} + \pi \cdot \frac{1}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      3. add-sqr-sqrtN/A

        \[\leadsto \left(\sin \left(\left|angle \cdot \frac{1}{180}\right| \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} + \pi \cdot \frac{1}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      4. associate-*r*N/A

        \[\leadsto \left(\sin \left(\color{blue}{\left(\left|angle \cdot \frac{1}{180}\right| \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}} + \pi \cdot \frac{1}{2}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \left(\sin \color{blue}{\left(\mathsf{fma}\left(\left|angle \cdot \frac{1}{180}\right| \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right)} \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      6. lift-fabs.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\left|angle \cdot \frac{1}{180}\right|} \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      7. rem-sqrt-square-revN/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\sqrt{\left(angle \cdot \frac{1}{180}\right) \cdot \left(angle \cdot \frac{1}{180}\right)}} \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      8. sqrt-prodN/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\left(\sqrt{angle \cdot \frac{1}{180}} \cdot \sqrt{angle \cdot \frac{1}{180}}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      9. rem-square-sqrtN/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      10. lower-*.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\left(angle \cdot \frac{1}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      11. lift-*.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\left(angle \cdot \frac{1}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      12. *-commutativeN/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      13. lift-*.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      14. lift-PI.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\left(\frac{1}{180} \cdot angle\right) \cdot \sqrt{\color{blue}{\pi}}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      15. lower-sqrt.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\left(\frac{1}{180} \cdot angle\right) \cdot \color{blue}{\sqrt{\pi}}, \sqrt{\mathsf{PI}\left(\right)}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      16. lift-PI.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\left(\frac{1}{180} \cdot angle\right) \cdot \sqrt{\pi}, \sqrt{\color{blue}{\pi}}, \pi \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      17. lower-sqrt.f6457.0

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\pi}, \color{blue}{\sqrt{\pi}}, \pi \cdot 0.5\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \]
      18. lift-*.f64N/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\left(\frac{1}{180} \cdot angle\right) \cdot \sqrt{\pi}, \sqrt{\pi}, \color{blue}{\pi \cdot \frac{1}{2}}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      19. *-commutativeN/A

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\left(\frac{1}{180} \cdot angle\right) \cdot \sqrt{\pi}, \sqrt{\pi}, \color{blue}{\frac{1}{2} \cdot \pi}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \]
      20. lower-*.f6457.0

        \[\leadsto \left(\sin \left(\mathsf{fma}\left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\pi}, \sqrt{\pi}, \color{blue}{0.5 \cdot \pi}\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right)\right) \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \]
    7. Applied rewrites57.0%

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

Alternative 4: 67.1% 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 1.7 \cdot 10^{+102}:\\ \;\;\;\;\left(a + b\right) \cdot \left(\left(\sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right) + \sin \left(\mathsf{fma}\left(-0.005555555555555556, angle\_m \cdot \pi, 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, b, a \cdot a\right) \cdot \sin \left(\left(0.011111111111111112 \cdot angle\_m\right) \cdot \pi\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.7e+102)
    (*
     (+ a b)
     (*
      (+
       (sin (* 0.011111111111111112 (* angle_m PI)))
       (sin
        (fma
         -0.005555555555555556
         (* angle_m PI)
         (* 0.005555555555555556 (* angle_m PI)))))
      (- b a)))
    (* (fma b b (* a a)) (sin (* (* 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) {
	double tmp;
	if (angle_m <= 1.7e+102) {
		tmp = (a + b) * ((sin((0.011111111111111112 * (angle_m * ((double) M_PI)))) + sin(fma(-0.005555555555555556, (angle_m * ((double) M_PI)), (0.005555555555555556 * (angle_m * ((double) M_PI)))))) * (b - a));
	} else {
		tmp = fma(b, b, (a * a)) * sin(((0.011111111111111112 * angle_m) * ((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.7e+102)
		tmp = Float64(Float64(a + b) * Float64(Float64(sin(Float64(0.011111111111111112 * Float64(angle_m * pi))) + sin(fma(-0.005555555555555556, Float64(angle_m * pi), Float64(0.005555555555555556 * Float64(angle_m * pi))))) * Float64(b - a)));
	else
		tmp = Float64(fma(b, b, Float64(a * a)) * sin(Float64(Float64(0.011111111111111112 * angle_m) * 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.7e+102], N[(N[(a + b), $MachinePrecision] * N[(N[(N[Sin[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Sin[N[(-0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision] + N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * b + N[(a * a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(0.011111111111111112 * angle$95$m), $MachinePrecision] * Pi), $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.7 \cdot 10^{+102}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(\sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right) + \sin \left(\mathsf{fma}\left(-0.005555555555555556, angle\_m \cdot \pi, 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right) \cdot \left(b - a\right)\right)\\

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


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

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(\left(\sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) + \sin \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(b - a\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(\sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) + \sin \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
    8. Applied rewrites67.0%

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

    if 1.7e102 < angle

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

Alternative 5: 67.1% accurate, 1.2× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 1.15 \cdot 10^{+71}:\\ \;\;\;\;\left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right) \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot 2\right) \cdot \left(\left(\left(b - a\right) \cdot \cos t\_0\right) \cdot \sin t\_0\right)\\ \end{array} \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
 (let* ((t_0 (* PI (* 0.005555555555555556 angle_m))))
   (*
    angle_s
    (if (<= angle_m 1.15e+71)
      (*
       (+ a b)
       (*
        (* 2.0 (- b a))
        (*
         (cos (* -0.005555555555555556 (* PI angle_m)))
         (sin (* (* angle_m 0.005555555555555556) PI)))))
      (* (* (- b a) 2.0) (* (* (- b a) (cos t_0)) (sin t_0)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (0.005555555555555556 * angle_m);
	double tmp;
	if (angle_m <= 1.15e+71) {
		tmp = (a + b) * ((2.0 * (b - a)) * (cos((-0.005555555555555556 * (((double) M_PI) * angle_m))) * sin(((angle_m * 0.005555555555555556) * ((double) M_PI)))));
	} else {
		tmp = ((b - a) * 2.0) * (((b - a) * cos(t_0)) * sin(t_0));
	}
	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 t_0 = Math.PI * (0.005555555555555556 * angle_m);
	double tmp;
	if (angle_m <= 1.15e+71) {
		tmp = (a + b) * ((2.0 * (b - a)) * (Math.cos((-0.005555555555555556 * (Math.PI * angle_m))) * Math.sin(((angle_m * 0.005555555555555556) * Math.PI))));
	} else {
		tmp = ((b - a) * 2.0) * (((b - a) * Math.cos(t_0)) * Math.sin(t_0));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = math.pi * (0.005555555555555556 * angle_m)
	tmp = 0
	if angle_m <= 1.15e+71:
		tmp = (a + b) * ((2.0 * (b - a)) * (math.cos((-0.005555555555555556 * (math.pi * angle_m))) * math.sin(((angle_m * 0.005555555555555556) * math.pi))))
	else:
		tmp = ((b - a) * 2.0) * (((b - a) * math.cos(t_0)) * math.sin(t_0))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(pi * Float64(0.005555555555555556 * angle_m))
	tmp = 0.0
	if (angle_m <= 1.15e+71)
		tmp = Float64(Float64(a + b) * Float64(Float64(2.0 * Float64(b - a)) * Float64(cos(Float64(-0.005555555555555556 * Float64(pi * angle_m))) * sin(Float64(Float64(angle_m * 0.005555555555555556) * pi)))));
	else
		tmp = Float64(Float64(Float64(b - a) * 2.0) * Float64(Float64(Float64(b - a) * cos(t_0)) * sin(t_0)));
	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)
	t_0 = pi * (0.005555555555555556 * angle_m);
	tmp = 0.0;
	if (angle_m <= 1.15e+71)
		tmp = (a + b) * ((2.0 * (b - a)) * (cos((-0.005555555555555556 * (pi * angle_m))) * sin(((angle_m * 0.005555555555555556) * pi))));
	else
		tmp = ((b - a) * 2.0) * (((b - a) * cos(t_0)) * sin(t_0));
	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_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 1.15e+71], N[(N[(a + b), $MachinePrecision] * N[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[(N[(b - a), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 1.15 \cdot 10^{+71}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right) \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\\

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


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

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

      \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)} \]
    5. Step-by-step derivation
      1. lift-cos.f64N/A

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

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\color{blue}{\cos \left(\mathsf{neg}\left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)} \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      3. lower-cos.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\color{blue}{\cos \left(\mathsf{neg}\left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)} \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      4. lift-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\color{blue}{\left(angle \cdot \frac{1}{180}\right) \cdot \pi}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\color{blue}{\pi \cdot \left(angle \cdot \frac{1}{180}\right)}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\pi \cdot \left(angle \cdot \color{blue}{\frac{1}{180}}\right)\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      8. mult-flipN/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\pi \cdot \color{blue}{\frac{angle}{180}}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      9. lift-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      10. lift-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\color{blue}{\pi} \cdot \frac{angle}{180}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      11. div-flipN/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\pi \cdot \color{blue}{\frac{1}{\frac{180}{angle}}}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      12. lift-/.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\pi \cdot \frac{1}{\color{blue}{\frac{180}{angle}}}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      13. mult-flipN/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\color{blue}{\frac{\pi}{\frac{180}{angle}}}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      14. lift-/.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\color{blue}{\frac{\pi}{\frac{180}{angle}}}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      15. lift-/.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\color{blue}{\frac{\pi}{\frac{180}{angle}}}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      16. lift-/.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\frac{\pi}{\color{blue}{\frac{180}{angle}}}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      17. associate-/r/N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\color{blue}{\frac{\pi}{180} \cdot angle}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      18. associate-*l/N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\color{blue}{\frac{\pi \cdot angle}{180}}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      19. mult-flipN/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\color{blue}{\left(\pi \cdot angle\right) \cdot \frac{1}{180}}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      20. metadata-evalN/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\left(\pi \cdot angle\right) \cdot \color{blue}{\frac{1}{180}}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      21. *-commutativeN/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\color{blue}{\left(angle \cdot \pi\right)} \cdot \frac{1}{180}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      22. *-commutativeN/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\color{blue}{\frac{1}{180} \cdot \left(angle \cdot \pi\right)}\right)\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      23. distribute-lft-neg-inN/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{180}\right)\right) \cdot \left(angle \cdot \pi\right)\right)} \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \]
      24. *-commutativeN/A

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

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

    if 1.1500000000000001e71 < angle

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

Alternative 6: 67.0% 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}\;angle\_m \leq 9.5 \cdot 10^{-7}:\\ \;\;\;\;\left(a + b\right) \cdot \left(angle\_m \cdot \left(\mathsf{fma}\left(-0.005555555555555556, \pi, \mathsf{fma}\left(0.005555555555555556, \pi, 0.011111111111111112 \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right)\\ \mathbf{elif}\;angle\_m \leq 8.5 \cdot 10^{+69}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\left(\pi \cdot 0.011111111111111112\right) \cdot angle\_m\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, b, a \cdot a\right) \cdot \sin \left(\left(0.011111111111111112 \cdot angle\_m\right) \cdot \pi\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.5e-7)
    (*
     (+ a b)
     (*
      angle_m
      (*
       (fma
        -0.005555555555555556
        PI
        (fma 0.005555555555555556 PI (* 0.011111111111111112 PI)))
       (- b a))))
    (if (<= angle_m 8.5e+69)
      (* (* (- b a) (+ a b)) (sin (* (* PI 0.011111111111111112) angle_m)))
      (* (fma b b (* a a)) (sin (* (* 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) {
	double tmp;
	if (angle_m <= 9.5e-7) {
		tmp = (a + b) * (angle_m * (fma(-0.005555555555555556, ((double) M_PI), fma(0.005555555555555556, ((double) M_PI), (0.011111111111111112 * ((double) M_PI)))) * (b - a)));
	} else if (angle_m <= 8.5e+69) {
		tmp = ((b - a) * (a + b)) * sin(((((double) M_PI) * 0.011111111111111112) * angle_m));
	} else {
		tmp = fma(b, b, (a * a)) * sin(((0.011111111111111112 * angle_m) * ((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 <= 9.5e-7)
		tmp = Float64(Float64(a + b) * Float64(angle_m * Float64(fma(-0.005555555555555556, pi, fma(0.005555555555555556, pi, Float64(0.011111111111111112 * pi))) * Float64(b - a))));
	elseif (angle_m <= 8.5e+69)
		tmp = Float64(Float64(Float64(b - a) * Float64(a + b)) * sin(Float64(Float64(pi * 0.011111111111111112) * angle_m)));
	else
		tmp = Float64(fma(b, b, Float64(a * a)) * sin(Float64(Float64(0.011111111111111112 * angle_m) * 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, 9.5e-7], N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * N[(N[(-0.005555555555555556 * Pi + N[(0.005555555555555556 * Pi + N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 8.5e+69], N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(Pi * 0.011111111111111112), $MachinePrecision] * angle$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(b * b + N[(a * a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(0.011111111111111112 * angle$95$m), $MachinePrecision] * Pi), $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.5 \cdot 10^{-7}:\\
\;\;\;\;\left(a + b\right) \cdot \left(angle\_m \cdot \left(\mathsf{fma}\left(-0.005555555555555556, \pi, \mathsf{fma}\left(0.005555555555555556, \pi, 0.011111111111111112 \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right)\\

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

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


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

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(angle \cdot \left(\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \color{blue}{\left(\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\left(b - a\right)}\right)\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \mathsf{PI}\left(\right), \frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\color{blue}{b} - a\right)\right)\right) \]
      4. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b - a\right)\right)\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \mathsf{PI}\left(\right), \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right) \]
      6. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \pi, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \pi, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right) \]
      8. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \pi, \frac{1}{90} \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right) \]
      9. lower--.f6462.2

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(-0.005555555555555556, \pi, \mathsf{fma}\left(0.005555555555555556, \pi, 0.011111111111111112 \cdot \pi\right)\right) \cdot \left(b - \color{blue}{a}\right)\right)\right) \]
    8. Applied rewrites62.2%

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

    if 9.5000000000000001e-7 < angle < 8.5000000000000002e69

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

      \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \color{blue}{\left(\left(2 \cdot \left(angle \cdot \frac{1}{180}\right)\right) \cdot \pi\right)} \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \color{blue}{\left(\left(2 \cdot \left(angle \cdot \frac{1}{180}\right)\right) \cdot \pi\right)} \]
      5. lift-*.f64N/A

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\left(2 \cdot \color{blue}{\left(\frac{1}{180} \cdot angle\right)}\right) \cdot \pi\right) \]
      7. associate-*r*N/A

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\left(\color{blue}{\frac{1}{90}} \cdot angle\right) \cdot \pi\right) \]
      9. lower-*.f6457.1

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

      \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\sin \left(\left(0.011111111111111112 \cdot angle\right) \cdot \pi\right)} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \color{blue}{\left(\left(\frac{1}{90} \cdot angle\right) \cdot \pi\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \color{blue}{\left(\pi \cdot \left(\frac{1}{90} \cdot angle\right)\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\pi \cdot \color{blue}{\left(\frac{1}{90} \cdot angle\right)}\right) \]
      4. associate-*r*N/A

        \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \color{blue}{\left(\left(\pi \cdot \frac{1}{90}\right) \cdot angle\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \color{blue}{\left(\left(\pi \cdot \frac{1}{90}\right) \cdot angle\right)} \]
      6. lower-*.f6457.2

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

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

    if 8.5000000000000002e69 < angle

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

Alternative 7: 67.0% accurate, 2.1× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \sin \left(\left(0.011111111111111112 \cdot angle\_m\right) \cdot \pi\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 8 \cdot 10^{-7}:\\ \;\;\;\;\left(a + b\right) \cdot \left(angle\_m \cdot \left(\mathsf{fma}\left(-0.005555555555555556, \pi, \mathsf{fma}\left(0.005555555555555556, \pi, 0.011111111111111112 \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right)\\ \mathbf{elif}\;angle\_m \leq 9 \cdot 10^{+69}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, b, a \cdot a\right) \cdot t\_0\\ \end{array} \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
 (let* ((t_0 (sin (* (* 0.011111111111111112 angle_m) PI))))
   (*
    angle_s
    (if (<= angle_m 8e-7)
      (*
       (+ a b)
       (*
        angle_m
        (*
         (fma
          -0.005555555555555556
          PI
          (fma 0.005555555555555556 PI (* 0.011111111111111112 PI)))
         (- b a))))
      (if (<= angle_m 9e+69)
        (* (* (- b a) (+ a b)) t_0)
        (* (fma b b (* a a)) t_0))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = sin(((0.011111111111111112 * angle_m) * ((double) M_PI)));
	double tmp;
	if (angle_m <= 8e-7) {
		tmp = (a + b) * (angle_m * (fma(-0.005555555555555556, ((double) M_PI), fma(0.005555555555555556, ((double) M_PI), (0.011111111111111112 * ((double) M_PI)))) * (b - a)));
	} else if (angle_m <= 9e+69) {
		tmp = ((b - a) * (a + b)) * t_0;
	} else {
		tmp = fma(b, b, (a * a)) * t_0;
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = sin(Float64(Float64(0.011111111111111112 * angle_m) * pi))
	tmp = 0.0
	if (angle_m <= 8e-7)
		tmp = Float64(Float64(a + b) * Float64(angle_m * Float64(fma(-0.005555555555555556, pi, fma(0.005555555555555556, pi, Float64(0.011111111111111112 * pi))) * Float64(b - a))));
	elseif (angle_m <= 9e+69)
		tmp = Float64(Float64(Float64(b - a) * Float64(a + b)) * t_0);
	else
		tmp = Float64(fma(b, b, Float64(a * a)) * t_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_] := Block[{t$95$0 = N[Sin[N[(N[(0.011111111111111112 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 8e-7], N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * N[(N[(-0.005555555555555556 * Pi + N[(0.005555555555555556 * Pi + N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 9e+69], N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(b * b + N[(a * a), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, b, a \cdot a\right) \cdot t\_0\\


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

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(angle \cdot \left(\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \color{blue}{\left(\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\left(b - a\right)}\right)\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \mathsf{PI}\left(\right), \frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\color{blue}{b} - a\right)\right)\right) \]
      4. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b - a\right)\right)\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \mathsf{PI}\left(\right), \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right) \]
      6. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \pi, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \pi, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right) \]
      8. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \pi, \frac{1}{90} \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right) \]
      9. lower--.f6462.2

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(-0.005555555555555556, \pi, \mathsf{fma}\left(0.005555555555555556, \pi, 0.011111111111111112 \cdot \pi\right)\right) \cdot \left(b - \color{blue}{a}\right)\right)\right) \]
    8. Applied rewrites62.2%

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

    if 7.9999999999999996e-7 < angle < 8.9999999999999999e69

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

      \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \color{blue}{\left(\left(2 \cdot \left(angle \cdot \frac{1}{180}\right)\right) \cdot \pi\right)} \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \color{blue}{\left(\left(2 \cdot \left(angle \cdot \frac{1}{180}\right)\right) \cdot \pi\right)} \]
      5. lift-*.f64N/A

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\left(2 \cdot \color{blue}{\left(\frac{1}{180} \cdot angle\right)}\right) \cdot \pi\right) \]
      7. associate-*r*N/A

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

        \[\leadsto \left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\left(\color{blue}{\frac{1}{90}} \cdot angle\right) \cdot \pi\right) \]
      9. lower-*.f6457.1

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

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

    if 8.9999999999999999e69 < angle

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

Alternative 8: 67.0% 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 \cdot 10^{+69}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right) \cdot \left(b + a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, b, a \cdot a\right) \cdot \sin \left(\left(0.011111111111111112 \cdot angle\_m\right) \cdot \pi\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 9e+69)
    (* (- b a) (* (sin (* PI (* angle_m 0.011111111111111112))) (+ b a)))
    (* (fma b b (* a a)) (sin (* (* 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) {
	double tmp;
	if (angle_m <= 9e+69) {
		tmp = (b - a) * (sin((((double) M_PI) * (angle_m * 0.011111111111111112))) * (b + a));
	} else {
		tmp = fma(b, b, (a * a)) * sin(((0.011111111111111112 * angle_m) * ((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 <= 9e+69)
		tmp = Float64(Float64(b - a) * Float64(sin(Float64(pi * Float64(angle_m * 0.011111111111111112))) * Float64(b + a)));
	else
		tmp = Float64(fma(b, b, Float64(a * a)) * sin(Float64(Float64(0.011111111111111112 * angle_m) * 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, 9e+69], N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * b + N[(a * a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(0.011111111111111112 * angle$95$m), $MachinePrecision] * Pi), $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 \cdot 10^{+69}:\\
\;\;\;\;\left(b - a\right) \cdot \left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right) \cdot \left(b + a\right)\right)\\

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


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

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

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

    if 8.9999999999999999e69 < angle

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

Alternative 9: 66.8% accurate, 1.2× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 9 \cdot 10^{+69}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right) \cdot \left(b + a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot 2\right) \cdot \left(\left(\left(b - a\right) \cdot \cos t\_0\right) \cdot \sin t\_0\right)\\ \end{array} \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
 (let* ((t_0 (* PI (* 0.005555555555555556 angle_m))))
   (*
    angle_s
    (if (<= angle_m 9e+69)
      (* (- b a) (* (sin (* PI (* angle_m 0.011111111111111112))) (+ b a)))
      (* (* (- b a) 2.0) (* (* (- b a) (cos t_0)) (sin t_0)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (0.005555555555555556 * angle_m);
	double tmp;
	if (angle_m <= 9e+69) {
		tmp = (b - a) * (sin((((double) M_PI) * (angle_m * 0.011111111111111112))) * (b + a));
	} else {
		tmp = ((b - a) * 2.0) * (((b - a) * cos(t_0)) * sin(t_0));
	}
	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 t_0 = Math.PI * (0.005555555555555556 * angle_m);
	double tmp;
	if (angle_m <= 9e+69) {
		tmp = (b - a) * (Math.sin((Math.PI * (angle_m * 0.011111111111111112))) * (b + a));
	} else {
		tmp = ((b - a) * 2.0) * (((b - a) * Math.cos(t_0)) * Math.sin(t_0));
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	t_0 = math.pi * (0.005555555555555556 * angle_m)
	tmp = 0
	if angle_m <= 9e+69:
		tmp = (b - a) * (math.sin((math.pi * (angle_m * 0.011111111111111112))) * (b + a))
	else:
		tmp = ((b - a) * 2.0) * (((b - a) * math.cos(t_0)) * math.sin(t_0))
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = Float64(pi * Float64(0.005555555555555556 * angle_m))
	tmp = 0.0
	if (angle_m <= 9e+69)
		tmp = Float64(Float64(b - a) * Float64(sin(Float64(pi * Float64(angle_m * 0.011111111111111112))) * Float64(b + a)));
	else
		tmp = Float64(Float64(Float64(b - a) * 2.0) * Float64(Float64(Float64(b - a) * cos(t_0)) * sin(t_0)));
	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)
	t_0 = pi * (0.005555555555555556 * angle_m);
	tmp = 0.0;
	if (angle_m <= 9e+69)
		tmp = (b - a) * (sin((pi * (angle_m * 0.011111111111111112))) * (b + a));
	else
		tmp = ((b - a) * 2.0) * (((b - a) * cos(t_0)) * sin(t_0));
	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_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 9e+69], N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[(N[(b - a), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


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

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

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

    if 8.9999999999999999e69 < angle

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

Alternative 10: 66.7% accurate, 2.2× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \sin \left(\left(0.011111111111111112 \cdot angle\_m\right) \cdot \pi\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 9 \cdot 10^{+69}:\\ \;\;\;\;\left(a + b\right) \cdot \left(t\_0 \cdot \left(b - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, b, a \cdot a\right) \cdot t\_0\\ \end{array} \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
 (let* ((t_0 (sin (* (* 0.011111111111111112 angle_m) PI))))
   (*
    angle_s
    (if (<= angle_m 9e+69)
      (* (+ a b) (* t_0 (- b a)))
      (* (fma b b (* a a)) t_0)))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double t_0 = sin(((0.011111111111111112 * angle_m) * ((double) M_PI)));
	double tmp;
	if (angle_m <= 9e+69) {
		tmp = (a + b) * (t_0 * (b - a));
	} else {
		tmp = fma(b, b, (a * a)) * t_0;
	}
	return angle_s * tmp;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	t_0 = sin(Float64(Float64(0.011111111111111112 * angle_m) * pi))
	tmp = 0.0
	if (angle_m <= 9e+69)
		tmp = Float64(Float64(a + b) * Float64(t_0 * Float64(b - a)));
	else
		tmp = Float64(fma(b, b, Float64(a * a)) * t_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_] := Block[{t$95$0 = N[Sin[N[(N[(0.011111111111111112 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 9e+69], N[(N[(a + b), $MachinePrecision] * N[(t$95$0 * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * b + N[(a * a), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, b, a \cdot a\right) \cdot t\_0\\


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

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

      \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(\left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right) \cdot \left(2 \cdot \left(b - a\right)\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(\left(\left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right) \cdot 2\right) \cdot \left(b - a\right)\right)} \]
      5. *-commutativeN/A

        \[\leadsto \left(a + b\right) \cdot \left(\color{blue}{\left(2 \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right)} \cdot \left(b - a\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \color{blue}{\left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)}\right) \cdot \left(b - a\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \color{blue}{\left(\sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)}\right) \cdot \left(b - a\right)\right) \]
      8. lift-sin.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(\left(2 \cdot \left(\color{blue}{\sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)} \cdot \cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \left(b - a\right)\right) \]
      9. lift-cos.f64N/A

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

        \[\leadsto \left(a + b\right) \cdot \left(\color{blue}{\sin \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)} \cdot \left(b - a\right)\right) \]
      11. lift-*.f64N/A

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

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

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

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

    if 8.9999999999999999e69 < angle

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

Alternative 11: 66.0% 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 0.01:\\ \;\;\;\;\left(a + b\right) \cdot \left(angle\_m \cdot \left(\mathsf{fma}\left(-0.005555555555555556, \pi, \mathsf{fma}\left(0.005555555555555556, \pi, 0.011111111111111112 \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sin \left(\left(0.011111111111111112 \cdot angle\_m\right) \cdot \pi\right) \cdot \left(b - a\right)\right) \cdot \left(b - a\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 0.01)
    (*
     (+ a b)
     (*
      angle_m
      (*
       (fma
        -0.005555555555555556
        PI
        (fma 0.005555555555555556 PI (* 0.011111111111111112 PI)))
       (- b a))))
    (* (* (sin (* (* 0.011111111111111112 angle_m) PI)) (- 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) {
	double tmp;
	if (angle_m <= 0.01) {
		tmp = (a + b) * (angle_m * (fma(-0.005555555555555556, ((double) M_PI), fma(0.005555555555555556, ((double) M_PI), (0.011111111111111112 * ((double) M_PI)))) * (b - a)));
	} else {
		tmp = (sin(((0.011111111111111112 * angle_m) * ((double) M_PI))) * (b - a)) * (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 <= 0.01)
		tmp = Float64(Float64(a + b) * Float64(angle_m * Float64(fma(-0.005555555555555556, pi, fma(0.005555555555555556, pi, Float64(0.011111111111111112 * pi))) * Float64(b - a))));
	else
		tmp = Float64(Float64(sin(Float64(Float64(0.011111111111111112 * angle_m) * pi)) * Float64(b - a)) * Float64(b - a));
	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, 0.01], N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * N[(N[(-0.005555555555555556 * Pi + N[(0.005555555555555556 * Pi + N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[N[(N[(0.011111111111111112 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $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 \begin{array}{l}
\mathbf{if}\;angle\_m \leq 0.01:\\
\;\;\;\;\left(a + b\right) \cdot \left(angle\_m \cdot \left(\mathsf{fma}\left(-0.005555555555555556, \pi, \mathsf{fma}\left(0.005555555555555556, \pi, 0.011111111111111112 \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right)\\

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


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

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(angle \cdot \left(\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \color{blue}{\left(\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\left(b - a\right)}\right)\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \mathsf{PI}\left(\right), \frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\color{blue}{b} - a\right)\right)\right) \]
      4. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b - a\right)\right)\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \mathsf{PI}\left(\right), \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right) \]
      6. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \pi, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \pi, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right) \]
      8. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \pi, \frac{1}{90} \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right) \]
      9. lower--.f6462.2

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(-0.005555555555555556, \pi, \mathsf{fma}\left(0.005555555555555556, \pi, 0.011111111111111112 \cdot \pi\right)\right) \cdot \left(b - \color{blue}{a}\right)\right)\right) \]
    8. Applied rewrites62.2%

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

    if 0.0100000000000000002 < angle

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

      \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \left(a + b\right)} \]
      3. lift-+.f64N/A

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

        \[\leadsto \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \color{blue}{\left(b + a\right)} \]
      5. add-flipN/A

        \[\leadsto \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \color{blue}{\left(b - \left(\mathsf{neg}\left(a\right)\right)\right)} \]
      6. lift-neg.f64N/A

        \[\leadsto \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \left(b - \color{blue}{\left(-a\right)}\right) \]
      7. rem-exp-logN/A

        \[\leadsto \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \left(b - \color{blue}{e^{\log \left(-a\right)}}\right) \]
      8. lift-log.f64N/A

        \[\leadsto \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \left(b - e^{\color{blue}{\log \left(-a\right)}}\right) \]
      9. exp-fabsN/A

        \[\leadsto \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \left(b - \color{blue}{\left|e^{\log \left(-a\right)}\right|}\right) \]
      10. lift-log.f64N/A

        \[\leadsto \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \left(b - \left|e^{\color{blue}{\log \left(-a\right)}}\right|\right) \]
      11. rem-exp-logN/A

        \[\leadsto \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \left(b - \left|\color{blue}{-a}\right|\right) \]
      12. lift-neg.f64N/A

        \[\leadsto \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \left(b - \left|\color{blue}{\mathsf{neg}\left(a\right)}\right|\right) \]
      13. neg-fabsN/A

        \[\leadsto \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \left(b - \color{blue}{\left|a\right|}\right) \]
      14. rem-exp-logN/A

        \[\leadsto \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \left(b - \left|\color{blue}{e^{\log a}}\right|\right) \]
      15. exp-fabsN/A

        \[\leadsto \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \left(b - \color{blue}{e^{\log a}}\right) \]
      16. rem-exp-logN/A

        \[\leadsto \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \left(b - \color{blue}{a}\right) \]
      17. lift--.f64N/A

        \[\leadsto \left(\left(2 \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) \cdot \color{blue}{\left(b - a\right)} \]
      18. lower-*.f6444.8

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

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

Alternative 12: 66.0% accurate, 2.3× 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 0.01:\\ \;\;\;\;\left(a + b\right) \cdot \left(angle\_m \cdot \left(\mathsf{fma}\left(-0.005555555555555556, \pi, \mathsf{fma}\left(0.005555555555555556, \pi, 0.011111111111111112 \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, b, a \cdot a\right) \cdot \sin \left(\left(0.011111111111111112 \cdot angle\_m\right) \cdot \pi\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 0.01)
    (*
     (+ a b)
     (*
      angle_m
      (*
       (fma
        -0.005555555555555556
        PI
        (fma 0.005555555555555556 PI (* 0.011111111111111112 PI)))
       (- b a))))
    (* (fma b b (* a a)) (sin (* (* 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) {
	double tmp;
	if (angle_m <= 0.01) {
		tmp = (a + b) * (angle_m * (fma(-0.005555555555555556, ((double) M_PI), fma(0.005555555555555556, ((double) M_PI), (0.011111111111111112 * ((double) M_PI)))) * (b - a)));
	} else {
		tmp = fma(b, b, (a * a)) * sin(((0.011111111111111112 * angle_m) * ((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 <= 0.01)
		tmp = Float64(Float64(a + b) * Float64(angle_m * Float64(fma(-0.005555555555555556, pi, fma(0.005555555555555556, pi, Float64(0.011111111111111112 * pi))) * Float64(b - a))));
	else
		tmp = Float64(fma(b, b, Float64(a * a)) * sin(Float64(Float64(0.011111111111111112 * angle_m) * 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, 0.01], N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * N[(N[(-0.005555555555555556 * Pi + N[(0.005555555555555556 * Pi + N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * b + N[(a * a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(0.011111111111111112 * angle$95$m), $MachinePrecision] * Pi), $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 0.01:\\
\;\;\;\;\left(a + b\right) \cdot \left(angle\_m \cdot \left(\mathsf{fma}\left(-0.005555555555555556, \pi, \mathsf{fma}\left(0.005555555555555556, \pi, 0.011111111111111112 \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right)\\

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


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

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(angle \cdot \left(\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \color{blue}{\left(\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\left(b - a\right)}\right)\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \mathsf{PI}\left(\right), \frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\color{blue}{b} - a\right)\right)\right) \]
      4. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b - a\right)\right)\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \mathsf{PI}\left(\right), \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right) \]
      6. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \pi, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \pi, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right) \]
      8. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \pi, \frac{1}{90} \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right) \]
      9. lower--.f6462.2

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(-0.005555555555555556, \pi, \mathsf{fma}\left(0.005555555555555556, \pi, 0.011111111111111112 \cdot \pi\right)\right) \cdot \left(b - \color{blue}{a}\right)\right)\right) \]
    8. Applied rewrites62.2%

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

    if 0.0100000000000000002 < angle

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

Alternative 13: 62.6% accurate, 3.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.5 \cdot 10^{+269}:\\ \;\;\;\;\left(a + b\right) \cdot \left(angle\_m \cdot \left(\mathsf{fma}\left(-0.005555555555555556, \pi, \mathsf{fma}\left(0.005555555555555556, \pi, 0.011111111111111112 \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(\left(b - a\right) \cdot \left(a - b\right)\right) \cdot \pi\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.5e+269)
    (*
     (+ a b)
     (*
      angle_m
      (*
       (fma
        -0.005555555555555556
        PI
        (fma 0.005555555555555556 PI (* 0.011111111111111112 PI)))
       (- b a))))
    (* 0.011111111111111112 (* angle_m (* (* (- b a) (- 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 (angle_m <= 1.5e+269) {
		tmp = (a + b) * (angle_m * (fma(-0.005555555555555556, ((double) M_PI), fma(0.005555555555555556, ((double) M_PI), (0.011111111111111112 * ((double) M_PI)))) * (b - a)));
	} else {
		tmp = 0.011111111111111112 * (angle_m * (((b - a) * (a - b)) * ((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.5e+269)
		tmp = Float64(Float64(a + b) * Float64(angle_m * Float64(fma(-0.005555555555555556, pi, fma(0.005555555555555556, pi, Float64(0.011111111111111112 * pi))) * Float64(b - a))));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(Float64(b - a) * Float64(a - b)) * 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.5e+269], N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * N[(N[(-0.005555555555555556 * Pi + N[(0.005555555555555556 * Pi + N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(N[(N[(b - a), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision] * Pi), $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.5 \cdot 10^{+269}:\\
\;\;\;\;\left(a + b\right) \cdot \left(angle\_m \cdot \left(\mathsf{fma}\left(-0.005555555555555556, \pi, \mathsf{fma}\left(0.005555555555555556, \pi, 0.011111111111111112 \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right)\\

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


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

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\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. *-commutativeN/A

        \[\leadsto \color{blue}{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)} \]
      5. lower-*.f64N/A

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

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

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

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

      \[\leadsto \left(a + b\right) \cdot \color{blue}{\left(angle \cdot \left(\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \color{blue}{\left(\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\left(\frac{-1}{180} \cdot \mathsf{PI}\left(\right) + \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\left(b - a\right)}\right)\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \mathsf{PI}\left(\right), \frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\color{blue}{b} - a\right)\right)\right) \]
      4. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \frac{1}{180} \cdot \mathsf{PI}\left(\right) + \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b - a\right)\right)\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \mathsf{PI}\left(\right), \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right) \]
      6. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \pi, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \pi, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b - a\right)\right)\right) \]
      8. lower-PI.f64N/A

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(\frac{-1}{180}, \pi, \mathsf{fma}\left(\frac{1}{180}, \pi, \frac{1}{90} \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right) \]
      9. lower--.f6462.2

        \[\leadsto \left(a + b\right) \cdot \left(angle \cdot \left(\mathsf{fma}\left(-0.005555555555555556, \pi, \mathsf{fma}\left(0.005555555555555556, \pi, 0.011111111111111112 \cdot \pi\right)\right) \cdot \left(b - \color{blue}{a}\right)\right)\right) \]
    8. Applied rewrites62.2%

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

    if 1.5000000000000001e269 < angle

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
      4. lower-PI.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{{b}^{2}} - {a}^{2}\right)\right)\right) \]
      5. lower--.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - \color{blue}{{a}^{2}}\right)\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
      7. lower-pow.f6450.4

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

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\pi}\right)\right) \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \pi\right)\right) \]
      2. add-flipN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(a - \left(\mathsf{neg}\left(b\right)\right)\right)\right) \cdot \pi\right)\right) \]
      3. sub-to-multN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{a}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      4. rem-exp-logN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{e^{\log a}}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      5. exp-fabsN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|e^{\log a}\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      6. rem-exp-logN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|a\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      7. neg-fabsN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|\mathsf{neg}\left(a\right)\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      8. lift-neg.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|-a\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      9. rem-exp-logN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|e^{\log \left(-a\right)}\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      10. lift-log.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|e^{\log \left(-a\right)}\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      11. exp-fabsN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{e^{\log \left(-a\right)}}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      12. lift-log.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{e^{\log \left(-a\right)}}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      13. rem-exp-logN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{-a}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      14. lift-neg.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\mathsf{neg}\left(a\right)}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      15. frac-2negN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{b}{a}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      16. sub-to-multN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(a - b\right)\right) \cdot \pi\right)\right) \]
      17. lower--.f6438.1

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(a - b\right)\right) \cdot \pi\right)\right) \]
    7. Applied rewrites38.1%

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

Alternative 14: 62.5% accurate, 5.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}\;angle\_m \leq 1.5 \cdot 10^{+269}:\\ \;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(b - a\right)\right) \cdot \left(a + b\right)\right) \cdot 0.011111111111111112\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(\left(b - a\right) \cdot \left(a - b\right)\right) \cdot \pi\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.5e+269)
    (* (* (* (* PI angle_m) (- b a)) (+ a b)) 0.011111111111111112)
    (* 0.011111111111111112 (* angle_m (* (* (- b a) (- 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 (angle_m <= 1.5e+269) {
		tmp = (((((double) M_PI) * angle_m) * (b - a)) * (a + b)) * 0.011111111111111112;
	} else {
		tmp = 0.011111111111111112 * (angle_m * (((b - a) * (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 (angle_m <= 1.5e+269) {
		tmp = (((Math.PI * angle_m) * (b - a)) * (a + b)) * 0.011111111111111112;
	} else {
		tmp = 0.011111111111111112 * (angle_m * (((b - a) * (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 angle_m <= 1.5e+269:
		tmp = (((math.pi * angle_m) * (b - a)) * (a + b)) * 0.011111111111111112
	else:
		tmp = 0.011111111111111112 * (angle_m * (((b - a) * (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 (angle_m <= 1.5e+269)
		tmp = Float64(Float64(Float64(Float64(pi * angle_m) * Float64(b - a)) * Float64(a + b)) * 0.011111111111111112);
	else
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(Float64(b - a) * Float64(a - 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 (angle_m <= 1.5e+269)
		tmp = (((pi * angle_m) * (b - a)) * (a + b)) * 0.011111111111111112;
	else
		tmp = 0.011111111111111112 * (angle_m * (((b - a) * (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[angle$95$m, 1.5e+269], N[(N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(N[(N[(b - a), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision] * Pi), $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.5 \cdot 10^{+269}:\\
\;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(b - a\right)\right) \cdot \left(a + b\right)\right) \cdot 0.011111111111111112\\

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


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

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
      4. lower-PI.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{{b}^{2}} - {a}^{2}\right)\right)\right) \]
      5. lower--.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - \color{blue}{{a}^{2}}\right)\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
      7. lower-pow.f6450.4

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

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
      3. lower-*.f6450.4

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

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

    if 1.5000000000000001e269 < angle

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
      4. lower-PI.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{{b}^{2}} - {a}^{2}\right)\right)\right) \]
      5. lower--.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - \color{blue}{{a}^{2}}\right)\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
      7. lower-pow.f6450.4

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

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\pi}\right)\right) \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \pi\right)\right) \]
      2. add-flipN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(a - \left(\mathsf{neg}\left(b\right)\right)\right)\right) \cdot \pi\right)\right) \]
      3. sub-to-multN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{a}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      4. rem-exp-logN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{e^{\log a}}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      5. exp-fabsN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|e^{\log a}\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      6. rem-exp-logN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|a\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      7. neg-fabsN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|\mathsf{neg}\left(a\right)\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      8. lift-neg.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|-a\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      9. rem-exp-logN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|e^{\log \left(-a\right)}\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      10. lift-log.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|e^{\log \left(-a\right)}\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      11. exp-fabsN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{e^{\log \left(-a\right)}}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      12. lift-log.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{e^{\log \left(-a\right)}}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      13. rem-exp-logN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{-a}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      14. lift-neg.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\mathsf{neg}\left(a\right)}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      15. frac-2negN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{b}{a}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      16. sub-to-multN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(a - b\right)\right) \cdot \pi\right)\right) \]
      17. lower--.f6438.1

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(a - b\right)\right) \cdot \pi\right)\right) \]
    7. Applied rewrites38.1%

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

Alternative 15: 57.5% accurate, 0.9× speedup?

\[\begin{array}{l} 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}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq 0:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(\left(b - a\right) \cdot \left(a - b\right)\right) \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\right) \cdot \left(b \cdot \pi\right)\\ \end{array} \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
 (let* ((t_0 (* PI (/ angle_m 180.0))))
   (*
    angle_s
    (if (<=
         (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))
         0.0)
      (* 0.011111111111111112 (* angle_m (* (* (- b a) (- a b)) PI)))
      (* (* (* angle_m 0.011111111111111112) (- 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 t_0 = ((double) M_PI) * (angle_m / 180.0);
	double tmp;
	if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0)) <= 0.0) {
		tmp = 0.011111111111111112 * (angle_m * (((b - a) * (a - b)) * ((double) M_PI)));
	} else {
		tmp = ((angle_m * 0.011111111111111112) * (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 t_0 = Math.PI * (angle_m / 180.0);
	double tmp;
	if ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0)) <= 0.0) {
		tmp = 0.011111111111111112 * (angle_m * (((b - a) * (a - b)) * Math.PI));
	} else {
		tmp = ((angle_m * 0.011111111111111112) * (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):
	t_0 = math.pi * (angle_m / 180.0)
	tmp = 0
	if (((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)) <= 0.0:
		tmp = 0.011111111111111112 * (angle_m * (((b - a) * (a - b)) * math.pi))
	else:
		tmp = ((angle_m * 0.011111111111111112) * (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)
	t_0 = Float64(pi * Float64(angle_m / 180.0))
	tmp = 0.0
	if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) <= 0.0)
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(Float64(b - a) * Float64(a - b)) * pi)));
	else
		tmp = Float64(Float64(Float64(angle_m * 0.011111111111111112) * 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)
	t_0 = pi * (angle_m / 180.0);
	tmp = 0.0;
	if ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) <= 0.0)
		tmp = 0.011111111111111112 * (angle_m * (((b - a) * (a - b)) * pi));
	else
		tmp = ((angle_m * 0.011111111111111112) * (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_] := 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, 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], 0.0], N[(0.011111111111111112 * N[(angle$95$m * N[(N[(N[(b - a), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
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}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq 0:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(\left(b - a\right) \cdot \left(a - b\right)\right) \cdot \pi\right)\right)\\

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

    1. Initial program 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
      4. lower-PI.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{{b}^{2}} - {a}^{2}\right)\right)\right) \]
      5. lower--.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - \color{blue}{{a}^{2}}\right)\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
      7. lower-pow.f6450.4

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

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

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \color{blue}{\pi}\right)\right) \]
    6. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \pi\right)\right) \]
      2. add-flipN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(a - \left(\mathsf{neg}\left(b\right)\right)\right)\right) \cdot \pi\right)\right) \]
      3. sub-to-multN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{a}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      4. rem-exp-logN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{e^{\log a}}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      5. exp-fabsN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|e^{\log a}\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      6. rem-exp-logN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|a\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      7. neg-fabsN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|\mathsf{neg}\left(a\right)\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      8. lift-neg.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|-a\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      9. rem-exp-logN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|e^{\log \left(-a\right)}\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      10. lift-log.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\left|e^{\log \left(-a\right)}\right|}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      11. exp-fabsN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{e^{\log \left(-a\right)}}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      12. lift-log.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{e^{\log \left(-a\right)}}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      13. rem-exp-logN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{-a}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      14. lift-neg.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{\mathsf{neg}\left(b\right)}{\mathsf{neg}\left(a\right)}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      15. frac-2negN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(\left(1 - \frac{b}{a}\right) \cdot a\right)\right) \cdot \pi\right)\right) \]
      16. sub-to-multN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(a - b\right)\right) \cdot \pi\right)\right) \]
      17. lower--.f6438.1

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot \left(a - b\right)\right) \cdot \pi\right)\right) \]
    7. Applied rewrites38.1%

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

    if 0.0 < (*.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 53.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
      4. lower-PI.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{{b}^{2}} - {a}^{2}\right)\right)\right) \]
      5. lower--.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - \color{blue}{{a}^{2}}\right)\right)\right) \]
      6. lower-pow.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
      7. lower-pow.f6450.4

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

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

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

      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
    7. Step-by-step derivation
      1. Applied rewrites37.1%

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right)} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)}\right) \]
        3. associate-*r*N/A

          \[\leadsto \left(\frac{1}{90} \cdot angle\right) \cdot \color{blue}{\left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)} \]
        4. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{90} \cdot angle\right) \cdot \left(\color{blue}{\left(\left(b - a\right) \cdot b\right)} \cdot \pi\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{90} \cdot angle\right) \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \color{blue}{\pi}\right) \]
        6. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{90} \cdot angle\right) \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right) \]
        7. associate-*l*N/A

          \[\leadsto \left(\frac{1}{90} \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\left(b \cdot \pi\right)}\right) \]
        8. associate-*r*N/A

          \[\leadsto \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(b \cdot \pi\right)} \]
        9. lower-*.f64N/A

          \[\leadsto \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(b \cdot \pi\right)} \]
        10. lower-*.f64N/A

          \[\leadsto \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \left(\color{blue}{b} \cdot \pi\right) \]
        11. lift-*.f64N/A

          \[\leadsto \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \left(b \cdot \pi\right) \]
        12. *-commutativeN/A

          \[\leadsto \left(\left(angle \cdot \frac{1}{90}\right) \cdot \left(b - a\right)\right) \cdot \left(b \cdot \pi\right) \]
        13. lower-*.f64N/A

          \[\leadsto \left(\left(angle \cdot \frac{1}{90}\right) \cdot \left(b - a\right)\right) \cdot \left(b \cdot \pi\right) \]
        14. lower-*.f6441.3

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

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

    Alternative 16: 42.5% accurate, 0.9× speedup?

    \[\begin{array}{l} 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}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq 10^{+138}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot \left(b - a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\right) \cdot \left(b \cdot \pi\right)\\ \end{array} \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
     (let* ((t_0 (* PI (/ angle_m 180.0))))
       (*
        angle_s
        (if (<=
             (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))
             1e+138)
          (* 0.011111111111111112 (* (* PI angle_m) (* b (- b a))))
          (* (* (* angle_m 0.011111111111111112) (- 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 t_0 = ((double) M_PI) * (angle_m / 180.0);
    	double tmp;
    	if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0)) <= 1e+138) {
    		tmp = 0.011111111111111112 * ((((double) M_PI) * angle_m) * (b * (b - a)));
    	} else {
    		tmp = ((angle_m * 0.011111111111111112) * (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 t_0 = Math.PI * (angle_m / 180.0);
    	double tmp;
    	if ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0)) <= 1e+138) {
    		tmp = 0.011111111111111112 * ((Math.PI * angle_m) * (b * (b - a)));
    	} else {
    		tmp = ((angle_m * 0.011111111111111112) * (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):
    	t_0 = math.pi * (angle_m / 180.0)
    	tmp = 0
    	if (((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)) <= 1e+138:
    		tmp = 0.011111111111111112 * ((math.pi * angle_m) * (b * (b - a)))
    	else:
    		tmp = ((angle_m * 0.011111111111111112) * (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)
    	t_0 = Float64(pi * Float64(angle_m / 180.0))
    	tmp = 0.0
    	if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) <= 1e+138)
    		tmp = Float64(0.011111111111111112 * Float64(Float64(pi * angle_m) * Float64(b * Float64(b - a))));
    	else
    		tmp = Float64(Float64(Float64(angle_m * 0.011111111111111112) * 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)
    	t_0 = pi * (angle_m / 180.0);
    	tmp = 0.0;
    	if ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) <= 1e+138)
    		tmp = 0.011111111111111112 * ((pi * angle_m) * (b * (b - a)));
    	else
    		tmp = ((angle_m * 0.011111111111111112) * (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_] := 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, 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+138], N[(0.011111111111111112 * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
    
    \begin{array}{l}
    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}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq 10^{+138}:\\
    \;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot \left(b - a\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\right) \cdot \left(b \cdot \pi\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))))) < 1e138

      1. Initial program 53.3%

        \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
      2. 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. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
        3. lower-*.f64N/A

          \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
        4. lower-PI.f64N/A

          \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{{b}^{2}} - {a}^{2}\right)\right)\right) \]
        5. lower--.f64N/A

          \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - \color{blue}{{a}^{2}}\right)\right)\right) \]
        6. lower-pow.f64N/A

          \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
        7. lower-pow.f6450.4

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
      7. Step-by-step derivation
        1. Applied rewrites37.1%

          \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
        2. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)}\right) \]
          2. lift-*.f64N/A

            \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \color{blue}{\pi}\right)\right) \]
          3. *-commutativeN/A

            \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b - a\right) \cdot b\right)}\right)\right) \]
          4. associate-*r*N/A

            \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot b\right)}\right) \]
          5. *-commutativeN/A

            \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot b\right)\right) \]
          6. lift-*.f64N/A

            \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot b\right)\right) \]
          7. lower-*.f6437.1

            \[\leadsto 0.011111111111111112 \cdot \left(\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot b\right)}\right) \]
          8. lift-*.f64N/A

            \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{b}\right)\right) \]
          9. *-commutativeN/A

            \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot \color{blue}{\left(b - a\right)}\right)\right) \]
          10. lower-*.f6437.1

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

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

        if 1e138 < (*.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 53.3%

          \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
        2. 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. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
          2. lower-*.f64N/A

            \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
          3. lower-*.f64N/A

            \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
          4. lower-PI.f64N/A

            \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{{b}^{2}} - {a}^{2}\right)\right)\right) \]
          5. lower--.f64N/A

            \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - \color{blue}{{a}^{2}}\right)\right)\right) \]
          6. lower-pow.f64N/A

            \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
          7. lower-pow.f6450.4

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

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

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

          \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
        7. Step-by-step derivation
          1. Applied rewrites37.1%

            \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
          2. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right)} \]
            2. lift-*.f64N/A

              \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)}\right) \]
            3. associate-*r*N/A

              \[\leadsto \left(\frac{1}{90} \cdot angle\right) \cdot \color{blue}{\left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)} \]
            4. lift-*.f64N/A

              \[\leadsto \left(\frac{1}{90} \cdot angle\right) \cdot \left(\color{blue}{\left(\left(b - a\right) \cdot b\right)} \cdot \pi\right) \]
            5. lift-*.f64N/A

              \[\leadsto \left(\frac{1}{90} \cdot angle\right) \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \color{blue}{\pi}\right) \]
            6. lift-*.f64N/A

              \[\leadsto \left(\frac{1}{90} \cdot angle\right) \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right) \]
            7. associate-*l*N/A

              \[\leadsto \left(\frac{1}{90} \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{\left(b \cdot \pi\right)}\right) \]
            8. associate-*r*N/A

              \[\leadsto \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(b \cdot \pi\right)} \]
            9. lower-*.f64N/A

              \[\leadsto \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \color{blue}{\left(b \cdot \pi\right)} \]
            10. lower-*.f64N/A

              \[\leadsto \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \left(\color{blue}{b} \cdot \pi\right) \]
            11. lift-*.f64N/A

              \[\leadsto \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \left(b \cdot \pi\right) \]
            12. *-commutativeN/A

              \[\leadsto \left(\left(angle \cdot \frac{1}{90}\right) \cdot \left(b - a\right)\right) \cdot \left(b \cdot \pi\right) \]
            13. lower-*.f64N/A

              \[\leadsto \left(\left(angle \cdot \frac{1}{90}\right) \cdot \left(b - a\right)\right) \cdot \left(b \cdot \pi\right) \]
            14. lower-*.f6441.3

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

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

        Alternative 17: 41.9% accurate, 0.9× speedup?

        \[\begin{array}{l} 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}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq 10^{+81}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot \left(b - a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\\ \end{array} \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
         (let* ((t_0 (* PI (/ angle_m 180.0))))
           (*
            angle_s
            (if (<=
                 (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))
                 1e+81)
              (* 0.011111111111111112 (* (* PI angle_m) (* b (- b a))))
              (* (* 0.011111111111111112 (* (* angle_m b) (- 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 t_0 = ((double) M_PI) * (angle_m / 180.0);
        	double tmp;
        	if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0)) <= 1e+81) {
        		tmp = 0.011111111111111112 * ((((double) M_PI) * angle_m) * (b * (b - a)));
        	} else {
        		tmp = (0.011111111111111112 * ((angle_m * b) * (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 t_0 = Math.PI * (angle_m / 180.0);
        	double tmp;
        	if ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0)) <= 1e+81) {
        		tmp = 0.011111111111111112 * ((Math.PI * angle_m) * (b * (b - a)));
        	} else {
        		tmp = (0.011111111111111112 * ((angle_m * b) * (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):
        	t_0 = math.pi * (angle_m / 180.0)
        	tmp = 0
        	if (((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)) <= 1e+81:
        		tmp = 0.011111111111111112 * ((math.pi * angle_m) * (b * (b - a)))
        	else:
        		tmp = (0.011111111111111112 * ((angle_m * b) * (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)
        	t_0 = Float64(pi * Float64(angle_m / 180.0))
        	tmp = 0.0
        	if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) <= 1e+81)
        		tmp = Float64(0.011111111111111112 * Float64(Float64(pi * angle_m) * Float64(b * Float64(b - a))));
        	else
        		tmp = Float64(Float64(0.011111111111111112 * Float64(Float64(angle_m * b) * 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)
        	t_0 = pi * (angle_m / 180.0);
        	tmp = 0.0;
        	if ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) <= 1e+81)
        		tmp = 0.011111111111111112 * ((pi * angle_m) * (b * (b - a)));
        	else
        		tmp = (0.011111111111111112 * ((angle_m * b) * (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_] := 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, 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+81], N[(0.011111111111111112 * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.011111111111111112 * N[(N[(angle$95$m * b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]]), $MachinePrecision]]
        
        \begin{array}{l}
        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}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq 10^{+81}:\\
        \;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot \left(b - a\right)\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\\
        
        
        \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))))) < 9.99999999999999921e80

          1. Initial program 53.3%

            \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
          2. 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. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
            2. lower-*.f64N/A

              \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
            3. lower-*.f64N/A

              \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
            4. lower-PI.f64N/A

              \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{{b}^{2}} - {a}^{2}\right)\right)\right) \]
            5. lower--.f64N/A

              \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - \color{blue}{{a}^{2}}\right)\right)\right) \]
            6. lower-pow.f64N/A

              \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
            7. lower-pow.f6450.4

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

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

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

            \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
          7. Step-by-step derivation
            1. Applied rewrites37.1%

              \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)}\right) \]
              2. lift-*.f64N/A

                \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \color{blue}{\pi}\right)\right) \]
              3. *-commutativeN/A

                \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b - a\right) \cdot b\right)}\right)\right) \]
              4. associate-*r*N/A

                \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot b\right)}\right) \]
              5. *-commutativeN/A

                \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot b\right)\right) \]
              6. lift-*.f64N/A

                \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot b\right)\right) \]
              7. lower-*.f6437.1

                \[\leadsto 0.011111111111111112 \cdot \left(\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot b\right)}\right) \]
              8. lift-*.f64N/A

                \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{b}\right)\right) \]
              9. *-commutativeN/A

                \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot \color{blue}{\left(b - a\right)}\right)\right) \]
              10. lower-*.f6437.1

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

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

            if 9.99999999999999921e80 < (*.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 53.3%

              \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
            2. 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. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
              3. lower-*.f64N/A

                \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
              4. lower-PI.f64N/A

                \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{{b}^{2}} - {a}^{2}\right)\right)\right) \]
              5. lower--.f64N/A

                \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - \color{blue}{{a}^{2}}\right)\right)\right) \]
              6. lower-pow.f64N/A

                \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
              7. lower-pow.f6450.4

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

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

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

              \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
            7. Step-by-step derivation
              1. Applied rewrites37.1%

                \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
              2. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right)} \]
                2. lift-*.f64N/A

                  \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)}\right) \]
                3. lift-*.f64N/A

                  \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \color{blue}{\pi}\right)\right) \]
                4. associate-*r*N/A

                  \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot b\right)\right) \cdot \color{blue}{\pi}\right) \]
                5. associate-*r*N/A

                  \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \left(\left(b - a\right) \cdot b\right)\right)\right) \cdot \color{blue}{\pi} \]
                6. lower-*.f64N/A

                  \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \left(\left(b - a\right) \cdot b\right)\right)\right) \cdot \color{blue}{\pi} \]
                7. lower-*.f64N/A

                  \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \left(\left(b - a\right) \cdot b\right)\right)\right) \cdot \pi \]
                8. lift-*.f64N/A

                  \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \left(\left(b - a\right) \cdot b\right)\right)\right) \cdot \pi \]
                9. *-commutativeN/A

                  \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \left(b \cdot \left(b - a\right)\right)\right)\right) \cdot \pi \]
                10. associate-*r*N/A

                  \[\leadsto \left(\frac{1}{90} \cdot \left(\left(angle \cdot b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi \]
                11. lower-*.f64N/A

                  \[\leadsto \left(\frac{1}{90} \cdot \left(\left(angle \cdot b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi \]
                12. lower-*.f6439.9

                  \[\leadsto \left(0.011111111111111112 \cdot \left(\left(angle \cdot b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi \]
              3. Applied rewrites39.9%

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

            Alternative 18: 41.8% 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 2 \cdot 10^{+255}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot \left(b - a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(angle\_m \cdot b\right) \cdot \left(b - a\right)\right) \cdot \pi\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))) 2e+255)
                (* 0.011111111111111112 (* (* PI angle_m) (* b (- b a))))
                (* 0.011111111111111112 (* (* (* angle_m b) (- 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 ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) <= 2e+255) {
            		tmp = 0.011111111111111112 * ((((double) M_PI) * angle_m) * (b * (b - a)));
            	} else {
            		tmp = 0.011111111111111112 * (((angle_m * b) * (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 ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) <= 2e+255) {
            		tmp = 0.011111111111111112 * ((Math.PI * angle_m) * (b * (b - a)));
            	} else {
            		tmp = 0.011111111111111112 * (((angle_m * b) * (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 (2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) <= 2e+255:
            		tmp = 0.011111111111111112 * ((math.pi * angle_m) * (b * (b - a)))
            	else:
            		tmp = 0.011111111111111112 * (((angle_m * b) * (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 (Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) <= 2e+255)
            		tmp = Float64(0.011111111111111112 * Float64(Float64(pi * angle_m) * Float64(b * Float64(b - a))));
            	else
            		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(angle_m * b) * 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 ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) <= 2e+255)
            		tmp = 0.011111111111111112 * ((pi * angle_m) * (b * (b - a)));
            	else
            		tmp = 0.011111111111111112 * (((angle_m * b) * (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[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+255], N[(0.011111111111111112 * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(N[(angle$95$m * b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * Pi), $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 2 \cdot 10^{+255}:\\
            \;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot \left(b - a\right)\right)\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(angle\_m \cdot b\right) \cdot \left(b - a\right)\right) \cdot \pi\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)))) < 1.99999999999999998e255

              1. Initial program 53.3%

                \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
              2. 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. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
                2. lower-*.f64N/A

                  \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
                3. lower-*.f64N/A

                  \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
                4. lower-PI.f64N/A

                  \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{{b}^{2}} - {a}^{2}\right)\right)\right) \]
                5. lower--.f64N/A

                  \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - \color{blue}{{a}^{2}}\right)\right)\right) \]
                6. lower-pow.f64N/A

                  \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
                7. lower-pow.f6450.4

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

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

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

                \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
              7. Step-by-step derivation
                1. Applied rewrites37.1%

                  \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
                2. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)}\right) \]
                  2. lift-*.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \color{blue}{\pi}\right)\right) \]
                  3. *-commutativeN/A

                    \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b - a\right) \cdot b\right)}\right)\right) \]
                  4. associate-*r*N/A

                    \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot b\right)}\right) \]
                  5. *-commutativeN/A

                    \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot b\right)\right) \]
                  6. lift-*.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot b\right)\right) \]
                  7. lower-*.f6437.1

                    \[\leadsto 0.011111111111111112 \cdot \left(\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot b\right)}\right) \]
                  8. lift-*.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{b}\right)\right) \]
                  9. *-commutativeN/A

                    \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot \color{blue}{\left(b - a\right)}\right)\right) \]
                  10. lower-*.f6437.1

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

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

                if 1.99999999999999998e255 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))))

                1. Initial program 53.3%

                  \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
                2. 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. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
                  2. lower-*.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
                  3. lower-*.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
                  4. lower-PI.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{{b}^{2}} - {a}^{2}\right)\right)\right) \]
                  5. lower--.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - \color{blue}{{a}^{2}}\right)\right)\right) \]
                  6. lower-pow.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
                  7. lower-pow.f6450.4

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

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

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

                  \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
                7. Step-by-step derivation
                  1. Applied rewrites37.1%

                    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
                  2. Step-by-step derivation
                    1. lift-*.f64N/A

                      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)}\right) \]
                    2. lift-*.f64N/A

                      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \color{blue}{\pi}\right)\right) \]
                    3. associate-*r*N/A

                      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot b\right)\right) \cdot \color{blue}{\pi}\right) \]
                    4. lower-*.f64N/A

                      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot b\right)\right) \cdot \color{blue}{\pi}\right) \]
                    5. lift-*.f64N/A

                      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot b\right)\right) \cdot \pi\right) \]
                    6. *-commutativeN/A

                      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
                    7. associate-*r*N/A

                      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(angle \cdot b\right) \cdot \left(b - a\right)\right) \cdot \pi\right) \]
                    8. lower-*.f64N/A

                      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(angle \cdot b\right) \cdot \left(b - a\right)\right) \cdot \pi\right) \]
                    9. lower-*.f6439.9

                      \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(angle \cdot b\right) \cdot \left(b - a\right)\right) \cdot \pi\right) \]
                  3. Applied rewrites39.9%

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

                Alternative 19: 37.1% 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(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot \left(b - a\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 (* (* PI angle_m) (* 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) {
                	return angle_s * (0.011111111111111112 * ((((double) M_PI) * angle_m) * (b * (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 * (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 * (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(0.011111111111111112 * Float64(Float64(pi * angle_m) * Float64(b * 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 * (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[(0.011111111111111112 * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b * N[(b - a), $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(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot \left(b - a\right)\right)\right)\right)
                \end{array}
                
                Derivation
                1. Initial program 53.3%

                  \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
                2. 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. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
                  2. lower-*.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
                  3. lower-*.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
                  4. lower-PI.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{{b}^{2}} - {a}^{2}\right)\right)\right) \]
                  5. lower--.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - \color{blue}{{a}^{2}}\right)\right)\right) \]
                  6. lower-pow.f64N/A

                    \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
                  7. lower-pow.f6450.4

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

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

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

                  \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
                7. Step-by-step derivation
                  1. Applied rewrites37.1%

                    \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
                  2. Step-by-step derivation
                    1. lift-*.f64N/A

                      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)}\right) \]
                    2. lift-*.f64N/A

                      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \color{blue}{\pi}\right)\right) \]
                    3. *-commutativeN/A

                      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left(\left(b - a\right) \cdot b\right)}\right)\right) \]
                    4. associate-*r*N/A

                      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \pi\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot b\right)}\right) \]
                    5. *-commutativeN/A

                      \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot b\right)\right) \]
                    6. lift-*.f64N/A

                      \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\color{blue}{\left(b - a\right)} \cdot b\right)\right) \]
                    7. lower-*.f6437.1

                      \[\leadsto 0.011111111111111112 \cdot \left(\left(\pi \cdot angle\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot b\right)}\right) \]
                    8. lift-*.f64N/A

                      \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \color{blue}{b}\right)\right) \]
                    9. *-commutativeN/A

                      \[\leadsto \frac{1}{90} \cdot \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot \color{blue}{\left(b - a\right)}\right)\right) \]
                    10. lower-*.f6437.1

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

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

                  Alternative 20: 37.1% 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(\left(b - a\right) \cdot b\right) \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 (* 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) {
                  	return angle_s * (0.011111111111111112 * (angle_m * (((b - a) * b) * ((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) * 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) * 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(Float64(b - a) * b) * 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) * 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[(N[(b - a), $MachinePrecision] * b), $MachinePrecision] * 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(angle\_m \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right)\right)
                  \end{array}
                  
                  Derivation
                  1. Initial program 53.3%

                    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
                  2. 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. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto \frac{1}{90} \cdot \color{blue}{\left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
                    2. lower-*.f64N/A

                      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
                    3. lower-*.f64N/A

                      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
                    4. lower-PI.f64N/A

                      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\color{blue}{{b}^{2}} - {a}^{2}\right)\right)\right) \]
                    5. lower--.f64N/A

                      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - \color{blue}{{a}^{2}}\right)\right)\right) \]
                    6. lower-pow.f64N/A

                      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {\color{blue}{a}}^{2}\right)\right)\right) \]
                    7. lower-pow.f6450.4

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

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

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

                    \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left(\left(b - a\right) \cdot b\right) \cdot \pi\right)\right) \]
                  7. Step-by-step derivation
                    1. Applied rewrites37.1%

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

                    Reproduce

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