[sympy] sympy + mpmath findroot

2011-05-26 Thread Matthew Emmett
Hi everyone, I am having trouble combining mpmath's findroot function with sympy. Here is a short example of what I am trying to accomplish: import sympy import mpmath mpmath.mp.dps = 45 x = sympy.var('x') p = (5.0/2.0*x**3 - 3.0/2.0*x).as_poly() print 'subs: ', mpmath.findroot(lambda xi: p.s

Re: [sympy] sympy + mpmath findroot

2011-05-26 Thread Matthew Emmett
774596669241483377035853079956479922166584341 > > In [38]: print 'exact: ', mpmath.sqrt(mpmath.mpf('3.0')/mpmath.mpf('5.0')) > exact: 0.774596669241483377035853079956479922166584341 > > In [39]: print 'lambda:', mpmath.findroot(lambda x: 5.0*x**3/2.0 - 3.0*x/2.0, &g

Re: [sympy] sympy + mpmath findroot

2011-05-27 Thread Matthew Emmett
: > Well, it still fails there with the subs. Like I said, it's a bug. Can you > open an issue for it? > > Aaron Meurer > > On May 26, 2011, at 9:09 PM, Matthew Emmett wrote: > > > Thanks for the quick reply Aaron. I will get the latest git version > > an

[sympy] code generation and simplification

2012-07-26 Thread Matthew Emmett
Hi everyone, I have some sympy code that generates Fortran code, and was wondering if there a good way of simplifying the sympy expressions in order to minimize the number of floating point operations that are required to evaluate them numerically. Any suggestions? Thanks, Matt -- You received

Re: [sympy] code generation and simplification

2012-07-27 Thread Matthew Emmett
choose whether > or not to apply each of them. > > If you haven't already I recommend asking a non-sympy-specific version of > this question on scicomp.stackexchange.com > > On Thu, Jul 26, 2012 at 5:43 PM, Matthew Emmett wrote: >> >> Hi everyone, >> >> I