U
UKP
Basically, the calculation without log is -
x / [ 1-1/(1+x)^n]
So, when you take log, you get logx - log(1-(1/(1+x)^n))
But, when I'm doing this same in Java, I'm getting this error
"Operator ^ cannot be applied to double.." How come o.0
public static double f(double x) {
return Math.log(x)-Math.log(1-(1/(1+x)^n));
}
x / [ 1-1/(1+x)^n]
So, when you take log, you get logx - log(1-(1/(1+x)^n))
But, when I'm doing this same in Java, I'm getting this error
"Operator ^ cannot be applied to double.." How come o.0
public static double f(double x) {
return Math.log(x)-Math.log(1-(1/(1+x)^n));
}