LambertW

Trait LambertW 

Source
pub trait LambertW
where Self: Sized,
{ // Required methods fn lambert_w0(self) -> Self; fn lambert_wm1(self) -> Self; }
Expand description

Lambert W functions.

Required Methods§

Source

fn lambert_w0(self) -> Self

Compute the real-valued parts of the princial branch of the Lambert W function.

This function is the inverse of the function

f(w) = we^w

when w >= -1.

The implementation is based on lambert_w by Johanna Sörngård.

§Examples
use special::LambertW;

let Ω: f64 = 0.5671432904097838;
assert!((1.0.lambert_w0() - Ω).abs() < 1e-15);
§References
  1. T. Fukushima, Precise and fast computation of Lambert W function by piecewise minimax rational function approximation with variable transformation.
Source

fn lambert_wm1(self) -> Self

Compute the real-valued parts of the secondary branch of the Lambert W function.

This function is the inverse of the function

f(w) = we^w

when w < -1.

The implementation is based on lambert_w by Johanna Sörngård.

§Examples
use special::LambertW;

assert!(((-f64::ln(2.0) / 2.0).lambert_wm1() + f64::ln(4.0)).abs() < 1e-15);
§References
  1. T. Fukushima, Precise and fast computation of Lambert W function by piecewise minimax rational function approximation with variable transformation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl LambertW for f32

Source§

fn lambert_w0(self) -> Self

Source§

fn lambert_wm1(self) -> Self

Source§

impl LambertW for f64

Source§

fn lambert_w0(self) -> Self

Source§

fn lambert_wm1(self) -> Self

Implementors§