anchor.diff:  C
           IMPLICIT DOUBLE PRECISION (A-B,D-H,O-Y)
           IMPLICIT COMPLEX*16 (C,Z)
  -        CB0=Z**N*CDEXP(-.25D0*Z*Z)
  +        CB0=Z**N*EXP(-.25D0*Z*Z)
           CR=(1.0D0,0.0D0)
           CDN=(1.0D0,0.0D0)
           DO 10 K=1,16
              CR=-0.5D0*CR*(2.0*K-N-1.0)*(2.0*K-N-2.0)/(K*Z*Z)
              CDN=CDN+CR
  -           IF (CDABS(CR).LT.CDABS(CDN)*1.0D-12) GO TO 15
  +           IF (ABS(CR).LT.ABS(CDN)*1.0D-12) GO TO 15
   10      CONTINUE
   15      CDN=CB0*CDN
           RETURN
  
positive.code:               GL=GL-DLOG(X0-1.0D0)
  15            X0=X0-1.0D0
          ENDIF
  20      IF (KF.EQ.1) GL=DEXP(GL)
          RETURN
          END
  
  
negative.code:            DO 10 K=1,500
                CR=-CR*K*Z/(K+1.0D0)**2
                CE1=CE1+CR
                IF (ABS(CR).LE.ABS(CE1)*1.0D-15) GO TO 15
  10         CONTINUE
  15         CONTINUE
             IF (X.LE.0.0.AND.DIMAG(Z).EQ.0.0) THEN
  C     Careful on the branch cut -- use the sign of the imaginary part
  C     to get the right sign on the factor if pi.
                CE1=-EL-LOG(-Z)+Z*CE1-DSIGN(PI,DIMAG(Z))*(0.0D0,1.0D0)
             ELSE
                CE1=-EL-LOG(Z)+Z*CE1
             ENDIF
          ELSE
  C          Continued fraction https://dlmf.nist.gov/6.9
  