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

NAG CL Interface Introduction
Example description
/* nag_specfun_airy_bi_complex (s17dhc) Example Program.
 *
 * Copyright 2022 Numerical Algorithms Group.
 *
 * Mark 28.6, 2022.
 */

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

int main(void) {
  Integer exit_status = 0;
  Complex z, bi;
  char nag_enum_deriv[40], nag_enum_scal[40];
  Nag_ScaleResType scal;
  Nag_FunType deriv;
  NagError fail;

  INIT_FAIL(fail);

  /* Skip heading in data file */
  scanf("%*[^\n]");
  printf("nag_specfun_airy_bi_complex (s17dhc) Example Program Results\n");
  printf("    deriv               z              scal                bi\n");
  while (scanf(" %39s (%lf,%lf) %39s%*[^\n] ", nag_enum_deriv, &z.re, &z.im,
               nag_enum_scal) != EOF) {
    /* nag_enum_name_to_value (x04nac).
     * Converts NAG enum member name to value
     */
    deriv = (Nag_FunType)nag_enum_name_to_value(nag_enum_deriv);
    scal = (Nag_ScaleResType)nag_enum_name_to_value(nag_enum_scal);

    /* nag_specfun_airy_bi_complex (s17dhc).
     * Airy functions Bi(z), complex z
     */
    nag_specfun_airy_bi_complex(deriv, z, scal, &bi, &fail);
    if (fail.code != NE_NOERROR) {
      printf("Error from nag_specfun_airy_bi_complex (s17dhc).\n%s\n",
             fail.message);
      exit_status = 1;
      goto END;
    }
    printf(" %-12s  (%7.3f,%7.3f)  %-14s  (%7.3f,%7.3f)\n", nag_enum_deriv,
           z.re, z.im, nag_enum_scal, bi.re, bi.im);
  }

END:

  return exit_status;
}