Differentiation is performed by descendants of o2scl::deriv_base. These allow one to calculate either first, second, and third derivatives. A GSL-based routine is used in o2scl::deriv_gsl, and the CERNLIB routine is used in o2scl::deriv_cern. For functions which are tabulated over equally-spaced abscissas, the class o2scl::deriv_eqi is provided which applies the formulas from Abramowitz and Stegun at a specified order. The class o2scl::deriv_cern is slower and sometimes more accurate, but also fails more often than o2scl::deriv_gsl, which never calls the error handler.
Warning: For o2scl::deriv_gsl and o2scl::deriv_cern, the second and third derivatives are calculated by naive repeated application of the code for the first derivative and can be particularly troublesome if the function is not sufficiently smooth. Error estimation is not provided for second and third derivatives.
This example computes first and second derivatives of
with both o2scl::deriv_gsl and o2scl::deriv_cern .
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).