Actual source code: adintr_acos.c

      1: /*
      2:   macro expansion:
      3:   function_driver -> adintr_acos
      4:   exception number -> ADINTR_ACOS
      5:   exceptional code ->
      6: *fx = ADIntr_Partials[ADINTR_ACOS][ADINTR_FX];
      7: *fxx = ADIntr_Partials[ADINTR_ACOS][ADINTR_FXX];

      9:   */

     11: #include <stdarg.h>
     12: #include "adintrinsics.h"
     13: #include "knr-compat.h"

     15: #if defined(__cplusplus)
     17: #endif

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

     24: void
     25: adintr_acos (int deriv_order, int file_number, int line_number, double*fx, ...)
     26: {
     27:      /* Hack to make assignments to (*fxx) et alia OK, regardless */
     28:      double scratch;
     29:      double *fxx = &scratch;

     31:      const int exception = ADINTR_ACOS;

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

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

     41:      /* Here is where exceptional partials should be set. */
     42: *fx = ADIntr_Partials[ADINTR_ACOS][ADINTR_FX];
     43: *fxx = ADIntr_Partials[ADINTR_ACOS][ADINTR_FXX];

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