Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: calculation of exp(200)
Replies: 5   Last Post: Jul 10, 2014 12:51 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 1,069
Registered: 9/26/13
Re: calculation of exp(200)
Posted: Jul 9, 2014 12:12 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


"kumar vishwajeet" <kwzeet@gmail.com> wrote in message
news:lphu22$5i$1@newscl01ah.mathworks.com...
> "Nasser M. Abbasi" wrote in message <lpfj5e$4c4$1@speranza.aioe.org>...
>> On 7/7/2014 8:26 PM, kumar vishwajeet wrote:
>> > I want to find exp(N) where N can range from 0 to 200.
>> >Is there any method to calculate it with good accuracy?

>>
>> as James said, you can use vpa
>>
>> vpa(exp(sym(200)),500)
>> 7225973768125749258177477042189305697356874428527
>> 31928403269789123221909361473891661561.9265890625
>> 7055746840204310142941817711067711936822648098307
>> 7273278800877934252667473057807294372135876617806
>> 9702350324220401483115192088442120622525378469924
>> 9272881421981093552839024711140014485905504285329
>> 2850053281888896583514044902234770562940736477036
>> 9022153799888245922895391403712478563813079673045
>> 5316370477078232246232166391756343572294659379732
>> 9550687822348546666476886365318979823972170480437
>> 40943587594
>>
>> But you have to do all the rest of the computation
>> is syms land, otherwise what is the point of
>> getting this accuracy if you can't use it in
>> numerical matlab.
>>
>>
>>

> Actually I have a matrix whose elements range from exp(200) to exp(-200).

Is your matrix a double precision matrix or a symbolic matrix?

>The matrix is ill conditioned with conditioning number of 10^167.

So ... if you're doing ANYTHING in double precision with this matrix, you're
getting garbage.

http://en.wikipedia.org/wiki/Condition_number

"As a general rule of thumb, if the condition number is 10^k , then you may
lose up to k digits of accuracy on top of what would be lost to the
numerical method due to loss of precision from arithmetic methods."
[replaced images with text.]

By this guideline, you're losing roughly 167 digits of accuracy for the
numbers you know to roughly 16 digits.

> I am calculating determinant of this matrix. MATLAB gives it in the
> 10^-13. The matrix is posted in the following link.
> http://math.stackexchange.com/questions/859597/determinant-of-an-ill-conditioned-matrix/859614#859614
> So, I was just wondering whether to rely on this calculation of
> determinant or not.


That looks like you're trying to perform the computations in double
precision, in which case I would try not to have anything to do with this
matrix at all.

What is the underlying problem that you're trying to use this problem to
solve? There may be a way to solve that problem that doesn't require
creating a matrix whose elements span 200+ orders of magnitude.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.