#include <gpk_std.h>
#include <stdio.h>
#include <math.h>
#include <numerics.h>


double f(double x, C void *p)
{
 C double *pp = (C double *)p;
 C double min = 0.123456789;

 return (x-min)*(x-min) + pp[0]*fabs(x-min);
}


main(int argc, char **argv)
{
 double p[1];

 p[0] = atof(argv[1]);

 mmze_out x = minimize(f, 0.0, 1.0,
				(C void *)p, 1e-8, 1e-12);

 printf("%g @ %g\n", x.x, x.y);
}

