Problems 9
  1. Theory.
    1. What is the declaration of the gsl_function structure?
    2. What is the declaration of the gsl_integration_qag function?
    3. What is the declaration of the gsl_integration_qags function?
    4. What is the declaration of the gsl_integration_cquad function?
  2. Practice.
    1. Numerical integration with Gauss-Kronrod algorithm.
      1. Look up the definition of the error functions erf in Wikipedia.
      2. Implement a function with the signature
        double myerf(double x)
        that calculates the error function erf by direct numerical integration.
        • when x<0 use erf(x)=-erf(-x)
        • When x<1 use the expression
          erf(x) = (2/√π)0x e-t²
          
          and employ gsl_integration_qags.
        • otherwise use the expression
          erf(x) = 1 - (2/√π)x e-t²
          
          and employ gsl_integration_qagiu.
      3. Make a plot where you compare you function with the gsl_sf_erf function from gsl_sf_erf.h .