[genius] Wed Oct 16 08:11:49 2013 Jiri (George) Lebl <jirka 5z com>



commit 560114bd152289eefb864ab32c3f42f809010adc
Author: Jiri (George) Lebl <jirka 5z com>
Date:   Wed Oct 16 08:11:52 2013 -0500

    Wed Oct 16 08:11:49 2013  Jiri (George) Lebl <jirka 5z com>
    
        * lib/functions/lambert.gel: slight improvement in speed.

 ChangeLog                 |    4 ++++
 lib/functions/lambert.gel |    4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d0c8492..3ac0d93 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Oct 16 08:11:49 2013  Jiri (George) Lebl <jirka 5z com>
+
+       * lib/functions/lambert.gel: slight improvement in speed.
+
 Wed Oct 16 00:33:17 2013  Jiri (George) Lebl <jirka 5z com>
 
        * src/symbolic.c: add some derivatives for Bessel functions and
diff --git a/lib/functions/lambert.gel b/lib/functions/lambert.gel
index d143e90..a2b426e 100644
--- a/lib/functions/lambert.gel
+++ b/lib/functions/lambert.gel
@@ -8,7 +8,7 @@ function LambertW(x) = (
   else if (x < 24) then 
     (lnxm1 := ln(x)-1; y := 1+lnxm1/2.0+(lnxm1^2)/16.0)
   else
-    (l1:=ln(x);l2:=ln(ln(x));y:=l1-l2+l2/l1);
+    (l1:=ln(x);l2:=ln(l1);y:=l1-l2+l2/l1);
   y := y-(y*e^y-x)/(e^y+y*e^y);
   y := y-(y*e^y-x)/(e^y+y*e^y);
   y := y-(y*e^y-x)/(e^y+y*e^y);
@@ -28,7 +28,7 @@ function LambertW(x) = (
 SetHelp ("LambertWm1", "functions", "The minus-one branch of the Lambert W function for real values between 
-1/e and 0");
 function LambertWm1(x) = (
   if not IsReal(x) or x < -1/e or x >= 0.0 then (error ("LambertWm1: only defined for real x with -1/e <= x 
< 0");bailout);
-  if x < -0.116 then y := -8.22*x-4.23 else (l1:=ln(-x);l2:=ln(-ln(-x));y:=l1-l2+l2/l1);
+  if x < -0.116 then y := -8.22*x-4.23 else (l1:=ln(-x);l2:=ln(-l1);y:=l1-l2+l2/l1);
   for n=1 to 10 do (
     ylast := y;
     y := y-(y*e^y-x)/(e^y+y*e^y);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]