Here you can find the source of cos(double d)
public static double cos(double d)
//package com.java2s; //License from project: Open Source License public class Main { public static double[] SIN_TABLE = new double[65536]; public static double cos(double d) { return SIN_TABLE[(int) ((float) d * 10430.378F + 16384.0F) & 65535]; }//from w w w . j a v a 2s .c om }