parameters: (prob, df)
return_statement: return chisqval
docstring: This function calculates the inverse of the chi square function. Given
      a p-value and a df, it should approximate the critical value needed to 
      achieve these functions. Adapted from Gary Perlmans critchi function in
      C. Apologies if this breaks copyright, but no copyright notice was 
      attached to the relevant file.
docstring_summary: This function calculates the inverse of the chi square function. Given
      a p-value and a df, it should approximate the critical value needed to 
      achieve these functions. Adapted from Gary Perlmans critchi function in
      C. Apologies if this breaks copyright, but no copyright notice was 
      attached to the relevant file.
docstring_tokens: This function calculates the inverse of the chi square function . Given a p - value and a df it should approximate the critical value needed to achieve these functions . Adapted from Gary Perlmans critchi function in C . Apologies if this breaks copyright but no copyright notice was attached to the relevant file .
function: def inversechi(prob, df):
      """This function calculates the inverse of the chi square function. Given
      a p-value and a df, it should approximate the critical value needed to 
      achieve these functions. Adapted from Gary Perlmans critchi function in
      C. Apologies if this breaks copyright, but no copyright notice was 
      attached to the relevant file."""
      minchisq = 0.0
      maxchisq = 99999.0
      chi_epsilon = 0.000001
      if (prob <= 0.0):
          return maxchisq
      elif (prob >= 1.0):
          return 0.0
      chisqval = df / math.sqrt(prob)
      while ((maxchisq - minchisq) > chi_epsilon):
          if (chisqprob(chisqval, df) < prob):
              maxchisq = chisqval
          else:
              minchisq = chisqval
          chisqval = (maxchisq + minchisq) * 0.5
      return chisqval
function_tokens: def inversechi ( prob , df ) : minchisq = 0.0 maxchisq = 99999.0 chi_epsilon = 0.000001 if ( prob <= 0.0 ) : return maxchisq elif ( prob >= 1.0 ) : return 0.0 chisqval = df / math . sqrt ( prob ) while ( ( maxchisq - minchisq ) > chi_epsilon ) : if ( chisqprob ( chisqval , df ) < prob ) : maxchisq = chisqval else : minchisq = chisqval chisqval = ( maxchisq + minchisq ) * 0.5 return chisqval