Am Freitag, den 21.05.2010, 22:01 +0200 schrieb Reinhard Oldenburg:
> Dear all,
> I have been too lazy to search the documentation for the normal
> distribution and typed in:
>
> A:integrate(exp(-w^2/2),w);
> distri0(q):=float(subst(q,w,A));
> distri(q):=float(1/sqrt(2*%pi)*(sqrt(%pi/2)-distri0(q)));
>
> But then on Maxima 5.21.0 (the official binary gcl for windows) the
> calculation
> distri(0);
> yields the error message
> Maxima encountered a Lisp error:
> Error in MACSYMA-TOP-LEVEL [or a callee]:
> Error in CONDITIONS::CLCS-UNIVERSAL-ERROR-HANDLER [or a callee]: The
> slot CONDITIONS::DATUM is unbound in the object
> #<CONDITIONS::INTERNAL-TYPE-ERROR.2>.
> Fast links are on: do (use-fast-links nil) for debugging
> Broken at PCL::PRINT-STD-INSTANCE. Type :H for Help.
>
> On MuPAD the similair definitions work as expected.
>
> A:=int(exp(-w^2/2),w);
> distri0:= q->float(subs(A,w=q));
> distri:= q->float(1/sqrt(2*PI)*(sqrt(PI/2)-distri0(q)));
>
> distri(0) yields 0.5
When I repeat your example with the current CVS version I get the
expected result:
(%i1) A:integrate(exp(-w^2/2),w);
(%o1) sqrt(%pi)*erf(w/sqrt(2))/sqrt(2)
(%i2) distri0(q):=float(subst(q,w,A));
(%o2) distri0(q):=float(subst(q,w,A))
(%i3) distri(q):=float(1/sqrt(2*%pi)*(sqrt(%pi/2)-distri0(q)));
(%o3) distri(q):=float(1/sqrt(2*%pi)*(sqrt(%pi/2)-distri0(q)))
(%i4) distri(0);
(%o4) 0.5
Dieter Kaiser