public static double cos(double a) {if (a < 0.0) {a = -a;}if (a > SIN_COS_MAX_VALUE_FOR_INT_MODULO) {return Math.cos(a);}int index = (int)(a * SIN_COS_INDEXER + 0.5);double delta = (a - index * SIN_COS_DELTA_HI) - index * SIN_COS_DELTA_LO;index &= (SIN_COS_TABS_SIZE-2); double indexCos = cosTab[index];double indexSin = sinTab[index];return indexCos + delta * (-indexSin + delta * (-indexCos * ONE_DIV_F2 + delta * (indexSin * ONE_DIV_F3 + delta * indexCos * ONE_DIV_F4)));}

public static double Cos(double a){if (a < 0.0){a = -a;}if (a > SIN_COS_MAX_VALUE_FOR_INT_MODULO){return Math.Cos(a);}int index = (int)(a * SIN_COS_INDEXER + 0.5);double delta = (a - index * SIN_COS_DELTA_HI) - index * SIN_COS_DELTA_LO;index &= (SIN_COS_TABS_SIZE - 2); double indexCos = cosTab[index];double indexSin = sinTab[index];return indexCos + delta * (-indexSin + delta * (-indexCos * ONE_DIV_F2 + delta * (indexSin * ONE_DIV_F3 + delta * indexCos * ONE_DIV_F4)));}
