Tag Info

New answers tagged

6

SphericalBesselJ[210, (1/1.5)*2*Pi*1.5*1000/40] // InputForm 0. Use higher precision input SphericalBesselJ[210, (1/1.5`20)*2*Pi*1.5`20*1000/40] // InputForm 9.4770515229477837927439`0.13632911832271324*^-16 SphericalBesselJ[210, (2/3)*2*Pi*(3/2)*1000/40] // N[#, 20] & // InputForm 9.47705152294778379274395028349340334928589`20.*^-16 ...


2

In addition to @ybeltukov's excellent answer, I thought it would be worth noting the behaviour of RuntimeOptions, when compiling to either the Wolfram Virtual Machine (WVM) or to C, for these subnormal positive doubles. f = Compile[{{t, _Real}}, Exp[-9 t^2]]; Needs["GeneralUtilities`"] f[1.] (* = 0.00012341 *) f[8.872] (* = 2.191*10^-308 *) Do[f[1.], ...


4

What you experience is not Mathematica not dealing with 0.02 correctly, but your yy[...] being called with arguments, for which it is not defined. The following modification will show you the reason: yy[x_, t_]:= Which[x == 0, yy[0, t] = 0, x == 1, yy[1, t] = 0, t == 0, yy[x, 0] = Exp[-1000 (x - .3)^2], True, Print["x==", x, " t==", t];"yy[" ...



Top 50 recent answers are included