title: Problem with parameters of ROOT TF1 function declaration
body: <p>I use a user-defined function to fit a data set in ROOT. The TF1 class declaration in my code is:</p>
  
  <pre><code>double t=1000;
  double a=0.1*t, b=0.9*t;
  ...
  TF1 *ffit = new TF1("ffit",fit,a,b,2);
  ffit-&gt;FixParameter(0,t);
  ffit-&gt;SetParameter(1,1);
  ...
  TGraph *g = new TGraph(n,x,y);
  g-&gt;Fit("ffit","R");
  </code></pre>
  
  <p>I expect it will work, but actually it does not. There is a segmentation violation together with a mess appearing when I run this code. However, when I just put 100 and 900 instead of a and b in the declaration of TF1 function, it works well.</p>
  
  <p>So, what is the problem here? How can I overcome this issue?
  The function <code>fit</code> is as followed:</p>
  
  <pre><code>double fit(double *x, double *par) 
  { 
  double y=par[0], g=par[1], y0=x[0];
  double r=(y0*(y-y0))/y;  
  return (pow(r,1.5)*g); 
  } 
  </code></pre>
  
  <p>P/s: I am using ROOT v6.14</p>