]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/math/minimax/f.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / math / minimax / f.cpp
index 2c95378f1918b1d4364ca8020a2582dc061a6307..6ea405800e66c3f896531ee22d6ad742c94cb0ba 100644 (file)
@@ -11,6 +11,7 @@
 #include <boost/math/special_functions.hpp>
 #include <boost/math/special_functions/zeta.hpp>
 #include <boost/math/special_functions/expint.hpp>
+#include <boost/math/special_functions/lambert_w.hpp>
 
 #include <cmath>
 
@@ -358,6 +359,30 @@ mp_type f(const mp_type& x, int variant)
       mp_type xx = 1 / x;
       return boost::math::cyl_bessel_k(1, xx) * sqrt(xx) * exp(xx);
    }
+   // Lambert W0
+   case 40:
+      return boost::math::lambert_w0(x);
+   case 41:
+   {
+      if (x == 0)
+         return 1;
+      return boost::math::lambert_w0(x) / x;
+   }
+   case 42:
+   {
+      static const mp_type e1 = exp(mp_type(-1));
+      return x / -boost::math::lambert_w0(-e1 + x);
+   }
+   case 43:
+   {
+      mp_type xx = 1 / x;
+      return 1 / boost::math::lambert_w0(xx);
+   }
+   case 44:
+   {
+      mp_type ex = exp(x);
+      return boost::math::lambert_w0(ex) - x;
+   }
    }
    return 0;
 }