wright_omega

Crates.iowright_omega
lib.rswright_omega
version0.1.1
sourcesrc
created_at2023-09-21 16:34:31.880391
updated_at2023-09-21 16:35:39.488719
descriptionA Rust implementation of the Wright Omega function
homepage
repositoryhttps://github.com/tectin0/wrightomega-rs
max_upload_size
id979650
size15,120
Tectin (tectin0)

documentation

README

WrightOmega

This library is a rewrite of the wright.c file from Lawrence, Corless, and Jeffrey [1] in rust.

The Wright Omega function is defined as the solution to the equation ω + log(ω) = z. It is a special case of the Lambert W function.

Usage

The library is available on crates.io and can be included in your project by adding the following to your Cargo.toml file:

[dependencies]
wright_omega = "0.1.0"

Example

use wright_omega::wright_omega;
use wright_omega::Complex;

fn main() {
    let z = Complex::new(0.0, 0.0);
    let omega = wright_omega(z);
    println!("Wright Omega of {} is {}", z, omega);
}

> Wright Omega of 0+0i is 0.5671433+0i

Features

The library supports both f32 and f64 types. The f32 feature is enabled by default. To use f64 instead, add the following to your Cargo.toml file:

[dependencies]
wright_omega = { version = "0.1.0", features = ["f64"] }

Other Implementations

Scipy uses the same implementation for Python. Matlab also has a built in implementation.

References

[1] Lawrence, Corless, and Jeffrey, “Algorithm 917: Complex Double-Precision Evaluation of the Wright Function.” ACM Transactions on Mathematical Software, 2012. DOI:10.1145/2168773.2168779.


Commit count: 8

cargo fmt