ab-angle->ABCF B

Percentage Accurate: 54.6% → 68.0%
Time: 7.1s
Alternatives: 17
Speedup: 6.6×

Specification

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 54.6% accurate, 1.0× speedup?

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

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

Alternative 1: 68.0% accurate, 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 6.2 \cdot 10^{+43}:\\ \;\;\;\;\left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\frac{1}{\frac{180}{angle\_m}} \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\ \mathbf{elif}\;angle\_m \leq 3.2 \cdot 10^{+221}:\\ \;\;\;\;\left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot 2\right)\right) \cdot \sin \left(\mathsf{fma}\left(-0.005555555555555556, \pi \cdot angle\_m, \pi \cdot 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\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 6.2e+43)
    (*
     (* (+ a b) (* (- b a) (* (sin (* (/ 1.0 (/ 180.0 angle_m)) PI)) 2.0)))
     (cos (* PI (/ angle_m 180.0))))
    (if (<= angle_m 3.2e+221)
      (*
       (*
        (* (- b a) (+ a b))
        (* (sin (* (* 0.005555555555555556 angle_m) PI)) 2.0))
       (sin (fma -0.005555555555555556 (* PI angle_m) (* PI 0.5))))
      (* (* (- b a) (+ b 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 <= 6.2e+43) {
		tmp = ((a + b) * ((b - a) * (sin(((1.0 / (180.0 / angle_m)) * ((double) M_PI))) * 2.0))) * cos((((double) M_PI) * (angle_m / 180.0)));
	} else if (angle_m <= 3.2e+221) {
		tmp = (((b - a) * (a + b)) * (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * 2.0)) * sin(fma(-0.005555555555555556, (((double) M_PI) * angle_m), (((double) M_PI) * 0.5)));
	} else {
		tmp = ((b - a) * (b + 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 <= 6.2e+43)
		tmp = Float64(Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(sin(Float64(Float64(1.0 / Float64(180.0 / angle_m)) * pi)) * 2.0))) * cos(Float64(pi * Float64(angle_m / 180.0))));
	elseif (angle_m <= 3.2e+221)
		tmp = Float64(Float64(Float64(Float64(b - a) * Float64(a + b)) * Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * 2.0)) * sin(fma(-0.005555555555555556, Float64(pi * angle_m), Float64(pi * 0.5))));
	else
		tmp = Float64(Float64(Float64(b - a) * Float64(b + 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, 6.2e+43], N[(N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(N[(1.0 / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 3.2e+221], N[(N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision] + N[(Pi * 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + 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 6.2 \cdot 10^{+43}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\frac{1}{\frac{180}{angle\_m}} \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\

\mathbf{elif}\;angle\_m \leq 3.2 \cdot 10^{+221}:\\
\;\;\;\;\left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot 2\right)\right) \cdot \sin \left(\mathsf{fma}\left(-0.005555555555555556, \pi \cdot angle\_m, \pi \cdot 0.5\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\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 < 6.2000000000000003e43

    1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.2000000000000003e43 < angle < 3.2e221

    1. Initial program 54.6%

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

        \[\leadsto \left(\color{blue}{\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) \]
      3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2e221 < angle

    1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(b + a\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(b + a\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(b + a\right)\right) \cdot \sin \left(2 \cdot \color{blue}{\left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)}\right) \]
      3. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\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 < 3.2e221

    1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2e221 < angle

    1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(b + a\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(b + a\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(b + a\right)\right) \cdot \sin \left(2 \cdot \color{blue}{\left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)}\right) \]
      3. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 67.8% 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 := \pi \cdot \frac{angle\_m}{180}\\ t_1 := \cos t\_0\\ t_2 := \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot 2\right)\right)\\ 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 t\_1 \leq -1 \cdot 10^{+295}:\\ \;\;\;\;t\_2 \cdot \left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left({angle\_m}^{2} \cdot {\pi}^{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2 \cdot t\_1\\ \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)))
        (t_1 (cos t_0))
        (t_2
         (*
          (+ a b)
          (* (- b a) (* (sin (* (* 0.005555555555555556 angle_m) PI)) 2.0)))))
   (*
    angle_s
    (if (<= (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) t_1) -1e+295)
      (*
       t_2
       (+ 1.0 (* -1.54320987654321e-5 (* (pow angle_m 2.0) (pow PI 2.0)))))
      (* t_2 t_1)))))
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 t_1 = cos(t_0);
	double t_2 = (a + b) * ((b - a) * (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * 2.0));
	double tmp;
	if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * t_1) <= -1e+295) {
		tmp = t_2 * (1.0 + (-1.54320987654321e-5 * (pow(angle_m, 2.0) * pow(((double) M_PI), 2.0))));
	} else {
		tmp = t_2 * t_1;
	}
	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 t_1 = Math.cos(t_0);
	double t_2 = (a + b) * ((b - a) * (Math.sin(((0.005555555555555556 * angle_m) * Math.PI)) * 2.0));
	double tmp;
	if ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * t_1) <= -1e+295) {
		tmp = t_2 * (1.0 + (-1.54320987654321e-5 * (Math.pow(angle_m, 2.0) * Math.pow(Math.PI, 2.0))));
	} else {
		tmp = t_2 * t_1;
	}
	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)
	t_1 = math.cos(t_0)
	t_2 = (a + b) * ((b - a) * (math.sin(((0.005555555555555556 * angle_m) * math.pi)) * 2.0))
	tmp = 0
	if (((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * t_1) <= -1e+295:
		tmp = t_2 * (1.0 + (-1.54320987654321e-5 * (math.pow(angle_m, 2.0) * math.pow(math.pi, 2.0))))
	else:
		tmp = t_2 * t_1
	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))
	t_1 = cos(t_0)
	t_2 = Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * 2.0)))
	tmp = 0.0
	if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * t_1) <= -1e+295)
		tmp = Float64(t_2 * Float64(1.0 + Float64(-1.54320987654321e-5 * Float64((angle_m ^ 2.0) * (pi ^ 2.0)))));
	else
		tmp = Float64(t_2 * t_1);
	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);
	t_1 = cos(t_0);
	t_2 = (a + b) * ((b - a) * (sin(((0.005555555555555556 * angle_m) * pi)) * 2.0));
	tmp = 0.0;
	if ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * t_1) <= -1e+295)
		tmp = t_2 * (1.0 + (-1.54320987654321e-5 * ((angle_m ^ 2.0) * (pi ^ 2.0))));
	else
		tmp = t_2 * t_1;
	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]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $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] * t$95$1), $MachinePrecision], -1e+295], N[(t$95$2 * N[(1.0 + N[(-1.54320987654321e-5 * N[(N[Power[angle$95$m, 2.0], $MachinePrecision] * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * t$95$1), $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}\\
t_1 := \cos t\_0\\
t_2 := \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot 2\right)\right)\\
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 t\_1 \leq -1 \cdot 10^{+295}:\\
\;\;\;\;t\_2 \cdot \left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left({angle\_m}^{2} \cdot {\pi}^{2}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_2 \cdot t\_1\\


\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.9999999999999998e294

    1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \left(1 + \frac{-1}{64800} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{\color{blue}{2}}\right)\right) \]
      6. lower-PI.f6462.7

        \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right) \]
    6. Applied rewrites62.7%

      \[\leadsto \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \color{blue}{\left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)} \]

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

    1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.00000000000000006e180 < b

    1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 67.8% 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 2 \cdot 10^{+255}:\\ \;\;\;\;\left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\frac{\pi \cdot angle\_m}{180}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\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 2e+255)
    (*
     (* (+ a b) (* (- b a) (* (sin (/ (* PI angle_m) 180.0)) 2.0)))
     (cos (* PI (/ angle_m 180.0))))
    (* (* (- b a) (+ b 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 <= 2e+255) {
		tmp = ((a + b) * ((b - a) * (sin(((((double) M_PI) * angle_m) / 180.0)) * 2.0))) * cos((((double) M_PI) * (angle_m / 180.0)));
	} else {
		tmp = ((b - a) * (b + a)) * sin(((0.011111111111111112 * angle_m) * ((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 <= 2e+255) {
		tmp = ((a + b) * ((b - a) * (Math.sin(((Math.PI * angle_m) / 180.0)) * 2.0))) * Math.cos((Math.PI * (angle_m / 180.0)));
	} else {
		tmp = ((b - a) * (b + a)) * Math.sin(((0.011111111111111112 * angle_m) * 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 <= 2e+255:
		tmp = ((a + b) * ((b - a) * (math.sin(((math.pi * angle_m) / 180.0)) * 2.0))) * math.cos((math.pi * (angle_m / 180.0)))
	else:
		tmp = ((b - a) * (b + a)) * math.sin(((0.011111111111111112 * angle_m) * 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 <= 2e+255)
		tmp = Float64(Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(sin(Float64(Float64(pi * angle_m) / 180.0)) * 2.0))) * cos(Float64(pi * Float64(angle_m / 180.0))));
	else
		tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(Float64(0.011111111111111112 * angle_m) * 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 <= 2e+255)
		tmp = ((a + b) * ((b - a) * (sin(((pi * angle_m) / 180.0)) * 2.0))) * cos((pi * (angle_m / 180.0)));
	else
		tmp = ((b - a) * (b + a)) * sin(((0.011111111111111112 * angle_m) * 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, 2e+255], N[(N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + 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 2 \cdot 10^{+255}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\frac{\pi \cdot angle\_m}{180}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\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.99999999999999998e255

    1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999998e255 < angle

    1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(b + a\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(b + a\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(b + a\right)\right) \cdot \sin \left(2 \cdot \color{blue}{\left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)}\right) \]
      3. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 67.7% accurate, 1.3× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(\left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\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
  (*
   (*
    (+ a b)
    (* (- b a) (* (sin (* (* 0.005555555555555556 angle_m) PI)) 2.0)))
   (cos (* PI (/ angle_m 180.0))))))
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 * (((a + b) * ((b - a) * (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * 2.0))) * cos((((double) M_PI) * (angle_m / 180.0))));
}
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 * (((a + b) * ((b - a) * (Math.sin(((0.005555555555555556 * angle_m) * Math.PI)) * 2.0))) * Math.cos((Math.PI * (angle_m / 180.0))));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (((a + b) * ((b - a) * (math.sin(((0.005555555555555556 * angle_m) * math.pi)) * 2.0))) * math.cos((math.pi * (angle_m / 180.0))))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * 2.0))) * cos(Float64(pi * Float64(angle_m / 180.0)))))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (((a + b) * ((b - a) * (sin(((0.005555555555555556 * angle_m) * pi)) * 2.0))) * cos((pi * (angle_m / 180.0))));
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \left(\left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)
\end{array}
Derivation
  1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 67.6% accurate, 2.2× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 1.7 \cdot 10^{+40}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\_m\right)\right) \cdot \left(b + a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\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+40)
    (* (- b a) (* (sin (* 0.011111111111111112 (* PI angle_m))) (+ b a)))
    (* (* (- b a) (+ b 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+40) {
		tmp = (b - a) * (sin((0.011111111111111112 * (((double) M_PI) * angle_m))) * (b + a));
	} else {
		tmp = ((b - a) * (b + a)) * sin(((0.011111111111111112 * angle_m) * ((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.7e+40) {
		tmp = (b - a) * (Math.sin((0.011111111111111112 * (Math.PI * angle_m))) * (b + a));
	} else {
		tmp = ((b - a) * (b + a)) * Math.sin(((0.011111111111111112 * angle_m) * 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.7e+40:
		tmp = (b - a) * (math.sin((0.011111111111111112 * (math.pi * angle_m))) * (b + a))
	else:
		tmp = ((b - a) * (b + a)) * math.sin(((0.011111111111111112 * angle_m) * 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.7e+40)
		tmp = Float64(Float64(b - a) * Float64(sin(Float64(0.011111111111111112 * Float64(pi * angle_m))) * Float64(b + a)));
	else
		tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(Float64(0.011111111111111112 * angle_m) * 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.7e+40)
		tmp = (b - a) * (sin((0.011111111111111112 * (pi * angle_m))) * (b + a));
	else
		tmp = ((b - a) * (b + a)) * sin(((0.011111111111111112 * angle_m) * 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.7e+40], N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(0.011111111111111112 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + 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^{+40}:\\
\;\;\;\;\left(b - a\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\_m\right)\right) \cdot \left(b + a\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\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.69999999999999994e40

    1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.69999999999999994e40 < angle

    1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(b + a\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(b + a\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(b + a\right)\right) \cdot \sin \left(2 \cdot \color{blue}{\left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)}\right) \]
      3. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\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 < 7.5000000000000005e-92

    1. Initial program 54.6%

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

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

      \[\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 \left(angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
      2. lift-*.f64N/A

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
      7. lift--.f64N/A

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \pi\right) \]
      12. difference-of-squares-revN/A

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      17. lift-*.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      18. lift-+.f64N/A

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
      20. lower-+.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    6. Applied rewrites54.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.5000000000000005e-92 < angle

    1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(b + a\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(b + a\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(b + a\right)\right) \cdot \sin \left(2 \cdot \color{blue}{\left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)}\right) \]
      3. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 67.1% accurate, 2.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 7.5000000000000005e-92

    1. Initial program 54.6%

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

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

      \[\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 \left(angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
      2. lift-*.f64N/A

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
      7. lift--.f64N/A

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \pi\right) \]
      12. difference-of-squares-revN/A

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      17. lift-*.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      18. lift-+.f64N/A

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
      20. lower-+.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    6. Applied rewrites54.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.5000000000000005e-92 < angle

    1. Initial program 54.6%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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. 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) \]
      3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 54.6%

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

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

      \[\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 \left(angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
      2. lift-*.f64N/A

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
      7. lift--.f64N/A

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \pi\right) \]
      12. difference-of-squares-revN/A

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      17. lift-*.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      18. lift-+.f64N/A

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
      20. lower-+.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    6. Applied rewrites54.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6000000000000001e74 < angle

    1. Initial program 54.6%

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

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left({b}^{2} \cdot \mathsf{PI}\left(\right)\right)\right) \]
      3. lower-PI.f6434.9

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right)\right) \]
    7. Applied rewrites34.9%

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 9.9999999999999993e-78

    1. Initial program 54.6%

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

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

      \[\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 \left(angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
      2. lift-*.f64N/A

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
      7. lift--.f64N/A

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \pi\right) \]
      12. difference-of-squares-revN/A

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      17. lift-*.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      18. lift-+.f64N/A

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
      20. lower-+.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    6. Applied rewrites54.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999993e-78 < angle

    1. Initial program 54.6%

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

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

      \[\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 \left(angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
      2. lift-*.f64N/A

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
      7. lift--.f64N/A

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \pi\right) \]
      12. difference-of-squares-revN/A

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      17. lift-*.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      18. lift-+.f64N/A

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
      20. lower-+.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    6. Applied rewrites54.8%

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
      5. difference-of-squares-revN/A

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

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(\mathsf{neg}\left({a}^{2}\right)\right) + {b}^{2}\right)\right) \cdot \pi\right) \]
      11. unpow2N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(\mathsf{neg}\left(a \cdot a\right)\right) + {b}^{2}\right)\right) \cdot \pi\right) \]
      12. distribute-lft-neg-inN/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(\mathsf{neg}\left(a\right)\right) \cdot a + {b}^{2}\right)\right) \cdot \pi\right) \]
      13. lower-fma.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \mathsf{fma}\left(\mathsf{neg}\left(a\right), a, {b}^{2}\right)\right) \cdot \pi\right) \]
      14. lower-neg.f6453.7

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \mathsf{fma}\left(-a, a, {b}^{2}\right)\right) \cdot \pi\right) \]
      15. lift-pow.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \mathsf{fma}\left(-a, a, {b}^{2}\right)\right) \cdot \pi\right) \]
      16. unpow2N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \mathsf{fma}\left(-a, a, b \cdot b\right)\right) \cdot \pi\right) \]
      17. lower-*.f6453.7

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \mathsf{fma}\left(-a, a, b \cdot b\right)\right) \cdot \pi\right) \]
    8. Applied rewrites53.7%

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

Alternative 13: 62.6% accurate, 5.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 10^{+72}:\\ \;\;\;\;\left(\left(angle\_m \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \mathsf{fma}\left(-a, a, b \cdot b\right)\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= angle_m 1e+72)
    (* (* (* angle_m (+ b a)) (- b a)) (* PI 0.011111111111111112))
    (* 0.011111111111111112 (* angle_m (* PI (fma (- a) a (* b b))))))))
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 <= 1e+72) {
		tmp = ((angle_m * (b + a)) * (b - a)) * (((double) M_PI) * 0.011111111111111112);
	} else {
		tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * fma(-a, a, (b * b))));
	}
	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 <= 1e+72)
		tmp = Float64(Float64(Float64(angle_m * Float64(b + a)) * Float64(b - a)) * Float64(pi * 0.011111111111111112));
	else
		tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * fma(Float64(-a), a, Float64(b * b)))));
	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, 1e+72], N[(N[(N[(angle$95$m * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[((-a) * a + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


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

    1. Initial program 54.6%

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

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

      \[\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 \left(angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
      2. lift-*.f64N/A

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

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

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

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

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
      7. lift--.f64N/A

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \pi\right) \]
      12. difference-of-squares-revN/A

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      17. lift-*.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      18. lift-+.f64N/A

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
      20. lower-+.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    6. Applied rewrites54.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999944e71 < angle

    1. Initial program 54.6%

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

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

      \[\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 \left(angle \cdot \left(\pi \cdot \left({b}^{2} - \color{blue}{{a}^{2}}\right)\right)\right) \]
      2. sub-flipN/A

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

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

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\left(\mathsf{neg}\left({a}^{2}\right)\right) + {b}^{2}\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \left(\left(\mathsf{neg}\left(a \cdot a\right)\right) + {b}^{2}\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

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

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(\mathsf{neg}\left(a\right), \color{blue}{a}, {b}^{2}\right)\right)\right) \]
      8. lower-neg.f6453.6

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(-a, a, {b}^{2}\right)\right)\right) \]
      9. lift-pow.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(-a, a, {b}^{2}\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(-a, a, b \cdot b\right)\right)\right) \]
      11. lower-*.f6453.6

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(-a, a, b \cdot b\right)\right)\right) \]
    6. Applied rewrites53.6%

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

Alternative 14: 62.5% accurate, 6.6× speedup?

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

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

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

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

    \[\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 \left(angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
    2. lift-*.f64N/A

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

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

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

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

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
    7. lift--.f64N/A

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

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

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

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

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \pi\right) \]
    12. difference-of-squares-revN/A

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

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

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

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

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
    17. lift-*.f6454.8

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
    18. lift-+.f64N/A

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

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    20. lower-+.f6454.8

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
  6. Applied rewrites54.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 61.8% accurate, 6.6× speedup?

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

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

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

    \[\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 \left(angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
    2. lift-*.f64N/A

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

      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\pi}\right)\right) \]
    4. associate-*r*N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \color{blue}{\pi}\right) \]
    5. lower-*.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \color{blue}{\pi}\right) \]
    6. lower-*.f6451.4

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
    7. lift--.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
    8. lift-pow.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
    9. unpow2N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \pi\right) \]
    10. lift-pow.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \pi\right) \]
    11. unpow2N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \pi\right) \]
    12. difference-of-squares-revN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    13. +-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    14. lift-+.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    15. lift--.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    16. *-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
    17. lift-*.f6454.8

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
    18. lift-+.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
    19. +-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    20. lower-+.f6454.8

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
  6. Applied rewrites54.8%

    \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \color{blue}{\pi}\right) \]
  7. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    2. *-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot angle\right) \cdot \pi\right) \]
    3. lift-*.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot angle\right) \cdot \pi\right) \]
    4. associate-*l*N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
    5. lower-*.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
    6. lower-*.f6462.5

      \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
  8. Applied rewrites62.5%

    \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
  9. Add Preprocessing

Alternative 16: 59.9% 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 9 \cdot 10^{-67}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(a \cdot angle\_m\right)\right) \cdot \pi\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(angle\_m \cdot b\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))) 9e-67)
    (* 0.011111111111111112 (* (* (- b a) (* a angle_m)) PI))
    (* 0.011111111111111112 (* (* (- b a) (* angle_m b)) PI)))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) <= 9e-67) {
		tmp = 0.011111111111111112 * (((b - a) * (a * angle_m)) * ((double) M_PI));
	} else {
		tmp = 0.011111111111111112 * (((b - a) * (angle_m * b)) * ((double) M_PI));
	}
	return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	double tmp;
	if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) <= 9e-67) {
		tmp = 0.011111111111111112 * (((b - a) * (a * angle_m)) * Math.PI);
	} else {
		tmp = 0.011111111111111112 * (((b - a) * (angle_m * b)) * Math.PI);
	}
	return angle_s * tmp;
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	tmp = 0
	if (2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) <= 9e-67:
		tmp = 0.011111111111111112 * (((b - a) * (a * angle_m)) * math.pi)
	else:
		tmp = 0.011111111111111112 * (((b - a) * (angle_m * b)) * math.pi)
	return angle_s * tmp
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	tmp = 0.0
	if (Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) <= 9e-67)
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(b - a) * Float64(a * angle_m)) * pi));
	else
		tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(b - a) * Float64(angle_m * b)) * pi));
	end
	return Float64(angle_s * tmp)
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp_2 = code(angle_s, a, b, angle_m)
	tmp = 0.0;
	if ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) <= 9e-67)
		tmp = 0.011111111111111112 * (((b - a) * (a * angle_m)) * pi);
	else
		tmp = 0.011111111111111112 * (((b - a) * (angle_m * b)) * pi);
	end
	tmp_2 = angle_s * tmp;
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 9e-67], N[(0.011111111111111112 * N[(N[(N[(b - a), $MachinePrecision] * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(N[(b - a), $MachinePrecision] * N[(angle$95$m * b), $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 9 \cdot 10^{-67}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(a \cdot angle\_m\right)\right) \cdot \pi\right)\\

\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(angle\_m \cdot b\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)))) < 9.00000000000000031e-67

    1. Initial program 54.6%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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.f6451.3

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{\color{blue}{2}}\right)\right)\right) \]
    4. Applied rewrites51.3%

      \[\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 \left(angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\pi}\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \color{blue}{\pi}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \color{blue}{\pi}\right) \]
      6. lower-*.f6451.4

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
      7. lift--.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
      8. lift-pow.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
      9. unpow2N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \pi\right) \]
      10. lift-pow.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \pi\right) \]
      11. unpow2N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \pi\right) \]
      12. difference-of-squares-revN/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
      13. +-commutativeN/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
      14. lift-+.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
      15. lift--.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
      16. *-commutativeN/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      17. lift-*.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      18. lift-+.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      19. +-commutativeN/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
      20. lower-+.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    6. Applied rewrites54.8%

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \color{blue}{\pi}\right) \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
      2. *-commutativeN/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot angle\right) \cdot \pi\right) \]
      3. lift-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot angle\right) \cdot \pi\right) \]
      4. associate-*l*N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
      5. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
      6. lower-*.f6462.5

        \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
    8. Applied rewrites62.5%

      \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
    9. Taylor expanded in a around inf

      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(b - a\right) \cdot \left(a \cdot angle\right)\right) \cdot \pi\right) \]
    10. Step-by-step derivation
      1. lower-*.f6440.5

        \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(a \cdot angle\right)\right) \cdot \pi\right) \]
    11. Applied rewrites40.5%

      \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(a \cdot angle\right)\right) \cdot \pi\right) \]

    if 9.00000000000000031e-67 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))))

    1. Initial program 54.6%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. 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.f6451.3

        \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{\color{blue}{2}}\right)\right)\right) \]
    4. Applied rewrites51.3%

      \[\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 \left(angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\pi}\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \color{blue}{\pi}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \color{blue}{\pi}\right) \]
      6. lower-*.f6451.4

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
      7. lift--.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
      8. lift-pow.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
      9. unpow2N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \pi\right) \]
      10. lift-pow.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \pi\right) \]
      11. unpow2N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \pi\right) \]
      12. difference-of-squares-revN/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
      13. +-commutativeN/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
      14. lift-+.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
      15. lift--.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
      16. *-commutativeN/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      17. lift-*.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      18. lift-+.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
      19. +-commutativeN/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
      20. lower-+.f6454.8

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    6. Applied rewrites54.8%

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \color{blue}{\pi}\right) \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
      2. *-commutativeN/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot angle\right) \cdot \pi\right) \]
      3. lift-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot angle\right) \cdot \pi\right) \]
      4. associate-*l*N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
      5. lower-*.f64N/A

        \[\leadsto \frac{1}{90} \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
      6. lower-*.f6462.5

        \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
    8. Applied rewrites62.5%

      \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
    9. Taylor expanded in a around 0

      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(b - a\right) \cdot \left(angle \cdot b\right)\right) \cdot \pi\right) \]
    10. Step-by-step derivation
      1. lower-*.f6440.0

        \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(angle \cdot b\right)\right) \cdot \pi\right) \]
    11. Applied rewrites40.0%

      \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(angle \cdot b\right)\right) \cdot \pi\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 40.5% 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(\left(b - a\right) \cdot \left(a \cdot angle\_m\right)\right) \cdot \pi\right)\right) \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (* angle_s (* 0.011111111111111112 (* (* (- b a) (* a angle_m)) PI))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (((b - a) * (a * angle_m)) * ((double) M_PI)));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
	return angle_s * (0.011111111111111112 * (((b - a) * (a * angle_m)) * Math.PI));
}
angle\_m = math.fabs(angle)
angle\_s = math.copysign(1.0, angle)
def code(angle_s, a, b, angle_m):
	return angle_s * (0.011111111111111112 * (((b - a) * (a * angle_m)) * math.pi))
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a, b, angle_m)
	return Float64(angle_s * Float64(0.011111111111111112 * Float64(Float64(Float64(b - a) * Float64(a * angle_m)) * pi)))
end
angle\_m = abs(angle);
angle\_s = sign(angle) * abs(1.0);
function tmp = code(angle_s, a, b, angle_m)
	tmp = angle_s * (0.011111111111111112 * (((b - a) * (a * angle_m)) * pi));
end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(N[(N[(b - a), $MachinePrecision] * N[(a * angle$95$m), $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 \left(0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(a \cdot angle\_m\right)\right) \cdot \pi\right)\right)
\end{array}
Derivation
  1. Initial program 54.6%

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. 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.f6451.3

      \[\leadsto 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{\color{blue}{2}}\right)\right)\right) \]
  4. Applied rewrites51.3%

    \[\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 \left(angle \cdot \color{blue}{\left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]
    2. lift-*.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\pi \cdot \color{blue}{\left({b}^{2} - {a}^{2}\right)}\right)\right) \]
    3. *-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(angle \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \color{blue}{\pi}\right)\right) \]
    4. associate-*r*N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \color{blue}{\pi}\right) \]
    5. lower-*.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \color{blue}{\pi}\right) \]
    6. lower-*.f6451.4

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
    7. lift--.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
    8. lift-pow.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \pi\right) \]
    9. unpow2N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \pi\right) \]
    10. lift-pow.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - {a}^{2}\right)\right) \cdot \pi\right) \]
    11. unpow2N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \pi\right) \]
    12. difference-of-squares-revN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    13. +-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    14. lift-+.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    15. lift--.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \pi\right) \]
    16. *-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
    17. lift-*.f6454.8

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
    18. lift-+.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \pi\right) \]
    19. +-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    20. lower-+.f6454.8

      \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
  6. Applied rewrites54.8%

    \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \color{blue}{\pi}\right) \]
  7. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \pi\right) \]
    2. *-commutativeN/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot angle\right) \cdot \pi\right) \]
    3. lift-*.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot angle\right) \cdot \pi\right) \]
    4. associate-*l*N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
    5. lower-*.f64N/A

      \[\leadsto \frac{1}{90} \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
    6. lower-*.f6462.5

      \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
  8. Applied rewrites62.5%

    \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\right)\right) \cdot \pi\right) \]
  9. Taylor expanded in a around inf

    \[\leadsto \frac{1}{90} \cdot \left(\left(\left(b - a\right) \cdot \left(a \cdot angle\right)\right) \cdot \pi\right) \]
  10. Step-by-step derivation
    1. lower-*.f6440.5

      \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(a \cdot angle\right)\right) \cdot \pi\right) \]
  11. Applied rewrites40.5%

    \[\leadsto 0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(a \cdot angle\right)\right) \cdot \pi\right) \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2025155 
(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)))))