[sage-support] Re: Writing doctests and timing

2008-11-24 Thread Jason Grout
Tim Lahey wrote: > > On Nov 25, 2008, at 12:33 AM, Jason Grout wrote: >> sage: import sympy >> sage: var('x,a,b') >> (x, a, b) >> sage: f1=1/(a*x+b) >> sage: sympy.integrate(sympy.sympify(f1),sympy.sympify(x)) >> 1/a*log(b + a*x) >> sage: sympy_integrate = lambda f,x: sympy.integrate(sympy.sympif

[sage-support] Re: Writing doctests and timing

2008-11-24 Thread Tim Lahey
On Nov 25, 2008, at 12:33 AM, Jason Grout wrote: > > sage: import sympy > sage: var('x,a,b') > (x, a, b) > sage: f1=1/(a*x+b) > sage: sympy.integrate(sympy.sympify(f1),sympy.sympify(x)) > 1/a*log(b + a*x) > sage: sympy_integrate = lambda f,x: sympy.integrate(sympy.sympify(f), > sympy.sympify(x))

[sage-support] Re: Writing doctests and timing

2008-11-24 Thread Jason Grout
Jason Grout wrote: > > You could probably use the "sympyify" command: Sorry, as the examples illustrated, it's "sympify". I have such a hard time remembering how to spell that, and even if I remember, I always have a hard time typing it. -Jason --~--~-~--~~~---~

[sage-support] Re: Writing doctests and timing

2008-11-24 Thread Jason Grout
Tim Lahey wrote: > > On Nov 24, 2008, at 11:54 PM, William Stein wrote: > >> On Mon, Nov 24, 2008 at 8:27 PM, Tim Lahey <[EMAIL PROTECTED]> >> wrote: >>> Hi, >>> >>> If I have the following example Sage code, >>> >>> var('x,a,b') >>> # Test 1 >>> f1 = 1/(a*x+b) >>> aa = f1.integrate(x) >>> bb

[sage-support] Re: Writing doctests and timing

2008-11-24 Thread Tim Lahey
On Nov 24, 2008, at 11:54 PM, William Stein wrote: > > On Mon, Nov 24, 2008 at 8:27 PM, Tim Lahey <[EMAIL PROTECTED]> > wrote: >> >> Hi, >> >> If I have the following example Sage code, >> >> var('x,a,b') >> # Test 1 >> f1 = 1/(a*x+b) >> aa = f1.integrate(x) >> bb = 1/a*log(a*x+b) >> aa_cmp =

[sage-support] Re: Writing doctests and timing

2008-11-24 Thread William Stein
On Mon, Nov 24, 2008 at 8:27 PM, Tim Lahey <[EMAIL PROTECTED]> wrote: > > Hi, > > If I have the following example Sage code, > > var('x,a,b') > # Test 1 > f1 = 1/(a*x+b) > aa = f1.integrate(x) > bb = 1/a*log(a*x+b) > aa_cmp = bb-aa # Should be zero > sage_time_f1 = timeit.eval('f1.integrate(x)') >