?

Average Error: 49.92% → 34.75%
Time: 24.2s
Precision: binary64
Cost: 14920

?

\[\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 10^{-68}:\\ \;\;\;\;\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)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+257}:\\ \;\;\;\;-2 \cdot \left(\left(b + a\right) \cdot \frac{b \cdot b - a \cdot a}{\frac{\left(-a\right) - b}{\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot 0.5}}\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(a \cdot a - b \cdot b\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) 1e-68)
   (* (* -2.0 (+ b a)) (* (- a b) (sin (* 0.005555555555555556 (* angle PI)))))
   (if (<= (/ angle 180.0) 5e+257)
     (*
      -2.0
      (*
       (+ b a)
       (/
        (- (* b b) (* a a))
        (/ (- (- a) b) (* (sin (* PI (* angle 0.011111111111111112))) 0.5)))))
     (* -2.0 (* (sin (* PI (/ angle 180.0))) (- (* a a) (* 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 tmp;
	if ((angle / 180.0) <= 1e-68) {
		tmp = (-2.0 * (b + a)) * ((a - b) * sin((0.005555555555555556 * (angle * ((double) M_PI)))));
	} else if ((angle / 180.0) <= 5e+257) {
		tmp = -2.0 * ((b + a) * (((b * b) - (a * a)) / ((-a - b) / (sin((((double) M_PI) * (angle * 0.011111111111111112))) * 0.5))));
	} else {
		tmp = -2.0 * (sin((((double) M_PI) * (angle / 180.0))) * ((a * a) - (b * b)));
	}
	return tmp;
}
public static double code(double a, double b, double angle) {
	return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin((Math.PI * (angle / 180.0)))) * Math.cos((Math.PI * (angle / 180.0)));
}
public static double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= 1e-68) {
		tmp = (-2.0 * (b + a)) * ((a - b) * Math.sin((0.005555555555555556 * (angle * Math.PI))));
	} else if ((angle / 180.0) <= 5e+257) {
		tmp = -2.0 * ((b + a) * (((b * b) - (a * a)) / ((-a - b) / (Math.sin((Math.PI * (angle * 0.011111111111111112))) * 0.5))));
	} else {
		tmp = -2.0 * (Math.sin((Math.PI * (angle / 180.0))) * ((a * a) - (b * b)));
	}
	return tmp;
}
def code(a, b, angle):
	return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin((math.pi * (angle / 180.0)))) * math.cos((math.pi * (angle / 180.0)))
def code(a, b, angle):
	tmp = 0
	if (angle / 180.0) <= 1e-68:
		tmp = (-2.0 * (b + a)) * ((a - b) * math.sin((0.005555555555555556 * (angle * math.pi))))
	elif (angle / 180.0) <= 5e+257:
		tmp = -2.0 * ((b + a) * (((b * b) - (a * a)) / ((-a - b) / (math.sin((math.pi * (angle * 0.011111111111111112))) * 0.5))))
	else:
		tmp = -2.0 * (math.sin((math.pi * (angle / 180.0))) * ((a * a) - (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)
	tmp = 0.0
	if (Float64(angle / 180.0) <= 1e-68)
		tmp = Float64(Float64(-2.0 * Float64(b + a)) * Float64(Float64(a - b) * sin(Float64(0.005555555555555556 * Float64(angle * pi)))));
	elseif (Float64(angle / 180.0) <= 5e+257)
		tmp = Float64(-2.0 * Float64(Float64(b + a) * Float64(Float64(Float64(b * b) - Float64(a * a)) / Float64(Float64(Float64(-a) - b) / Float64(sin(Float64(pi * Float64(angle * 0.011111111111111112))) * 0.5)))));
	else
		tmp = Float64(-2.0 * Float64(sin(Float64(pi * Float64(angle / 180.0))) * Float64(Float64(a * a) - Float64(b * b))));
	end
	return tmp
end
function tmp = code(a, b, angle)
	tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin((pi * (angle / 180.0)))) * cos((pi * (angle / 180.0)));
end
function tmp_2 = code(a, b, angle)
	tmp = 0.0;
	if ((angle / 180.0) <= 1e-68)
		tmp = (-2.0 * (b + a)) * ((a - b) * sin((0.005555555555555556 * (angle * pi))));
	elseif ((angle / 180.0) <= 5e+257)
		tmp = -2.0 * ((b + a) * (((b * b) - (a * a)) / ((-a - b) / (sin((pi * (angle * 0.011111111111111112))) * 0.5))));
	else
		tmp = -2.0 * (sin((pi * (angle / 180.0))) * ((a * a) - (b * b)));
	end
	tmp_2 = 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], 1e-68], N[(N[(-2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(a - b), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+257], N[(-2.0 * N[(N[(b + a), $MachinePrecision] * N[(N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision] / N[(N[((-a) - b), $MachinePrecision] / N[(N[Sin[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a * a), $MachinePrecision] - 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}
\mathbf{if}\;\frac{angle}{180} \leq 10^{-68}:\\
\;\;\;\;\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)\\

\mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+257}:\\
\;\;\;\;-2 \cdot \left(\left(b + a\right) \cdot \frac{b \cdot b - a \cdot a}{\frac{\left(-a\right) - b}{\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot 0.5}}\right)\\

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

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

    1. Initial program 44.31

      \[\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. Simplified44.31

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

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

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

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

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

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

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

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

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

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

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

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

      \[ \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 44.35

      \[\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. Simplified22.66

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[ \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 23.82

      \[\leadsto \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 \color{blue}{1} \]

    if 1.00000000000000007e-68 < (/.f64 angle 180) < 5.00000000000000028e257

    1. Initial program 63.17

      \[\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. Simplified63.16

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

      [Start]63.17

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

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

      associate-*l* [=>]63.16

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

      *-commutative [=>]63.16

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

      associate-*l* [=>]63.16

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

      unpow2 [=>]63.16

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

      unpow2 [=>]63.16

      \[ 2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
    3. Applied egg-rr78.98

      \[\leadsto 2 \cdot \color{blue}{\sqrt{{\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(b \cdot b - a \cdot a\right)\right)\right)}^{2}}} \]
    4. Simplified78.98

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

      [Start]78.98

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

      associate-*r* [=>]78.98

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

      *-commutative [<=]78.98

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

      *-commutative [<=]78.98

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

      difference-of-squares [=>]78.98

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

      *-commutative [=>]78.98

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

      *-commutative [=>]78.98

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

      *-commutative [=>]78.98

      \[ 2 \cdot \sqrt{{\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \cos \left(\pi \cdot \color{blue}{\left(0.005555555555555556 \cdot angle\right)}\right)\right)\right)}^{2}} \]
    5. Applied egg-rr80.79

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

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

      [Start]80.79

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

    if 5.00000000000000028e257 < (/.f64 angle 180)

    1. Initial program 83.45

      \[\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. Simplified83.45

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

      [Start]83.45

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

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

      associate-*l* [=>]83.45

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

      *-commutative [=>]83.45

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

      associate-*l* [=>]83.45

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

      unpow2 [=>]83.45

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

      unpow2 [=>]83.45

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

      \[\leadsto 2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot \color{blue}{1}\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification34.75

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

Alternatives

Alternative 1
Error33.71%
Cost58944
\[\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(\left(angle \cdot \frac{\sqrt[3]{\pi}}{180}\right) \cdot {\left(\sqrt[3]{\sqrt{\pi}}\right)}^{4}\right) \]
Alternative 2
Error33.6%
Cost46080
\[\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{\sqrt{\pi}}{\frac{180}{angle \cdot \sqrt{\pi}}}\right) \]
Alternative 3
Error33.43%
Cost26816
\[\begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ -2 \cdot \left(\left(a - b\right) \cdot \left(\cos t_0 \cdot \left(\sin t_0 \cdot \left(b + a\right)\right)\right)\right) \end{array} \]
Alternative 4
Error33.49%
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(\frac{\pi}{\frac{180}{angle}}\right) \]
Alternative 5
Error33.51%
Cost26816
\[\left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
Alternative 6
Error34.21%
Cost14345
\[\begin{array}{l} t_0 := angle \cdot \left(b + a\right)\\ \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{-6} \lor \neg \left(\frac{angle}{180} \leq 10^{-82}\right):\\ \;\;\;\;-2 \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot -0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot t_0 - a \cdot t_0\right)\right)\\ \end{array} \]
Alternative 7
Error34.37%
Cost14344
\[\begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{-18}:\\ \;\;\;\;\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)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+257}:\\ \;\;\;\;-2 \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot -0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(a \cdot a - b \cdot b\right)\right)\\ \end{array} \]
Alternative 8
Error33.74%
Cost13833
\[\begin{array}{l} t_0 := angle \cdot \left(b + a\right)\\ \mathbf{if}\;angle \leq -1.45 \cdot 10^{-6} \lor \neg \left(angle \leq 10^{-39}\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 9
Error35.85%
Cost13832
\[\begin{array}{l} t_0 := angle \cdot \left(b + a\right)\\ \mathbf{if}\;angle \leq -5.5 \cdot 10^{+17}:\\ \;\;\;\;-2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot a\right)\right)\\ \mathbf{elif}\;angle \leq 36000:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot t_0 - a \cdot t_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(\frac{a}{2} \cdot \left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)\\ \end{array} \]
Alternative 10
Error35.88%
Cost13832
\[\begin{array}{l} t_0 := angle \cdot \left(b + a\right)\\ \mathbf{if}\;angle \leq -5.4 \cdot 10^{+17}:\\ \;\;\;\;-2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot a\right)\right)\\ \mathbf{elif}\;angle \leq 36000:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot t_0 - a \cdot t_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot \left(a \cdot \left(a \cdot 0.5\right)\right)\right)\\ \end{array} \]
Alternative 11
Error36.13%
Cost13832
\[\begin{array}{l} t_0 := angle \cdot \left(b + a\right)\\ \mathbf{if}\;angle \leq -9.5 \cdot 10^{+70}:\\ \;\;\;\;2 \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(b \cdot b\right)\right)\\ \mathbf{elif}\;angle \leq 36000:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot t_0 - a \cdot t_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot \left(a \cdot \left(a \cdot 0.5\right)\right)\right)\\ \end{array} \]
Alternative 12
Error36.15%
Cost13705
\[\begin{array}{l} t_0 := angle \cdot \left(b + a\right)\\ \mathbf{if}\;angle \leq -1.3 \cdot 10^{+19} \lor \neg \left(angle \leq 40000\right):\\ \;\;\;\;-2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \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
Error37.73%
Cost7816
\[\begin{array}{l} t_0 := angle \cdot \left(b + a\right)\\ \mathbf{if}\;angle \leq -3.5 \cdot 10^{+70}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;angle \leq 1.65 \cdot 10^{+37}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot t_0 - a \cdot t_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\left(a \cdot \left(a \cdot \pi\right)\right) \cdot -0.011111111111111112\right)\\ \end{array} \]
Alternative 14
Error37.73%
Cost7560
\[\begin{array}{l} \mathbf{if}\;angle \leq -7.2 \cdot 10^{+71}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;angle \leq 2.3 \cdot 10^{+37}:\\ \;\;\;\;-2 \cdot \left(0.005555555555555556 \cdot \left(\left(angle \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\left(a \cdot \left(a \cdot \pi\right)\right) \cdot -0.011111111111111112\right)\\ \end{array} \]
Alternative 15
Error46.56%
Cost7432
\[\begin{array}{l} \mathbf{if}\;b \leq -4.5 \cdot 10^{+101}:\\ \;\;\;\;\pi \cdot \left(0.011111111111111112 \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \mathbf{elif}\;b \leq 1.45 \cdot 10^{+143}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b - a \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(b \cdot \pi\right)\right)\\ \end{array} \]
Alternative 16
Error46.28%
Cost7432
\[\begin{array}{l} \mathbf{if}\;b \leq -4.5 \cdot 10^{+151}:\\ \;\;\;\;\pi \cdot \left(0.011111111111111112 \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \mathbf{elif}\;b \leq 10^{+145}:\\ \;\;\;\;angle \cdot \left(\left(a \cdot a - b \cdot b\right) \cdot \left(\pi \cdot -0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(b \cdot \pi\right)\right)\\ \end{array} \]
Alternative 17
Error51.32%
Cost7177
\[\begin{array}{l} \mathbf{if}\;b \leq -1.7 \cdot 10^{-37} \lor \neg \left(b \leq 3.8 \cdot 10^{-43}\right):\\ \;\;\;\;b \cdot \left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(b \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\left(a \cdot \left(a \cdot \pi\right)\right) \cdot -0.011111111111111112\right)\\ \end{array} \]
Alternative 18
Error51.54%
Cost7177
\[\begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{-35} \lor \neg \left(b \leq 2.6 \cdot 10^{-40}\right):\\ \;\;\;\;\pi \cdot \left(0.011111111111111112 \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\left(a \cdot \left(a \cdot \pi\right)\right) \cdot -0.011111111111111112\right)\\ \end{array} \]
Alternative 19
Error51.49%
Cost7177
\[\begin{array}{l} \mathbf{if}\;b \leq -4.5 \cdot 10^{-38} \lor \neg \left(b \leq 2.4 \cdot 10^{-42}\right):\\ \;\;\;\;\pi \cdot \left(0.011111111111111112 \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle \cdot -0.011111111111111112\right) \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\\ \end{array} \]
Alternative 20
Error51.55%
Cost7177
\[\begin{array}{l} \mathbf{if}\;b \leq -8.5 \cdot 10^{-37} \lor \neg \left(b \leq 2 \cdot 10^{-41}\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(a \cdot a\right)\right)\right)\\ \end{array} \]
Alternative 21
Error59.58%
Cost7176
\[\begin{array}{l} \mathbf{if}\;b \leq -1.55 \cdot 10^{-37}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;b \leq 6.5 \cdot 10^{-42}:\\ \;\;\;\;angle \cdot \left(\left(a \cdot \left(a \cdot \pi\right)\right) \cdot -0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 0.011111111111111112\right)\right)\right)\\ \end{array} \]
Alternative 22
Error68.99%
Cost6912
\[0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(b \cdot \pi\right)\right)\right) \]
Alternative 23
Error68.97%
Cost6912
\[0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right) \]
Alternative 24
Error68.84%
Cost6912
\[angle \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 0.011111111111111112\right)\right)\right) \]

Error

Reproduce?

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