// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class CosTest {
    public static void main(String[] args) {
        for(int i = 0; i < 25; i++) {
            double x = 2*Math.PI*Math.pow(10,i);
            double y = 0;
            long t1 = System.currentTimeMillis();
            for(int j = 0; j < 1000000; j++) {
                y = Math.cos(x);
            }
            long t2 = System.currentTimeMillis();
            System.out.println(i + " " + y + " " + (t2 - t1)/1000.0);
        }
    }
}
