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

NAG CL Interface Introduction
Example description
/* nag_specfun_ellipint_symm_1 (s21bbc) Example Program.
 *
 * Copyright 2021 Numerical Algorithms Group.
 *
 * Mark 27.3, 2021.
 */

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

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

  INIT_FAIL(fail);

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

END:
  return exit_status;
}