Maths › Rootfinding ›

# Muller

Calculates the zeros of a function using Muller's method.

Controller: **CodeCogs**

**Contents**

## Interface

C++

## Muller

doublemuller( | double | (*f)(double)[function pointer] | |

double | x0` = 0` | ||

double | d` = 3` | ||

double | eps` = 1E-10` | ||

int | maxit` = 1000` | ) |

*f*starting with an initial guess

*x0*and iterating the sequence above until either the accuracy

*eps*is achieved or the maximum number of iterations

*maxit*is exceeded. Another required parameter is the bound on the error of the initial guess

*d*.

## References:

- Jean-Pierre Moreau's Home Page, http://perso.wanadoo.fr/jean-pierre.moreau/
- F.R. Ruckdeschel, "BASIC Scientific Subroutines", Vol. II, BYTE/McGRAWW-HILL, 1981
- Wankere R. Mekwi, "Iterative Methods for Roots of Polynomials", Exeter College, University of Oxford

### Example 1

#include <codecogs/maths/rootfinding/muller.h> #include <iostream> #include <iomanip> // user-defined function double f(double x) { return sin(x); } int main() { double x = Maths::RootFinding::muller(f, 4); std::cout << "The calculated zero is X = " << std::setprecision(15) << x << std::endl; std::cout << "The associated ordinate value is Y = " << f(x) << std::endl; return 0; }

Output:The calculated zero is X = 3.14159265358979 The associated ordinate value is Y = 1.22460635382238e-016

### Parameters

f the user-defined function x0 Default value = 0 d Default value = 3 eps Default value = 1E-10 maxit Default value = 1000

### Authors

*Lucian Bentea (August 2005)*

##### Source Code

Source code is available when you buy a Commercial licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.