tags:

views:

71

answers:

4

Hi,

As the title says I'm looking for a software package that computes the roots of complex functions.

Languages: C/C++/C# Platform: Windows Functions: cos, sin, exp, log.

Thanks.

A: 

Use math library:

#include <math.h>

Math Library

Chris
A: 

The most common method I've seen in scientific literature is Mueller's method. The Wikipedia page contains a link to a Mathematica implementation. I've rewritten it a few times in various languages when I needed it, since it's basically just one function.

Victor Liu
@Victor Liu: Mueller's methos is for real funtions os a real variable.
Neves
@A. Neves: Mueller's method works equally well on complex functions. See Wikipedia page. I have personally used it for complex functions, so I would know.
Victor Liu
@Victor Liu: You are right, sorry. Maybe you could help with this. I have a function F(z)= f(x,y) + g(x,y)i, i.e. the real and imaginary parts are separated, are there techniques taking advantage of this (in order to find the roots)?
Neves
@Neves: In that case, it is highly doubtful that F(z) is an analytic function since f(x,y) and g(x,y) must satisfy the Cauchy-Riemann equations for it to be analytic. If F(z) is not analytic, ZEAL will not work. If F(z) is analytic, then you're in luck, as the original F90 implementation of ZEAL needs the function in the form of separate real and imaginary parts. In general though, separating real and imaginary parts isn't very useful since it runs counter to the general notion of an analytic function.
Victor Liu
A: 

The book Computing the Zeros of Analytic Functions describes the theory behind the software package ZEAL which is available here.

lhf
@lhf: Thanks, this is exactly what I was looking for. I wonder if this is the only package available. Unfortunately my reputation isn't enough to vote up.
Neves
lhf
I have implemented this package in C++, and it really doesn't work very well if your function is very poorly behaved, and if your function evaluations take a long time. I was integrating functions with zeros very near the boundary of the integration contour, and this algorithm has lots of problems with that.
Victor Liu