title: Chi-square test from gsl while integrating gives 0
body: <p>I'm trying to calculate the multiple integrant using gsl library but it seems endless because chisq value constantly equals 0. Here is my integrating method:</p>
  
  <pre><code>double Integr::Fgg(double x_val, double k_val){
  
      double result, error;
      double bound_up[] = {2*M_PI, 2*M_PI, k_max, k_max};
      double bound_down[] = {0,0,k_min, k_min};
      const gsl_rng_type *T;
      gsl_rng *r;
  
      struct f_params params = {x_val, k_val};
      gsl_monte_function Fgg = {&amp;Integr::integrant_prot, 4, &amp;params};
      size_t calls = 5000;
      gsl_rng_env_setup();
      T = gsl_rng_default;
      r = gsl_rng_alloc(T);
  
      //warm up
      gsl_monte_vegas_state *s = gsl_monte_vegas_alloc(4);
      gsl_monte_vegas_integrate(&amp;Fgg, bound_down, bound_up, 4, 1000, r, s, &amp;result, &amp;error);
  
      //integration
      do{
          gsl_monte_vegas_integrate(&amp;Fgg, bound_down, bound_up, 4, calls/5, r, s, &amp;result, &amp;error);
      }while(fabs(s-&gt;chisq - 1.0)&gt;0.5);
  
      gsl_monte_vegas_free(s);
      return result;
  }
  </code></pre>
  
  <p>Can anybody tell my why this value isn't changing? Is there sth wrong with my code or with my gsl usage? I have to admit that I'm new with gsl.</p>
  
  <p>[edit]
  Integrand function:</p>
  
  <pre><code>double Integr::integrant_prot(double *args, size_t dim, void *params){
  
      struct f_params *fp = (struct f_params *) params;
      return Integr::integrantFgg(fp-&gt;x_val, fp-&gt;k_val, args[0], args[1], args[2], args[3]);
  }
  </code></pre>