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

NAG CL Interface Introduction
Example description
/* nag_specfun_ellipint_symm_2 (s21bcc) Example Program.
 *
 * Copyright 2021 Numerical Algorithms Group.
 *
 * Mark 27.2, 2021.
 */

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

int main(void) {
  Integer exit_status = 0;
  double rd, x, y, z;
  Integer ix, iy;
  NagError fail;

  INIT_FAIL(fail);

  printf("nag_specfun_ellipint_symm_2 (s21bcc) Example Program Results\n");
  printf(
      "      x      y      z       nag_specfun_ellipint_symm_2 (s21bcc)  \n");
  for (ix = 1; ix <= 3; ix++) {
    x = ix * 0.5;
    for (iy = ix; iy <= 3; iy++) {
      y = iy * 0.5;
      z = 1.0;
      /* nag_specfun_ellipint_symm_2 (s21bcc).
       * Symmetrised elliptic integral of 2nd kind R_D(xyz)
       */
      rd = nag_specfun_ellipint_symm_2(x, y, z, &fail);
      if (fail.code != NE_NOERROR) {
        printf("Error from nag_specfun_ellipint_symm_2 (s21bcc).\n%s\n",
               fail.message);
        exit_status = 1;
        goto END;
      }
      printf(" %7.2f%7.2f%7.2f%12.4f\n", x, y, z, rd);
    }
  }

END:
  return exit_status;
}