[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] nth root
From: |
John D Lamb |
Subject: |
Re: [Help-gsl] nth root |
Date: |
Mon, 12 Dec 2005 07:48:04 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050921 |
Eric Germaneau wrote:
> Hello everyone,
>
> I'm wondering whether gsl provides a function which computes the nth
> root .....
You could use
r = std::exp( std::log( x ) / n )
If you want greater accuracy, try looking at the chapter on
1-dimensional root finding. If you want the complex roots,
gsl_complex_polar( r, a ), where a = 0, 2 * Pi / n, ... 2 * (n - 1) * Pi
/ n.
--
JDL