Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to increase the numerical accuracy

Subject: How to increase the numerical accuracy

From: KH

Date: 24 Mar, 2009 10:44:01

Message: 1 of 4

When using the hyperbolic functions, MATLAB will always return a relatively inaccurate result.

Also, the exponential term, exp, will go to infinity when the index is greater than 709 or become 0 for values below -709. Basically the workable range is exp(-709) to exp(709). How to increase the accuracy and expand the range of the exp?

Subject: How to increase the numerical accuracy

From: us

Date: 24 Mar, 2009 10:53:01

Message: 2 of 4

"KH"
> Also, the exponential term, exp, will go to infinity when the index is greater than 709 or become 0 for values below -709. Basically the workable range is exp(-709) to exp(709). How to increase the accuracy and expand the range of the exp...

yes, its the 64bit DOUBLEs...

     [log(realmin),log(realmax)]
% ans = -708.4 709.78

you may want to look at the symbolic math tbx

http://www.mathworks.com/products/symbolic/

us

Subject: How to increase the numerical accuracy

From: Steve Amphlett

Date: 24 Mar, 2009 11:06:02

Message: 3 of 4

"KH " <jambanova@hotmail.com> wrote in message <gqadhh$ife$1@fred.mathworks.com>...
> When using the hyperbolic functions, MATLAB will always return a relatively inaccurate result.
>
> Also, the exponential term, exp, will go to infinity when the index is greater than 709 or become 0 for values below -709. Basically the workable range is exp(-709) to exp(709). How to increase the accuracy and expand the range of the exp?

There are some very clever mathematicians in these parts (not me) who could and would probably help if you post the problem(s) you are trying to solve.

Subject: How to increase the numerical accuracy

From: John D'Errico

Date: 24 Mar, 2009 11:20:03

Message: 4 of 4

"KH " <jambanova@hotmail.com> wrote in message <gqadhh$ife$1@fred.mathworks.com>...
> When using the hyperbolic functions, MATLAB will always return a relatively inaccurate result.
>
> Also, the exponential term, exp, will go to infinity when the index is greater than 709 or become 0 for values below -709. Basically the workable range is exp(-709) to exp(709). How to increase the accuracy and expand the range of the exp?


Rather than trying to force exp and double
precision arithmetic to work overtime, a
simple investment of basic mathematics is a
far better choice.

Try scaling your numbers. Or work in terms
of logs.

Without more information, this is as clever as
I get.

John

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us