ab-angle->ABCF B

Percentage Accurate: 53.9% → 67.1%
Time: 17.3s
Alternatives: 19
Speedup: 10.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 53.9% accurate, 1.0× speedup?

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

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

Alternative 1: 67.1% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 60.1%

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

      \[\leadsto \color{blue}{\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)} \]
    4. Step-by-step derivation
      1. add-cube-cbrtN/A

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left({\left(\sqrt[3]{\color{blue}{\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}}}\right)}^{3} \cdot angle\right) \cdot \frac{1}{90}\right)\right) \]
      4. cbrt-prodN/A

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left({\color{blue}{\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}}^{3} \cdot angle\right) \cdot \frac{1}{90}\right)\right) \]
      5. unpow-prod-downN/A

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

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

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

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left({\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3} \cdot {\left(\sqrt[3]{\sqrt{\color{blue}{\mathsf{PI}\left(\right)}}}\right)}^{3}\right) \cdot angle\right) \cdot \frac{1}{90}\right)\right) \]
      14. lower-sqrt.f6484.0

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

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

    if -5.0000000000000004e301 < (*.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 48.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\color{blue}{\left(angle \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
      8. lift-PI.f64N/A

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right) \cdot \frac{1}{90}\right)\right) \]
      11. lower-sqrt.f6463.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq -5 \cdot 10^{+301}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \left({\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3} \cdot {\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3}\right)\right) \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\sqrt{\pi} \cdot \left(angle \cdot \sqrt{\pi}\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 66.0% accurate, 0.4× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \pi \cdot \frac{angle\_m}{180}\\ t_1 := \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle\_m \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle\_m \cdot angle\_m\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+259}:\\ \;\;\;\;\left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\_m\right) \cdot \left(\left(\pi \cdot \left(b - a\_m\right)\right) \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\\ \end{array} \end{array} \end{array} \]
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (/ angle_m 180.0)))
        (t_1
         (* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_0)) (cos t_0))))
   (*
    angle_s
    (if (<= t_1 (- INFINITY))
      (*
       (+ b a_m)
       (*
        (- b a_m)
        (*
         angle_m
         (fma
          -2.2862368541380886e-7
          (* (* angle_m angle_m) (* PI (* PI PI)))
          (* PI 0.011111111111111112)))))
      (if (<= t_1 2e+259)
        (*
         (* (+ b a_m) (- b a_m))
         (sin (* 0.011111111111111112 (* PI angle_m))))
        (*
         (+ b a_m)
         (* (* PI (- b a_m)) (* angle_m 0.011111111111111112))))))))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m / 180.0);
	double t_1 = ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_0)) * cos(t_0);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (b + a_m) * ((b - a_m) * (angle_m * fma(-2.2862368541380886e-7, ((angle_m * angle_m) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))), (((double) M_PI) * 0.011111111111111112))));
	} else if (t_1 <= 2e+259) {
		tmp = ((b + a_m) * (b - a_m)) * sin((0.011111111111111112 * (((double) M_PI) * angle_m)));
	} else {
		tmp = (b + a_m) * ((((double) M_PI) * (b - a_m)) * (angle_m * 0.011111111111111112));
	}
	return angle_s * tmp;
}
a_m = abs(a)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b, angle_m)
	t_0 = Float64(pi * Float64(angle_m / 180.0))
	t_1 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * cos(t_0))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(angle_m * fma(-2.2862368541380886e-7, Float64(Float64(angle_m * angle_m) * Float64(pi * Float64(pi * pi))), Float64(pi * 0.011111111111111112)))));
	elseif (t_1 <= 2e+259)
		tmp = Float64(Float64(Float64(b + a_m) * Float64(b - a_m)) * sin(Float64(0.011111111111111112 * Float64(pi * angle_m))));
	else
		tmp = Float64(Float64(b + a_m) * Float64(Float64(pi * Float64(b - a_m)) * Float64(angle_m * 0.011111111111111112)));
	end
	return Float64(angle_s * tmp)
end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle$95$m * N[(-2.2862368541380886e-7 * N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+259], N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(Pi * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 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))))) < -inf.0

    1. Initial program 60.1%

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \color{blue}{{angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}}, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. unpow2N/A

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \color{blue}{\left(angle \cdot angle\right)} \cdot {\mathsf{PI}\left(\right)}^{3}, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      6. cube-multN/A

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \left(angle \cdot angle\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      10. unpow2N/A

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \left(angle \cdot angle\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{\frac{1}{90} \cdot \mathsf{PI}\left(\right)}\right)\right)\right) \]
      15. lower-PI.f6466.6

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), 0.011111111111111112 \cdot \color{blue}{\pi}\right)\right)\right) \]
    6. Simplified66.6%

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

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

    1. Initial program 59.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e259 < (*.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 26.8%

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

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

      \[\leadsto \left(b + a\right) \cdot \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(b - a\right)\right)\right) \]
      6. lower--.f6468.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq -\infty:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{elif}\;\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) \leq 2 \cdot 10^{+259}:\\ \;\;\;\;\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(\pi \cdot \left(b - a\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 66.0% accurate, 0.4× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \pi \cdot \frac{angle\_m}{180}\\ t_1 := \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle\_m \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle\_m \cdot angle\_m\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+259}:\\ \;\;\;\;\left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right) \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\_m\right) \cdot \left(\left(\pi \cdot \left(b - a\_m\right)\right) \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\\ \end{array} \end{array} \end{array} \]
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (/ angle_m 180.0)))
        (t_1
         (* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_0)) (cos t_0))))
   (*
    angle_s
    (if (<= t_1 (- INFINITY))
      (*
       (+ b a_m)
       (*
        (- b a_m)
        (*
         angle_m
         (fma
          -2.2862368541380886e-7
          (* (* angle_m angle_m) (* PI (* PI PI)))
          (* PI 0.011111111111111112)))))
      (if (<= t_1 2e+259)
        (*
         (* (+ b a_m) (- b a_m))
         (sin (* PI (* angle_m 0.011111111111111112))))
        (*
         (+ b a_m)
         (* (* PI (- b a_m)) (* angle_m 0.011111111111111112))))))))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m / 180.0);
	double t_1 = ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_0)) * cos(t_0);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (b + a_m) * ((b - a_m) * (angle_m * fma(-2.2862368541380886e-7, ((angle_m * angle_m) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))), (((double) M_PI) * 0.011111111111111112))));
	} else if (t_1 <= 2e+259) {
		tmp = ((b + a_m) * (b - a_m)) * sin((((double) M_PI) * (angle_m * 0.011111111111111112)));
	} else {
		tmp = (b + a_m) * ((((double) M_PI) * (b - a_m)) * (angle_m * 0.011111111111111112));
	}
	return angle_s * tmp;
}
a_m = abs(a)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b, angle_m)
	t_0 = Float64(pi * Float64(angle_m / 180.0))
	t_1 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * cos(t_0))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(angle_m * fma(-2.2862368541380886e-7, Float64(Float64(angle_m * angle_m) * Float64(pi * Float64(pi * pi))), Float64(pi * 0.011111111111111112)))));
	elseif (t_1 <= 2e+259)
		tmp = Float64(Float64(Float64(b + a_m) * Float64(b - a_m)) * sin(Float64(pi * Float64(angle_m * 0.011111111111111112))));
	else
		tmp = Float64(Float64(b + a_m) * Float64(Float64(pi * Float64(b - a_m)) * Float64(angle_m * 0.011111111111111112)));
	end
	return Float64(angle_s * tmp)
end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle$95$m * N[(-2.2862368541380886e-7 * N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+259], N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(Pi * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 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))))) < -inf.0

    1. Initial program 60.1%

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \color{blue}{{angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}}, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. unpow2N/A

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \color{blue}{\left(angle \cdot angle\right)} \cdot {\mathsf{PI}\left(\right)}^{3}, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      6. cube-multN/A

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \left(angle \cdot angle\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      10. unpow2N/A

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \left(angle \cdot angle\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{\frac{1}{90} \cdot \mathsf{PI}\left(\right)}\right)\right)\right) \]
      15. lower-PI.f6466.6

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), 0.011111111111111112 \cdot \color{blue}{\pi}\right)\right)\right) \]
    6. Simplified66.6%

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

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

    1. Initial program 59.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{90}\right) \]
      10. difference-of-squaresN/A

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

        \[\leadsto \color{blue}{\left(b \cdot b - a \cdot a\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{90}\right)} \]
      12. difference-of-squaresN/A

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

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

        \[\leadsto \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{90}\right) \]
      15. lift-*.f6460.3

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

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

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

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

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

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

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

    if 2e259 < (*.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 26.8%

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

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

      \[\leadsto \left(b + a\right) \cdot \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(b - a\right)\right)\right) \]
      6. lower--.f6468.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq -\infty:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{elif}\;\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) \leq 2 \cdot 10^{+259}:\\ \;\;\;\;\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(\pi \cdot \left(b - a\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 63.9% accurate, 0.4× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \pi \cdot \frac{angle\_m}{180}\\ t_1 := \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle\_m \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle\_m \cdot angle\_m\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{elif}\;t\_1 \leq 10^{-299}:\\ \;\;\;\;\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\_m\right)\right) \cdot \left(a\_m \cdot \left(-a\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\_m\right) \cdot \left(\left(\pi \cdot \left(b - a\_m\right)\right) \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\\ \end{array} \end{array} \end{array} \]
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (/ angle_m 180.0)))
        (t_1
         (* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_0)) (cos t_0))))
   (*
    angle_s
    (if (<= t_1 (- INFINITY))
      (*
       (+ b a_m)
       (*
        (- b a_m)
        (*
         angle_m
         (fma
          -2.2862368541380886e-7
          (* (* angle_m angle_m) (* PI (* PI PI)))
          (* PI 0.011111111111111112)))))
      (if (<= t_1 1e-299)
        (* (sin (* 0.011111111111111112 (* PI angle_m))) (* a_m (- a_m)))
        (*
         (+ b a_m)
         (* (* PI (- b a_m)) (* angle_m 0.011111111111111112))))))))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m / 180.0);
	double t_1 = ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_0)) * cos(t_0);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (b + a_m) * ((b - a_m) * (angle_m * fma(-2.2862368541380886e-7, ((angle_m * angle_m) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))), (((double) M_PI) * 0.011111111111111112))));
	} else if (t_1 <= 1e-299) {
		tmp = sin((0.011111111111111112 * (((double) M_PI) * angle_m))) * (a_m * -a_m);
	} else {
		tmp = (b + a_m) * ((((double) M_PI) * (b - a_m)) * (angle_m * 0.011111111111111112));
	}
	return angle_s * tmp;
}
a_m = abs(a)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b, angle_m)
	t_0 = Float64(pi * Float64(angle_m / 180.0))
	t_1 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * cos(t_0))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(angle_m * fma(-2.2862368541380886e-7, Float64(Float64(angle_m * angle_m) * Float64(pi * Float64(pi * pi))), Float64(pi * 0.011111111111111112)))));
	elseif (t_1 <= 1e-299)
		tmp = Float64(sin(Float64(0.011111111111111112 * Float64(pi * angle_m))) * Float64(a_m * Float64(-a_m)));
	else
		tmp = Float64(Float64(b + a_m) * Float64(Float64(pi * Float64(b - a_m)) * Float64(angle_m * 0.011111111111111112)));
	end
	return Float64(angle_s * tmp)
end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle$95$m * N[(-2.2862368541380886e-7 * N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-299], N[(N[Sin[N[(0.011111111111111112 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a$95$m * (-a$95$m)), $MachinePrecision]), $MachinePrecision], N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(Pi * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{elif}\;t\_1 \leq 10^{-299}:\\
\;\;\;\;\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\_m\right)\right) \cdot \left(a\_m \cdot \left(-a\_m\right)\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 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))))) < -inf.0

    1. Initial program 60.1%

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \color{blue}{{angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}}, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. unpow2N/A

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \color{blue}{\left(angle \cdot angle\right)} \cdot {\mathsf{PI}\left(\right)}^{3}, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      6. cube-multN/A

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \left(angle \cdot angle\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      10. unpow2N/A

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \left(angle \cdot angle\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{\frac{1}{90} \cdot \mathsf{PI}\left(\right)}\right)\right)\right) \]
      15. lower-PI.f6466.6

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), 0.011111111111111112 \cdot \color{blue}{\pi}\right)\right)\right) \]
    6. Simplified66.6%

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

    if -inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 9.99999999999999992e-300

    1. Initial program 62.5%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr63.6%

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

      \[\leadsto \color{blue}{-1 \cdot \left({a}^{2} \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-negN/A

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot {a}^{2}}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\mathsf{neg}\left({a}^{2}\right)\right)} \]
      4. mul-1-negN/A

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

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

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

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

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

        \[\leadsto \sin \left(\frac{1}{90} \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot \left(-1 \cdot {a}^{2}\right) \]
      10. mul-1-negN/A

        \[\leadsto \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left({a}^{2}\right)\right)} \]
      11. unpow2N/A

        \[\leadsto \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\mathsf{neg}\left(\color{blue}{a \cdot a}\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\left(a \cdot \left(\mathsf{neg}\left(a\right)\right)\right)} \]
      13. mul-1-negN/A

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

        \[\leadsto \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\left(a \cdot \left(-1 \cdot a\right)\right)} \]
      15. mul-1-negN/A

        \[\leadsto \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(a \cdot \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right) \]
      16. lower-neg.f6448.8

        \[\leadsto \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot \color{blue}{\left(-a\right)}\right) \]
    6. Simplified48.8%

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

    if 9.99999999999999992e-300 < (*.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 40.5%

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

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

      \[\leadsto \left(b + a\right) \cdot \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(b - a\right)\right)\right) \]
      6. lower--.f6459.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq -\infty:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{elif}\;\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) \leq 10^{-299}:\\ \;\;\;\;\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(a \cdot \left(-a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(\pi \cdot \left(b - a\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 63.8% accurate, 0.4× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \pi \cdot \frac{angle\_m}{180}\\ t_1 := \pi \cdot \left(b - a\_m\right)\\ t_2 := \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-311}:\\ \;\;\;\;\left(b + a\_m\right) \cdot \left(angle\_m \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle\_m \cdot angle\_m\right), \left(b - a\_m\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), 0.011111111111111112 \cdot t\_1\right)\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+259}:\\ \;\;\;\;\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\_m\right)\right) \cdot \left(b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\_m\right) \cdot \left(t\_1 \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\\ \end{array} \end{array} \end{array} \]
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (/ angle_m 180.0)))
        (t_1 (* PI (- b a_m)))
        (t_2
         (* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_0)) (cos t_0))))
   (*
    angle_s
    (if (<= t_2 -2e-311)
      (*
       (+ b a_m)
       (*
        angle_m
        (fma
         (* -2.2862368541380886e-7 (* angle_m angle_m))
         (* (- b a_m) (* PI (* PI PI)))
         (* 0.011111111111111112 t_1))))
      (if (<= t_2 2e+259)
        (* (sin (* 0.011111111111111112 (* PI angle_m))) (* b b))
        (* (+ b a_m) (* t_1 (* angle_m 0.011111111111111112))))))))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m / 180.0);
	double t_1 = ((double) M_PI) * (b - a_m);
	double t_2 = ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_0)) * cos(t_0);
	double tmp;
	if (t_2 <= -2e-311) {
		tmp = (b + a_m) * (angle_m * fma((-2.2862368541380886e-7 * (angle_m * angle_m)), ((b - a_m) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))), (0.011111111111111112 * t_1)));
	} else if (t_2 <= 2e+259) {
		tmp = sin((0.011111111111111112 * (((double) M_PI) * angle_m))) * (b * b);
	} else {
		tmp = (b + a_m) * (t_1 * (angle_m * 0.011111111111111112));
	}
	return angle_s * tmp;
}
a_m = abs(a)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b, angle_m)
	t_0 = Float64(pi * Float64(angle_m / 180.0))
	t_1 = Float64(pi * Float64(b - a_m))
	t_2 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * cos(t_0))
	tmp = 0.0
	if (t_2 <= -2e-311)
		tmp = Float64(Float64(b + a_m) * Float64(angle_m * fma(Float64(-2.2862368541380886e-7 * Float64(angle_m * angle_m)), Float64(Float64(b - a_m) * Float64(pi * Float64(pi * pi))), Float64(0.011111111111111112 * t_1))));
	elseif (t_2 <= 2e+259)
		tmp = Float64(sin(Float64(0.011111111111111112 * Float64(pi * angle_m))) * Float64(b * b));
	else
		tmp = Float64(Float64(b + a_m) * Float64(t_1 * Float64(angle_m * 0.011111111111111112)));
	end
	return Float64(angle_s * tmp)
end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, -2e-311], N[(N[(b + a$95$m), $MachinePrecision] * N[(angle$95$m * N[(N[(-2.2862368541380886e-7 * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+259], N[(N[Sin[N[(0.011111111111111112 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision], N[(N[(b + a$95$m), $MachinePrecision] * N[(t$95$1 * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := \pi \cdot \left(b - a\_m\right)\\
t_2 := \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\left(b + a\_m\right) \cdot \left(angle\_m \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle\_m \cdot angle\_m\right), \left(b - a\_m\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), 0.011111111111111112 \cdot t\_1\right)\right)\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+259}:\\
\;\;\;\;\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\_m\right)\right) \cdot \left(b \cdot b\right)\\

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


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

    1. Initial program 52.1%

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

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\color{blue}{\frac{-1}{4374000} \cdot {angle}^{2}}, {\mathsf{PI}\left(\right)}^{3} \cdot \left(b - a\right), \frac{1}{90} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)\right)\right) \]
      5. unpow2N/A

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

        \[\leadsto \left(b + a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000} \cdot \color{blue}{\left(angle \cdot angle\right)}, {\mathsf{PI}\left(\right)}^{3} \cdot \left(b - a\right), \frac{1}{90} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)\right)\right) \]
      7. *-commutativeN/A

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

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

        \[\leadsto \left(b + a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000} \cdot \left(angle \cdot angle\right), \color{blue}{\left(b - a\right)} \cdot {\mathsf{PI}\left(\right)}^{3}, \frac{1}{90} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)\right)\right) \]
      10. cube-multN/A

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000} \cdot \left(angle \cdot angle\right), \left(b - a\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \frac{1}{90} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)\right)\right) \]
      14. unpow2N/A

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000} \cdot \left(angle \cdot angle\right), \left(b - a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{\frac{1}{90} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)}\right)\right) \]
    6. Simplified51.5%

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

    if -1.9999999999999e-311 < (*.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))))) < 2e259

    1. Initial program 68.6%

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

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

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

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

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

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

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

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

        \[\leadsto \sin \left(\frac{1}{90} \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot {b}^{2} \]
      7. unpow2N/A

        \[\leadsto \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\left(b \cdot b\right)} \]
      8. lower-*.f6452.6

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

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

    if 2e259 < (*.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 26.8%

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

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

      \[\leadsto \left(b + a\right) \cdot \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(b - a\right)\right)\right) \]
      6. lower--.f6468.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq -2 \cdot 10^{-311}:\\ \;\;\;\;\left(b + a\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \left(b - a\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), 0.011111111111111112 \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)\\ \mathbf{elif}\;\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) \leq 2 \cdot 10^{+259}:\\ \;\;\;\;\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(\pi \cdot \left(b - a\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 66.6% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 39.8%

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

      \[\leadsto \color{blue}{\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)} \]
    4. Step-by-step derivation
      1. add-cube-cbrtN/A

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left({\left(\sqrt[3]{\color{blue}{\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}}}\right)}^{3} \cdot angle\right) \cdot \frac{1}{90}\right)\right) \]
      4. cbrt-prodN/A

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left({\color{blue}{\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}}^{3} \cdot angle\right) \cdot \frac{1}{90}\right)\right) \]
      5. unpow-prod-downN/A

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

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

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

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left({\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3} \cdot {\left(\sqrt[3]{\sqrt{\color{blue}{\mathsf{PI}\left(\right)}}}\right)}^{3}\right) \cdot angle\right) \cdot \frac{1}{90}\right)\right) \]
      14. lower-sqrt.f6470.8

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

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

      \[\leadsto \left(b + a\right) \cdot \left(\color{blue}{\left(-1 \cdot a\right)} \cdot \sin \left(\left(\left({\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3} \cdot {\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3}\right) \cdot angle\right) \cdot \frac{1}{90}\right)\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \left(b + a\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot \sin \left(\left(\left({\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3} \cdot {\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3}\right) \cdot angle\right) \cdot \frac{1}{90}\right)\right) \]
      2. lower-neg.f6470.8

        \[\leadsto \left(b + a\right) \cdot \left(\color{blue}{\left(-a\right)} \cdot \sin \left(\left(\left({\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3} \cdot {\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3}\right) \cdot angle\right) \cdot 0.011111111111111112\right)\right) \]
    8. Simplified70.8%

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

    if -1.99999999999999994e224 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 54.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right) \]
    5. Applied egg-rr66.9%

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

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

Alternative 7: 66.9% accurate, 0.7× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \pi \cdot \frac{angle\_m}{180}\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq -\infty:\\ \;\;\;\;\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle\_m \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle\_m \cdot angle\_m\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\sqrt{\pi} \cdot \left(angle\_m \cdot \sqrt{\pi}\right)\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
 :precision binary64
 (let* ((t_0 (* PI (/ angle_m 180.0))))
   (*
    angle_s
    (if (<=
         (* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_0)) (cos t_0))
         (- INFINITY))
      (*
       (+ b a_m)
       (*
        (- b a_m)
        (*
         angle_m
         (fma
          -2.2862368541380886e-7
          (* (* angle_m angle_m) (* PI (* PI PI)))
          (* PI 0.011111111111111112)))))
      (*
       (+ b a_m)
       (*
        (- b a_m)
        (sin
         (* 0.011111111111111112 (* (sqrt PI) (* angle_m (sqrt PI)))))))))))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
	double t_0 = ((double) M_PI) * (angle_m / 180.0);
	double tmp;
	if ((((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_0)) * cos(t_0)) <= -((double) INFINITY)) {
		tmp = (b + a_m) * ((b - a_m) * (angle_m * fma(-2.2862368541380886e-7, ((angle_m * angle_m) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))), (((double) M_PI) * 0.011111111111111112))));
	} else {
		tmp = (b + a_m) * ((b - a_m) * sin((0.011111111111111112 * (sqrt(((double) M_PI)) * (angle_m * sqrt(((double) M_PI)))))));
	}
	return angle_s * tmp;
}
a_m = abs(a)
angle\_m = abs(angle)
angle\_s = copysign(1.0, angle)
function code(angle_s, a_m, b, angle_m)
	t_0 = Float64(pi * Float64(angle_m / 180.0))
	tmp = 0.0
	if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * cos(t_0)) <= Float64(-Inf))
		tmp = Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(angle_m * fma(-2.2862368541380886e-7, Float64(Float64(angle_m * angle_m) * Float64(pi * Float64(pi * pi))), Float64(pi * 0.011111111111111112)))));
	else
		tmp = Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * sin(Float64(0.011111111111111112 * Float64(sqrt(pi) * Float64(angle_m * sqrt(pi)))))));
	end
	return Float64(angle_s * tmp)
end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle$95$m * N[(-2.2862368541380886e-7 * N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(N[Sqrt[Pi], $MachinePrecision] * N[(angle$95$m * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


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

    1. Initial program 60.1%

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \color{blue}{{angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}}, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. unpow2N/A

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \color{blue}{\left(angle \cdot angle\right)} \cdot {\mathsf{PI}\left(\right)}^{3}, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      6. cube-multN/A

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \left(angle \cdot angle\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      10. unpow2N/A

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \left(angle \cdot angle\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{\frac{1}{90} \cdot \mathsf{PI}\left(\right)}\right)\right)\right) \]
      15. lower-PI.f6466.6

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), 0.011111111111111112 \cdot \color{blue}{\pi}\right)\right)\right) \]
    6. Simplified66.6%

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

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

    1. Initial program 48.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\color{blue}{\left(angle \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{90}\right)\right) \]
      8. lift-PI.f64N/A

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left(angle \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right) \cdot \frac{1}{90}\right)\right) \]
      11. lower-sqrt.f6463.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq -\infty:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\sqrt{\pi} \cdot \left(angle \cdot \sqrt{\pi}\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 67.2% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 63.4%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr68.8%

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

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(\left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}\right) \]
      7. lower-*.f6469.6

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

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

    if 4.00000000000000012e-117 < (*.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 32.8%

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

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

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(\left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}\right) \]
      7. lower-*.f6455.0

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

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\frac{1}{90} \cdot {\color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)}\right)}}^{2}\right) \cdot angle\right)\right) \]
      6. rem-cube-cbrtN/A

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\frac{1}{90} \cdot {\color{blue}{\left({\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3}\right)}}^{2}\right) \cdot angle\right)\right) \]
      7. lift-cbrt.f64N/A

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\frac{1}{90} \cdot {\left({\color{blue}{\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}}^{3}\right)}^{2}\right) \cdot angle\right)\right) \]
      8. lift-pow.f64N/A

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\frac{1}{90} \cdot {\color{blue}{\left({\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3}\right)}}^{2}\right) \cdot angle\right)\right) \]
      9. pow2N/A

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\frac{1}{90} \cdot \color{blue}{\left({\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3} \cdot {\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3}\right)}\right) \cdot angle\right)\right) \]
      10. lift-*.f6462.4

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(0.011111111111111112 \cdot \color{blue}{\left({\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3} \cdot {\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3}\right)}\right) \cdot angle\right)\right) \]
      11. lift-pow.f64N/A

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\frac{1}{90} \cdot \left(\color{blue}{{\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3}} \cdot {\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3}\right)\right) \cdot angle\right)\right) \]
      12. lift-cbrt.f64N/A

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\frac{1}{90} \cdot \left({\color{blue}{\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}}^{3} \cdot {\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3}\right)\right) \cdot angle\right)\right) \]
      13. rem-cube-cbrt64.8

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(0.011111111111111112 \cdot \left(\color{blue}{\sqrt{\pi}} \cdot {\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3}\right)\right) \cdot angle\right)\right) \]
      14. lift-pow.f64N/A

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\frac{1}{90} \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{{\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3}}\right)\right) \cdot angle\right)\right) \]
      15. lift-cbrt.f64N/A

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\frac{1}{90} \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot {\color{blue}{\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}}^{3}\right)\right) \cdot angle\right)\right) \]
      16. rem-cube-cbrt63.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq 4 \cdot 10^{-117}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(angle \cdot \left(0.011111111111111112 \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 66.3% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 59.9%

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

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

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(\left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}\right) \]
      7. lower-*.f6465.0

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

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

    if 2e259 < (*.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 26.8%

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

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

      \[\leadsto \left(b + a\right) \cdot \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(b - a\right)\right)\right) \]
      6. lower--.f6468.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq 2 \cdot 10^{+259}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(\pi \cdot \left(b - a\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 66.4% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 51.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr63.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right)\right) \]
    5. Applied egg-rr66.5%

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

    if 4.20000000000000021e264 < a

    1. Initial program 36.4%

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

      \[\leadsto \color{blue}{\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)} \]
    4. Step-by-step derivation
      1. add-cube-cbrtN/A

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left({\left(\sqrt[3]{\color{blue}{\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}}}\right)}^{3} \cdot angle\right) \cdot \frac{1}{90}\right)\right) \]
      4. cbrt-prodN/A

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left({\color{blue}{\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}}^{3} \cdot angle\right) \cdot \frac{1}{90}\right)\right) \]
      5. unpow-prod-downN/A

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

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

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

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left({\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3} \cdot {\left(\sqrt[3]{\sqrt{\color{blue}{\mathsf{PI}\left(\right)}}}\right)}^{3}\right) \cdot angle\right) \cdot \frac{1}{90}\right)\right) \]
      14. lower-sqrt.f6472.7

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left({\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3} \cdot {\left(\sqrt[3]{\color{blue}{\sqrt{\mathsf{PI}\left(\right)}}}\right)}^{3}\right) \cdot angle\right) \cdot \frac{1}{90}\right)\right) \]
      3. rem-cube-cbrt90.9

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\left({\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3} \cdot \color{blue}{\sqrt{\pi}}\right) \cdot angle\right) \cdot 0.011111111111111112\right)\right) \]
    7. Applied egg-rr90.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 4.2 \cdot 10^{+264}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\mathsf{fma}\left(\frac{\sqrt{\pi}}{180}, \frac{\sqrt{\pi}}{\frac{1}{angle}}, \pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \left(\sqrt{\pi} \cdot {\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3}\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 57.6% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 54.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
      12. lower--.f6454.3

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

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

      \[\leadsto \color{blue}{\frac{-1}{90} \cdot \left({a}^{2} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)} \]
      7. lower-PI.f6454.8

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

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

    if 5.00000000000000037e-286 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
      12. lower--.f6449.0

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

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

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\color{blue}{\left(angle \cdot {b}^{2}\right)} \cdot \mathsf{PI}\left(\right)\right) \]
      5. unpow2N/A

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right) \cdot \mathsf{PI}\left(\right)\right) \]
      7. lower-PI.f6446.4

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \color{blue}{\pi}\right) \]
    8. Simplified46.4%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \pi\right)} \]
    9. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\color{blue}{\left(b \cdot angle\right)} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right) \]
      7. lower-*.f6454.5

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(\left(b \cdot angle\right) \cdot b\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{90} \]
      9. associate-*l*N/A

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

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

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

        \[\leadsto \color{blue}{\left(b \cdot \left(b \cdot angle\right)\right)} \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{90}\right) \]
      13. lower-*.f6454.6

        \[\leadsto \left(b \cdot \left(b \cdot angle\right)\right) \cdot \color{blue}{\left(\pi \cdot 0.011111111111111112\right)} \]
    12. Applied egg-rr54.6%

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

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

Alternative 12: 57.5% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 54.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
      12. lower--.f6454.3

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

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

      \[\leadsto \color{blue}{\frac{-1}{90} \cdot \left({a}^{2} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)} \]
      7. lower-PI.f6454.8

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

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

    if 5.00000000000000037e-286 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
      12. lower--.f6449.0

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

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

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

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

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\color{blue}{\left(angle \cdot {b}^{2}\right)} \cdot \mathsf{PI}\left(\right)\right) \]
      5. unpow2N/A

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right) \cdot \mathsf{PI}\left(\right)\right) \]
      7. lower-PI.f6446.4

        \[\leadsto 0.011111111111111112 \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \color{blue}{\pi}\right) \]
    8. Simplified46.4%

      \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \pi\right)} \]
    9. Step-by-step derivation
      1. associate-*r*N/A

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

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

        \[\leadsto \frac{1}{90} \cdot \left(\left(\color{blue}{\left(b \cdot angle\right)} \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \]
      4. lower-*.f6454.6

        \[\leadsto 0.011111111111111112 \cdot \left(\left(\color{blue}{\left(b \cdot angle\right)} \cdot b\right) \cdot \pi\right) \]
    10. Applied egg-rr54.6%

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

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

Alternative 13: 63.2% accurate, 5.8× speedup?

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

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

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

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


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

    1. Initial program 56.6%

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

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\color{blue}{\frac{-1}{4374000} \cdot {angle}^{2}}, {\mathsf{PI}\left(\right)}^{3} \cdot \left(b - a\right), \frac{1}{90} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)\right)\right) \]
      5. unpow2N/A

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

        \[\leadsto \left(b + a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000} \cdot \color{blue}{\left(angle \cdot angle\right)}, {\mathsf{PI}\left(\right)}^{3} \cdot \left(b - a\right), \frac{1}{90} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)\right)\right) \]
      7. *-commutativeN/A

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

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

        \[\leadsto \left(b + a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000} \cdot \left(angle \cdot angle\right), \color{blue}{\left(b - a\right)} \cdot {\mathsf{PI}\left(\right)}^{3}, \frac{1}{90} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)\right)\right) \]
      10. cube-multN/A

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000} \cdot \left(angle \cdot angle\right), \left(b - a\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \frac{1}{90} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)\right)\right) \]
      14. unpow2N/A

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000} \cdot \left(angle \cdot angle\right), \left(b - a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{\frac{1}{90} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)}\right)\right) \]
    6. Simplified67.0%

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

    if 9.9999999999999993e44 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999945e272

    1. Initial program 30.4%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
      12. lower--.f6434.6

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

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(a \cdot \left(\frac{b}{a} + \color{blue}{-1}\right)\right)\right) \]
      3. distribute-lft-inN/A

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(a \cdot \frac{b}{a} + \color{blue}{-1 \cdot a}\right)\right) \]
      5. mul-1-negN/A

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(a \cdot \frac{b}{a} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right) \]
      6. unsub-negN/A

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(\color{blue}{\frac{a \cdot b}{a}} - a\right)\right) \]
      10. lower-*.f6434.6

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

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

    if 9.99999999999999945e272 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
      12. lower--.f6430.5

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right) \]
      2. lower-neg.f6430.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{+45}:\\ \;\;\;\;\left(b + a\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \left(b - a\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), 0.011111111111111112 \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+273}:\\ \;\;\;\;\left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(\left(b + a\right) \cdot \left(\frac{b \cdot a}{a} - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(-a \cdot \left(b + a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 63.4% accurate, 5.9× speedup?

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

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

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

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


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

    1. Initial program 56.6%

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

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \color{blue}{{angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}}, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      4. unpow2N/A

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \color{blue}{\left(angle \cdot angle\right)} \cdot {\mathsf{PI}\left(\right)}^{3}, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      6. cube-multN/A

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \left(angle \cdot angle\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
      10. unpow2N/A

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(\frac{-1}{4374000}, \left(angle \cdot angle\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{\frac{1}{90} \cdot \mathsf{PI}\left(\right)}\right)\right)\right) \]
      15. lower-PI.f6466.9

        \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), 0.011111111111111112 \cdot \color{blue}{\pi}\right)\right)\right) \]
    6. Simplified66.9%

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

    if 9.9999999999999993e44 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999945e272

    1. Initial program 30.4%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
      12. lower--.f6434.6

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

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(a \cdot \left(\frac{b}{a} + \color{blue}{-1}\right)\right)\right) \]
      3. distribute-lft-inN/A

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(a \cdot \frac{b}{a} + \color{blue}{-1 \cdot a}\right)\right) \]
      5. mul-1-negN/A

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(a \cdot \frac{b}{a} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right) \]
      6. unsub-negN/A

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(\color{blue}{\frac{a \cdot b}{a}} - a\right)\right) \]
      10. lower-*.f6434.6

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

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

    if 9.99999999999999945e272 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
      12. lower--.f6430.5

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right) \]
      2. lower-neg.f6430.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{+45}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+273}:\\ \;\;\;\;\left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(\left(b + a\right) \cdot \left(\frac{b \cdot a}{a} - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(-a \cdot \left(b + a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 63.3% accurate, 5.9× speedup?

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

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

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

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


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

    1. Initial program 55.9%

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

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

      \[\leadsto \left(b + a\right) \cdot \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

        \[\leadsto \left(b + a\right) \cdot \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(b - a\right)\right)\right) \]
      6. lower--.f6469.2

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

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

    if 9.9999999999999998e-13 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999945e272

    1. Initial program 37.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
      12. lower--.f6435.8

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

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(a \cdot \left(\frac{b}{a} + \color{blue}{-1}\right)\right)\right) \]
      3. distribute-lft-inN/A

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(a \cdot \frac{b}{a} + \color{blue}{-1 \cdot a}\right)\right) \]
      5. mul-1-negN/A

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(a \cdot \frac{b}{a} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right) \]
      6. unsub-negN/A

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(\color{blue}{\frac{a \cdot b}{a}} - a\right)\right) \]
      10. lower-*.f6435.8

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

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

    if 9.99999999999999945e272 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 24.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
      12. lower--.f6430.5

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right) \]
      2. lower-neg.f6430.5

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

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

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

Alternative 16: 62.2% accurate, 10.3× speedup?

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

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

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


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

    1. Initial program 54.2%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr68.0%

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

      \[\leadsto \left(b + a\right) \cdot \color{blue}{\left(\frac{1}{90} \cdot \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

    if 1.00000000000000005e149 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 31.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
      9. difference-of-squaresN/A

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
      12. lower--.f6436.4

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

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

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

        \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right) \]
      2. lower-neg.f6439.0

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

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

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

Alternative 17: 38.4% accurate, 21.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
    9. difference-of-squaresN/A

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

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

      \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
    12. lower--.f6451.8

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

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

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

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

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

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

      \[\leadsto \frac{1}{90} \cdot \left(\color{blue}{\left(angle \cdot {b}^{2}\right)} \cdot \mathsf{PI}\left(\right)\right) \]
    5. unpow2N/A

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

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right) \cdot \mathsf{PI}\left(\right)\right) \]
    7. lower-PI.f6431.9

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

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \pi\right)} \]
  9. Step-by-step derivation
    1. associate-*r*N/A

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

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

      \[\leadsto \frac{1}{90} \cdot \left(\left(\color{blue}{\left(b \cdot angle\right)} \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \]
    4. lower-*.f6434.3

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

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

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

Alternative 18: 38.4% accurate, 21.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
    9. difference-of-squaresN/A

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

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

      \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
    12. lower--.f6451.8

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

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

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

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

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

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

      \[\leadsto \frac{1}{90} \cdot \left(\color{blue}{\left(angle \cdot {b}^{2}\right)} \cdot \mathsf{PI}\left(\right)\right) \]
    5. unpow2N/A

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

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right) \cdot \mathsf{PI}\left(\right)\right) \]
    7. lower-PI.f6431.9

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

    \[\leadsto \color{blue}{0.011111111111111112 \cdot \left(\left(angle \cdot \left(b \cdot b\right)\right) \cdot \pi\right)} \]
  9. Step-by-step derivation
    1. associate-*r*N/A

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

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

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

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

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

      \[\leadsto \frac{1}{90} \cdot \left(\color{blue}{\left(b \cdot angle\right)} \cdot \left(b \cdot \mathsf{PI}\left(\right)\right)\right) \]
    7. lower-*.f6434.3

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

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

Alternative 19: 34.8% accurate, 21.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
    9. difference-of-squaresN/A

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

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

      \[\leadsto \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
    12. lower--.f6451.8

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

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

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

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

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

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

      \[\leadsto \frac{1}{90} \cdot \left(\color{blue}{\left(angle \cdot {b}^{2}\right)} \cdot \mathsf{PI}\left(\right)\right) \]
    5. unpow2N/A

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

      \[\leadsto \frac{1}{90} \cdot \left(\left(angle \cdot \color{blue}{\left(b \cdot b\right)}\right) \cdot \mathsf{PI}\left(\right)\right) \]
    7. lower-PI.f6431.9

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

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

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

Reproduce

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