Average Error: 30.7 → 21.6
Time: 51.7s
Precision: binary64
Cost: 65476
\[\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 := angle \cdot \left(0.005555555555555556 \cdot \pi\right)\\ t_1 := \frac{angle}{180} \cdot \pi\\ \mathbf{if}\;\frac{angle}{180} \leq -20:\\ \;\;\;\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sqrt{{\sin t_0}^{2}}\right) \cdot \sqrt{{\cos t_0}^{2}}\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-44}:\\ \;\;\;\;\left(angle \cdot \left(a - b\right)\right) \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin t_1 \cdot \left(\left(-2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\right) \cdot \cos t_1\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 (* angle (* 0.005555555555555556 PI)))
        (t_1 (* (/ angle 180.0) PI)))
   (if (<= (/ angle 180.0) -20.0)
     (*
      (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sqrt (pow (sin t_0) 2.0)))
      (sqrt (pow (cos t_0) 2.0)))
     (if (<= (/ angle 180.0) 2e-44)
       (* (* angle (- a b)) (* -0.011111111111111112 (* PI (+ b a))))
       (* (sin t_1) (* (* -2.0 (fma a a (* b (- b)))) (cos 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 = angle * (0.005555555555555556 * ((double) M_PI));
	double t_1 = (angle / 180.0) * ((double) M_PI);
	double tmp;
	if ((angle / 180.0) <= -20.0) {
		tmp = ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sqrt(pow(sin(t_0), 2.0))) * sqrt(pow(cos(t_0), 2.0));
	} else if ((angle / 180.0) <= 2e-44) {
		tmp = (angle * (a - b)) * (-0.011111111111111112 * (((double) M_PI) * (b + a)));
	} else {
		tmp = sin(t_1) * ((-2.0 * fma(a, a, (b * -b))) * cos(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(angle * Float64(0.005555555555555556 * pi))
	t_1 = Float64(Float64(angle / 180.0) * pi)
	tmp = 0.0
	if (Float64(angle / 180.0) <= -20.0)
		tmp = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sqrt((sin(t_0) ^ 2.0))) * sqrt((cos(t_0) ^ 2.0)));
	elseif (Float64(angle / 180.0) <= 2e-44)
		tmp = Float64(Float64(angle * Float64(a - b)) * Float64(-0.011111111111111112 * Float64(pi * Float64(b + a))));
	else
		tmp = Float64(sin(t_1) * Float64(Float64(-2.0 * fma(a, a, Float64(b * Float64(-b)))) * cos(t_1)));
	end
	return tmp
end
code[a_, b_, angle_] := N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -20.0], N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[Power[N[Sin[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[Power[N[Cos[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-44], N[(N[(angle * N[(a - b), $MachinePrecision]), $MachinePrecision] * N[(-0.011111111111111112 * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[t$95$1], $MachinePrecision] * N[(N[(-2.0 * N[(a * a + N[(b * (-b)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $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 := angle \cdot \left(0.005555555555555556 \cdot \pi\right)\\
t_1 := \frac{angle}{180} \cdot \pi\\
\mathbf{if}\;\frac{angle}{180} \leq -20:\\
\;\;\;\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sqrt{{\sin t_0}^{2}}\right) \cdot \sqrt{{\cos t_0}^{2}}\\

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

\mathbf{else}:\\
\;\;\;\;\sin t_1 \cdot \left(\left(-2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\right) \cdot \cos t_1\right)\\


\end{array}

Error

Derivation

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

    1. Initial program 50.1

      \[\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. Applied egg-rr51.2

      \[\leadsto \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \color{blue}{\sqrt{{\sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}^{2}}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
    3. Applied egg-rr51.0

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

    if -20 < (/.f64 angle 180) < 1.99999999999999991e-44

    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}{\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 angle around 0 17.8

      \[\leadsto \color{blue}{-0.011111111111111112 \cdot \left(angle \cdot \left(\left(-1 \cdot {b}^{2} + {a}^{2}\right) \cdot \pi\right)\right)} \]
    4. Simplified17.8

      \[\leadsto \color{blue}{\pi \cdot \left(\left(a \cdot a - b \cdot b\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right)} \]
      Proof
      (*.f64 (PI.f64) (*.f64 (-.f64 (*.f64 a a) (*.f64 b b)) (*.f64 angle -1/90))): 0 points increase in error, 0 points decrease in error
      (*.f64 (PI.f64) (*.f64 (-.f64 (Rewrite<= unpow2_binary64 (pow.f64 a 2)) (*.f64 b b)) (*.f64 angle -1/90))): 0 points increase in error, 0 points decrease in error
      (*.f64 (PI.f64) (*.f64 (-.f64 (pow.f64 a 2) (Rewrite<= unpow2_binary64 (pow.f64 b 2))) (*.f64 angle -1/90))): 0 points increase in error, 0 points decrease in error
      (*.f64 (PI.f64) (*.f64 (Rewrite<= unsub-neg_binary64 (+.f64 (pow.f64 a 2) (neg.f64 (pow.f64 b 2)))) (*.f64 angle -1/90))): 0 points increase in error, 0 points decrease in error
      (*.f64 (PI.f64) (*.f64 (+.f64 (pow.f64 a 2) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (pow.f64 b 2)))) (*.f64 angle -1/90))): 0 points increase in error, 0 points decrease in error
      (*.f64 (PI.f64) (*.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (pow.f64 b 2)) (pow.f64 a 2))) (*.f64 angle -1/90))): 0 points increase in error, 0 points decrease in error
      (*.f64 (PI.f64) (*.f64 (+.f64 (*.f64 -1 (pow.f64 b 2)) (pow.f64 a 2)) (Rewrite<= *-commutative_binary64 (*.f64 -1/90 angle)))): 0 points increase in error, 0 points decrease in error
      (*.f64 (PI.f64) (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 -1/90 angle) (+.f64 (*.f64 -1 (pow.f64 b 2)) (pow.f64 a 2))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 (*.f64 -1/90 angle) (+.f64 (*.f64 -1 (pow.f64 b 2)) (pow.f64 a 2))) (PI.f64))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*r*_binary64 (*.f64 (*.f64 -1/90 angle) (*.f64 (+.f64 (*.f64 -1 (pow.f64 b 2)) (pow.f64 a 2)) (PI.f64)))): 19 points increase in error, 30 points decrease in error
      (Rewrite<= associate-*r*_binary64 (*.f64 -1/90 (*.f64 angle (*.f64 (+.f64 (*.f64 -1 (pow.f64 b 2)) (pow.f64 a 2)) (PI.f64))))): 22 points increase in error, 25 points decrease in error
    5. Applied egg-rr0.7

      \[\leadsto \pi \cdot \color{blue}{\left(0 + \left(a + b\right) \cdot \left(\left(a - b\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right)\right)} \]
    6. Applied egg-rr0.7

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(a - b\right) \cdot \left(angle \cdot -0.011111111111111112\right), \left(a + b\right) \cdot \pi, 0\right)} \]
    7. Applied egg-rr0.6

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

    if 1.99999999999999991e-44 < (/.f64 angle 180)

    1. Initial program 44.1

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

      \[\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. Recombined 3 regimes into one program.
  4. Final simplification21.6

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

Alternatives

Alternative 1
Error21.4
Cost33672
\[\begin{array}{l} t_0 := -2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\\ t_1 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ \mathbf{if}\;\frac{angle}{180} \leq -20:\\ \;\;\;\;\sin t_1 \cdot \left(t_0 \cdot \cos t_1\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-44}:\\ \;\;\;\;\left(angle \cdot \left(a - b\right)\right) \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(t_0 \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\ \end{array} \]
Alternative 2
Error21.4
Cost33672
\[\begin{array}{l} t_0 := -2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\\ t_1 := \frac{angle}{180} \cdot \pi\\ t_2 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ \mathbf{if}\;\frac{angle}{180} \leq -20:\\ \;\;\;\;\sin t_2 \cdot \left(t_0 \cdot \cos t_2\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-44}:\\ \;\;\;\;\left(angle \cdot \left(a - b\right)\right) \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin t_1 \cdot \left(t_0 \cdot \cos t_1\right)\\ \end{array} \]
Alternative 3
Error21.4
Cost33412
\[\begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ t_1 := \sin t_0\\ \mathbf{if}\;\frac{angle}{180} \leq -20:\\ \;\;\;\;t_1 \cdot \left(\left(-2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\right) \cdot \cos t_0\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-44}:\\ \;\;\;\;\left(angle \cdot \left(a - b\right)\right) \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(t_1 \cdot \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)\right)\\ \end{array} \]
Alternative 4
Error21.3
Cost27336
\[\begin{array}{l} t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\ t_1 := \left(\left(a \cdot a - b \cdot b\right) \cdot \cos t_0\right) \cdot \left(-2 \cdot \sin t_0\right)\\ \mathbf{if}\;\frac{angle}{180} \leq -20:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-18}:\\ \;\;\;\;\left(angle \cdot \left(a - b\right)\right) \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error21.3
Cost27336
\[\begin{array}{l} t_0 := angle \cdot \left(0.005555555555555556 \cdot \pi\right)\\ t_1 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\ t_2 := a \cdot a - b \cdot b\\ \mathbf{if}\;\frac{angle}{180} \leq -20:\\ \;\;\;\;t_2 \cdot \left(-2 \cdot \left(\sin t_0 \cdot \cos t_0\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-18}:\\ \;\;\;\;\left(angle \cdot \left(a - b\right)\right) \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t_2 \cdot \cos t_1\right) \cdot \left(-2 \cdot \sin t_1\right)\\ \end{array} \]
Alternative 6
Error21.4
Cost27336
\[\begin{array}{l} t_0 := angle \cdot \left(0.005555555555555556 \cdot \pi\right)\\ \mathbf{if}\;\frac{angle}{180} \leq -20:\\ \;\;\;\;\left(a \cdot a - b \cdot b\right) \cdot \left(-2 \cdot \left(\sin t_0 \cdot \cos t_0\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-44}:\\ \;\;\;\;\left(angle \cdot \left(a - b\right)\right) \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)\right)\\ \end{array} \]
Alternative 7
Error22.2
Cost27080
\[\begin{array}{l} t_0 := \frac{angle}{180} \cdot \pi\\ \mathbf{if}\;\frac{angle}{180} \leq -20:\\ \;\;\;\;\sin t_0 \cdot \left(-2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5:\\ \;\;\;\;\left(angle \cdot \left(a - b\right)\right) \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos t_0 \cdot \left(\left(b \cdot b\right) \cdot \left(2 \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\\ \end{array} \]
Alternative 8
Error22.2
Cost27080
\[\begin{array}{l} t_0 := \frac{angle}{180} \cdot \pi\\ t_1 := \sin t_0\\ \mathbf{if}\;\frac{angle}{180} \leq -20:\\ \;\;\;\;t_1 \cdot \left(-2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5:\\ \;\;\;\;\left(angle \cdot \left(a - b\right)\right) \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos t_0 \cdot \left(t_1 \cdot \left(2 \cdot \left(b \cdot b\right)\right)\right)\\ \end{array} \]
Alternative 9
Error22.1
Cost20552
\[\begin{array}{l} t_0 := \sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(-2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\right)\\ \mathbf{if}\;\frac{angle}{180} \leq -20:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\frac{angle}{180} \leq 5:\\ \;\;\;\;\left(angle \cdot \left(a - b\right)\right) \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 10
Error22.9
Cost13704
\[\begin{array}{l} t_0 := \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(-2 \cdot \left(a \cdot a\right)\right)\\ \mathbf{if}\;angle \leq -3.55 \cdot 10^{-12}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;angle \leq 3600000000000:\\ \;\;\;\;\left(angle \cdot \left(a - b\right)\right) \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 11
Error31.9
Cost7440
\[\begin{array}{l} t_0 := 0.011111111111111112 \cdot \left(b \cdot \left(\pi \cdot \left(angle \cdot b\right)\right)\right)\\ \mathbf{if}\;b \leq -6.721319745083332 \cdot 10^{+42}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -4.933978243410387 \cdot 10^{-141}:\\ \;\;\;\;a \cdot \left(a \cdot \left(-0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;b \leq 9.714708825665121 \cdot 10^{-253}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\\ \mathbf{elif}\;b \leq 3.9724331814730144 \cdot 10^{-60}:\\ \;\;\;\;\pi \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 12
Error31.9
Cost7440
\[\begin{array}{l} t_0 := 0.011111111111111112 \cdot \left(b \cdot \left(\pi \cdot \left(angle \cdot b\right)\right)\right)\\ \mathbf{if}\;b \leq -6.721319745083332 \cdot 10^{+42}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -4.933978243410387 \cdot 10^{-141}:\\ \;\;\;\;\pi \cdot \left(a \cdot \left(angle \cdot \left(a \cdot -0.011111111111111112\right)\right)\right)\\ \mathbf{elif}\;b \leq 9.714708825665121 \cdot 10^{-253}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\\ \mathbf{elif}\;b \leq 3.9724331814730144 \cdot 10^{-60}:\\ \;\;\;\;\pi \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 13
Error31.9
Cost7440
\[\begin{array}{l} t_0 := b \cdot \left(b \cdot \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\\ \mathbf{if}\;b \leq -6.721319745083332 \cdot 10^{+42}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -4.933978243410387 \cdot 10^{-141}:\\ \;\;\;\;\pi \cdot \left(a \cdot \left(angle \cdot \left(a \cdot -0.011111111111111112\right)\right)\right)\\ \mathbf{elif}\;b \leq 9.714708825665121 \cdot 10^{-253}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\\ \mathbf{elif}\;b \leq 3.9724331814730144 \cdot 10^{-60}:\\ \;\;\;\;\pi \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 14
Error25.6
Cost7300
\[\begin{array}{l} \mathbf{if}\;angle \leq -7 \cdot 10^{-36}:\\ \;\;\;\;angle \cdot \left(0.011111111111111112 \cdot \left(b \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\pi \cdot \left(b + a\right)\right) \cdot \left(\left(a - b\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right)\\ \end{array} \]
Alternative 15
Error25.0
Cost7300
\[\begin{array}{l} \mathbf{if}\;angle \leq -3.55 \cdot 10^{-12}:\\ \;\;\;\;angle \cdot \left(0.011111111111111112 \cdot \left(b \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle \cdot \left(a - b\right)\right) \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\ \end{array} \]
Alternative 16
Error32.4
Cost7176
\[\begin{array}{l} t_0 := a \cdot \left(a \cdot \left(-0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)\\ \mathbf{if}\;a \leq -122919547337051.47:\\ \;\;\;\;t_0\\ \mathbf{elif}\;a \leq 6625230513137.851:\\ \;\;\;\;angle \cdot \left(0.011111111111111112 \cdot \left(b \cdot \left(b \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 17
Error43.1
Cost6912
\[angle \cdot \left(0.011111111111111112 \cdot \left(b \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)))))