Привет ,помогите решить уровнения Math.sqrt(x+1)?Math.sqrt(1-2*Math.sin(x)) в Java используя цикл for
double x, dx, xg;
Scanner sc = new Scanner(System.in);
System.out.println("from: ");
if (sc.hasNextDouble())
x = sc.nextDouble();
else {
System.out.println("input error");
sc.close();
return;
}
System.out.println("to: ");
if (sc.hasNextDouble())
xg = sc.nextDouble();
else {
System.out.println("input error");
sc.close();
return;
}
System.out.println("step: ");
if (sc.hasNextDouble())
dx = sc.nextDouble();
else {
System.out.println("input error");
sc.close();
return;
}
sc.close();
System.out.println("x-------F");
for (;x<=xg;) {
if (x<-1 || 2*Math.sin(x)>0 ||
Math.abs(1-2*Math.sin(x))<0.0001)
System.out.println(x + " not defined");
else
System.out.println(x + " " +
Math.sqrt(1+x)/Math.sqrt(1-2*Math.sin(x)));
x=x+dx;
}