[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] GSL bug

From: Viou AINOU
Subject: [Bug-gsl] GSL bug
Date: Fri, 24 Sep 2010 12:03:25 +0200

Good morning,

I'm currently running a code (see below) using GNU library. I get a bug
which for instance:*undefined reference to `gsl_deriv_central'*. What can be
the cause of this bug and how could I remove it?

thanks in advance.

#include <stdio.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_deriv.h>

     double f (double x, void * params)
       return pow (x, 1.5);

     int main (void)
       gsl_function F;
       double result, abserr;

       F.function = &f;
       F.params = 0;

       printf ("f(x) = x^(3/2)\n");

       gsl_deriv_central (&F, 2.0, 1e-8, &result, &abserr);
       printf ("x = 2.0\n");
       printf ("f'(x) = %.10f +/- %.10f\n", result, abserr);
       printf ("exact = %.10f\n\n", 1.5 * sqrt(2.0));

       gsl_deriv_forward (&F, 0.0, 1e-8, &result, &abserr);
       printf ("x = 0.0\n");
       printf ("f'(x) = %.10f +/- %.10f\n", result, abserr);
       printf ("exact = %.10f\n", 0.0);

       return 0;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]