class Newton { static double f(double x) { return Math.sin(x); } static double df(double x) { return Math.cos(x); } public static void main(String argv[]) { double tolerance = .000000001; int max_count = 200; double x; if(argv.length==1) { x= Double.valueOf(argv[0]).doubleValue(); } else { x=0; } for ( int count=1; (Math.abs(f(x)) > tolerance) && ( count