Hi all.

I just encountered something like a bug, when i tried to calculate some
statistics.

here is an example:
\begin{example}
var('x s')
assume(x>0)
S=x.parent()
w0=S.wild(0)
f(x) = (2/sqrt(pi)*exp(-s^2)).integrate(s,0,x)
g(x) = f(x).diff(x)
h(x) = diff(erf(x),x)
print "g :", g
print "h :", h
print "g :", g.subs(diff(erf(x),x)(x=w0) == 2/sqrt(pi) * exp(-w0^2))
print "h :", h.subs(diff(erf(x),x)(x=w0) == 2/sqrt(pi) * exp(-w0^2))
print "g-h :", g-h
print "g-h :",(g-h).subs(diff(erf(x),x)(x=w0) == 2/sqrt(pi) * exp(-w0^2))
print "g-h :",(g-h).simplify()
\end{example}

the output is as follows:
\begin{output}
1: g : x |--> D[0](erf)(x)
2: h : x |--> D[0](erf)(x)
3: g : x |--> D[0](erf)(x)
4: h : x |--> 2*e^(-x^2)/sqrt(pi)
5: g-h : x |--> -D[0](erf)(x) + D[0](erf)(x)
6: g-h : x |--> -2*e^(-x^2)/sqrt(pi) + D[0](erf)(x)
7: g-h : x |--> 0
\end{output}

I dont understand why output line 3 differs from output line 4.
in line 5-7 simplify() works as expected, but subs() doesnt.

regards and thanks
felix

-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to