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

NAG CL Interface Introduction
Example description
/* nag_specfun_ellipint_legendre_1 (s21bec) Example Program.
 *
 * Copyright 2022 Numerical Algorithms Group.
 *
 * Mark 28.5, 2022.
 */
/* Pre-processor includes */
#include <nag.h>
#include <stdio.h>

int main(void) {
  /*Integer scalar and array declarations */
  Integer exit_status = 0;
  Integer ix;
  /*Double scalar and array declarations */
  double dm, f, phi, pi;
  NagError fail;

  INIT_FAIL(fail);

  printf("%s\n",
         "nag_specfun_ellipint_legendre_1 (s21bec) Example Program Results");
  printf("\n");
  printf("%s\n", "    phi    dm       nag_specfun_ellipint_legendre_1");
  printf("\n");
  pi = nag_math_pi;
  for (ix = 1; ix <= 3; ix++) {
    phi = ix * pi / 6.00e0;
    dm = ix * 0.250e0;
    /*
     * nag_specfun_ellipint_legendre_1 (s21bec)
     * Elliptic integral of 1st kind, Legendre form, F( phi |m)
     */
    f = nag_specfun_ellipint_legendre_1(phi, dm, &fail);
    if (fail.code != NE_NOERROR) {
      printf("Error from nag_specfun_ellipint_legendre_1 (s21bec).\n%s\n",
             fail.message);
      exit_status = 1;
      goto END;
    }
    printf("%7.2f%7.2f%12.4f\n", phi, dm, f);
  }

END:

  return exit_status;
}