sleef

Crates.iosleef
lib.rssleef
version0.3.2
sourcesrc
created_at2022-08-05 11:26:29.737301
updated_at2024-01-24 20:23:43.798524
descriptionMath functions for SIMD vectors
homepage
repositoryhttps://github.com/burrbull/sleef-rs/
max_upload_size
id639274
size753,863
Zgarbul Andrey (burrbull)

documentation

https://docs.rs/sleef

README

crates.io crates.io Released API docs CI

sleef-rs

Rust port of Sleef math library based on Portable SIMD Vectors a.k.a. core::simd

Usage

Requires nightly feature portable_simd.

You can call math functions directly:

#![feature(portable_simd)]

use core::simd::f64x2;

fn main() {
    let input = f64x2::from_array([1.43, 0.57]);
    let output = sleef::f64x::sin_u10(input);
    println!("sin(α) = {:?}", output);
}

or use Sleef trait:

#![feature(portable_simd)]

use core::simd::f64x2;
use sleef::Sleef;

fn main() {
    let input = f64x2::from_array([1.43, 0.57]);
    let output = input.sin();
    println!("sin(α) = {:?}", output);
}
Commit count: 160

cargo fmt