Computing Andrew's slog solution
#9
Here's my SAGE code preparing the coefficients, for rational and for integer matrices:

For the rational solution, you'll need to divide each coefficient by k factorial (for the kth coefficient). I did that step elsewhere, which is why it isn't shown below. But for comparison purposes, it's probably best to put it in this function. I'd do it myself, but SAGE is still crunching numbers, so I can't test a code change right now.
Code:
# For optimal speed and accuracy, try to use a rational LogB
def Prepare_Slog_Q(LogB, size):
    print "Preparing slog for base e^(%s) with %s terms"%(LogB, size)
    m = matrix(QQ, size, size, [[[((c+1)^r)*factorial(c+1) -
        (c==(r-1))/(LogB^r)] for c in xrange(size)]
        for r in xrange(size)])
    v = vector(QQ, size, [(k==0) for k in xrange(size)])
    s = m.solve_right(v)
    ret = vector(QQ, len(s)+1, [-1] + list(s))
    return ret

Code:
# For optimal speed and accuracy, try to use a rational LogB
def Prepare_Slog(LogB, size):
    print "Preparing slog for base e^(%s) with %s terms"%(LogB, size)
    m = matrix(QQ, size, size, [[[((c+1)^r) -
        factorial(c+1)*(c==(r-1))/(LogB^r)]
        for c in xrange(size)] for r in xrange(size)])
    v = vector(QQ, size, [(k==0) for k in xrange(size)])
    s = m.solve_right(v)
    ret = vector(QQ, len(s)+1, [-1] + list(s))
    return ret
~ Jay Daniel Fox
Reply


Messages In This Thread
Computing Andrew's slog solution - by jaydfox - 08/21/2007, 04:27 PM
RE: Computing Andrew's slog solution - by jaydfox - 08/21/2007, 04:41 PM
RE: Computing Andrew's slog solution - by jaydfox - 08/22/2007, 04:27 AM
RE: Computing Andrew's slog solution - by jaydfox - 08/22/2007, 10:41 AM
RE: Computing Andrew's slog solution - by jaydfox - 08/22/2007, 04:00 PM
RE: Computing Andrew's slog solution - by jaydfox - 08/22/2007, 04:06 PM
RE: Computing Andrew's slog solution - by jaydfox - 08/23/2007, 07:27 AM
RE: Computing Andrew's slog solution - by jaydfox - 08/23/2007, 04:43 PM
RE: Computing Andrew's slog solution - by jaydfox - 08/23/2007, 04:47 PM
RE: Computing Andrew's slog solution - by jaydfox - 08/24/2007, 07:07 AM
RE: Computing Andrew's slog solution - by jaydfox - 08/24/2007, 07:48 AM
RE: Computing Andrew's slog solution - by jaydfox - 08/24/2007, 03:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Computing Kneser's Super Logarithm and its Analytic Continuation Catullus 2 8,131 07/10/2022, 04:04 AM
Last Post: Catullus
Question Computing Integer Tetrations Catullus 5 12,338 06/10/2022, 10:59 PM
Last Post: JmsNxn
  Revisting my accelerated slog solution using Abel matrix inversion jaydfox 22 80,277 05/16/2021, 11:51 AM
Last Post: Gottfried
  A note on computation of the slog Gottfried 6 29,925 07/12/2010, 10:24 AM
Last Post: Gottfried
  Improving convergence of Andrew's slog jaydfox 19 76,443 07/02/2010, 06:59 AM
Last Post: bo198214
  intuitive slog base sqrt(2) developed between 2 and 4 bo198214 1 11,303 09/10/2009, 06:47 PM
Last Post: bo198214
  SAGE code for computing flow matrix for exp(z)-1 jaydfox 4 24,967 08/21/2009, 05:32 PM
Last Post: jaydfox
  computing teh last digits without computing the number deepinlife 3 16,507 02/24/2009, 09:09 AM
Last Post: deepinlife
  sexp and slog at a microcalculator Kouznetsov 0 8,189 01/08/2009, 08:51 AM
Last Post: Kouznetsov
  Convergence of matrix solution for base e jaydfox 6 27,107 12/18/2007, 12:14 AM
Last Post: jaydfox



Users browsing this thread: 1 Guest(s)