From $ROOTSYS/tutorials/math/exampleMultiRoot.C

// example of using multiroot finder
// based on GSL algorithm
// Find the root of Rosenbrock system of equations
// f1(x,y) = a(1-x)
// f2(x,y) = b(y-x^2)
//  with 1 = 1, b=10
//
// The MultiRootFinder is based on GSL and it requires the MathMore library
// installed
//
// Usage:
//  >.x exampleMultiRoot.C()
// or
// >.x exampleMultiRoot(algoname,printlevel)
//
// where algoname is for an algorithm not using the derivatives:
//  hybridS (default) , hybrid, dnewton, broyden
//
#include "RConfigure.h"

#ifdef R__HAS_MATHMORE
#include "Math/MultiRootFinder.h"
#endif
#include "Math/WrappedMultiTF1.h"
#include "TF2.h"
#include "TError.h"

// example of using multi root finder based on GSL
// need to use an algorithm not requiring the derivative
//like hybrids (default), hybrid, dnewton, broyden

using namespace ROOT::Math;
void exampleMultiRoot(const char * algo = 0, int printlevel = 1) {

#ifndef R__HAS_MATHMORE
   Error("exampleMultiRoot","libMathMore is not available - cannot run this tutorial");
#else


   ROOT::Math::MultiRootFinder r(algo);
    //defining the function
   // use Rosenbrock functions
   TF2 * f1 = new TF2("f1","[0]*(1-x)+[1]*y");
   TF2 * f2 = new TF2("f2","[0]*(y-x*x)");
   f1->SetParameters(1,0);
   f2->SetParameter(0,10);
   // wrap the functions
   ROOT::Math::WrappedMultiTF1 g1(*f1,2);
   ROOT::Math::WrappedMultiTF1 g2(*f2,2);
   r.AddFunction(g1);
   r.AddFunction(g2);
   r.SetPrintLevel(printlevel);

   // starting point
   double x0[2]={-1,-1};
   r.Solve(x0);
#endif

}

 exampleMultiRoot.C:1
 exampleMultiRoot.C:2
 exampleMultiRoot.C:3
 exampleMultiRoot.C:4
 exampleMultiRoot.C:5
 exampleMultiRoot.C:6
 exampleMultiRoot.C:7
 exampleMultiRoot.C:8
 exampleMultiRoot.C:9
 exampleMultiRoot.C:10
 exampleMultiRoot.C:11
 exampleMultiRoot.C:12
 exampleMultiRoot.C:13
 exampleMultiRoot.C:14
 exampleMultiRoot.C:15
 exampleMultiRoot.C:16
 exampleMultiRoot.C:17
 exampleMultiRoot.C:18
 exampleMultiRoot.C:19
 exampleMultiRoot.C:20
 exampleMultiRoot.C:21
 exampleMultiRoot.C:22
 exampleMultiRoot.C:23
 exampleMultiRoot.C:24
 exampleMultiRoot.C:25
 exampleMultiRoot.C:26
 exampleMultiRoot.C:27
 exampleMultiRoot.C:28
 exampleMultiRoot.C:29
 exampleMultiRoot.C:30
 exampleMultiRoot.C:31
 exampleMultiRoot.C:32
 exampleMultiRoot.C:33
 exampleMultiRoot.C:34
 exampleMultiRoot.C:35
 exampleMultiRoot.C:36
 exampleMultiRoot.C:37
 exampleMultiRoot.C:38
 exampleMultiRoot.C:39
 exampleMultiRoot.C:40
 exampleMultiRoot.C:41
 exampleMultiRoot.C:42
 exampleMultiRoot.C:43
 exampleMultiRoot.C:44
 exampleMultiRoot.C:45
 exampleMultiRoot.C:46
 exampleMultiRoot.C:47
 exampleMultiRoot.C:48
 exampleMultiRoot.C:49
 exampleMultiRoot.C:50
 exampleMultiRoot.C:51
 exampleMultiRoot.C:52
 exampleMultiRoot.C:53
 exampleMultiRoot.C:54
 exampleMultiRoot.C:55
 exampleMultiRoot.C:56
 exampleMultiRoot.C:57
 exampleMultiRoot.C:58
 exampleMultiRoot.C:59
 exampleMultiRoot.C:60
 exampleMultiRoot.C:61