help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Asymptotic Expansions of acosh(x) for large x (was Unidentified s ub


From: Miroslaw Kwasniak
Subject: Re: Asymptotic Expansions of acosh(x) for large x (was Unidentified s ubject!)
Date: Thu, 5 May 2005 11:06:13 +0200
User-agent: Mutt/1.5.6+20040907i

On Wed, May 04, 2005 at 05:09:36PM -0400, Hall, Benjamin wrote:
> >I've got a problem calculating "acosh". I have to calculate cosh^(-1) of
> >a very large complex number (-7.2718e+15 + 1.3382e+15i). If I try to
> 
> 
> The wolfram website indicates some asymtotic expansions for acosh(x) for
> large x
> 
> http://functions.wolfram.com/ElementaryFunctions/ArcCosh/06/01/04/
> 
> For your case it looks like 2 terms may be enough:
> 
> 
> octave:20> z = -7.28e+15 + 1.34e+15i
> z = -7.2800e+15 + 1.3400e+15i
> 
> ### Asymtotic expansion for acosh(z) for large z
> octave:21> y = log( -4*z^2 ) / 2 - pi*sqrt( -z^2 ) / (2*z)
> y = 37.2337 +  2.9596i
> 
> octave:22> z2 = cosh(y)
> z2 = -7.2800e+15 + 1.3400e+15i
> 
> octave:25> abs(z - z2)/abs(z)
> ans =  1.2275e-15

Even whithout doing asymptotics a generic formula from
http://mathworld.wolfram.com/InverseHyperbolicCosine.html
gives proper result:

octave2.9:98> function y=acosh1(x); y=log(x+sqrt(x+1).*sqrt(x-1)); endfunction
octave2.9:99> z = -7.28e+15 + 1.34e+15i
z = -7.2800e+15 + 1.3400e+15i
octave2.9:100> y1=acosh1(z)
y1 = 37.2337 +  2.9596i
octave2.9:101> y = log( -4*z^2 ) / 2 - pi*sqrt( -z^2 ) / (2*z)
y = 37.2337 +  2.9596i
octave2.9:102> y1-y
ans = 0




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]