diff --git a/ex-1/tests.c b/ex-1/tests.c index 09bb892..b2e85f8 100644 --- a/ex-1/tests.c +++ b/ex-1/tests.c @@ -60,7 +60,7 @@ double neg_landau_pdf(double x, void* params) { * interval for the optimisation. */ double numeric_mode(double min, double max) { - // create funtion + // create function gsl_function pdf; pdf.function = &neg_landau_pdf; pdf.params = NULL; @@ -86,6 +86,8 @@ double numeric_mode(double min, double max) { } while (status == GSL_CONTINUE && iter < max_iter); + fprintf(stderr, "mode error: %.3g\n", max - min); + // Free memory gsl_min_fminimizer_free(s); return guess; @@ -107,7 +109,7 @@ double abs_landau_pdf(double x, void* params_) { * computer with `numeric_mode(min, max)`. */ double numeric_fwhm(double min, double max, double mode) { - // create funtion + // create function gsl_function pdf; pdf.function = &abs_landau_pdf; double params [1];