?

Average Error: 30.9 → 21.3
Time: 22.0s
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} t_0 := b \cdot b - a \cdot a\\ \mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{-13}:\\ \;\;\;\;t_0 \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-5}:\\ \;\;\;\;\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) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\\ \mathbf{else}:\\ \;\;\;\;\left|t_0 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\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 (- (* b b) (* a a))))
   (if (<= (/ angle 180.0) -2e-13)
     (* t_0 (sin (* (* angle PI) 0.011111111111111112)))
     (if (<= (/ angle 180.0) 2e-5)
       (*
        (* (* -2.0 (+ b a)) (* (- a b) (* angle (* 0.005555555555555556 PI))))
        (cos (* PI (/ angle 180.0))))
       (fabs (* t_0 (sin (* angle (* PI 0.011111111111111112)))))))))
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 = (b * b) - (a * a);
	double tmp;
	if ((angle / 180.0) <= -2e-13) {
		tmp = t_0 * sin(((angle * ((double) M_PI)) * 0.011111111111111112));
	} else if ((angle / 180.0) <= 2e-5) {
		tmp = ((-2.0 * (b + a)) * ((a - b) * (angle * (0.005555555555555556 * ((double) M_PI))))) * cos((((double) M_PI) * (angle / 180.0)));
	} else {
		tmp = fabs((t_0 * sin((angle * (((double) M_PI) * 0.011111111111111112)))));
	}
	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 t_0 = (b * b) - (a * a);
	double tmp;
	if ((angle / 180.0) <= -2e-13) {
		tmp = t_0 * Math.sin(((angle * Math.PI) * 0.011111111111111112));
	} else if ((angle / 180.0) <= 2e-5) {
		tmp = ((-2.0 * (b + a)) * ((a - b) * (angle * (0.005555555555555556 * Math.PI)))) * Math.cos((Math.PI * (angle / 180.0)));
	} else {
		tmp = Math.abs((t_0 * Math.sin((angle * (Math.PI * 0.011111111111111112)))));
	}
	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):
	t_0 = (b * b) - (a * a)
	tmp = 0
	if (angle / 180.0) <= -2e-13:
		tmp = t_0 * math.sin(((angle * math.pi) * 0.011111111111111112))
	elif (angle / 180.0) <= 2e-5:
		tmp = ((-2.0 * (b + a)) * ((a - b) * (angle * (0.005555555555555556 * math.pi)))) * math.cos((math.pi * (angle / 180.0)))
	else:
		tmp = math.fabs((t_0 * math.sin((angle * (math.pi * 0.011111111111111112)))))
	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(Float64(b * b) - Float64(a * a))
	tmp = 0.0
	if (Float64(angle / 180.0) <= -2e-13)
		tmp = Float64(t_0 * sin(Float64(Float64(angle * pi) * 0.011111111111111112)));
	elseif (Float64(angle / 180.0) <= 2e-5)
		tmp = Float64(Float64(Float64(-2.0 * Float64(b + a)) * Float64(Float64(a - b) * Float64(angle * Float64(0.005555555555555556 * pi)))) * cos(Float64(pi * Float64(angle / 180.0))));
	else
		tmp = abs(Float64(t_0 * sin(Float64(angle * Float64(pi * 0.011111111111111112)))));
	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)
	t_0 = (b * b) - (a * a);
	tmp = 0.0;
	if ((angle / 180.0) <= -2e-13)
		tmp = t_0 * sin(((angle * pi) * 0.011111111111111112));
	elseif ((angle / 180.0) <= 2e-5)
		tmp = ((-2.0 * (b + a)) * ((a - b) * (angle * (0.005555555555555556 * pi)))) * cos((pi * (angle / 180.0)));
	else
		tmp = abs((t_0 * sin((angle * (pi * 0.011111111111111112)))));
	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_] := Block[{t$95$0 = N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e-13], N[(t$95$0 * N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-5], N[(N[(N[(-2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(a - b), $MachinePrecision] * N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(t$95$0 * N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $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}
t_0 := b \cdot b - a \cdot a\\
\mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{-13}:\\
\;\;\;\;t_0 \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\\

\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\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) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\\

\mathbf{else}:\\
\;\;\;\;\left|t_0 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\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) < -2.0000000000000001e-13

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

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

      associate-*l* [=>]48.4

      \[ \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.4

      \[ \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.4

      \[ \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.6

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

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

      [Start]53.6

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

      expm1-def [=>]51.6

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

      expm1-log1p [=>]48.5

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

      *-commutative [=>]48.5

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

      associate-*l* [=>]48.4

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

      *-commutative [=>]48.4

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

      associate-*l* [=>]48.4

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

      metadata-eval [=>]48.4

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

    if -2.0000000000000001e-13 < (/.f64 angle 180) < 2.00000000000000016e-5

    1. Initial program 17.6

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

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

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

      *-commutative [=>]17.6

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

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

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

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

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

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

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

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

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

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

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

      \[\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.4

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

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

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

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

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

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

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

      \[ \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.4

      \[ \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.4

      \[\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.4

      \[ \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 2.00000000000000016e-5 < (/.f64 angle 180)

    1. Initial program 48.9

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

      \[\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.9

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

      associate-*l* [=>]48.9

      \[ \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.9

      \[ \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.9

      \[ \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-rr55.7

      \[\leadsto \color{blue}{\log \left({\left(\sqrt{e^{\sin 0 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}}\right)}^{\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)}\right)} \]
    4. Simplified49.0

      \[\leadsto \color{blue}{\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \log \left(\sqrt{e^{\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)}}\right)} \]
      Proof

      [Start]55.7

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

      log-pow [=>]48.9

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

      sin-0 [=>]48.9

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

      +-lft-identity [=>]48.9

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

      *-commutative [=>]48.9

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

      associate-*r* [=>]49.0

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

      *-commutative [<=]49.0

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

      associate-*l* [=>]49.0

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

      metadata-eval [=>]49.0

      \[ \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \log \left(\sqrt{e^{\sin \left(\left(angle \cdot \pi\right) \cdot \color{blue}{0.011111111111111112}\right)}}\right) \]
    5. Applied egg-rr53.1

      \[\leadsto \color{blue}{\sqrt{{\left(2 \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot \left(0.5 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)\right)}^{2}}} \]
    6. Simplified50.4

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

      [Start]53.1

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

      unpow2 [=>]53.1

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

      rem-sqrt-square [=>]50.4

      \[ \color{blue}{\left|2 \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot \left(0.5 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)\right|} \]

      *-commutative [=>]50.4

      \[ \left|\color{blue}{\left(\left(b \cdot b - a \cdot a\right) \cdot \left(0.5 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right) \cdot 2}\right| \]

      associate-*l* [=>]50.4

      \[ \left|\color{blue}{\left(b \cdot b - a \cdot a\right) \cdot \left(\left(0.5 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right) \cdot 2\right)}\right| \]

      *-commutative [=>]50.4

      \[ \left|\left(b \cdot b - a \cdot a\right) \cdot \color{blue}{\left(2 \cdot \left(0.5 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)}\right| \]

      associate-*r* [=>]50.4

      \[ \left|\left(b \cdot b - a \cdot a\right) \cdot \color{blue}{\left(\left(2 \cdot 0.5\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)}\right| \]

      metadata-eval [=>]50.4

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

      *-lft-identity [=>]50.4

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

      *-commutative [=>]50.4

      \[ \left|\left(b \cdot b - a \cdot a\right) \cdot \sin \left(angle \cdot \color{blue}{\left(0.011111111111111112 \cdot \pi\right)}\right)\right| \]
  3. Recombined 3 regimes into one program.
  4. Final simplification21.3

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

Alternatives

Alternative 1
Error21.1
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(0.005555555555555556 \cdot \frac{\pi}{\frac{1}{angle}}\right) \]
Alternative 2
Error21.0
Cost26816
\[\begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ \left(\left(-2 \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \sin t_0\right)\right) \cdot \cos t_0 \end{array} \]
Alternative 3
Error21.3
Cost20488
\[\begin{array}{l} t_0 := b \cdot b - a \cdot a\\ \mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{-13}:\\ \;\;\;\;t_0 \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-5}:\\ \;\;\;\;\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)\\ \mathbf{else}:\\ \;\;\;\;\left|t_0 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right|\\ \end{array} \]
Alternative 4
Error21.5
Cost14089
\[\begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{-13} \lor \neg \left(\frac{angle}{180} \leq 6 \cdot 10^{-92}\right):\\ \;\;\;\;\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 \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 5
Error22.0
Cost13700
\[\begin{array}{l} \mathbf{if}\;angle \leq -3.5 \cdot 10^{-26}:\\ \;\;\;\;\left(b \cdot b - a \cdot a\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\ \mathbf{elif}\;angle \leq 2.1 \cdot 10^{+26}:\\ \;\;\;\;\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)\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot 0\right)\\ \end{array} \]
Alternative 6
Error22.6
Cost13508
\[\begin{array}{l} \mathbf{if}\;angle \leq -0.0095:\\ \;\;\;\;\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot \left(-a \cdot a\right)\\ \mathbf{elif}\;angle \leq 2.1 \cdot 10^{+26}:\\ \;\;\;\;\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)\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot 0\right)\\ \end{array} \]
Alternative 7
Error22.9
Cost7561
\[\begin{array}{l} \mathbf{if}\;angle \leq -8.8 \cdot 10^{+43} \lor \neg \left(angle \leq 2.1 \cdot 10^{+26}\right):\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot 0\right)\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \end{array} \]
Alternative 8
Error29.0
Cost7433
\[\begin{array}{l} \mathbf{if}\;a \leq -5 \cdot 10^{+119} \lor \neg \left(a \leq 1.5 \cdot 10^{+83}\right):\\ \;\;\;\;\pi \cdot \left(a \cdot \left(a \cdot \left(angle \cdot -0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\\ \end{array} \]
Alternative 9
Error29.0
Cost7433
\[\begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{+117} \lor \neg \left(a \leq 1.25 \cdot 10^{+83}\right):\\ \;\;\;\;\pi \cdot \left(a \cdot \left(a \cdot \left(angle \cdot -0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\ \end{array} \]
Alternative 10
Error22.9
Cost7433
\[\begin{array}{l} \mathbf{if}\;angle \leq -8.6 \cdot 10^{+43} \lor \neg \left(angle \leq 2.1 \cdot 10^{+26}\right):\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot 0\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\pi \cdot 0.011111111111111112\right) \cdot \left(\left(\left(b + a\right) \cdot angle\right) \cdot \left(b - a\right)\right)\\ \end{array} \]
Alternative 11
Error37.1
Cost7177
\[\begin{array}{l} \mathbf{if}\;angle \leq -8.2 \cdot 10^{+43} \lor \neg \left(angle \leq 1.65 \cdot 10^{+35}\right):\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot 0\right)\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot \left(a \cdot angle\right)\right)\right)\\ \end{array} \]
Alternative 12
Error37.1
Cost7177
\[\begin{array}{l} \mathbf{if}\;angle \leq -8.8 \cdot 10^{+43} \lor \neg \left(angle \leq 9 \cdot 10^{+36}\right):\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot 0\right)\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(a \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 13
Error32.2
Cost7176
\[\begin{array}{l} \mathbf{if}\;a \leq -3.15 \cdot 10^{-22}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot \left(a \cdot angle\right)\right)\right)\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-21}:\\ \;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(a \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 14
Error32.2
Cost7176
\[\begin{array}{l} \mathbf{if}\;a \leq -8.4 \cdot 10^{-23}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot \left(a \cdot angle\right)\right)\right)\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{-20}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(a \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 15
Error32.2
Cost7176
\[\begin{array}{l} \mathbf{if}\;a \leq -5.8 \cdot 10^{-22}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot \left(a \cdot angle\right)\right)\right)\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{-19}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(\pi \cdot \left(a \cdot \left(angle \cdot -0.011111111111111112\right)\right)\right)\\ \end{array} \]
Alternative 16
Error32.2
Cost7176
\[\begin{array}{l} \mathbf{if}\;a \leq -2.75 \cdot 10^{-21}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot \left(a \cdot angle\right)\right)\right)\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{-20}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \left(a \cdot \left(a \cdot \left(angle \cdot -0.011111111111111112\right)\right)\right)\\ \end{array} \]
Alternative 17
Error51.7
Cost320
\[-0.011111111111111112 \cdot \left(angle \cdot 0\right) \]

Error

Reproduce?

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