Dear Burcin, dear list
Le mardi 27 août 2013 11:16:18 UTC+2, Burcin Erocal a écrit :
>
> On Sat, 24 Aug 2013 14:16:01 -0700 (PDT)
> Emmanuel Charpentier <[email protected] <javascript:>> wrote:
>
> > Dear list,
[ Snip.. ]
> > h=g(x,m1,m2,s1,s2) # to get a symbolic expression
> > print h.denominator()
> >
> > This prints
> >
> > sqrt(pi*s1^2)*sqrt(pi*s2^2)
> >
> > which is simple, but obviously *FALSE*. And, by the way,
> >
> > maxima.denom(h).sage()
> >
> > gives the much more reasonable :
> >
> > sqrt(2)*sqrt(pi*s1^2)*sqrt(pi*s2^2)*sqrt((s1^2 + s2^2)/(s1^2*s2^2))
>
> You can get a similar response from Sage (or the underlying library
> GiNaC/pynac) by setting normalize=False:
>
> sage: var("x,t,mu,sigma")
> (x, t, mu, sigma)
> sage: assume(x,"real",t,"real",mu,"real",sigma,"real",sigma>0)
> sage: var("m1,m2,s1,s2")
> (m1, m2, s1, s2)
> sage: phi(x,mu,sigma)=e^-(((x-mu)^2)/(2*sigma^2))/sqrt(2*pi*sigma^2)
> sage: ex = integrate(phi(t,m1,s1)*phi(x-t,m2,s2),t,-oo,oo)
> sage: ex.denominator(normalize=False)
> sqrt(pi*s1^2)*sqrt(pi*s2^2)*sqrt((s1^2 + s2^2)/(s1^2*s2^2))
>
> Our .denominator() method returns the denominator of the "normalized"
> expression by default:
>
Thank you. I was under the (false) impression that Sage used Maxima's CRE
as a canonical representation. Hence two questions :
1) Shouldn't this "normalized form" be used when one asks for h ?
2) Where is this "normalized" form discussed (possibly against CRE) ? I
suppose that, since Sage uses Maxima for a lot of the symbolics, changing
its internal representation to one different from Maxima's (or, s case
might be, deciding to stay with a previous choice) has been deemed worth
of it, and I'd like to understand the rationale for this decision.
Again, thank you very much !
Emmanuel
Charpentier.
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.