dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.27k stars 4.73k forks source link

ARM/ARM64 returns an incorrect result for `pow(x, 1)` #12139

Open tannergooding opened 5 years ago

tannergooding commented 5 years ago

ARM/ARM64 currently return 0 for Math.Pow(double.Epsilon, 1) when it should be returning double.Epsilon. My best guess is that the implementation is not properly special casing y=1.

category:correctness theme:jit-intrinsics skill-level:beginner cost:small

tannergooding commented 5 years ago

CC. @AndyAyersMS logged this to track the underlying issue for https://github.com/dotnet/coreclr/pull/22802

tannergooding commented 5 years ago

There are other various cross-platform differences for the various Math functions so I am putting this into future.

echesakov commented 2 years ago

Un-assigning myself cc @BruceForstall

AndyAyersMS commented 2 years ago

@tannergooding can you update the status of this issue?

ghost commented 2 years ago

Tagging subscribers to this area: @dotnet/area-system-numerics See info in area-owners.md if you want to be subscribed.

Issue Details
ARM/ARM64 currently return `0` for `Math.Pow(double.Epsilon, 1)` when it should be returning `double.Epsilon`. My best guess is that the implementation is not properly special casing `y=1`. category:correctness theme:jit-intrinsics skill-level:beginner cost:small
Author: tannergooding
Assignees: -
Labels: `bug`, `arch-arm32`, `arch-arm64`, `area-System.Numerics`, `Priority:3`
Milestone: 7.0.0
tannergooding commented 2 years ago

Issue is still present and should be eventually resolved. This isn't really a codegen issue, but rather an implementation issue with the underlying CRT implementation we defer to, so I've changed the area path.

tannergooding commented 1 year ago

This is a "fix anytime" issue. It may eventually get picked up alongside other determinism changes that happen