Results 1 to 4 of 4
  1. #1
    ajay.eeralla is offline Member
    Join Date
    Mar 2011
    Posts
    7
    Rep Power
    0

    Default Does 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

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,778
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by ajay.eeralla View Post
    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
    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
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    ajay.eeralla is offline Member
    Join Date
    Mar 2011
    Posts
    7
    Rep Power
    0

    Default

    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..

  4. #4
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    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.

Similar Threads

  1. BigInteger value of
    By ccie007 in forum New To Java
    Replies: 2
    Last Post: 09-26-2010, 04:46 PM
  2. convert BigInteger
    By bobo67 in forum New To Java
    Replies: 1
    Last Post: 09-01-2010, 03:00 PM
  3. BigInteger
    By windows.login in forum New To Java
    Replies: 8
    Last Post: 07-13-2010, 02:10 PM
  4. My own BigInteger class. Need help.
    By Dinde in forum New To Java
    Replies: 2
    Last Post: 01-27-2010, 09:49 PM
  5. how to convert from BigInteger to Hex
    By nanaji in forum Advanced Java
    Replies: 10
    Last Post: 05-22-2008, 01:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •