Understanding Hyperbolic Functions: Calculations in Calculators and MATLAB

  • Thread starter Thread starter Firepanda
  • Start date Start date
  • Tags Tags
    Computing
Click For Summary

Homework Help Overview

The discussion revolves around how calculators and MATLAB compute hyperbolic functions, particularly focusing on the methods and algorithms involved in these calculations. Participants explore the use of Taylor series, Maclaurin series, and other mathematical approaches for both small and large values of x.

Discussion Character

  • Exploratory, Conceptual clarification, Mathematical reasoning, Assumption checking

Approaches and Questions Raised

  • Participants discuss the potential use of Taylor series for computing hyperbolic functions and question how many terms are used in these series. There is also consideration of using double-angle and angle-addition formulas for large numbers, as well as Newton's method for refining estimates. The distinction between methods for small and large values of x is a recurring theme.

Discussion Status

The discussion is active with various perspectives being shared. Some participants suggest that calculators utilize stored values for small inputs while employing series expansions for larger inputs. There is no explicit consensus, but several productive lines of reasoning are being explored regarding the algorithms used in calculators.

Contextual Notes

Participants note constraints such as the limited digit storage of calculators, which impacts the accuracy of calculations for large values. The discussion also highlights the need for clarity on the specific series used for different ranges of x.

Firepanda
Messages
425
Reaction score
0
How do calculators/matlab compute hyperbolic functions?

I believe it may have something to do with the taylor series but apart from that I can't find anything else from the net. I was told to try and compute cosh^2(x) - sinh^2(x) = 1, and notice the errors for increasing values of x, which I have done, but I'm still unsure on how this is computed. If it is in fact the taylor series used, then how do I find out how many terms it was computed to?

Thanks :)
 
Physics news on Phys.org
For large numbers, I would expect them to make good use of the double-angle and angle-addition formulas. For small numbers, I suppose you could use half-angle formulae, but a Taylor series is probably best in this domain.

Maybe there's a way to use Newton's method to refine an initial estimate?

(Note that you would compute e^x with the same kinds of methods)
 
Nice advice, but what I think they want is simpler, considering we havn't learned much of what you mentioned :P. I was thinking along the lines of them being computed by the maclaurin series, to an already determined-term degree of accuracy. Such that as x increases the graph of the functions converges further away, (as x needs to stay small using maclaurin).
 
Not sure about matlab, but pocket calculators only store about 15 digits of accuracy. To get that even for e^(1000) you would require less than 20 taylor series terms (someone could probably reduce that upper bound for me), and I am quite certain for large values they have taylor series sums, and for small values they are stored.

eg if you put [itex]exp(\sqrt{163}\pi) - (640320^4 + 744)[/itex] into your calculator, it says exactly zero, because the exponential differs from the integer part by less than 1x 10^(-60). Theoretically, you calculator should be able to display that information, it is by no means too small or too large for the display, but the memory only holds 15 digits, so it thinks they are the same numbers.
 
I understand what you mean gib z, but your example doesn't work for me :P

So when the calculator calculates cosh(x), does it use ((e^x) + (e^-x))/2, and use taylor series for e^x and e^-x, or just simply use the series of cosh(x)?
 
Ok well let me reiterate that small values are kept on the calculators storage, its only large values we are wondering about. Now, calculators keep it to about 15 digits memory, which means that an error of 1 * 10^(-15) is ok for a calculator. We shall note that e^(-x)/2 reaches this very quickly indeed. In fact, the error bound is already satisfied for x= 35. So really all the calculator does is compute (e^x)/2. For that, it uses the Taylor series of e^x.

PS: Hurkyl, i wouldn't say no to a homework helpers ribbon, i have earned it no :D?
 
Last edited:
So let me get this straight, the calculator uses an algorithm inside it using the exact definition of cosh(x), but it uses the taylor series when computing the exponentials.

Also, you say the series for e^x is used for higher values of x, but what series is used for the lower values? Say |x| < 1, or more generally |x| < 35.

P.S. And give him his ribbon :P
 
For smaller values the calculator keeps extensive libraries of data, remember a calculators storage memory can have millions upon millions of digits. So it would have handy e, e^10, e^(0.1), e^(0.001)...e^(0.0000000001). Then any power of e can be composed from them, eg e^(3.2) = ( e^1 ) ^ 3 * (e^0.1)^2
 
That's exactly what i needed to know, thankyou
 
  • #10
No problem =]
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K