Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in powi on Windows beta/nightly #192

Closed
iliekturtles opened this issue Jun 16, 2020 · 0 comments · Fixed by #193
Closed

Regression in powi on Windows beta/nightly #192

iliekturtles opened this issue Jun 16, 2020 · 0 comments · Fixed by #193

Comments

@iliekturtles
Copy link
Owner

https://travis-ci.org/github/iliekturtles/uom/builds/698980459?utm_medium=notification&utm_source=email

extern crate typenum; // 2.12.0

fn main() {
    let v = 12.046623229980468750000000000000_f32;
    let a = a(v);
    let b = b(v);

    println!("std powi {:.30?}", a);
    println!("typenum  {:.30?}", b);
}

#[inline(never)]
fn a(v: f32) -> f32 {
    v.powi(3)
}

#[inline(never)]
fn b(v: f32) -> f32 {
    typenum::Pow::powi(v, typenum::P3::new())
}
/d/Code/Test/rust/tst (master)$ cargo run; rustc --version
   Compiling tst v0.1.0 (D:\Code\Test\rust\tst)
    Finished dev [unoptimized + debuginfo] target(s) in 3.90s
     Running `target\debug\tst.exe`
std powi 1748.219482421875000000000000000000
typenum  1748.219482421875000000000000000000
rustc 1.44.0 (49cae5576 2020-06-01)
/d/Code/Test/rust/tst (master)$ cargo +beta run; rustc +beta --version
    Finished dev [unoptimized + debuginfo] target(s) in 2.79s
     Running `target\debug\tst.exe`
std powi 1748.219604492187500000000000000000
typenum  1748.219482421875000000000000000000
rustc 1.45.0-beta.3359 (b7dc83a3f 2020-06-03)
@iliekturtles iliekturtles reopened this Jun 18, 2020
iliekturtles added a commit that referenced this issue Jun 22, 2020
In Rust 1.45 the upgrade to LLVM 10.0 changes the behavior of
`f{32|64}::powi` on Windows. This commit changes the `Quantity::powi`
implementation to simplify down to `f{32|64}::powi` instead of using
`Typenum::Pow::powi` which uses a less precise algorithm. Resolves #192.
iliekturtles added a commit that referenced this issue Jun 22, 2020
In Rust 1.45 the upgrade to LLVM 10.0 changes the behavior of
`f{32|64}::powi` on Windows. This commit changes the `Quantity::powi`
implementation to simplify down to `f{32|64}::powi` instead of using
`Typenum::Pow::powi` which uses a less precise algorithm. Resolves #192.
iliekturtles added a commit that referenced this issue Jun 23, 2020
In Rust 1.45 the upgrade to LLVM 10.0 changes the behavior of
`f{32|64}::powi` on Windows. This commit changes the `Quantity::powi`
implementation to simplify down to `f{32|64}::powi` instead of using
`Typenum::Pow::powi` which uses a less precise algorithm. Resolves #192.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant