<html><body><span style="font-family:Times New Roman; color:#000000; font-size:12pt;"><div>I am sorry that I don not know the numerical method used in intg. But if it is the simple trapezoidal rule, the result is understandable.</div>
<div> </div>
<div>In the trap method, the domain is evenly divided into a set of intervals, this might be 1000 or 10000. What happens when we step out 1/1000 th the distance to 1e10? The first point is 1e7. The value of the function at that point is ... close to zero and the values only get smaller. </div>
<div> </div>
<div>If we use an integration method that tries to 'learn' the function may look at the slope of the function at the first point. For the function at hand, the result is worse than the previous because the slope implies that 'next' 'best' step is even further away from the 'interesting' part of the function. </div>
<div> </div>
<div>Many math functions will have difficulties when the domain spans large values. The standard binary searches for information may easily fail. The implication may be to let such algorithms 'study' the characteristics of the space of interest for math operator at hand. Sometimes, it may take human intervention to help the algorithm reach valuable parameters. The exponential function has interesting support between 0 and 1; at 1000 or more, the slope and support are both almost nil. A less known known function may take significant study to sufficiently understand its behavior so appropriate numerical methods may be applied.</div>
<div> </div>
<div>One size some times does not fit all. Of course this is where a firm background in numerical methods can be valuable. This is not to say the computers can not perform as well as professional human mathematician, but it will take capturing some of the escents of that background for our programs to help us from falling into numerical traps. This is not to say that any particular numerical package is 'smarter' than another, they are at least ... different.</div>
<div> </div>
<div>I hope this helps some,</div>
<div>ray</div>
<BLOCKQUOTE style="BORDER-LEFT: blue 2px solid; PADDING-LEFT: 8px; FONT-FAMILY: verdana; COLOR: black; MARGIN-LEFT: 8px; FONT-SIZE: 10pt" id=replyBlockquote webmail="1">
<DIV id=wmQuoteWrapper>-------- Original Message --------<BR>Subject: Re: [scilab-Users] Re: intg: results differ substantially from<BR>those from Wolfram Alpha, which are correct?<BR>From: Sylvestre Ledru <<a href="mailto:sylvestre.ledru@scilab.org">sylvestre.ledru@scilab.org</a>><BR>Date: Fri, May 20, 2011 8:16 am<BR>To: <a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><BR><BR>You received an email when you subscribed.<BR>or click here:<BR><a href="http://www.scilab.org/communities/developer_zone/tools/mailing_list">http://www.scilab.org/communities/developer_zone/tools/mailing_list</a><BR>and send the email with the address you subscribed with.<BR><BR>S<BR><BR>Le vendredi 20 mai 2011 à 06:09 -0700, Bassam Awad a écrit :<BR>> Any one knows how to unsubscribe to the list?<BR>> <BR>> <BR>> <BR>> --- On Fri, 5/20/11, Jean-Yves Baudais<BR>> <<a href="http://jean-yves.baudais@insa-rennes.fr>">jean-yves.baudais@insa-rennes.fr></a>; wrote:<BR>> <BR>> From: Jean-Yves Baudais <<a href="http://jean-yves.baudais@insa-rennes.fr>">jean-yves.baudais@insa-rennes.fr></a>;<BR>> Subject: Re: [scilab-Users] Re: intg: results differ<BR>> substantially from those from Wolfram Alpha, which are<BR>> correct?<BR>> To: <a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><BR>> Date: Friday, May 20, 2011, 1:05 PM<BR>> <BR>> Hello,<BR>> <BR>> > ok, for normal distribution I found a cure - folded normal<BR>> dist (<BR>> > <a href="http://en.wikipedia.org/wiki/Folded_normal_distribution">http://en.wikipedia.org/wiki/Folded_normal_distribution</a>)<BR>> that avoids the<BR>> > abs() in the integral; but what about other cases?<BR>> <BR>> But in the folded normal dist there is no log function as in<BR>> your function. Your problem is the same as<BR>> <BR>> --> function y=f(x),y=exp(-x), endfunction<BR>> --> intg(0,1e10,f)<BR>> ans=<BR>> 0<BR>> <BR>> The integral calculation is performed with Monte-Carlo method<BR>> (I think), so the probability to obtain non zero contribution,<BR>> when the upper limit increases, decreases. With lower upper<BR>> limit the result is good<BR>> <BR>> --> intg(0,1e2,f)<BR>> ans=<BR>> 1<BR>> <BR>> When lim(x->0) f(x)=0, you must pay attention to the upper<BR>> limit. It is your case.<BR>> <BR><BR><BR></DIV></BLOCKQUOTE></span></body></html>