Average Error: 30.7 → 22.0
Time: 40.0s
Precision: binary64
Cost: 39748
\[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
\[\begin{array}{l} t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\ t_1 := 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\\ \mathbf{if}\;{b}^{2} - {a}^{2} \leq 5 \cdot 10^{-306}:\\ \;\;\;\;a \cdot \left(\left(\cos t_0 \cdot \left(a \cdot \sin t_0\right)\right) \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\cos t_1 \cdot \left(b \cdot \left(b \cdot \sin t_1\right)\right)\right)\\ \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (*
  (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0))))
  (cos (* PI (/ angle 180.0)))))
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* PI (* angle 0.005555555555555556)))
        (t_1 (* 0.005555555555555556 (* PI angle))))
   (if (<= (- (pow b 2.0) (pow a 2.0)) 5e-306)
     (* a (* (* (cos t_0) (* a (sin t_0))) -2.0))
     (* 2.0 (* (cos t_1) (* b (* b (sin t_1))))))))
double code(double a, double b, double angle) {
	return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin((((double) M_PI) * (angle / 180.0)))) * cos((((double) M_PI) * (angle / 180.0)));
}
double code(double a, double b, double angle) {
	double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
	double t_1 = 0.005555555555555556 * (((double) M_PI) * angle);
	double tmp;
	if ((pow(b, 2.0) - pow(a, 2.0)) <= 5e-306) {
		tmp = a * ((cos(t_0) * (a * sin(t_0))) * -2.0);
	} else {
		tmp = 2.0 * (cos(t_1) * (b * (b * sin(t_1))));
	}
	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 = Math.PI * (angle * 0.005555555555555556);
	double t_1 = 0.005555555555555556 * (Math.PI * angle);
	double tmp;
	if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= 5e-306) {
		tmp = a * ((Math.cos(t_0) * (a * Math.sin(t_0))) * -2.0);
	} else {
		tmp = 2.0 * (Math.cos(t_1) * (b * (b * Math.sin(t_1))));
	}
	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 = math.pi * (angle * 0.005555555555555556)
	t_1 = 0.005555555555555556 * (math.pi * angle)
	tmp = 0
	if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= 5e-306:
		tmp = a * ((math.cos(t_0) * (a * math.sin(t_0))) * -2.0)
	else:
		tmp = 2.0 * (math.cos(t_1) * (b * (b * math.sin(t_1))))
	return tmp
function code(a, b, angle)
	return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(Float64(pi * Float64(angle / 180.0)))) * cos(Float64(pi * Float64(angle / 180.0))))
end
function code(a, b, angle)
	t_0 = Float64(pi * Float64(angle * 0.005555555555555556))
	t_1 = Float64(0.005555555555555556 * Float64(pi * angle))
	tmp = 0.0
	if (Float64((b ^ 2.0) - (a ^ 2.0)) <= 5e-306)
		tmp = Float64(a * Float64(Float64(cos(t_0) * Float64(a * sin(t_0))) * -2.0));
	else
		tmp = Float64(2.0 * Float64(cos(t_1) * Float64(b * Float64(b * sin(t_1)))));
	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 = pi * (angle * 0.005555555555555556);
	t_1 = 0.005555555555555556 * (pi * angle);
	tmp = 0.0;
	if (((b ^ 2.0) - (a ^ 2.0)) <= 5e-306)
		tmp = a * ((cos(t_0) * (a * sin(t_0))) * -2.0);
	else
		tmp = 2.0 * (cos(t_1) * (b * (b * sin(t_1))));
	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[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 5e-306], N[(a * N[(N[(N[Cos[t$95$0], $MachinePrecision] * N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[t$95$1], $MachinePrecision] * N[(b * N[(b * N[Sin[t$95$1], $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 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\\
\mathbf{if}\;{b}^{2} - {a}^{2} \leq 5 \cdot 10^{-306}:\\
\;\;\;\;a \cdot \left(\left(\cos t_0 \cdot \left(a \cdot \sin t_0\right)\right) \cdot -2\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos t_1 \cdot \left(b \cdot \left(b \cdot \sin t_1\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 2 regimes
  2. if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < 4.99999999999999998e-306

    1. Initial program 27.5

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

      \[\leadsto \color{blue}{\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(-2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      Proof
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 -2 (fma.f64 a a (*.f64 b (neg.f64 b)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 (Rewrite<= metadata-eval (neg.f64 2)) (fma.f64 a a (*.f64 b (neg.f64 b)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 (neg.f64 2) (fma.f64 a a (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 b b))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 (neg.f64 2) (fma.f64 a a (neg.f64 (Rewrite<= unpow2_binary64 (pow.f64 b 2))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 (neg.f64 2) (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 a a) (pow.f64 b 2)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 (neg.f64 2) (-.f64 (Rewrite<= unpow2_binary64 (pow.f64 a 2)) (pow.f64 b 2))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (Rewrite<= distribute-lft-neg-in_binary64 (neg.f64 (*.f64 2 (-.f64 (pow.f64 a 2) (pow.f64 b 2))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (Rewrite<= distribute-rgt-neg-out_binary64 (*.f64 2 (neg.f64 (-.f64 (pow.f64 a 2) (pow.f64 b 2))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 2 (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 (pow.f64 a 2) (pow.f64 b 2))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 2 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 (pow.f64 a 2)) (pow.f64 b 2)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 2 (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 (pow.f64 a 2))) (pow.f64 b 2))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 2 (Rewrite<= +-commutative_binary64 (+.f64 (pow.f64 b 2) (neg.f64 (pow.f64 a 2))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 2 (Rewrite<= sub-neg_binary64 (-.f64 (pow.f64 b 2) (pow.f64 a 2)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 19 points increase in error, 16 points decrease in error
      (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))): 0 points increase in error, 0 points decrease in error
    3. Applied egg-rr27.8

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

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \]
    5. Simplified19.5

      \[\leadsto \color{blue}{a \cdot \left(\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot a\right)\right) \cdot -2\right)} \]
      Proof
      (*.f64 a (*.f64 (*.f64 (cos.f64 (*.f64 (PI.f64) (*.f64 angle 1/180))) (*.f64 (sin.f64 (*.f64 (PI.f64) (*.f64 angle 1/180))) a)) -2)): 0 points increase in error, 0 points decrease in error
      (*.f64 a (*.f64 (*.f64 (cos.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (PI.f64) angle) 1/180))) (*.f64 (sin.f64 (*.f64 (PI.f64) (*.f64 angle 1/180))) a)) -2)): 11 points increase in error, 15 points decrease in error
      (*.f64 a (*.f64 (*.f64 (cos.f64 (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 angle (PI.f64))) 1/180)) (*.f64 (sin.f64 (*.f64 (PI.f64) (*.f64 angle 1/180))) a)) -2)): 0 points increase in error, 0 points decrease in error
      (*.f64 a (*.f64 (*.f64 (cos.f64 (Rewrite<= *-commutative_binary64 (*.f64 1/180 (*.f64 angle (PI.f64))))) (*.f64 (sin.f64 (*.f64 (PI.f64) (*.f64 angle 1/180))) a)) -2)): 0 points increase in error, 0 points decrease in error
      (*.f64 a (*.f64 (*.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) (*.f64 (sin.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (PI.f64) angle) 1/180))) a)) -2)): 18 points increase in error, 18 points decrease in error
      (*.f64 a (*.f64 (*.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) (*.f64 (sin.f64 (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 angle (PI.f64))) 1/180)) a)) -2)): 0 points increase in error, 0 points decrease in error
      (*.f64 a (*.f64 (*.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) (*.f64 (sin.f64 (Rewrite<= *-commutative_binary64 (*.f64 1/180 (*.f64 angle (PI.f64))))) a)) -2)): 0 points increase in error, 0 points decrease in error
      (*.f64 a (*.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64))))) a)) -2)): 7 points increase in error, 17 points decrease in error
      (*.f64 a (*.f64 (Rewrite=> *-commutative_binary64 (*.f64 a (*.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64))))))) -2)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 a (*.f64 a (*.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64))))))) -2)): 1 points increase in error, 1 points decrease in error
      (*.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 a a) (*.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64))))))) -2): 44 points increase in error, 17 points decrease in error
      (*.f64 (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 a 2)) (*.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))))) -2): 0 points increase in error, 0 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 -2 (*.f64 (pow.f64 a 2) (*.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))))))): 0 points increase in error, 0 points decrease in error

    if 4.99999999999999998e-306 < (-.f64 (pow.f64 b 2) (pow.f64 a 2))

    1. Initial program 34.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. Simplified34.6

      \[\leadsto \color{blue}{\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(-2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
      Proof
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 -2 (fma.f64 a a (*.f64 b (neg.f64 b)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 (Rewrite<= metadata-eval (neg.f64 2)) (fma.f64 a a (*.f64 b (neg.f64 b)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 (neg.f64 2) (fma.f64 a a (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 b b))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 (neg.f64 2) (fma.f64 a a (neg.f64 (Rewrite<= unpow2_binary64 (pow.f64 b 2))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 (neg.f64 2) (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 a a) (pow.f64 b 2)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 (neg.f64 2) (-.f64 (Rewrite<= unpow2_binary64 (pow.f64 a 2)) (pow.f64 b 2))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (Rewrite<= distribute-lft-neg-in_binary64 (neg.f64 (*.f64 2 (-.f64 (pow.f64 a 2) (pow.f64 b 2))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (Rewrite<= distribute-rgt-neg-out_binary64 (*.f64 2 (neg.f64 (-.f64 (pow.f64 a 2) (pow.f64 b 2))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 2 (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 (pow.f64 a 2) (pow.f64 b 2))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 2 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 (pow.f64 a 2)) (pow.f64 b 2)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 2 (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 (pow.f64 a 2))) (pow.f64 b 2))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 2 (Rewrite<= +-commutative_binary64 (+.f64 (pow.f64 b 2) (neg.f64 (pow.f64 a 2))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 (*.f64 2 (Rewrite<= sub-neg_binary64 (-.f64 (pow.f64 b 2) (pow.f64 a 2)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))) (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180))))): 19 points increase in error, 16 points decrease in error
      (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in b around inf 34.8

      \[\leadsto \color{blue}{2 \cdot \left({b}^{2} \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \]
    4. Taylor expanded in b around 0 34.8

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

      \[\leadsto 2 \cdot \color{blue}{\left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b \cdot \left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)} \]
      Proof
      (*.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) (*.f64 b (*.f64 b (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64))))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 b b) (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64))))))): 44 points increase in error, 24 points decrease in error
      (*.f64 (cos.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 b 2)) (sin.f64 (*.f64 1/180 (*.f64 angle (PI.f64)))))): 0 points increase in error, 0 points decrease in error
  3. Recombined 2 regimes into one program.
  4. Final simplification22.0

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

Alternatives

Alternative 1
Error27.1
Cost26824
\[\begin{array}{l} t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\ t_1 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\ \mathbf{if}\;b \leq -6.721319745083332 \cdot 10^{+42}:\\ \;\;\;\;2 \cdot \left(b \cdot \left(b \cdot \left(\cos t_1 \cdot \sin t_1\right)\right)\right)\\ \mathbf{elif}\;b \leq 2.3529063810130428 \cdot 10^{-66}:\\ \;\;\;\;a \cdot \left(\left(\cos t_0 \cdot \left(a \cdot \sin t_0\right)\right) \cdot -2\right)\\ \mathbf{elif}\;b \leq 10^{+155}:\\ \;\;\;\;\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(-2 \cdot \mathsf{fma}\left(a, a, -b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\\ \end{array} \]
Alternative 2
Error27.2
Cost26692
\[\begin{array}{l} t_0 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\ \mathbf{if}\;b \leq -1.2976891086010757 \cdot 10^{+118}:\\ \;\;\;\;2 \cdot \left(b \cdot \left(b \cdot \left(\cos t_0 \cdot \sin t_0\right)\right)\right)\\ \mathbf{elif}\;b \leq 10^{+155}:\\ \;\;\;\;\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(-2 \cdot \mathsf{fma}\left(a, a, -b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\\ \end{array} \]
Alternative 3
Error27.2
Cost20296
\[\begin{array}{l} \mathbf{if}\;b \leq -4.4366599829239334 \cdot 10^{+153}:\\ \;\;\;\;b \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;b \leq 10^{+155}:\\ \;\;\;\;\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(-2 \cdot \mathsf{fma}\left(a, a, -b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\\ \end{array} \]
Alternative 4
Error29.1
Cost7432
\[\begin{array}{l} \mathbf{if}\;b \leq -1.2976891086010757 \cdot 10^{+118}:\\ \;\;\;\;b \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;b \leq 3.753679536394362 \cdot 10^{+135}:\\ \;\;\;\;angle \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot a - b \cdot b\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(b \cdot \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\ \end{array} \]
Alternative 5
Error38.5
Cost7176
\[\begin{array}{l} t_0 := b \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{if}\;b \leq -1.7575400961096486 \cdot 10^{+140}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 2.26 \cdot 10^{+20}:\\ \;\;\;\;angle \cdot \left(\left(b \cdot \pi\right) \cdot \left(b \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error33.3
Cost7176
\[\begin{array}{l} \mathbf{if}\;b \leq -6.721319745083332 \cdot 10^{+42}:\\ \;\;\;\;b \cdot \left(angle \cdot \left(b \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{elif}\;b \leq 3.9724331814730144 \cdot 10^{-60}:\\ \;\;\;\;angle \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 7
Error33.3
Cost7176
\[\begin{array}{l} \mathbf{if}\;b \leq -6.721319745083332 \cdot 10^{+42}:\\ \;\;\;\;b \cdot \left(angle \cdot \left(b \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{elif}\;b \leq 3.9724331814730144 \cdot 10^{-60}:\\ \;\;\;\;angle \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(a \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 8
Error33.3
Cost7176
\[\begin{array}{l} \mathbf{if}\;b \leq -6.721319745083332 \cdot 10^{+42}:\\ \;\;\;\;b \cdot \left(b \cdot \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{elif}\;b \leq 3.9724331814730144 \cdot 10^{-60}:\\ \;\;\;\;angle \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(a \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 9
Error40.0
Cost6912
\[b \cdot \left(angle \cdot \left(b \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right) \]
Alternative 10
Error40.0
Cost6912
\[b \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right) \]

Error

Reproduce

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