*
* $Id$
*
* $Log$
* Revision 1.1  1996/02/15 17:48:38  mclareni
* Initial revision
*
*
#include "kernnumt/pilot.h"
#if defined(CERNLIB_NEVER)
      SUBROUTINE C300ER(H,I,ISIGN,EREL,ECREL,F2REL)
      CHARACTER*1 H
      LOGICAL FIRST
      DOUBLE PRECISION CONST,X,CX,E,EC,F2,EREF,ECREF,F2REF
      DOUBLE PRECISION DERF,DERFC,DFREQ
#if (defined(CERNLIB_NUMCD)||defined(CERNLIB_NUMIB1)||defined(CERNLIB_NUMIB2)||defined(CERNLIB_NUMUC))&&(defined(CERNLIB_NUMOWNCODE))
      EXTERNAL ERF,ERFC,DERF,DERFC
#endif
      DATA FIRST/.TRUE./
C
C  USING X=X(I) TAKEN FROM THE TABLE IN SUBROUTINE C300GT (WITH NEG-
C  ATIVE SIGN IF ISIGN=2), SETS EREL, ECREL, F2REL TO THE APPROPRI-
C  ATELY WEIGHTED RELATIVE ERRORS IN THE FUNCTION VALUES ERF(X),
C  ERFC(X), FREQ(SQRT(2)*X), RESPECTIVELY.
C
C  CALLS ... FUNCTIONS ERF, ERFC, FREQ, DERF, DERFC, DFREQ.
C        ... TEST-ROUTINE C300GT.
C
C  START.
      IF(FIRST) CONST=DSQRT(2D0)
      FIRST=.FALSE.
      CALL C300GT(I,ISIGN,X,EREF,ECREF,F2REF)
      RX=X
      CX=CONST*X
      RCX=CX
      IF(H.EQ.'R') THEN
         E=ERF(RX)
         EC=ERFC(RX)
         F2=FREQ(RCX)
#if defined(CERNLIB_NUMLOPRE)
      ELSE
         E=DERF(X)
         EC=DERFC(X)
         F2=DFREQ(CX)
#endif
      ENDIF
      EREL=E-EREF
      ECREL=EC-ECREF
      F2REL=F2-F2REF
      IF(EREF.NE.0D0) EREL=EREL/DABS(EREF)
      IF(ECREF.NE.0D0) ECREL=ECREL/DABS(ECREF)
      IF(F2REF.NE.0D0) F2REL=F2REL/DABS(F2REF)
      IF(RX.GE.0.) ECREL=ECREL/(1.+RX**2)
      IF(RX.LT.0.) F2REL=F2REL/(1.+RX**2)
      RETURN
      END
#endif
