Re: square number
- From: dcorbit@xxxxxxxxx
- Date: 15 Aug 2006 15:51:50 -0700
"Ioannis" <morpheus@xxxxxxxxxxxx> wrote in message
news:1155679826.896855@xxxxxxxxxxx
<dcorbit@xxxxxxxxx> wrote in message
news:1155678816.656595.9750@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[snip]
Here is the solution to a related problem:
Given a number, find what number raised to its own power is equal to
that number.
So given 4, the answer is 2 and given 27 the answer is 3. But what if
you are given 5 or 32.123?
This is known to have a solution via Lambert's W function. The equation
x^x=y
is solvable as:
x=log(y)/W(log(y)).
Of course, then one requires an algorithm for the principal branch of W
with
good precision, but such algorithms exist and can be found with Google.
My program attached also solves the problem. It uses Schroeder's
methods to
solve x^x-y = 0
If you don't have Maple or Mathematica, it is not likely that you have
an
implementation of Lambert's W function handy. The code I supplied
works for
any C compiler. I see that Lambert's W function is included in the
GSL. So
a shortened solution would be easy to produce.
--
Ioannis
.
- References:
- square number
- From: V Mind
- Re: square number
- From: Pubkeybreaker
- Re: square number
- From: dcorbit
- Re: square number
- From: Ioannis
- square number
- Prev by Date: Re: Slow learner trying to learn math
- Next by Date: Re: Agh, this ought to be easy... (linear algebra)
- Previous by thread: Re: square number
- Next by thread: Re: square number
- Index(es):
Relevant Pages
|