Re: The old round off problem?

2006-03-05 Thread David Treadwell
On Mar 5, 2006, at 1:01 AM, sam wrote:David Treadwell wrote: exp(x) is implemented by:1.  reducing x into the range |r| <=  0.5 * ln(2), such that x = k *ln(2) + r2.  approximating exp(r) with a fifth-order polynomial,3.  re-scaling by multiplying by 2^k: exp(x) = 2^k * exp(r)sinh(x) is mathematica

Re: The old round off problem?

2006-03-04 Thread sam
David Treadwell wrote: > exp(x) is implemented by: > > 1. reducing x into the range |r| <= 0.5 * ln(2), such that x = k * > ln(2) + r > 2. approximating exp(r) with a fifth-order polynomial, > 3. re-scaling by multiplying by 2^k: exp(x) = 2^k * exp(r) > > sinh(x) is mathematically ( exp(x) - e

Re: The old round off problem?

2006-03-04 Thread David Treadwell
I wish I knew! So I asked Google. Here's what I learned: Most implementations are based on, or similar to the implementation in the fdlibm package. sinh(x) and cosh(x) are both based on exp(x). See http:// www.netlib.org/cgi-bin/netlibfiles.pl?filename=/fdlibm/e_sinh.c exp(x) is implemented

Re: The old round off problem?

2006-03-04 Thread sam
David I beg I beg Can you answer the question? Also thanks for the information on using the Taylor series. Sam Schulenburg -- http://mail.python.org/mailman/listinfo/python-list

Re: The old round off problem?

2006-03-04 Thread David Treadwell
On Mar 4, 2006, at 4:33 PM, Paul Rubin wrote: > "sam" <[EMAIL PROTECTED]> writes: >> Hello all, I am taking a class in scientific programming at the local >> college. My problem is that the following difference produces >> round off >> errors as the value of x increases. For x >= 19 the diferenc

Re: The old round off problem?

2006-03-04 Thread Paul Rubin
"sam" <[EMAIL PROTECTED]> writes: > Hello all, I am taking a class in scientific programming at the local > college. My problem is that the following difference produces round off > errors as the value of x increases. For x >= 19 the diference goes to > zero.I understand the problem, but am curious

The old round off problem?

2006-03-04 Thread sam
Hello all, I am taking a class in scientific programming at the local college. My problem is that the following difference produces round off errors as the value of x increases. For x >= 19 the diference goes to zero.I understand the problem, but am curious as to whether their exists a solution. I