how to write e^sqrt(lognloglog(n)) ,where n is biginteger

i wrote Double a;

a=Math.pow(e,Math.sqrt(Math.log(num.longValue())*M ath.log(Math.log(num.longValue())))));

but iam getting error

- 03-07-2011, 09:05 AMajay.eerallaDoes any one know how to write this e^sqrt(lognloglog(n)) ,where n is biginteger
how to write e^sqrt(lognloglog(n)) ,where n is biginteger

i wrote Double a;

a=Math.pow(e,Math.sqrt(Math.log(num.longValue())*M ath.log(Math.log(num.longValue())))));

but iam getting error - 03-07-2011, 12:37 PMJosAH
Is n very big? i.e. n > Double.MAX_VALUE. If so you have to approximate those logs. The disadvantage with approximating a log with, say, a Taylor or McLaurin series is that they become quite inaccurate for large values. A way to reduce the inaccuracy is:

log(x+y) == log(y)+log(1+y/x))

for suitable values of x and y when x+y == n. If you can elaborate on this, feel free to reply here.

kind regards,

Jos - 03-08-2011, 04:56 AMajay.eeralla
Thank you josAH for quick reply...

n is very big,i.e n>>Double.maxvalue,

actually iam implementing quadratic sieve algorithm for integer factorization problem..

in that i have to find lognloglogn value.. - 03-08-2011, 06:15 AMtoadaly
If numerical accuracy is desired (I'm assuming it is), I'd write a log function using the BigInteger and BigDecimal classes directly.

You might consider talking to a mathematician. This function appears to me to be monotonic, and so a gradient descent (Newton-Raphson) approach may work and provide a solution much faster than direct computation.