예제 #1
0
int TSIL_Tanalytic (TSIL_REAL X,
                    TSIL_REAL Y,
                    TSIL_REAL Z,
                    TSIL_COMPLEX S,
                    TSIL_REAL QQ,
                    TSIL_COMPLEX *result)
{
    TSIL_REAL tmp;
    int success = 1;

    if (Y < Z) {
        tmp = Z;
        Z = Y;
        Y = tmp;
    }

    if (X < TSIL_TOL) {
        TSIL_Warn("Tanalytic", "T(x,y,z) is undefined for x = 0.");
        *result = TSIL_Infinity;
    }
    else if (Z < TSIL_TOL)
        *result = TSIL_Tx0y (X,Y,S,QQ);
    else if (TSIL_CABS(S) < TSIL_TOL)
        *result = TSIL_TAtZero(X, Y, Z, QQ);
    else if (TSIL_CABS(S-X) + TSIL_FABS(Y-Z) < TSIL_TOL)
        *result = TSIL_TxyyAtx(X,Y,QQ);
    else if (TSIL_CABS(S-Z) + TSIL_FABS(Y-X) < TSIL_TOL)
        *result = TSIL_TyyxAtx(Z,Y,QQ);
    else if (TSIL_CABS(S-Y) + TSIL_FABS(Z-X) < TSIL_TOL)
        *result = TSIL_TyyxAtx(Y,X,QQ);
    else success = 0;

    return success;
}
예제 #2
0
파일: trilog.c 프로젝트: BAllanach/softsusy
TSIL_COMPLEX TSIL_Trilogunitdisk (TSIL_COMPLEX z)
{
  TSIL_COMPLEX result;
  TSIL_REAL rez = TSIL_CREAL (z);
  TSIL_REAL absz = TSIL_CABS (z);
  TSIL_REAL absimz = TSIL_FABS (TSIL_CIMAG (z));

  if (TSIL_CABS(z - 1.0L) < 2.0L * TSIL_TOL)
    result = cZeta3;
  else if (TSIL_CABS(z) < 2.0L * TSIL_TOL)
    result = 0.0L;
  else if (TSIL_CABS(TSIL_CLOG(z)) < trilog_CLZseries_radius)
    result = TSIL_TrilogCLZseries (z);
  else if (absz <= trilog_powerseries_radius)
    result = TSIL_Trilogseries (z);
  else if (rez <= 0.0L)
    result = TSIL_TrilogregionA (z);
  else if (rez <= absimz)
    result = TSIL_TrilogregionB (z);
  else {
    TSIL_Warn("TSIL_Trilogunitdisk", "trilog function yielding undefined result.");
    result = TSIL_Infinity;
  }

  return result;
}
예제 #3
0
파일: analyticAB.c 프로젝트: apik/mr
TSIL_COMPLEX TSIL_Bp (TSIL_REAL X, TSIL_REAL Y, TSIL_COMPLEX S, TSIL_REAL QQ)
{
  if (X < TSIL_TOL) {
    TSIL_Warn("Bp", "B(x',y) is undefined for x=0.");
    return TSIL_Infinity;
  }

  if (TSIL_CABS(1.0L - S/(X+Y+2.0L*TSIL_SQRT(X*Y))) < TSIL_TOL) {
    TSIL_Warn("Bp", "B(x',y) is undefined at s = (sqrt(x) + sqrt(y))^2.");
    return TSIL_Infinity;
  }

  if (TSIL_CABS(S) < TSIL_TOL) {
    if (TSIL_FABS(1.0L - X/Y) < TSIL_TOL)
      return (-0.5L/X);
    else
      return 1.0L/(Y-X) + Y*TSIL_LOG(X/Y)/((Y-X)*(Y-X));
  }

  if (TSIL_CABS(1.0L - (X + Y - 2.0L*TSIL_SQRT(X*Y))/S) < TSIL_TOL) 
    return (1.0L - TSIL_SQRT(Y/X) +0.5L*TSIL_LOG(Y/X))/(X + Y - 2.0L*TSIL_SQRT(X*Y));
  else
    return ((X-Y-S)*TSIL_B(X,Y,S,QQ) + (X+Y-S)*TSIL_LOG(X/QQ) 
	    -2.0L*TSIL_A(Y,QQ) + 2.0L*(S-X))/TSIL_Delta(S,X,Y);
}
예제 #4
0
파일: trilog.c 프로젝트: BAllanach/softsusy
TSIL_COMPLEX TSIL_TrilogCLZseries(TSIL_COMPLEX z)
{
  TSIL_COMPLEX logz, logzsquared, logztothek, term;
  TSIL_COMPLEX first6terms, remainingterms, result;
  TSIL_REAL accuracygoal;
  int j;

  logz = TSIL_CLOG(z);
  logzsquared = logz*logz;
  logztothek = logzsquared*logzsquared*logzsquared;

  first6terms = logztothek/86400.0L;
  first6terms += -logzsquared*logzsquared/288.0L;
  first6terms += -logzsquared*logz/12.0L;
  first6terms += (0.75L - 0.5L*TSIL_CLOG(-logz))*logzsquared;
  first6terms += cZeta3 + cZeta2*logz; 
  
  accuracygoal = TSIL_TOL* TSIL_CABS (first6terms);
  remainingterms = 0.0L;

  for (j=0; j< 25; j++)
    {
      logztothek = logztothek*logzsquared;
      term = CLZcoeffs_trilog[j]*logztothek;
      remainingterms += term;
      if (TSIL_CABS (term) < accuracygoal) 
	break;
      if (j == 24)
        TSIL_Warn("TSIL_TrilogCLZseries", "trilog CLZ series converging too slowly.");
    }

  result = remainingterms + first6terms;

  return result;
}
예제 #5
0
int SUMO_Update ()
{
  TSIL_COMPLEX bphase;

  if (TSIL_CABS(b) > TSIL_TOL)
    bphase = (b)/TSIL_CABS(b);
  else
    bphase = 1.0;

  b = SUMO_CABS(b);
  mu = mu/bphase;

  Q2 = Q*Q;

  g2 = g*g;
  gp2 = gp*gp;
  g2plusgp2 = g2 + gp2;

  if (g2plusgp2 < TSIL_TOL) e2 = 0.0;
  else e2 = g2*gp2/g2plusgp2;

  e = SUMO_SQRT(e2);

  vu2 = vu*vu;
  vd2 = vd*vd;
  v2 = vu2 + vd2;
  vuvd = vu*vd;

  if (vd > TSIL_TOL) tanbeta = vu/vd; else tanbeta = 666;

  if (v2 > TSIL_TOL) {
    sinbeta = vu/TSIL_SQRT(v2);
    cosbeta = vd/TSIL_SQRT(v2);
  } else{
    sinbeta = 0;
    cosbeta = 0;
  }

  ytop2 = ytop*ytop;
  ybot2 = ybot*ybot;
  ytau2 = ytau*ytau;

  muc = SUMO_CONJ(mu);
  mu2 = TSIL_CREAL(mu*muc);
  atopc = SUMO_CONJ(atop);
  abotc = SUMO_CONJ(abot);
  atauc = SUMO_CONJ(atau);

  is_updated = 1;
  return 0;
}
예제 #6
0
파일: analyticAB.c 프로젝트: apik/mr
TSIL_COMPLEX TSIL_B0x (TSIL_REAL X, TSIL_COMPLEX S, TSIL_REAL QQ)
{
  if (TSIL_FABS (X) < TSIL_TOL)
    return TSIL_B00(S,QQ);

  if (TSIL_CABS (S) < TSIL_TOL)
    return (1.0L - TSIL_LOG (X/QQ));

  if (TSIL_CABS (1.0L - S/X) < 10.0L*TSIL_TOL)
    return 2.0L - TSIL_LOG(X/QQ);

  S = TSIL_AddIeps(S);  
  return 2.0L + ((X - S)*TSIL_CLOG((X - S)/QQ) - X*TSIL_LOG(X/QQ))/S;
}
예제 #7
0
TSIL_COMPLEX TSIL_Tx0y (TSIL_REAL X, TSIL_REAL Y, TSIL_COMPLEX S,
                        TSIL_REAL QQ)
{
    TSIL_COMPLEX sqDeltaSXY, tp, tm, log1mtp, log1mtm;
    TSIL_REAL    lnbarX, lnbarY;

    if (X < TSIL_TOL) {
        TSIL_Warn("TSIL_Tx0y", "T(x,0,y) is undefined for x = 0.");
        return TSIL_Infinity;
    }

    if (TSIL_CABS(S) < TSIL_TOL) return -TSIL_I2p(X, 0.0L, Y, QQ);
    if (Y < TSIL_TOL) return TSIL_Tx00(X, S, QQ);

    S = TSIL_AddIeps(S);
    sqDeltaSXY = TSIL_CSQRT(X*X + Y*Y + S*S - 2.0L*X*Y - 2.0L*X*S - 2.0L*Y*S);
    lnbarX = TSIL_LOG(X/QQ);
    lnbarY = TSIL_LOG(Y/QQ);
    tp = (Y - X + S + sqDeltaSXY)/(2.0L * Y);
    tm = (Y - X + S - sqDeltaSXY)/(2.0L * Y);
    log1mtp = TSIL_CLOG(1.0L - tp);
    log1mtm = TSIL_CLOG(1.0L - tm);

    return (-TSIL_Dilog (tp) - TSIL_Dilog (tm) + (1.0L - Y/S)*log1mtp*log1mtm
            + sqDeltaSXY * (log1mtp - log1mtm) / (2.0L * S)
            + lnbarX*lnbarY - 0.5L*(lnbarY + 1.0L)*(lnbarY + 1.0L)
            + (3.0L*S + Y - X) *(lnbarY-lnbarX)/(2.0L * S));
}
예제 #8
0
파일: trilog.c 프로젝트: BAllanach/softsusy
TSIL_COMPLEX TSIL_Trilogseries (TSIL_COMPLEX z)
{
  TSIL_REAL absz = TSIL_CABS (z);
  TSIL_REAL logepsilon = TSIL_LOG (TSIL_TOL);
  TSIL_REAL mlogabsz;
  TSIL_COMPLEX sum = z;
  TSIL_COMPLEX ztothek;
  TSIL_COMPLEX term;
  TSIL_COMPLEX kcubed;
  int k, kmax;

  mlogabsz = -TSIL_CLOG (absz);

/*
  The following kmax is hopefully designed to give accuracy to within
  e^logepsilon, with some safety margin built in. Not completely
  tested, but it seems good enough for government work anyway.
*/

  kmax = 5 + (int) (( 6.0 -logepsilon -3.0 * log(-logepsilon)
		      + 3.0 * log (mlogabsz)) / mlogabsz);

  for (k = kmax; k > 1; k--)
    {
      ztothek = TSIL_CPOW (z, k);
      kcubed = k*k*k;
      term = ztothek/kcubed;
      sum += term;
    }

  return sum;
}
예제 #9
0
TSIL_COMPLEX SUMO_dBds (TSIL_REAL x,
			TSIL_REAL y,
			TSIL_COMPLEX s,
			TSIL_REAL qq,
			int interp)
{
  TSIL_COMPLEX snew, dBdsplus, dBdsminus;
  TSIL_REAL delta;

  if (interp == NO) return TSIL_dBds (x,y,s,qq);

  delta = TSIL_CABS(s)/TSIL_POW(TSIL_SQRT(x)+TSIL_SQRT(y), 2) - 1.0L;

  if (TSIL_FABS(delta) > THRESH_TOL)
    return TSIL_dBds (x,y,s,qq);

  /* If we get here we interpolate: */
  snew = (1.0L + THRESH_TOL)*s;
  dBdsplus = TSIL_dBds (x,y,snew,qq);

  snew = (1.0L - THRESH_TOL)*s;
  dBdsminus = TSIL_dBds (x,y,snew,qq);

  return 0.5L*(1.0L + delta/THRESH_TOL)*dBdsplus + 
         0.5L*(1.0L - delta/THRESH_TOL)*dBdsminus;
}
예제 #10
0
파일: analyticAB.c 프로젝트: apik/mr
TSIL_COMPLEX TSIL_B00 (TSIL_COMPLEX S, TSIL_REAL QQ)
{
  if (TSIL_CABS (S) < TSIL_TOL) {
    TSIL_Warn("TSIL_B00", "B(0,0) is undefined when s=0."); 
    return TSIL_Infinity;
  }

  S = TSIL_AddIeps(S);    
  return (2.0L - TSIL_CLOG(-S/QQ));
}
예제 #11
0
파일: analyticAB.c 프로젝트: apik/mr
TSIL_COMPLEX TSIL_dBds (TSIL_REAL x,
			TSIL_REAL y,
			TSIL_COMPLEX s,
			TSIL_REAL qq)
{
  TSIL_REAL thxy, psxy, sqrtx, sqrty, alphax, alphay, temp;
  TSIL_COMPLEX Btemp, result;

  if (x < y) {temp = y; y = x; x = temp;}

  if (x + TSIL_CABS(s) < TSIL_TOL) {
    TSIL_Warn("TSIL_dBds", "dBds(0,0) is undefined when s=0.");
    return TSIL_Infinity;
  }

  if (TSIL_CABS(s/x) < TSIL_TOL) return TSIL_BprimeAtZero (x, y, qq);

  thxy = TSIL_Th2 (x, y);
  psxy = TSIL_Ps2 (x, y);
  sqrtx = TSIL_SQRT(x);
  sqrty = TSIL_SQRT(y);
  alphax = TSIL_Alpha(x,qq);
  alphay = TSIL_Alpha(y,qq);
  
  if (TSIL_CABS(1.0L - s/thxy) < TSIL_TOL) {
    TSIL_Warn("TSIL_dBds", "dBds(x,y) is undefined at threshold.");
    return TSIL_Infinity;
  }

  if (TSIL_CABS(1.0L - s/psxy) < TSIL_TOL) {
    return (0.5L * alphax * (1.0L + sqrty/sqrtx) 
	    - 0.5L * alphay * (1.0L + sqrtx/sqrty)
	    + 2.0L * (sqrty - sqrtx) )/TSIL_POW(sqrtx - sqrty,3);
  }

  Btemp = TSIL_B (x, y, s, qq);

  result = (0.5L/s) * (
           (thxy * Btemp - s + (sqrtx + sqrty)*(alphax + alphay))/(s - thxy)
         + (psxy * Btemp - s + (sqrtx - sqrty)*(alphax - alphay))/(s - psxy));
 
  return result;
}
예제 #12
0
파일: trilog.c 프로젝트: BAllanach/softsusy
TSIL_COMPLEX TSIL_Trilog (TSIL_COMPLEX z)
{
  TSIL_COMPLEX result;
  
  if (TSIL_CABS(z) > 1.0L)
    result = TSIL_Trilogoutofunitdisk (z);
  else
    result = TSIL_Trilogunitdisk (z);

  return result;
}
예제 #13
0
TSIL_COMPLEX TSIL_Tx00 (TSIL_REAL X, TSIL_COMPLEX S, TSIL_REAL QQ)
{
    TSIL_REAL lnbarX;

    if (X < TSIL_TOL) {
        TSIL_Warn("TSIL_Tx00", "T(x,0,0) is undefined for x = 0.");
        return TSIL_Infinity;
    }

    if (TSIL_CABS(S) < TSIL_TOL) return -TSIL_I2p(X, 0.0L, 0.0L, QQ);

    lnbarX = TSIL_LOG(X/QQ);

    if (TSIL_CABS (1.0L - S/X) < 10.0L*TSIL_TOL)
        return 2.0L*Zeta2 -0.5L -lnbarX + 0.5L*lnbarX*lnbarX;

    S = TSIL_AddIeps(S);

    return Zeta2 - 0.5L + (1.0L - X/S)*TSIL_CLOG(1.0L -S/X)
           -lnbarX + 0.5L*lnbarX*lnbarX + TSIL_Dilog (S/X);
}
예제 #14
0
파일: analyticAB.c 프로젝트: apik/mr
TSIL_COMPLEX TSIL_Beps0x (TSIL_REAL x, TSIL_COMPLEX s, TSIL_REAL qq)
{
  TSIL_COMPLEX sqrtx, lnbarx, log1msox, lnbarms;

  if (TSIL_CABS(s) < TSIL_TOL) return TSIL_BepsAtZero (0, x, qq);

  if (x < TSIL_TOL) {
    lnbarms = TSIL_CLOG(-TSIL_AddIeps(s)/qq);
    return 4.0L - Zeta2/2.0L - 2.0L*lnbarms + lnbarms*lnbarms/2.0L;
  }

  sqrtx = TSIL_CSQRT(x);
  lnbarx = TSIL_CLOG(x/qq);

  if (TSIL_CABS(1 - s/x) < 10.0*TSIL_TOL)
    return 4.0L + Zeta2/2.0L + lnbarx*(lnbarx - 4.0L)/2.0L;

  log1msox = TSIL_CLOG(1.0L - TSIL_AddIeps(s)/x);

  return 4.0L + Zeta2/2.0L - 2.0L*lnbarx + lnbarx*lnbarx/2.0L 
         + (1.0L - x/s)*(lnbarx*log1msox - 2.0L*log1msox 
         + log1msox*log1msox/2.0L -TSIL_Dilog(s/(s-x)));
}
예제 #15
0
파일: analyticAB.c 프로젝트: apik/mr
TSIL_COMPLEX TSIL_B (TSIL_REAL X, TSIL_REAL Y, TSIL_COMPLEX S, TSIL_REAL QQ)
{
  TSIL_REAL    temp;
  TSIL_COMPLEX sqDeltaSXY, lnbarX, lnbarY;

  if (TSIL_FABS (X) < TSIL_FABS (Y)) {temp = Y; Y = X; X = temp;}

  if (TSIL_FABS (X) < TSIL_TOL)
    return TSIL_B00(S,QQ);

  if (TSIL_FABS (Y) < TSIL_TOL)
    return TSIL_B0x(X,S,QQ);

  if (TSIL_CABS (S) < TSIL_TOL) {
    if (TSIL_FABS (1.0L - Y/X) > 0.0L)
      return (1.0L + (Y*TSIL_LOG(Y/QQ) - X*TSIL_LOG(X/QQ))/(X-Y));
    else 
      return (-TSIL_LOG (X/QQ));
  }

  S = TSIL_AddIeps(S);   
  sqDeltaSXY = TSIL_CSQRT(TSIL_Delta(S, X, Y));
  lnbarX = TSIL_LOG (X/QQ);
  lnbarY = TSIL_LOG (Y/QQ);

  /* Following avoids roundoff error for very negative s. */
  if ((TSIL_CREAL(S) < -10.0L*(X+Y)) && (TSIL_CIMAG(S) < TSIL_TOL)) {   
    return (2.0L - 0.5L * (lnbarX + lnbarY) +
	  (sqDeltaSXY * TSIL_CLOG(0.5L*(X + Y - S + sqDeltaSXY)/Y) +
	   0.5L * (Y - X - sqDeltaSXY) * (lnbarX - lnbarY))/S);
  }

  return (2.0L - 0.5L * (lnbarX + lnbarY) +
	  (-sqDeltaSXY * TSIL_CLOG(0.5L*(X + Y - S - sqDeltaSXY)/X) +
	   0.5L * (Y - X - sqDeltaSXY) * (lnbarX - lnbarY))/S);
}
예제 #16
0
파일: analyticAB.c 프로젝트: apik/mr
TSIL_COMPLEX TSIL_Beps (TSIL_REAL X, TSIL_REAL Y, TSIL_COMPLEX S, TSIL_REAL QQ)
{
  TSIL_COMPLEX sqrtdeltasxy, t1, t2, t3, t4, logt1, logt2, logt3, logt4;
  TSIL_COMPLEX log1mt1, log1mt2, sqrtx, sqrty, lnbarx, lnbary;
  TSIL_REAL temp;

  if (X < Y) {temp = X; X = Y; Y = temp;}

  if (TSIL_CABS(S) < TSIL_TOL) return TSIL_BepsAtZero (X, Y, QQ);

  if (Y < TSIL_TOL) return TSIL_Beps0x (X, S, QQ);
  
  sqrtx = TSIL_CSQRT(X);
  sqrty = TSIL_CSQRT(Y);
  lnbarx = TSIL_CLOG(X/QQ);
  lnbary = TSIL_CLOG(Y/QQ);

  if (TSIL_CABS(S - (sqrtx + sqrty)*(sqrtx + sqrty))/(X+Y) < 10.0*TSIL_TOL) 
    return 4.0L + Zeta2/2.0L 
           + (sqrtx*lnbarx*(lnbarx - 4.0L) + 
	      sqrty*lnbary*(lnbary - 4.0L))/(2.0L*(sqrtx + sqrty)); 

  if (TSIL_CABS(S - (sqrtx - sqrty)*(sqrtx - sqrty))/(X+Y) < 10.0*TSIL_TOL) 
    return 4.0L + Zeta2/2.0L 
           + (sqrtx*lnbarx*(lnbarx - 4.0L) - 
	      sqrty*lnbary*(lnbary - 4.0L))/(2.0L*(sqrtx - sqrty)); 

  S = TSIL_AddIeps(S);

  sqrtdeltasxy = TSIL_CSQRT(TSIL_Delta(S,X,Y));

  t1 = ( S - X + Y + sqrtdeltasxy)/(2.0L*sqrtdeltasxy);
  t2 = (-S - X + Y + sqrtdeltasxy)/(2.0L*sqrtdeltasxy);
  t3 = (-S + X + Y + sqrtdeltasxy)/(2.0L*X);
  t4 = (-S + X + Y - sqrtdeltasxy)/(2.0L*X);

/*   printf("\ns = ");TSIL_cprintf(S);printf("\n"); */
/*   printf("x = %Lf\n", X); */
/*   printf("y = %Lf\n", Y); */
/*   printf("sqrtdeltasxy = ");TSIL_cprintf(sqrtdeltasxy);printf("\n"); */

/*   printf("\nt1    = ");TSIL_cprintf(t1);printf("\n"); */
/*   printf("t2    = ");TSIL_cprintf(t2);printf("\n"); */
/*   printf("t3    = ");TSIL_cprintf(t3);printf("\n"); */
/*   printf("t4    = ");TSIL_cprintf(t4);printf("\n"); */
  
  logt1 = TSIL_CLOG(t1);
  logt2 = TSIL_CLOG(t2);
  logt3 = TSIL_CLOG(t3);
  logt4 = TSIL_CLOG(t4);

/*   printf("\nlogt1 = ");TSIL_cprintf(logt1);printf("\n"); */
/*   printf("logt2 = ");TSIL_cprintf(logt2);printf("\n"); */
/*   printf("logt3 = ");TSIL_cprintf(logt3);printf("\n"); */
/*   printf("logt4 = ");TSIL_cprintf(logt4);printf("\n"); */

  log1mt1 = TSIL_CLOG(1.0L - t1);
  log1mt2 = TSIL_CLOG(1.0L - t2);

  return 4.0L + Zeta2/2.0L + (lnbarx*lnbarx + lnbary*lnbary)/4.0L 
         - lnbarx - lnbary + (sqrtdeltasxy*(TSIL_Dilog(t2) - TSIL_Dilog(t1) 
              + (logt3 - logt4)*(1.0L - lnbarx/4.0L - lnbary/4.0L) 
              + (log1mt1 + log1mt2)*(logt2 - logt1)/2.0L) 
         + (X - Y)*(lnbary - lnbarx)*(1.0L - lnbarx/4.0L - lnbary/4.0L))/S;
}
예제 #17
0
int TSIL_Integrate (TSIL_DATA    *foo,
		    TSIL_COMPLEX t0,
		    TSIL_COMPLEX t1,
		    int          max_steps,
		    int          intmode,
		    TSIL_REAL    sthresh)
{
  TSIL_COMPLEX t, dt;
  TSIL_REAL pre_error = foo->precisionGoal;
  int force_step;
  int rkmode = 0;
  int goodsteps, badsteps; 
  int rk6status = 1; /* 1 for success or forced; 0 for need retry, 
                        -1 when the error is big and we need to bail. */

  goodsteps = badsteps = 0;

  if (intmode > 0)
    rkmode = intmode - 1;

  t  = t0;
  dt = (t1 - t0)/(foo->nStepsStart);
           
  /* Note in the following line, rk6status can be 1 or -1, but never 0 */    
  while ( (TSIL_CABS(dt) < 0.5*TSIL_CABS(t1-t)) && (1 == rk6status)) {
    for (;;) {
      if ( TSIL_CABS(dt) < TSIL_CABS(t1-t0)/max_steps ) {
        force_step = 1;
        dt = (t1-t0)/max_steps;
      }
      else force_step = 0;

      if (TSIL_CABS(dt) > TSIL_CABS(t1-t0)/(foo->nStepsMin))
        dt = (t1-t0)/(foo->nStepsMin);

      rk6status = foo->RKstepper6 (foo, &t, &dt, sthresh, rkmode, 
				   pre_error, force_step);

      if (0 != rk6status) { 
	goodsteps += (1-force_step);
	badsteps += force_step;
	break;
      }
    }
  }

  /* If the error got too big, it's over. Do not pass Go, do not
     collect $200. */
  if (-1 == rk6status) return 0;

  /* The remaining distance is less than twice the step size.  So, for
     the next-to-last step, go half the distance to the goal, and
     force it. Too many small steps here could be bad if there is a
     (pseudo)-threshold. */

  dt = 0.5L*(t1 - t);
  foo->RKstepper6 (foo, &t, &dt, sthresh, rkmode, pre_error, 1);

  /* Arrange final step to land exactly on t1, and force it. */
  dt = t1 - t;

  if ((0 == intmode) || (3 == intmode)) 
    foo->RKstepper6 (foo, &t, &dt, sthresh, rkmode, pre_error, 1);
  else 
    foo->RKstepper5 (foo, &t, dt, sthresh, rkmode);       

  /* Return a status code eventually */
  return 0;
}
예제 #18
0
파일: testprog.c 프로젝트: pathron/softsusy
void TSIL_Compare (const char   *name,
                   TSIL_COMPLEX actual,
                   TSIL_COMPLEX computed,
                   TSIL_REAL    allow_pass,
                   TSIL_REAL    allow_warn,
                   int          *result)
{
    TSIL_REAL a_re, a_im, c_re, c_im, magnitude, err;
    int foo;

    a_re = TSIL_CREAL (actual);
    a_im = TSIL_CIMAG (actual);
    c_re = TSIL_CREAL (computed);
    c_im = TSIL_CIMAG (computed);
    magnitude = TSIL_CABS (actual) + TSIL_TOL;

    /* DGR */
    if (TSIL_IsInfinite (actual))
    {
        if (TSIL_IsInfinite (computed))
            foo = PASS * PASS;
        else
            foo = FAIL;
    }
    else
    {
        /* Check Real part */
        err = TSIL_FABS (a_re - c_re) / magnitude;

        if (err < allow_pass)
            foo = PASS;
        else if (err < allow_warn)
            foo = WARN;
        else {
            /* 	printf("\nFailure in re part: err = %Le\n", (long double) err); */
            foo = FAIL;
        }

        /* Check Imaginary part */
        err = TSIL_FABS (a_im - c_im) / magnitude;

        if (err < allow_pass)
            foo *= PASS;
        else if (err < allow_warn)
            foo *= WARN;
        else {
            /* 	printf("\nFailure in im part: err = %Le\n", (long double) err); */
            foo *= FAIL;
        }
    }

    if (foo == 4)
        *result = PASS;
    else if (foo == 1 || foo == 2)
    {
        *result = WARN;
        printf ("\nWARN\n");
        printf ("Expected for %s: ", name);
        TSIL_cprintfM (actual);
        printf ("\n");
        printf ("Obtained for %s: ", name);
        TSIL_cprintfM (computed);
        printf ("\n");
    }
    else if (foo == 0)
    {
        *result = FAIL;
        printf ("\nFAIL\n");
        printf ("Expected for %s: ", name);
        TSIL_cprintfM (actual);
        printf ("\n");
        printf ("Obtained for %s: ", name);
        TSIL_cprintfM (computed);
        printf ("\n");
    }
    else
        printf ("NOPE! Can't EVER get here in TSIL_Compare!!!\n");

    return;
}
예제 #19
0
SUMO_COMPLEX SUMO_V2_strong (void)
{ 
  int i,j;
  TSIL_REAL g3sq = g3*g3;
  TSIL_REAL qq = Q2;
  TSIL_COMPLEX V2_strong_sqsq = 0.0L;
  TSIL_COMPLEX V2_strong_qgluinosq = 0.0L;
  TSIL_COMPLEX V2_strong_sqsqg = 0.0L;
  TSIL_COMPLEX V2_strong_qqg;
  
  /* ------------------------------------------------------------------- */
  /* hep-ph/0206136 eq. (3.14) */

  for (i=0; i<2; i++) {
    V2_strong_sqsq += SUMO_Fvac_SS (m2_suL[i], m2_suL[i], qq);
    V2_strong_sqsq += SUMO_Fvac_SS (m2_sdL[i], m2_sdL[i], qq);
    V2_strong_sqsq += SUMO_Fvac_SS (m2_suR[i], m2_suR[i], qq);
    V2_strong_sqsq += SUMO_Fvac_SS (m2_sdR[i], m2_sdR[i], qq);
  }

  for (i=0; i<2; i++) {
    for (j=0; j<2; j++) {
      V2_strong_sqsq +=
	SUMO_Fvac_SS (m2_stop[i], m2_stop[j], qq) *
	TSIL_POW(TSIL_CABS((Lstop[i]) * (Lstopc[j])
			   -(Rstop[i]) * (Rstopc[j])),2);

      V2_strong_sqsq +=
	SUMO_Fvac_SS (m2_sbot[i], m2_sbot[j], qq) *
	TSIL_POW(TSIL_CABS((Lsbot[i]) * (Lsbotc[j])
			   -(Rsbot[i]) * (Rsbotc[j])),2);
    }}

  V2_strong_sqsq *= 2.0L * g3sq;

  /* ------------------------------------------------------------------- */
  /* equation (3.25) */

  for (i=0; i<2; i++) {
    V2_strong_qgluinosq +=
      SUMO_Fvac_FFS (0.L, m2_gluino, m2_suL[i], qq);
    V2_strong_qgluinosq +=
      SUMO_Fvac_FFS (0.L, m2_gluino, m2_sdL[i], qq);
    V2_strong_qgluinosq +=
      SUMO_Fvac_FFS (0.L, m2_gluino, m2_suR[i], qq);
    V2_strong_qgluinosq +=
      SUMO_Fvac_FFS (0.L, m2_gluino, m2_sdR[i], qq);
    V2_strong_qgluinosq +=
      SUMO_Fvac_FFS (m2_bot, m2_gluino, m2_sbot[i], qq);
    V2_strong_qgluinosq +=
      SUMO_Fvac_FFS (m2_top, m2_gluino, m2_stop[i], qq);
    V2_strong_qgluinosq +=
      - 2.0L * TSIL_CREAL((Lsbot[i]) * (Rsbotc[i])) *
      SUMO_Fvac_ffS (m2_bot, m2_gluino, m2_sbot[i], qq);
    V2_strong_qgluinosq +=
      - 2.0L * TSIL_CREAL((Lstop[i]) * (Rstopc[i])) *
      SUMO_Fvac_ffS (m2_top, m2_gluino, m2_stop[i], qq);
  }

  V2_strong_qgluinosq *= 8.0L*g3sq;

  /* ------------------------------------------------------------------- */
  /* equation (3.48) */

  for (i=0; i<2; i++) {
    V2_strong_sqsqg +=
      SUMO_Fvac_SSV (m2_suL[i], m2_suL[i], 0.0L, qq);
    V2_strong_sqsqg +=
      SUMO_Fvac_SSV (m2_sdL[i], m2_sdL[i], 0.0L, qq);
    V2_strong_sqsqg +=
      SUMO_Fvac_SSV (m2_suR[i], m2_suR[i], 0.0L, qq);
    V2_strong_sqsqg +=
      SUMO_Fvac_SSV (m2_sdR[i], m2_sdR[i], 0.0L, qq);
    V2_strong_sqsqg +=
      SUMO_Fvac_SSV (m2_stop[i], m2_stop[i], 0.0L, qq);
    V2_strong_sqsqg +=
      SUMO_Fvac_SSV (m2_sbot[i], m2_sbot[i], 0.0L, qq);
  }

  V2_strong_sqsqg *= 2.0L*g3sq;

  /* ------------------------------------------------------------------- */
  /* equation (3.61) */

  V2_strong_qqg = 4.0L*g3sq*(
      SUMO_Fvac_FFV (m2_top, m2_top, 0.0L, qq)
    + SUMO_Fvac_FFV (m2_bot, m2_bot, 0.0L, qq)
    - SUMO_Fvac_ffV (m2_top, m2_top, 0.0L, qq)
    - SUMO_Fvac_ffV (m2_bot, m2_bot, 0.0L, qq)
      );

  /* ------------------------------------------------------------------- */

  return (SUMO_twoloopfactor * 
    (V2_strong_sqsq + V2_strong_qgluinosq + V2_strong_sqsqg + V2_strong_qqg));
}
예제 #20
0
int TSIL_MaxSteps (TSIL_DATA *foo, TSIL_COMPLEX z)
{
  return (foo->nStepsMaxCon 
          + floor((double) (TSIL_CABS(z) * foo->nStepsMaxVar)));
}