Are these bugs fixed in Mathematica 8 ?
- To: mathgroup at smc.vnet.net
- Subject: [mg114550] Are these bugs fixed in Mathematica 8 ?
- From: "Ted Ersek" <ersekt at md.metrocast.net>
- Date: Tue, 7 Dec 2010 06:47:59 -0500 (EST)
- References: <324752EE19E4E946968CE52D04456DAF0223A739@naeapaxrez02v.nadsusea.nads.navy.mil>
I don't plan on upgrading to Mathematica 8 anytime soon. Note: I no longer get to use it at work, and I don't use it very much at home. Below are some bugs in Mathematica 7 that I reported to Wolfram Research tech-support, and I was wondering if they are fixed in version 8. ---------------------------------------------------- In[1]:= SetOptions[ FourierTransform, FourierParameters->{1,1} ]; x[t_,a_,b_] := ((t+a/2)*UnitStep[t+a/2]-(t-a/2)*UnitStep[t-a/2])*b/(2*a); Plot[ x[t,20,24], {t,-12,12} ] (* Graphic not shown *) In[4]:= FullSimplify[ FourierTransform[x[t,a,b],t,w], And[ 0<a, 0<b, Element[w,Reals]] ] Out[4]= ((I/2)*b*E^((I/2)*a*w))/w It seems to me the previous result should be 2*I*b/(a*w^2)*Sin[a*w/2]+ Pi*b*DiracDelta[w] Notice the above setting for FourierParameters. (* -------------------------------------------------- *) In[5]:= Off[General::ovfl,General::unfl]; SlightlyNegative= -$MinNumber/10; VeryNegative= -10*$MaxNumber; BigComplex=($MaxNumber (-0.664-0.747 I))^4; {SlightlyNegative,VeryNegative,BigComplex} Out[9]= {Underflow[], Overflow[], Overflow[]} I agree that the results above lead to underflow and overflow. However, I was surprised by the result of the next two cells. Although the next two output cells are mostly by design since the documentation for Overflow says "Overflow[] is considered a Real number." The documentation for Underflow is similar. In[10]:= {Head[SlightlyNegative], Head[VeryNegative], Head[BigComplex]} Out[10]= {Real , Real , Real} In[11]:= { NumericQ[SlightlyNegative], NumberQ[SlightlyNegative], NumericQ[VeryNegative], NumberQ[VeryNegative] } Out[11]= {True, True, True, True} Mathematica 7 represents any overflow as Overflow[], and any underflow as Underflow[]. As a result any information on the sign[_], and Arg[_] of such a results are lost. The documentation doesn't mention that some built-in functions consider any overflow or underflow a positive real number :-( This leads to incorrect results below. In[12]:= {Sign[VeryNegative], Sign[SlightlyNegative], Sign[BigComplex]} Out[12]= {1, 1, 1 } In[13]: Map[0<#&, {SlightlyNegative, VeryNegative, BigComplex} ] Out[13]= {True, True, True} In[14]:= Element[BigComplex, Reals] Out[14]= True In[15]:= Im[BigComplex] Out[15]= 0 In[16]:= VeryNegative + Exp[5.0*^323228465] Out[16]= Overflow[] In the previous line we are computing Overflow[] + Overflow[]. Even if Mathematica would keep track of the sign of an overflow, it would not know which has larger magnitude, so the result should be Indeterminate. The next result is most outrageous because Exp[1.5*^-323228465] is very close to 1. In[16]:= 10^80000 < Exp[1.5*^-323228465] Out[16]= True ---------------- Ted Ersek