Esempio n. 1
0
/* ********************************************************************** */
TBL_REAL get_fluct(TBL_REAL E, enum material_type M, unsigned int *seed) {
    int		i, j, k;
    TBL_REAL    z, s;
/* We want to find the right energy level */
    if (E < ENRG[0]) return(0.0);
    k = -1;
    for (i=0; i<NE; i++) {
	if (E < ENRG[i]) {
	    k = i;
	    break;
	}
    }
    assert(k > 0);
/* generate a random number from zero to 1 */
    z = (TBL_REAL) fastrand01(seed);
    j = NQ-1;
    for (i=0; i<NQ; i++) {
	if (z < PERC[i]) {
	    j = i;
	    break;
	}
    }
/* so now we want to interpolate */
    s = interpol8(ENRG[k-1], ENRG[k], E,
		  FLUC[INDEX(M,k-1,j-1)], FLUC[INDEX(M,k,j-1)],
		  FLUC[INDEX(M,k-1,j)], FLUC[INDEX(M,k,j)]);
/* the value is hyperbolic sin of 1000 times the value in MeV so... */
    return(0.001*SINH(s));
}
Esempio n. 2
0
void bessel_i_scaled_double(double x, double i[], int n, int n1)
/* computes i_n(x)/x^(n+1) */
{
     int l;
     double s, x2;

     x2 = x*x;
     i[n1-1] = 0.0;
     i[n1-2] = 1.0;

     for (l=n1-3; l>=0; l--) {
         i[l] = x2*i[l+2] + (2*l+3)*i[l+1];
     }

     s = SINH(x)/(x2*i[0]);
     for (l=0;l<n; l++) {
         i[l] *= s;
     }    
}
Esempio n. 3
0
single XSINH( single *arg ) {
//===========================

    return( SINH( *arg ) );
}