Forums before death by AOL, social media and spammers... "We can't have nice things"
|    sci.math.symbolic    |    Symbolic algebra discussion    |    10,432 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 8,843 of 10,432    |
|    Nasser M. Abbasi to Nasser M. Abbasi    |
|    Re: on sin(very large number)    |
|    03 Aug 15 21:48:36    |
      From: nma@12000.org              On 8/3/2015 9:44 PM, Nasser M. Abbasi wrote:       > I was answering someone question on Matlab forum, and noticed       > something interesting.       >       > Maple:       > ========       > Digits::60: sin(2*10^30): evalf(%);       > 0.17950046751493908795061771231643809505098047699633484280836744\       > 698514457349325219       >       > Matematica:       > ===========       > In[21]:= N[Sin[2*10^30], 60]       > Out[21]= 0.179500467514939087950617712316438095050980476996334842808367       >       > Mupad:       > ======       > Digits:=60:       > simplify(sin(2.0*10^30));       > -0.6054240282319655434839500429688996518962085247039794921875       >       > But when calling mupad from Matlab, now it gives different answer       > (same as Maple and Mathematica)       >       >>> evalin(symengine,'DIGITS := 60: simplify(sin(2.0*10^30))')       > 0.179500467514939087950617712316438095050980476996334842808367       4698514564171539337       >       > But Matlab gives different answer       > =================================       >>> sin(2*10^30)       > -0.018662125294758       >       > Which is the correct result, and what is the algorithm used for such       > evaluations when the argument of trig is large?       >       > thanks,       > --Nasser       >              Opps, I forgot to add one more result              In[22]:= Sin[2.0*10^30]       Out[22]= -0.0186621              Which is different from              In[21]:= N[Sin[2*10^30], 60]       Out[21]= 0.179500467514939087950617712316438095050980476996334842808367              I think now that the second is the correct one, since it uses       larger precision, while the first result, uses default hardware       precision.              --Nasser              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca