fastCos function

dynamic fastCos(
  1. double x
)

Implementation

fastCos(double x) {
  x += halfPi;
  if (x > pi) {
    x -= twoPi;
  }
  if (x < 0) {
    return 1.27323954 * x + 0.405284735 * x * x;
  } else {
    return 1.27323954 * x - 0.405284735 * x * x;
  }
}