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

NAG CL Interface Introduction
Example description
/* nag_specfun_ellipint_symm_3 (s21bdc) Example Program.
 *
 * Copyright 2023 Numerical Algorithms Group.
 *
 * Mark 29.3, 2023.
 */

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

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

  INIT_FAIL(fail);

  printf("nag_specfun_ellipint_symm_3 (s21bdc) Example Program Results\n");
  printf("      x      y      z      r       nag_specfun_ellipint_symm_3\n");

  for (ix = 1; ix <= 3; ix++) {
    x = ix * 0.5;
    for (iy = ix; iy <= 3; iy++) {
      y = iy * 0.5;
      for (iz = iy; iz <= 3; iz++) {
        z = iz * 0.5;
        r = 2.0;
        /* nag_specfun_ellipint_symm_3 (s21bdc).
         * Symmetrised elliptic integral of 3rd kind R_J(xyzr)
         */
        rj = nag_specfun_ellipint_symm_3(x, y, z, r, &fail);
        if (fail.code != NE_NOERROR) {
          printf("Error from "
                 "nag_specfun_ellipint_symm_3 (s21bdc).\n%s\n",
                 fail.message);
          exit_status = 1;
          goto END;
        }
        printf(" %7.2f%7.2f%7.2f%7.2f%12.4f\n", x, y, z, r, rj);
      }
    }
  }

END:
  return exit_status;
}