?

Average Error: 31.6 → 22.0
Time: 23.2s
Precision: binary64
Cost: 20936

?

\[\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} \mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-78}:\\ \;\;\;\;\frac{\sin \left(2 \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right) \cdot \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)}{2}\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-11}:\\ \;\;\;\;\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin \left(\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot 2\right)}{\frac{2}{2 \cdot \mathsf{fma}\left(b, b, a \cdot \left(-a\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
 (if (<= (/ angle 180.0) -5e-78)
   (/
    (*
     (sin (* 2.0 (* PI (* 0.005555555555555556 angle))))
     (* 2.0 (- (* b b) (* a a))))
    2.0)
   (if (<= (/ angle 180.0) 2e-11)
     (*
      (cos (* PI (/ angle 180.0)))
      (* (* -2.0 (+ b a)) (* (- a b) (* angle (* 0.005555555555555556 PI)))))
     (/
      (sin (* (* 0.005555555555555556 (* angle PI)) 2.0))
      (/ 2.0 (* 2.0 (fma b b (* a (- a)))))))))
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 tmp;
	if ((angle / 180.0) <= -5e-78) {
		tmp = (sin((2.0 * (((double) M_PI) * (0.005555555555555556 * angle)))) * (2.0 * ((b * b) - (a * a)))) / 2.0;
	} else if ((angle / 180.0) <= 2e-11) {
		tmp = cos((((double) M_PI) * (angle / 180.0))) * ((-2.0 * (b + a)) * ((a - b) * (angle * (0.005555555555555556 * ((double) M_PI)))));
	} else {
		tmp = sin(((0.005555555555555556 * (angle * ((double) M_PI))) * 2.0)) / (2.0 / (2.0 * fma(b, b, (a * -a))));
	}
	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)
	tmp = 0.0
	if (Float64(angle / 180.0) <= -5e-78)
		tmp = Float64(Float64(sin(Float64(2.0 * Float64(pi * Float64(0.005555555555555556 * angle)))) * Float64(2.0 * Float64(Float64(b * b) - Float64(a * a)))) / 2.0);
	elseif (Float64(angle / 180.0) <= 2e-11)
		tmp = Float64(cos(Float64(pi * Float64(angle / 180.0))) * Float64(Float64(-2.0 * Float64(b + a)) * Float64(Float64(a - b) * Float64(angle * Float64(0.005555555555555556 * pi)))));
	else
		tmp = Float64(sin(Float64(Float64(0.005555555555555556 * Float64(angle * pi)) * 2.0)) / Float64(2.0 / Float64(2.0 * fma(b, b, Float64(a * Float64(-a))))));
	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_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e-78], N[(N[(N[Sin[N[(2.0 * N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-11], N[(N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(-2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(a - b), $MachinePrecision] * N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] / N[(2.0 / N[(2.0 * N[(b * b + N[(a * (-a)), $MachinePrecision]), $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}
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-78}:\\
\;\;\;\;\frac{\sin \left(2 \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right) \cdot \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)}{2}\\

\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-11}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\\

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


\end{array}

Error?

Derivation?

  1. Split input into 3 regimes
  2. if (/.f64 angle 180) < -4.9999999999999996e-78

    1. Initial program 41.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. Simplified41.3

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

      associate-*l* [=>]41.3

      \[ \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 [=>]41.3

      \[ \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 [=>]41.3

      \[ \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. Applied egg-rr41.1

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

    if -4.9999999999999996e-78 < (/.f64 angle 180) < 1.99999999999999988e-11

    1. Initial program 19.0

      \[\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. Simplified19.0

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

      [Start]19.0

      \[ \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 [=>]19.0

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

      sub-neg [=>]19.0

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

      +-commutative [=>]19.0

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

      neg-sub0 [=>]19.0

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

      associate-+l- [=>]19.0

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

      sub0-neg [=>]19.0

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

      distribute-lft-neg-out [=>]19.0

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

      distribute-rgt-neg-in [=>]19.0

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

      unpow2 [=>]19.0

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

      unpow2 [=>]19.0

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

      metadata-eval [=>]19.0

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

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

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

      [Start]19.0

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

      unpow2 [=>]19.0

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

      unpow2 [=>]19.0

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

      difference-of-squares [=>]19.0

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

      associate-*r* [=>]19.0

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

      *-commutative [<=]19.0

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

      *-commutative [<=]19.0

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

      associate-*l* [=>]0.4

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

      associate-*l* [<=]0.4

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

      +-commutative [=>]0.4

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

      *-commutative [=>]0.4

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

      *-commutative [=>]0.4

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

      associate-*r* [<=]0.3

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

      \[\leadsto \left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    6. Simplified0.3

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

      [Start]0.3

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

      associate-*r* [=>]0.4

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

      *-commutative [=>]0.4

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

      associate-*r* [<=]0.3

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

    if 1.99999999999999988e-11 < (/.f64 angle 180)

    1. Initial program 48.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. Simplified48.8

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

      associate-*l* [=>]48.8

      \[ \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 [=>]48.8

      \[ \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 [=>]48.8

      \[ \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. Applied egg-rr53.1

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

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

      [Start]53.1

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

      unpow2 [=>]53.1

      \[ \left(2 \cdot \sqrt{\color{blue}{\left(b \cdot b - a \cdot a\right) \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) \]

      rem-sqrt-square [=>]50.1

      \[ \left(2 \cdot \color{blue}{\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) \]

      difference-of-squares [=>]50.1

      \[ \left(2 \cdot \left|\color{blue}{\left(b + a\right) \cdot \left(b - a\right)}\right|\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
    5. Applied egg-rr53.6

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\left(\sin 0 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)\right)}{2}\right)} - 1} \]
    6. Simplified48.7

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

      [Start]53.6

      \[ e^{\mathsf{log1p}\left(\frac{\left(\sin 0 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)\right)}{2}\right)} - 1 \]

      expm1-def [=>]51.8

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

      expm1-log1p [=>]48.8

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

      associate-/l* [=>]48.9

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

      sin-0 [=>]48.9

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

      associate-*r* [=>]48.7

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

      *-commutative [<=]48.7

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

      *-commutative [<=]48.7

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

      distribute-rgt-neg-in [=>]48.7

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

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

Alternatives

Alternative 1
Error21.8
Cost46208
\[\left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\frac{\pi \cdot {\left(\sqrt[3]{angle}\right)}^{2}}{\frac{180}{\sqrt[3]{angle}}}\right) \]
Alternative 2
Error21.7
Cost40072
\[\begin{array}{l} t_0 := {b}^{2} - {a}^{2}\\ \mathbf{if}\;t_0 \leq -6 \cdot 10^{+306}:\\ \;\;\;\;\left(a \cdot \left(a \cdot angle\right)\right) \cdot \left(\pi \cdot -0.011111111111111112\right)\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{+292}:\\ \;\;\;\;\left(b \cdot b - a \cdot a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 3
Error21.7
Cost39680
\[\left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot {\left(\sqrt[3]{\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}\right)}^{3} \]
Alternative 4
Error21.7
Cost26944
\[\left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\frac{1}{\frac{\frac{180}{angle}}{\pi}}\right) \]
Alternative 5
Error21.7
Cost26944
\[\left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\frac{\frac{\pi}{180}}{\frac{1}{angle}}\right) \]
Alternative 6
Error21.7
Cost26816
\[\left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
Alternative 7
Error21.8
Cost20937
\[\begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -0.004 \lor \neg \left(\frac{angle}{180} \leq 2 \cdot 10^{-58}\right):\\ \;\;\;\;\left(b \cdot b - a \cdot a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\\ \end{array} \]
Alternative 8
Error22.0
Cost20937
\[\begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-78} \lor \neg \left(\frac{angle}{180} \leq 2 \cdot 10^{-11}\right):\\ \;\;\;\;\frac{\sin \left(\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot 2\right)}{\frac{2}{2 \cdot \mathsf{fma}\left(b, b, a \cdot \left(-a\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\\ \end{array} \]
Alternative 9
Error22.0
Cost20936
\[\begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-78}:\\ \;\;\;\;\frac{2 \cdot \left(b \cdot b - a \cdot a\right)}{\frac{2}{\sin \left(2 \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)}}\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-11}:\\ \;\;\;\;\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin \left(\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot 2\right)}{\frac{2}{2 \cdot \mathsf{fma}\left(b, b, a \cdot \left(-a\right)\right)}}\\ \end{array} \]
Alternative 10
Error21.8
Cost14089
\[\begin{array}{l} t_0 := \left(b + a\right) \cdot angle\\ \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{-8} \lor \neg \left(\frac{angle}{180} \leq 2 \cdot 10^{-20}\right):\\ \;\;\;\;\left(b \cdot b - a \cdot a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot t_0 - a \cdot t_0\right)\right)\\ \end{array} \]
Alternative 11
Error24.8
Cost13700
\[\begin{array}{l} t_0 := \left(b + a\right) \cdot angle\\ \mathbf{if}\;\frac{angle}{180} \leq -2000000000:\\ \;\;\;\;2 \cdot \left(\left(b \cdot b\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot t_0 - a \cdot t_0\right)\right)\\ \end{array} \]
Alternative 12
Error24.8
Cost13700
\[\begin{array}{l} t_0 := \left(b + a\right) \cdot angle\\ \mathbf{if}\;\frac{angle}{180} \leq -2000000000:\\ \;\;\;\;\sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(-2 \cdot \left(a \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot t_0 - a \cdot t_0\right)\right)\\ \end{array} \]
Alternative 13
Error25.3
Cost7684
\[\begin{array}{l} t_0 := \left(b + a\right) \cdot angle\\ \mathbf{if}\;angle \leq -80000000000:\\ \;\;\;\;angle \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot t_0 - a \cdot t_0\right)\right)\\ \end{array} \]
Alternative 14
Error33.5
Cost7572
\[\begin{array}{l} t_0 := \left(a \cdot \left(a \cdot angle\right)\right) \cdot \left(\pi \cdot -0.011111111111111112\right)\\ \mathbf{if}\;b \leq -6.3 \cdot 10^{+119}:\\ \;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;b \leq -1.5 \cdot 10^{-51}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -1.03 \cdot 10^{-78}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-303}:\\ \;\;\;\;angle \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{+14}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \end{array} \]
Alternative 15
Error33.5
Cost7572
\[\begin{array}{l} t_0 := \left(a \cdot \left(a \cdot angle\right)\right) \cdot \left(\pi \cdot -0.011111111111111112\right)\\ \mathbf{if}\;b \leq -6.3 \cdot 10^{+119}:\\ \;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;b \leq -2.2 \cdot 10^{-51}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -5.8 \cdot 10^{-80}:\\ \;\;\;\;\left(angle \cdot \pi\right) \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\\ \mathbf{elif}\;b \leq 6.2 \cdot 10^{-303}:\\ \;\;\;\;angle \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\\ \mathbf{elif}\;b \leq 5.1 \cdot 10^{+14}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \end{array} \]
Alternative 16
Error30.2
Cost7560
\[\begin{array}{l} t_0 := \left(a \cdot \left(a \cdot angle\right)\right) \cdot \left(\pi \cdot -0.011111111111111112\right)\\ \mathbf{if}\;a \leq -1.9 \cdot 10^{+109}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;a \leq -2.05 \cdot 10^{-73}:\\ \;\;\;\;2 \cdot \left(\left(0.005555555555555556 \cdot angle\right) \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-16}:\\ \;\;\;\;\pi \cdot \left(0.011111111111111112 \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 17
Error30.2
Cost7432
\[\begin{array}{l} t_0 := \left(a \cdot \left(a \cdot angle\right)\right) \cdot \left(\pi \cdot -0.011111111111111112\right)\\ \mathbf{if}\;a \leq -2.2 \cdot 10^{+102}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;a \leq -1.25 \cdot 10^{-72}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b - a \cdot a\right)\right)\right)\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{-16}:\\ \;\;\;\;\pi \cdot \left(0.011111111111111112 \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 18
Error32.7
Cost7176
\[\begin{array}{l} \mathbf{if}\;b \leq -2.85 \cdot 10^{-80}:\\ \;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{-24}:\\ \;\;\;\;angle \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \end{array} \]
Alternative 19
Error32.6
Cost7176
\[\begin{array}{l} t_0 := b \cdot \left(b \cdot angle\right)\\ \mathbf{if}\;b \leq -1.03 \cdot 10^{-78}:\\ \;\;\;\;\pi \cdot \left(0.011111111111111112 \cdot t_0\right)\\ \mathbf{elif}\;b \leq 4.9 \cdot 10^{-26}:\\ \;\;\;\;angle \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot t_0\right)\\ \end{array} \]
Alternative 20
Error43.4
Cost6912
\[0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(b \cdot \pi\right)\right)\right) \]
Alternative 21
Error39.7
Cost6912
\[0.011111111111111112 \cdot \left(b \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]
Alternative 22
Error39.7
Cost6912
\[0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right) \]

Error

Reproduce?

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