-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Vectorize TensorPrimitives.Pow, Exp2, Exp10, Cbrt, RootN, Hypot, Log(x,y), Log10 #97623
Conversation
While there are likely more accurate and better performing options that involve more code, for now we can: - Implement Pow for now as Exp(y * Log(x)) - Implement Exp2 for now as Exp(x * Log(2)) - Implement Exp10 for now as Exp(x * Log(10)) - Implement Cbrt for now as Exp(Log(x) / 3) - (The way Exp2M1 and Exp10M1 are already implemented, they implicitly vectorize now as well.)
Tagging subscribers to this area: @dotnet/area-system-numerics Issue DetailsWhile there are likely more accurate and better performing options that involve more code, for now we can:
@tannergooding, is this legit?
|
...ries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.netcore.cs
Outdated
Show resolved
Hide resolved
There's some edge cases that IEEE 754 explicitly requires to return If you don't have access:
While we do allow imprecision in certain computed results, these edges we do traditionally have a strict requirements around since they are often form the foundations of correctness in composed algorithms. The scalar math APIs should be validating these edges already and I've been adding the same coverage to the |
We have all of the "SpecialValues" tests, e.g. runtime/src/libraries/System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs Lines 405 to 423 in 7c852c4
which are validating these values using the generic math implementations as oracles. The values being tested for floating-point types are these: runtime/src/libraries/System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs Lines 262 to 290 in 7c852c4
|
While there are likely more accurate and better performing options that involve more code, for now we can:
@tannergooding, is this legit?
Contributes to #97193