chiark / gitweb /
whoops, fix gradient
authorstevenj <stevenj@alum.mit.edu>
Sun, 2 Sep 2007 02:10:52 +0000 (22:10 -0400)
committerstevenj <stevenj@alum.mit.edu>
Sun, 2 Sep 2007 02:10:52 +0000 (22:10 -0400)
darcs-hash:20070902021052-c8de0-a9be63facbd050d1e2a61a62cce45c0175fca451.gz

test/testfuncs.c

index 06856f9e24f0514eaf4cee361a32b7d747507c32..cff30974aefa358a3b3d11e7cc18b46ccf2aa91a 100644 (file)
@@ -362,7 +362,7 @@ static double osc1d_f(int n, const double *x, double *grad, void *data)
 {
      double y = *x - 1.23456789;
      UNUSED(data);
-     if (grad) grad[0] = y*0.02 - sin(y - 2*sin(3*y)) * (1 - 6*cos(3*y));
+     if (grad) grad[0] = y*0.02 + sin(y - 2*sin(3*y)) * (1 - 6*cos(3*y));
      RETURN(sqr(y*0.1) - cos(y - 2*sin(3*y)));
 }