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

\mathbf{elif}\;\frac{angle}{180} \leq 4 \cdot 10^{-78}:\\
\;\;\;\;\mathsf{fma}\left(a + b, \pi \cdot \left(\left(a - b\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right), 0\right)\\

\mathbf{else}:\\
\;\;\;\;\sqrt{{\sin t_0}^{2}} \cdot \left(t_1 \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\


\end{array}

Error

Derivation

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

    1. Initial program 48.3

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

      \[\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))))): 13 points increase in error, 22 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-rr48.5

      \[\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}{\left(0 + \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)}\right) \]

    if -1e-8 < (/.f64 angle 180) < 4e-78

    1. Initial program 19.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. Simplified19.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))))): 13 points increase in error, 22 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 19.1

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

      \[\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)))): 22 points increase in error, 28 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))))): 37 points increase in error, 24 points decrease in error
    5. Applied egg-rr0.4

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

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

    if 4e-78 < (/.f64 angle 180)

    1. Initial program 39.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. Simplified39.9

      \[\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))))): 13 points increase in error, 22 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-rr40.7

      \[\leadsto \color{blue}{\sqrt{{\sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}^{2}}} \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) \]
    4. Taylor expanded in angle around inf 40.7

      \[\leadsto \sqrt{{\sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}^{2}} \cdot \left(\left(-2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\right) \cdot \color{blue}{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification21.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{-8}:\\ \;\;\;\;\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(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 4 \cdot 10^{-78}:\\ \;\;\;\;\mathsf{fma}\left(a + b, \pi \cdot \left(\left(a - b\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right), 0\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{{\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{2}} \cdot \left(\left(-2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Error21.2
Cost112264
\[\begin{array}{l} t_0 := \frac{angle}{180} \cdot \pi\\ t_1 := \sin t_0\\ t_2 := \cos t_0 \cdot \left(t_1 \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;\pi \cdot \left(\left(a + b\right) \cdot \left(angle \cdot \left(\left(a - b\right) \cdot -0.011111111111111112\right)\right)\right)\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+297}:\\ \;\;\;\;t_1 \cdot \left(\left(-2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a + b, \pi \cdot \left(\left(a - b\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right), 0\right)\\ \end{array} \]
Alternative 2
Error21.7
Cost40200
\[\begin{array}{l} t_0 := \frac{angle}{180} \cdot \pi\\ \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{-8}:\\ \;\;\;\;\sin t_0 \cdot \left(\left(-2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-74}:\\ \;\;\;\;\mathsf{fma}\left(a + b, \pi \cdot \left(\left(a - b\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right), 0\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot \sqrt{{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}\right)\right) \cdot \cos t_0\\ \end{array} \]
Alternative 3
Error21.7
Cost40072
\[\begin{array}{l} t_0 := \frac{angle}{180} \cdot \pi\\ t_1 := -2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\\ \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{-8}:\\ \;\;\;\;\sin t_0 \cdot \left(t_1 \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{-77}:\\ \;\;\;\;\mathsf{fma}\left(a + b, \pi \cdot \left(\left(a - b\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right), 0\right)\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right| \cdot \left(t_1 \cdot \cos t_0\right)\\ \end{array} \]
Alternative 4
Error21.5
Cost27336
\[\begin{array}{l} t_0 := \cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot \left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right)\\ \mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-45}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\frac{angle}{180} \leq 4 \cdot 10^{-78}:\\ \;\;\;\;\mathsf{fma}\left(a + b, \pi \cdot \left(\left(a - b\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right), 0\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error22.1
Cost20552
\[\begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{-8}:\\ \;\;\;\;2 \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+19}:\\ \;\;\;\;\mathsf{fma}\left(a + b, \pi \cdot \left(\left(a - b\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right), 0\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(-2 \cdot \mathsf{fma}\left(a, a, b \cdot \left(-b\right)\right)\right)\\ \end{array} \]
Alternative 6
Error22.2
Cost13960
\[\begin{array}{l} t_0 := 2 \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\ \mathbf{if}\;angle \leq -1 \cdot 10^{-7}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;angle \leq 10^{+40}:\\ \;\;\;\;\mathsf{fma}\left(a + b, \pi \cdot \left(\left(a - b\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right), 0\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 7
Error23.5
Cost13832
\[\begin{array}{l} t_0 := angle \cdot \left(\left(1 + -0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot a\right)\right)\right) + -1\right)\\ \mathbf{if}\;angle \leq -1.82 \cdot 10^{+22}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;angle \leq 1.7 \cdot 10^{+48}:\\ \;\;\;\;\mathsf{fma}\left(a + b, \pi \cdot \left(\left(a - b\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right), 0\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Error23.8
Cost7432
\[\begin{array}{l} \mathbf{if}\;angle \leq -1.82 \cdot 10^{+22}:\\ \;\;\;\;\pi \cdot \left(\left(angle \cdot -0.011111111111111112\right) \cdot \left(a \cdot a\right)\right)\\ \mathbf{elif}\;angle \leq 3.4 \cdot 10^{+57}:\\ \;\;\;\;\left(a + b\right) \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(\pi \cdot -0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot 0.011111111111111112\right)\right)\right)\\ \end{array} \]
Alternative 9
Error23.9
Cost7432
\[\begin{array}{l} \mathbf{if}\;angle \leq -1.82 \cdot 10^{+22}:\\ \;\;\;\;\pi \cdot \left(\left(angle \cdot -0.011111111111111112\right) \cdot \left(a \cdot a\right)\right)\\ \mathbf{elif}\;angle \leq 3.4 \cdot 10^{+57}:\\ \;\;\;\;\pi \cdot \left(\left(a + b\right) \cdot \left(\left(a - b\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot 0.011111111111111112\right)\right)\right)\\ \end{array} \]
Alternative 10
Error23.5
Cost7432
\[\begin{array}{l} t_0 := angle \cdot \left(\left(1 + -0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot a\right)\right)\right) + -1\right)\\ \mathbf{if}\;angle \leq -1.82 \cdot 10^{+22}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;angle \leq 1.7 \cdot 10^{+48}:\\ \;\;\;\;\pi \cdot \left(\left(a + b\right) \cdot \left(\left(a - b\right) \cdot \left(angle \cdot -0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 11
Error23.5
Cost7432
\[\begin{array}{l} t_0 := angle \cdot \left(\left(1 + -0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot a\right)\right)\right) + -1\right)\\ \mathbf{if}\;angle \leq -1.82 \cdot 10^{+22}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;angle \leq 1.7 \cdot 10^{+48}:\\ \;\;\;\;\pi \cdot \left(\left(a + b\right) \cdot \left(angle \cdot \left(\left(a - b\right) \cdot -0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 12
Error32.8
Cost7176
\[\begin{array}{l} t_0 := -0.011111111111111112 \cdot \left(a \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)\\ \mathbf{if}\;a \leq -5.057685158200246 \cdot 10^{-113}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;a \leq 8.251828225926857 \cdot 10^{-92}:\\ \;\;\;\;angle \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 13
Error32.7
Cost7176
\[\begin{array}{l} t_0 := \pi \cdot \left(a \cdot \left(a \cdot \left(angle \cdot -0.011111111111111112\right)\right)\right)\\ \mathbf{if}\;a \leq -5.057685158200246 \cdot 10^{-113}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;a \leq 8.251828225926857 \cdot 10^{-92}:\\ \;\;\;\;angle \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 14
Error32.7
Cost7176
\[\begin{array}{l} \mathbf{if}\;a \leq -5.057685158200246 \cdot 10^{-113}:\\ \;\;\;\;\pi \cdot \left(a \cdot \left(a \cdot \left(angle \cdot -0.011111111111111112\right)\right)\right)\\ \mathbf{elif}\;a \leq 8.251828225926857 \cdot 10^{-92}:\\ \;\;\;\;angle \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot 0.011111111111111112\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot a\right)\right)\right)\\ \end{array} \]
Alternative 15
Error31.6
Cost7176
\[\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 -2.3789139562884364 \cdot 10^{-68}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 3.1668626249207726 \cdot 10^{+35}:\\ \;\;\;\;\pi \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 16
Error31.5
Cost7176
\[\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 -2.3789139562884364 \cdot 10^{-68}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 3.1668626249207726 \cdot 10^{+35}:\\ \;\;\;\;\pi \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 17
Error43.6
Cost6912
\[angle \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot 0.011111111111111112\right)\right)\right) \]

Error

Reproduce

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