kuiprsvn.c 412 B

123456789101112131415161718192021222324
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <grass/cdhc.h>
  4. #include "local_proto.h"
  5. double *Cdhc_kuipers_v(double *x, int n)
  6. {
  7. static double y[2];
  8. double *d, sqrtn;
  9. sqrtn = sqrt((double)n);
  10. d = Cdhc_dmax(x, n);
  11. y[1] = d[0] + d[1];
  12. y[0] = y[1] * (sqrtn + 0.05 + 0.82 / sqrtn);
  13. #ifdef NOISY
  14. fprintf(stdout, " TEST5 KV(N) =%10.4f\n", y[0]);
  15. #endif /* NOISY */
  16. return y;
  17. }