?

Average Accuracy: 51.6% → 65.3%
Time: 25.4s
Precision: binary64
Cost: 72644

?

\[\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) \]
\[\begin{array}{l} t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\ t_1 := \sin t_0\\ t_2 := \cos t_0\\ t_3 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\ \mathbf{if}\;{b}^{2} - {a}^{2} \leq 5 \cdot 10^{+198}:\\ \;\;\;\;\mathsf{fma}\left(-2, a \cdot \left(a \cdot \left(t_1 \cdot t_2\right)\right), \cos t_3 \cdot \left(2 \cdot \left(\left(b \cdot b\right) \cdot \sin t_3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \left(b \cdot \left(t_1 \cdot \left(b + b\right)\right)\right)\\ \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (*
  (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0))))
  (cos (* PI (/ angle 180.0)))))
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* PI (* 0.005555555555555556 angle)))
        (t_1 (sin t_0))
        (t_2 (cos t_0))
        (t_3 (* angle (* PI 0.005555555555555556))))
   (if (<= (- (pow b 2.0) (pow a 2.0)) 5e+198)
     (fma
      -2.0
      (* a (* a (* t_1 t_2)))
      (* (cos t_3) (* 2.0 (* (* b b) (sin t_3)))))
     (* t_2 (* b (* t_1 (+ b b)))))))
double code(double a, double b, double angle) {
	return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin((((double) M_PI) * (angle / 180.0)))) * cos((((double) M_PI) * (angle / 180.0)));
}
double code(double a, double b, double angle) {
	double t_0 = ((double) M_PI) * (0.005555555555555556 * angle);
	double t_1 = sin(t_0);
	double t_2 = cos(t_0);
	double t_3 = angle * (((double) M_PI) * 0.005555555555555556);
	double tmp;
	if ((pow(b, 2.0) - pow(a, 2.0)) <= 5e+198) {
		tmp = fma(-2.0, (a * (a * (t_1 * t_2))), (cos(t_3) * (2.0 * ((b * b) * sin(t_3)))));
	} else {
		tmp = t_2 * (b * (t_1 * (b + b)));
	}
	return tmp;
}
function code(a, b, angle)
	return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(Float64(pi * Float64(angle / 180.0)))) * cos(Float64(pi * Float64(angle / 180.0))))
end
function code(a, b, angle)
	t_0 = Float64(pi * Float64(0.005555555555555556 * angle))
	t_1 = sin(t_0)
	t_2 = cos(t_0)
	t_3 = Float64(angle * Float64(pi * 0.005555555555555556))
	tmp = 0.0
	if (Float64((b ^ 2.0) - (a ^ 2.0)) <= 5e+198)
		tmp = fma(-2.0, Float64(a * Float64(a * Float64(t_1 * t_2))), Float64(cos(t_3) * Float64(2.0 * Float64(Float64(b * b) * sin(t_3)))));
	else
		tmp = Float64(t_2 * Float64(b * Float64(t_1 * Float64(b + b))));
	end
	return tmp
end
code[a_, b_, angle_] := N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 5e+198], N[(-2.0 * N[(a * N[(a * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t$95$3], $MachinePrecision] * N[(2.0 * N[(N[(b * b), $MachinePrecision] * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(b * N[(t$95$1 * N[(b + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\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)
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
t_1 := \sin t_0\\
t_2 := \cos t_0\\
t_3 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\
\mathbf{if}\;{b}^{2} - {a}^{2} \leq 5 \cdot 10^{+198}:\\
\;\;\;\;\mathsf{fma}\left(-2, a \cdot \left(a \cdot \left(t_1 \cdot t_2\right)\right), \cos t_3 \cdot \left(2 \cdot \left(\left(b \cdot b\right) \cdot \sin t_3\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_2 \cdot \left(b \cdot \left(t_1 \cdot \left(b + b\right)\right)\right)\\


\end{array}

Error?

Derivation?

  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < 5.00000000000000049e198

    1. Initial program 56.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. Simplified56.4%

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

      [Start]56.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) \]

      *-commutative [=>]56.4

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

      associate-*l* [=>]56.4

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

      unpow2 [=>]56.4

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

      fma-neg [=>]56.4

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

      unpow2 [=>]56.4

      \[ \sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \mathsf{fma}\left(b, b, -\color{blue}{a \cdot a}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    3. Applied egg-rr55.5%

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

      [Start]56.4

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

      add-cube-cbrt [=>]55.6

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

      pow3 [=>]55.5

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

      div-inv [=>]55.5

      \[ \sin \left({\left(\sqrt[3]{\pi \cdot \color{blue}{\left(angle \cdot \frac{1}{180}\right)}}\right)}^{3}\right) \cdot \left(\left(2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]

      metadata-eval [=>]55.5

      \[ \sin \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot \color{blue}{0.005555555555555556}\right)}\right)}^{3}\right) \cdot \left(\left(2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    4. Taylor expanded in b around 0 56.4%

      \[\leadsto \color{blue}{2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left({1}^{0.3333333333333333} \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) + -2 \cdot \left({a}^{2} \cdot \left(\sin \left(0.005555555555555556 \cdot \left({1}^{0.3333333333333333} \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \]
    5. Simplified64.5%

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

      [Start]56.4

      \[ 2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left({1}^{0.3333333333333333} \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot {b}^{2}\right)\right) + -2 \cdot \left({a}^{2} \cdot \left(\sin \left(0.005555555555555556 \cdot \left({1}^{0.3333333333333333} \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]

      +-commutative [=>]56.4

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

      *-commutative [=>]56.4

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

      fma-def [=>]56.4

      \[ \color{blue}{\mathsf{fma}\left(-2, {a}^{2} \cdot \left(\sin \left(0.005555555555555556 \cdot \left({1}^{0.3333333333333333} \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right), 2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left({1}^{0.3333333333333333} \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \left({b}^{2} \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)} \]
    6. Taylor expanded in angle around inf 64.5%

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

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

      [Start]64.5

      \[ \mathsf{fma}\left(-2, a \cdot \left(a \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right), 2 \cdot \left({b}^{2} \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right) \]

      associate-*r* [=>]64.5

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

      associate-*r* [=>]64.5

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

      *-commutative [<=]64.5

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

      *-commutative [<=]64.5

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

      *-commutative [=>]64.5

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

      associate-*r* [<=]64.5

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

      associate-*r* [<=]64.5

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

      *-commutative [=>]64.5

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

      associate-*r* [=>]64.5

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

      *-commutative [<=]64.5

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

    if 5.00000000000000049e198 < (-.f64 (pow.f64 b 2) (pow.f64 a 2))

    1. Initial program 29.7%

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

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

      [Start]29.7

      \[ \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) \]

      associate-*l* [=>]29.7

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

      unpow2 [=>]29.7

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

      unpow2 [=>]29.7

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

      \[\leadsto \color{blue}{2 \cdot \left({b}^{2} \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \]
    4. Simplified29.5%

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

      [Start]29.6

      \[ 2 \cdot \left({b}^{2} \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]

      unpow2 [=>]29.6

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

      associate-*r* [=>]29.5

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

      *-commutative [=>]29.5

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

      associate-*r* [=>]29.5

      \[ \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \color{blue}{\left(\left(2 \cdot b\right) \cdot b\right)} \]
    5. Applied egg-rr68.5%

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

      [Start]29.5

      \[ \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \left(\left(2 \cdot b\right) \cdot b\right) \]

      add-log-exp [=>]1.1

      \[ \color{blue}{\log \left(e^{\left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \left(\left(2 \cdot b\right) \cdot b\right)}\right)} \]

      *-un-lft-identity [=>]1.1

      \[ \log \color{blue}{\left(1 \cdot e^{\left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \left(\left(2 \cdot b\right) \cdot b\right)}\right)} \]

      log-prod [=>]1.1

      \[ \color{blue}{\log 1 + \log \left(e^{\left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \left(\left(2 \cdot b\right) \cdot b\right)}\right)} \]

      metadata-eval [=>]1.1

      \[ \color{blue}{0} + \log \left(e^{\left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \left(\left(2 \cdot b\right) \cdot b\right)}\right) \]

      add-log-exp [<=]29.5

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

      associate-*l* [=>]29.5

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

      associate-*r* [=>]29.4

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

      *-commutative [=>]29.4

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

      associate-*r* [=>]68.3

      \[ 0 + \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \color{blue}{\left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot b\right)\right) \cdot b\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification65.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq 5 \cdot 10^{+198}:\\ \;\;\;\;\mathsf{fma}\left(-2, a \cdot \left(a \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right), \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(\left(b \cdot b\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(b \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(b + b\right)\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy64.8%
Cost52996
\[\begin{array}{l} t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\ t_1 := \sin t_0\\ t_2 := \cos t_0\\ \mathbf{if}\;{b}^{2} - {a}^{2} \leq -2 \cdot 10^{-315}:\\ \;\;\;\;\mathsf{fma}\left(-2, a \cdot \left(a \cdot \left(t_1 \cdot t_2\right)\right), \left(\pi \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \left(b \cdot \left(t_1 \cdot \left(b + b\right)\right)\right)\\ \end{array} \]
Alternative 2
Accuracy64.9%
Cost39748
\[\begin{array}{l} t_0 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\ t_1 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\ \mathbf{if}\;{b}^{2} - {a}^{2} \leq -2 \cdot 10^{-315}:\\ \;\;\;\;-2 \cdot \left(a \cdot \left(a \cdot \left(\cos t_0 \cdot \sin t_0\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos t_1 \cdot \left(b \cdot \left(\sin t_1 \cdot \left(b + b\right)\right)\right)\\ \end{array} \]
Alternative 3
Accuracy60.3%
Cost26956
\[\begin{array}{l} t_0 := b \cdot b - a \cdot a\\ t_1 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\ t_2 := b \cdot \left(b \cdot angle\right)\\ \mathbf{if}\;b \leq -1 \cdot 10^{+153}:\\ \;\;\;\;\pi \cdot \left(0.011111111111111112 \cdot t_2\right)\\ \mathbf{elif}\;b \leq -6.2 \cdot 10^{-29}:\\ \;\;\;\;t_0 \cdot \sin \left(2 \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\\ \mathbf{elif}\;b \leq 1.65 \cdot 10^{-72}:\\ \;\;\;\;-2 \cdot \left(a \cdot \left(a \cdot \left(\cos t_1 \cdot \sin t_1\right)\right)\right)\\ \mathbf{elif}\;b \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_0 \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot t_2\right)\\ \end{array} \]
Alternative 4
Accuracy58.5%
Cost13960
\[\begin{array}{l} t_0 := b \cdot \left(b \cdot angle\right)\\ \mathbf{if}\;b \leq -1 \cdot 10^{+153}:\\ \;\;\;\;\pi \cdot \left(0.011111111111111112 \cdot t_0\right)\\ \mathbf{elif}\;b \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\left(b \cdot b - a \cdot a\right) \cdot \sin \left(2 \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot t_0\right)\\ \end{array} \]
Alternative 5
Accuracy58.5%
Cost13832
\[\begin{array}{l} t_0 := b \cdot \left(b \cdot angle\right)\\ \mathbf{if}\;b \leq -1 \cdot 10^{+153}:\\ \;\;\;\;\pi \cdot \left(0.011111111111111112 \cdot t_0\right)\\ \mathbf{elif}\;b \leq 9 \cdot 10^{+153}:\\ \;\;\;\;\left(b \cdot b - a \cdot a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot t_0\right)\\ \end{array} \]
Alternative 6
Accuracy52.4%
Cost7433
\[\begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+143} \lor \neg \left(b \leq 2.9 \cdot 10^{-6}\right):\\ \;\;\;\;\pi \cdot \left(0.011111111111111112 \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - a \cdot a\right)\right)\right)\\ \end{array} \]
Alternative 7
Accuracy52.3%
Cost7432
\[\begin{array}{l} t_0 := b \cdot \left(b \cdot angle\right)\\ \mathbf{if}\;b \leq -2.35 \cdot 10^{+111}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot t_0\right)\\ \mathbf{elif}\;b \leq 2 \cdot 10^{-6}:\\ \;\;\;\;\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(b \cdot b - a \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \left(0.011111111111111112 \cdot t_0\right)\\ \end{array} \]
Alternative 8
Accuracy48.4%
Cost7177
\[\begin{array}{l} \mathbf{if}\;b \leq -5.7 \cdot 10^{-30} \lor \neg \left(b \leq 5.2 \cdot 10^{-50}\right):\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\left(\pi \cdot \left(a \cdot a\right)\right) \cdot -0.011111111111111112\right)\\ \end{array} \]
Alternative 9
Accuracy48.5%
Cost7176
\[\begin{array}{l} t_0 := b \cdot \left(b \cdot angle\right)\\ \mathbf{if}\;b \leq -1.12 \cdot 10^{-26}:\\ \;\;\;\;\pi \cdot \left(0.011111111111111112 \cdot t_0\right)\\ \mathbf{elif}\;b \leq 6.8 \cdot 10^{-50}:\\ \;\;\;\;angle \cdot \left(\left(\pi \cdot \left(a \cdot a\right)\right) \cdot -0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot t_0\right)\\ \end{array} \]
Alternative 10
Accuracy48.4%
Cost7176
\[\begin{array}{l} t_0 := b \cdot \left(b \cdot angle\right)\\ \mathbf{if}\;b \leq -2.8 \cdot 10^{-27}:\\ \;\;\;\;\pi \cdot \left(0.011111111111111112 \cdot t_0\right)\\ \mathbf{elif}\;b \leq 5.2 \cdot 10^{-50}:\\ \;\;\;\;\left(angle \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot t_0\right)\\ \end{array} \]
Alternative 11
Accuracy32.3%
Cost6912
\[0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right) \]
Alternative 12
Accuracy36.8%
Cost6912
\[0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right) \]

Error

Reproduce?

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