[sage-support] Re: Li(x) in the complex domain

2008-06-11 Thread M. Yurko
I forgot the code in the last post: def li(z): #def log integral for real and complex variables if z in RR and z >= 2: #check if real number greater than 2 return Li(z) + 1.04516378011749278484459194613136522615578151 #adjust for offset in SAGE def elif z == 0: return 0

[sage-support] Re: Li(x) in the complex domain

2008-06-11 Thread M. Yurko
I made a few modifications so it now works everywhere but (0,1) On Jun 11, 1:45 pm, "William Stein" <[EMAIL PROTECTED]> wrote: > On Wed, Jun 11, 2008 at 8:07 AM, M. Yurko <[EMAIL PROTECTED]> wrote: > > > O.K. I defined li(x) as follows: > > > def li(z): #def log integral for real and complex vari

[sage-support] Re: Li(x) in the complex domain

2008-06-11 Thread William Stein
On Wed, Jun 11, 2008 at 8:07 AM, M. Yurko <[EMAIL PROTECTED]> wrote: > > O.K. I defined li(x) as follows: > > def li(z): #def log integral for real and complex variables >if z in RR and z >= 2: #check if real number greater than 2 >return Li(z) + > 1.0451637801174927848445919461313

[sage-support] Re: Li(x) in the complex domain

2008-06-11 Thread M. Yurko
O.K. I defined li(x) as follows: def li(z): #def log integral for real and complex variables if z in RR and z >= 2: #check if real number greater than 2 return Li(z) + 1.04516378011749278484459194613136522615578151 #adjust for offset in SAGE def elif z == 1: return -in

[sage-support] Re: Li(x) in the complex domain

2008-06-11 Thread M. Yurko
O.K. I defined li(x) as follows: def li(z): #def log integral for real and complex variables if z in RR and z >= 2: #check if real number greater than 2 return Li(z) + 1.04516378011749278484459194613136522615578151 #adjust for offset in SAGE def elif z == 1: return -in

[sage-support] Re: Li(x) in the complex domain

2008-06-11 Thread M. Yurko
Sure. My current code is a bit messy, so I'll clean it up and make an example. However, one thing to note is that I defined my Li(x) starting from 0 ("American" convention), while the current Li(x) in SAGE (for positive reals) is defined starting at 2 ("offset"). On Jun 10, 11:02 pm, "William Ste

[sage-support] Re: Li(x) in the complex domain

2008-06-10 Thread William Stein
On Tue, Jun 10, 2008 at 7:50 PM, M. Yurko <[EMAIL PROTECTED]> wrote: > > Thanks again to everyone who tried to assist me. I was able to use the > incomplete gamma function already in sage to compute Li(x) for complex > inputs. For the speed that I need this works fine. However, this > should be im

[sage-support] Re: Li(x) in the complex domain

2008-06-10 Thread M. Yurko
Thanks again to everyone who tried to assist me. I was able to use the incomplete gamma function already in sage to compute Li(x) for complex inputs. For the speed that I need this works fine. However, this should be impetus for me to try and learn Cython. On Jun 10, 8:04 pm, "William Stein" <[EM

[sage-support] Re: Li(x) in the complex domain

2008-06-10 Thread William Stein
On Tue, Jun 10, 2008 at 3:49 PM, Robert Bradshaw <[EMAIL PROTECTED]> wrote: > > Just for a start, try looking in sage/interfaces for several > examples. You could also try wrapping it in Cython (though this is > sometimes a bit harder with C++ than with C). I don't think there is any command line

[sage-support] Re: Li(x) in the complex domain

2008-06-10 Thread Robert Bradshaw
Just for a start, try looking in sage/interfaces for several examples. You could also try wrapping it in Cython (though this is sometimes a bit harder with C++ than with C). - Robert On Jun 10, 2008, at 7:35 AM, M. Yurko wrote: > After a little more searching, it appears that I should use a

[sage-support] Re: Li(x) in the complex domain

2008-06-10 Thread M. Yurko
After a little more searching, it appears that I should use a Pseudo tty( right?). However, the programming guide gives no information on how to actually do this. Any help would be greatly appreciated (copying and pasting input and output is less than ideal). On Jun 10, 10:15 am, "M. Yurko" <[EMA

[sage-support] Re: Li(x) in the complex domain

2008-06-10 Thread M. Yurko
Mike, thanks for the code. This is just what I need and works well from the command line. However, I'm a bit of a SAGE and linux newbie and I'm unsure about the best way of integrating this with SAGE. I checked the programming guide, but I only have some basic Python experience and have never done

[sage-support] Re: Li(x) in the complex domain

2008-06-08 Thread Michael
My package has routines for the incomplete gamma function, and the logarithmic integral is a special case of that. For the incomplete gamma function I use a combination of series, asumptotics, and continued fractions. The relevant file is Lgamma.h in the include directory of my L-function packag

[sage-support] Re: Li(x) in the complex domain

2008-06-07 Thread William Stein
On Sat, Jun 7, 2008 at 12:54 PM, M. Yurko <[EMAIL PROTECTED]> wrote: > > Is there any way for SAGE to calculate Li(x) (logarithmic integral) > for complex inputs? I don't think that functionality is directly exposed in Sage in any easy to use way. I've cc'd Mike Rubinstein who has probably writt