1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Computing Hyperbolics

  1. Oct 20, 2007 #1
    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 :)
     
  2. jcsd
  3. Oct 20, 2007 #2

    Hurkyl

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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)
     
  4. Oct 20, 2007 #3
    Nice advice, but what I think they want is simpler, considering we havn't learnt 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).
     
  5. Oct 20, 2007 #4

    Gib Z

    User Avatar
    Homework Helper

    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 im 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.
     
  6. Oct 21, 2007 #5
    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)?
     
  7. Oct 21, 2007 #6

    Gib Z

    User Avatar
    Homework Helper

    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: Oct 21, 2007
  8. Oct 21, 2007 #7
    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
     
  9. Oct 21, 2007 #8

    Gib Z

    User Avatar
    Homework Helper

    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
     
  10. Oct 21, 2007 #9
    That's exactly what i needed to know, thankyou
     
  11. Oct 21, 2007 #10

    Gib Z

    User Avatar
    Homework Helper

    No problem =]
     
  12. Oct 21, 2007 #11

    robphy

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Computing Hyperbolics
  1. Hyperbolic Sine (Replies: 10)

Loading...