Actual source code: adintr_atan2.c

      1: /*
      2:   macro expansion:
      3:   function_driver -> adintr_atan2
      4:   exception number -> ADINTR_ATAN2
      5:   exceptional code ->

      7:   */

      9: #include <stdarg.h>
     10: #include "adintrinsics.h"
     11: #include "knr-compat.h"
     12: #if defined(__cplusplus)
     14: #endif

     16: /* #include "report-once.h" */
     17: void reportonce_accumulate Proto((int,int,int));

     20: /* The fy must be on a line by itself to be removed for funcs like sin(x). */
     21: void
     22: adintr_atan2 (int deriv_order, int file_number, int line_number,
     23:                  double*fx, double*fy, ...)
     24: {
     25:      /* Hack to make assignments to (*fxx) et alia OK, regardless */
     26:      double scratch;
     27:      double *fxx = &scratch;
     28:      double *fxy = &scratch;
     29:      double *fyy = &scratch;

     31:      const int exception = ADINTR_ATAN2;

     33:      va_list argptr;
     34:      va_start(argptr,fy);

     36:      if (deriv_order == 2)
     37:      {
     38:           fxx = va_arg(argptr, double *);
     39:           fxy = va_arg(argptr, double *);
     40:           fyy = va_arg(argptr, double *);
     41:      }

     43:      /* Here is where exceptional partials should be set. */
     44:      *fx = ADIntr_Partials[ADINTR_ATAN2][ADINTR_FX];
     45:      *fy = ADIntr_Partials[ADINTR_ATAN2][ADINTR_FY];
     46:      *fxx = ADIntr_Partials[ADINTR_ATAN2][ADINTR_FXX];
     47:      *fxy = ADIntr_Partials[ADINTR_ATAN2][ADINTR_FXY];
     48:      *fyy = ADIntr_Partials[ADINTR_ATAN2][ADINTR_FYY];

     51:      /* Here is where we perform the action appropriate to the current mode. */
     52:      if (ADIntr_Mode == ADINTR_REPORTONCE)
     53:      {
     54:           reportonce_accumulate(file_number, line_number, exception);
     55:      }
     56:
     57:      va_end(argptr);
     58: }
     59: #if defined(__cplusplus)
     60: }
     61: #endif