Merge commit 'origin/stable'
[pspp-builds.git] / src / math / ts / innovations.c
index 553e20e8f7953a879595c3ddb0dce2e0e715b1dc..3ab2f3edce165ed0a709688e711867986683eee3 100644 (file)
  */
 
 #include <config.h>
+
+#include <math.h>
+#include <stdlib.h>
+
 #include <gsl/gsl_matrix.h>
 #include <gsl/gsl_vector.h>
-#include <stdlib.h>
 #include <libpspp/compiler.h>
+#include <libpspp/misc.h>
 #include <math/coefficient.h>
 #include <math/ts/innovations.h>
 
@@ -160,7 +164,7 @@ innovations_update_scale (struct innovations_estimate *est, double *theta,
       for (j = 0; j < i; j++)
        {
          k = i - j - 1;
-         result -= theta[k] * theta[k] * est->scale[j];
+         result -= pow2 (theta[k]) * est->scale[j];
        }
       est->scale[i] = result;
     }