Average Error: 31.3 → 22.1
Time: 24.6s
Precision: binary64
Cost: 33672
\[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
\[\begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{-19}:\\ \;\;\;\;\left|\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right|\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{-42}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(\left(b + a\right) \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\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)\\ \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (*
  (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0))))
  (cos (* PI (/ angle 180.0)))))
(FPCore (a b angle)
 :precision binary64
 (if (<= (/ angle 180.0) -1e-19)
   (fabs (* (* (+ b a) (- b a)) (sin (* 0.011111111111111112 (* PI angle)))))
   (if (<= (/ angle 180.0) 5e-42)
     (* -0.011111111111111112 (* (- a b) (* angle (* (+ b a) PI))))
     (*
      (sin (* 0.005555555555555556 (* PI angle)))
      (* (* -2.0 (fma a a (* b (- b)))) (cos (* PI (/ angle 180.0))))))))
double code(double a, double b, double angle) {
	return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin((((double) M_PI) * (angle / 180.0)))) * cos((((double) M_PI) * (angle / 180.0)));
}
double code(double a, double b, double angle) {
	double tmp;
	if ((angle / 180.0) <= -1e-19) {
		tmp = fabs((((b + a) * (b - a)) * sin((0.011111111111111112 * (((double) M_PI) * angle)))));
	} else if ((angle / 180.0) <= 5e-42) {
		tmp = -0.011111111111111112 * ((a - b) * (angle * ((b + a) * ((double) M_PI))));
	} else {
		tmp = sin((0.005555555555555556 * (((double) M_PI) * angle))) * ((-2.0 * fma(a, a, (b * -b))) * cos((((double) M_PI) * (angle / 180.0))));
	}
	return tmp;
}
function code(a, b, angle)
	return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(Float64(pi * Float64(angle / 180.0)))) * cos(Float64(pi * Float64(angle / 180.0))))
end
function code(a, b, angle)
	tmp = 0.0
	if (Float64(angle / 180.0) <= -1e-19)
		tmp = abs(Float64(Float64(Float64(b + a) * Float64(b - a)) * sin(Float64(0.011111111111111112 * Float64(pi * angle)))));
	elseif (Float64(angle / 180.0) <= 5e-42)
		tmp = Float64(-0.011111111111111112 * Float64(Float64(a - b) * Float64(angle * Float64(Float64(b + a) * pi))));
	else
		tmp = Float64(sin(Float64(0.005555555555555556 * Float64(pi * angle))) * Float64(Float64(-2.0 * fma(a, a, Float64(b * Float64(-b)))) * cos(Float64(pi * Float64(angle / 180.0)))));
	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_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -1e-19], N[Abs[N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e-42], N[(-0.011111111111111112 * N[(N[(a - b), $MachinePrecision] * N[(angle * N[(N[(b + a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(-2.0 * N[(a * a + N[(b * (-b)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $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}
\mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{-19}:\\
\;\;\;\;\left|\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right|\\

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

\mathbf{else}:\\
\;\;\;\;\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\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)\\


\end{array}

Error

Derivation

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

    1. Initial program 47.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. Simplified47.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
      (*.f64 (*.f64 2 (-.f64 (*.f64 b b) (*.f64 a a))) (*.f64 (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
      (*.f64 (*.f64 2 (-.f64 (Rewrite<= unpow2_binary64 (pow.f64 b 2)) (*.f64 a a))) (*.f64 (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
      (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (Rewrite<= unpow2_binary64 (pow.f64 a 2)))) (*.f64 (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
      (Rewrite<= associate-*l*_binary64 (*.f64 (*.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))))): 18 points increase in error, 14 points decrease in error
    3. Applied egg-rr52.7

      \[\leadsto \color{blue}{\sqrt{{\left(\left(b \cdot b - a \cdot a\right) \cdot \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}^{2}}} \]
    4. Applied egg-rr49.7

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

    if -9.9999999999999998e-20 < (/.f64 angle 180) < 5.00000000000000003e-42

    1. Initial program 18.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. Simplified18.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))))): 1 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))))): 17 points increase in error, 18 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 18.6

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

      \[\leadsto \color{blue}{angle \cdot \left(\left(\left(b + a\right) \cdot \left(\left(a - b\right) \cdot \pi\right)\right) \cdot -0.011111111111111112\right)} \]
      Proof
      (*.f64 angle (*.f64 (*.f64 (+.f64 b a) (*.f64 (-.f64 a b) (PI.f64))) -1/90)): 0 points increase in error, 0 points decrease in error
      (*.f64 angle (*.f64 (*.f64 (Rewrite<= +-commutative_binary64 (+.f64 a b)) (*.f64 (-.f64 a b) (PI.f64))) -1/90)): 0 points increase in error, 0 points decrease in error
      (*.f64 angle (*.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (+.f64 a b) (-.f64 a b)) (PI.f64))) -1/90)): 15 points increase in error, 21 points decrease in error
      (*.f64 angle (*.f64 (*.f64 (Rewrite<= difference-of-squares_binary64 (-.f64 (*.f64 a a) (*.f64 b b))) (PI.f64)) -1/90)): 0 points increase in error, 0 points decrease in error
      (*.f64 angle (*.f64 (*.f64 (Rewrite=> sub-neg_binary64 (+.f64 (*.f64 a a) (neg.f64 (*.f64 b b)))) (PI.f64)) -1/90)): 0 points increase in error, 0 points decrease in error
      (*.f64 angle (*.f64 (*.f64 (+.f64 (*.f64 a a) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (*.f64 b b)))) (PI.f64)) -1/90)): 0 points increase in error, 0 points decrease in error
      (*.f64 angle (*.f64 (*.f64 (+.f64 (*.f64 a a) (*.f64 -1 (Rewrite<= unpow2_binary64 (pow.f64 b 2)))) (PI.f64)) -1/90)): 0 points increase in error, 0 points decrease in error
      (*.f64 angle (*.f64 (*.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (pow.f64 b 2)) (*.f64 a a))) (PI.f64)) -1/90)): 0 points increase in error, 0 points decrease in error
      (*.f64 angle (*.f64 (*.f64 (+.f64 (*.f64 -1 (pow.f64 b 2)) (Rewrite<= unpow2_binary64 (pow.f64 a 2))) (PI.f64)) -1/90)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 angle (*.f64 (+.f64 (*.f64 -1 (pow.f64 b 2)) (pow.f64 a 2)) (PI.f64))) -1/90)): 31 points increase in error, 22 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 -1/90 (*.f64 angle (*.f64 (+.f64 (*.f64 -1 (pow.f64 b 2)) (pow.f64 a 2)) (PI.f64))))): 0 points increase in error, 0 points decrease in error
    5. Taylor expanded in angle around 0 18.6

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

      \[\leadsto \color{blue}{-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(\left(\pi \cdot \left(a + b\right)\right) \cdot angle\right)\right)} \]
      Proof
      (*.f64 -1/90 (*.f64 (-.f64 a b) (*.f64 (*.f64 (PI.f64) (+.f64 a b)) angle))): 0 points increase in error, 0 points decrease in error
      (*.f64 -1/90 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (-.f64 a b) (*.f64 (PI.f64) (+.f64 a b))) angle))): 59 points increase in error, 24 points decrease in error
      (*.f64 -1/90 (Rewrite<= *-commutative_binary64 (*.f64 angle (*.f64 (-.f64 a b) (*.f64 (PI.f64) (+.f64 a b)))))): 0 points increase in error, 0 points decrease in error

    if 5.00000000000000003e-42 < (/.f64 angle 180)

    1. Initial program 44.7

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

      \[\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))))): 1 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))))): 17 points increase in error, 18 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 inf 44.9

      \[\leadsto \color{blue}{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\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) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification22.1

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

Alternatives

Alternative 1
Error21.4
Cost33472
\[\begin{array}{l} t_0 := 0.5 \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\\ 2 \cdot \mathsf{fma}\left(b + a, \left(b - a\right) \cdot t_0, 0 \cdot t_0\right) \end{array} \]
Alternative 2
Error22.1
Cost27336
\[\begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{-19}:\\ \;\;\;\;\left|\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right|\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{-14}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(\left(b + a\right) \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot \left(\sin \left(\frac{\pi \cdot angle}{180}\right) \cdot \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\ \end{array} \]
Alternative 3
Error22.1
Cost20228
\[\begin{array}{l} t_0 := \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\\ \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{-19}:\\ \;\;\;\;\left|\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot t_0\right|\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{-42}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(\left(b + a\right) \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot b - a \cdot a\right) \cdot t_0\\ \end{array} \]
Alternative 4
Error21.6
Cost14088
\[\begin{array}{l} t_0 := \left(b \cdot b - a \cdot a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{-30}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{-42}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(\left(b + a\right) \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error21.6
Cost14088
\[\begin{array}{l} t_0 := b \cdot b - a \cdot a\\ \mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{-30}:\\ \;\;\;\;t_0 \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{-42}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(\left(b + a\right) \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\\ \end{array} \]
Alternative 6
Error22.9
Cost13640
\[\begin{array}{l} t_0 := \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(a \cdot \left(-a\right)\right)\\ \mathbf{if}\;angle \leq -1.8 \cdot 10^{-17}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;angle \leq 0.075:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(\left(b + a\right) \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 7
Error22.7
Cost13640
\[\begin{array}{l} t_0 := \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\\ \mathbf{if}\;angle \leq -0.0135:\\ \;\;\;\;a \cdot \left(\left(-a\right) \cdot t_0\right)\\ \mathbf{elif}\;angle \leq 0.00145:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(\left(b + a\right) \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(a \cdot \left(-a\right)\right)\\ \end{array} \]
Alternative 8
Error22.9
Cost13640
\[\begin{array}{l} \mathbf{if}\;angle \leq -1.8 \cdot 10^{-17}:\\ \;\;\;\;a \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot \left(-a\right)\right)\\ \mathbf{elif}\;angle \leq 0.3:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(\left(b + a\right) \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(a \cdot \left(-a\right)\right)\\ \end{array} \]
Alternative 9
Error23.0
Cost13576
\[\begin{array}{l} t_0 := b \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right)\\ \mathbf{if}\;angle \leq -1.08 \cdot 10^{+21}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;angle \leq 2.25 \cdot 10^{-7}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(\left(b + a\right) \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 10
Error23.0
Cost13576
\[\begin{array}{l} t_0 := \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\\ \mathbf{if}\;angle \leq -1.08 \cdot 10^{+21}:\\ \;\;\;\;b \cdot \left(b \cdot t_0\right)\\ \mathbf{elif}\;angle \leq 2.25 \cdot 10^{-7}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(\left(b + a\right) \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot b\right) \cdot t_0\\ \end{array} \]
Alternative 11
Error23.0
Cost13576
\[\begin{array}{l} \mathbf{if}\;angle \leq -1.08 \cdot 10^{+21}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \mathbf{elif}\;angle \leq 2.25 \cdot 10^{-7}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(\left(b + a\right) \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\\ \end{array} \]
Alternative 12
Error32.4
Cost7440
\[\begin{array}{l} t_0 := a \cdot \left(\pi \cdot \left(angle \cdot \left(a \cdot -0.011111111111111112\right)\right)\right)\\ t_1 := 0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \mathbf{if}\;b \leq -1.3 \cdot 10^{+123}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -2.75 \cdot 10^{+97}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -1.02 \cdot 10^{+48}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b\right)\right)\\ \mathbf{elif}\;b \leq 3.5 \cdot 10^{-81}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Error32.4
Cost7440
\[\begin{array}{l} t_0 := a \cdot \left(\pi \cdot \left(angle \cdot \left(a \cdot -0.011111111111111112\right)\right)\right)\\ t_1 := 0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \mathbf{if}\;b \leq -1.3 \cdot 10^{+123}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -5.2 \cdot 10^{+98}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -1.72 \cdot 10^{+47}:\\ \;\;\;\;angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{elif}\;b \leq 3.4 \cdot 10^{-81}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 14
Error32.4
Cost7440
\[\begin{array}{l} t_0 := a \cdot \left(\pi \cdot \left(angle \cdot \left(a \cdot -0.011111111111111112\right)\right)\right)\\ t_1 := 0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \mathbf{if}\;b \leq -1.3 \cdot 10^{+123}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -5.2 \cdot 10^{+98}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -3.1 \cdot 10^{+48}:\\ \;\;\;\;angle \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{elif}\;b \leq 2.52 \cdot 10^{-76}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 15
Error24.0
Cost7432
\[\begin{array}{l} \mathbf{if}\;angle \leq -9.3 \cdot 10^{+21}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(\left(1 + a \cdot \pi\right) + -1\right)\right)\right)\\ \mathbf{elif}\;angle \leq 10.5:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(\left(b + a\right) \cdot angle\right) \cdot \left(\pi \cdot \left(a - b\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(-0.011111111111111112 \cdot \left(\left(b + a\right) \cdot \left(a \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 16
Error24.0
Cost7432
\[\begin{array}{l} \mathbf{if}\;angle \leq -5.4 \cdot 10^{+21}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(\left(1 + a \cdot \pi\right) + -1\right)\right)\right)\\ \mathbf{elif}\;angle \leq 10.5:\\ \;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(\left(b + a\right) \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(-0.011111111111111112 \cdot \left(\left(b + a\right) \cdot \left(a \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 17
Error37.7
Cost7176
\[\begin{array}{l} t_0 := 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{if}\;b \leq -2.4 \cdot 10^{-20}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 9 \cdot 10^{-79}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(a \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 18
Error32.7
Cost7176
\[\begin{array}{l} t_0 := 0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot angle\right)\right)\right)\\ \mathbf{if}\;b \leq -1.8 \cdot 10^{-20}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 1.75 \cdot 10^{-76}:\\ \;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(a \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 19
Error43.4
Cost6912
\[-0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(a \cdot \pi\right)\right)\right) \]

Error

Reproduce

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