Index: sasmodels/models/fractal_core_shell.c
===================================================================
--- sasmodels/models/fractal_core_shell.c	(revision 7d4b2ae2af901813f3ff60e60aa0eae98f4dfd5e)
+++ sasmodels/models/fractal_core_shell.c	(revision 679430173a9e06492b08f4e0ab362871445963f6)
@@ -47,5 +47,5 @@
     double qr = q*radius;
 
-    double t1 = frac_dim*exp(lanczos_gamma(frac_1))*sin(frac_1*atan(q*cor_length));
+    double t1 = frac_dim*sas_gamma(frac_1)*sin(frac_1*atan(q*cor_length));
     double t2 = (1.0 + 1.0/(q*cor_length)/(q*cor_length));
     double t3 = pow(qr, frac_dim) * pow(t2, (frac_1/2.0));
Index: sasmodels/models/fractal_core_shell.py
===================================================================
--- sasmodels/models/fractal_core_shell.py	(revision aa2edb2b2fb550caed0506dcf63bc7eac7e1779a)
+++ sasmodels/models/fractal_core_shell.py	(revision 679430173a9e06492b08f4e0ab362871445963f6)
@@ -73,5 +73,5 @@
 # pylint: enable=bad-whitespace, line-too-long
 
-source = ["lib/sph_j1c.c", "lib/lanczos_gamma.c", "lib/core_shell.c", "fractal_core_shell.c"]
+source = ["lib/sph_j1c.c", "lib/sas_gamma.c", "lib/core_shell.c", "fractal_core_shell.c"]
 
 demo = dict(scale=0.05,
Index: smodels/models/lib/lanczos_gamma.c
===================================================================
--- sasmodels/models/lib/lanczos_gamma.c	(revision e6f14104e82489f43d4acc1eeda0d50ad5408fb6)
+++ 	(revision )
@@ -1,21 +1,0 @@
-double lanczos_gamma(double q);
-double lanczos_gamma(double q)
-{
-    // Lanczos approximation to the Log Gamma function.
-
-    double x,y,tmp,ser;
-    double coeff[6]=
-        {76.18009172947146,     -86.50532032941677,
-         24.01409824083091,     -1.231739572450155,
-          0.1208650973866179e-2,-0.5395239384953e-5};
-
-    y=x=q;
-    tmp  = x+5.5;
-    tmp -= (x+0.5)*log(tmp);
-    ser  = 1.000000000190015;
-    for (int j=0; j<=5; j++) {
-        y+=1.0;
-        ser += coeff[j]/y;
-    }
-    return -tmp+log(2.5066282746310005*ser/x);
-}
Index: sasmodels/models/mass_fractal.c
===================================================================
--- sasmodels/models/mass_fractal.c	(revision 61fd21d4097a94b40842a94b31e0b755200eb1c1)
+++ sasmodels/models/mass_fractal.c	(revision 679430173a9e06492b08f4e0ab362871445963f6)
@@ -28,5 +28,5 @@
     //calculate S(q)
     double mmo = mass_dim-1.0;
-    double sq = exp(lanczos_gamma(mmo))*sin((mmo)*atan(q*cutoff_length));
+    double sq = sas_gamma(mmo)*sin((mmo)*atan(q*cutoff_length));
     sq *= pow(cutoff_length, mmo);
     sq /= pow((1.0 + (q*cutoff_length)*(q*cutoff_length)),(mmo/2.0));
Index: sasmodels/models/mass_fractal.py
===================================================================
--- sasmodels/models/mass_fractal.py	(revision 684eff96e056ae7868da7127ca50dbfb8525b722)
+++ sasmodels/models/mass_fractal.py	(revision 679430173a9e06492b08f4e0ab362871445963f6)
@@ -85,5 +85,5 @@
 # pylint: enable=bad-whitespace, line-too-long
 
-source = ["lib/sph_j1c.c", "lib/lanczos_gamma.c", "mass_fractal.c"]
+source = ["lib/sph_j1c.c", "lib/sas_gamma.c", "mass_fractal.c"]
 
 demo = dict(scale=1, background=0,
Index: sasmodels/models/surface_fractal.c
===================================================================
--- sasmodels/models/surface_fractal.c	(revision 9c461c713e9961727442c844be3e6354d6548c2f)
+++ sasmodels/models/surface_fractal.c	(revision 679430173a9e06492b08f4e0ab362871445963f6)
@@ -26,5 +26,5 @@
     //calculate S(q)
     mmo = 5.0 - surface_dim;
-    sq  = exp(lanczos_gamma(mmo))*sin(-(mmo)*atan(q*cutoff_length));
+    sq  = sas_gamma(mmo)*sin(-(mmo)*atan(q*cutoff_length));
     sq *= pow(cutoff_length, mmo);
     sq /= pow((1.0 + (q*cutoff_length)*(q*cutoff_length)),(mmo/2.0));
Index: sasmodels/models/surface_fractal.py
===================================================================
--- sasmodels/models/surface_fractal.py	(revision aa2edb2b2fb550caed0506dcf63bc7eac7e1779a)
+++ sasmodels/models/surface_fractal.py	(revision 679430173a9e06492b08f4e0ab362871445963f6)
@@ -87,5 +87,5 @@
 # pylint: enable=bad-whitespace, line-too-long
 
-source = ["lib/sph_j1c.c", "lib/lanczos_gamma.c", "surface_fractal.c"]
+source = ["lib/sph_j1c.c", "lib/sas_gamma.c", "surface_fractal.c"]
 
 demo = dict(scale=1, background=0,
