NAG Library Manual, Mark 30.2
Interfaces:  FL   CL   CPP   AD 

NAG CL Interface Introduction
Example description
/* nag_stat_prob_vonmises (g01erc) Example Program.
 *
 * Copyright 2024 Numerical Algorithms Group.
 *
 * Mark 30.2, 2024.
 */

#include <nag.h>
#include <stdio.h>

int main(void) {

  /* Scalars */
  double p, t, vk;
  Integer exit_status, i__, n;
  NagError fail;

  INIT_FAIL(fail);

  exit_status = 0;

  printf("nag_stat_prob_vonmises (g01erc) Example Program Results\n\n");

  /* Skip heading in data file */
  scanf("%*[^\n] ");
  scanf("%" NAG_IFMT "%*[^\n] ", &n);

  for (i__ = 1; i__ <= n; ++i__) {
    scanf("%lf%lf%*[^\n] ", &t, &vk);
    /* nag_stat_prob_vonmises (g01erc).
     * Computes probability for von Mises distribution
     */
    p = nag_stat_prob_vonmises(t, vk, &fail);
    if (fail.code != NE_NOERROR) {
      printf("Error from nag_stat_prob_vonmises (g01erc).\n%s\n", fail.message);
      exit_status = 1;
      goto END;
    }
    printf(" p = %10.4f\n", p);
  }
END:
  return exit_status;
}