Commit Graph
10 Commits
Author SHA1 Message Date
Robert Thompson cb56525312 Address PR feedback
Eliminate unnecessary math function calls, and also handle floating
point edge cases better.
2019-12-30 10:33:00 -05:00
Robert Thompson bc2f9fb7c6 Use NumericShims for math functions 2019-12-30 10:33:00 -05:00
Stephen Canon 5e978d85a2 Add inline decls of lgamma_r and friends on Linux, too. 2019-11-22 09:47:36 -05:00
Stephen Canon e24586e2b1 Defer to libm cbrt for root(x,3).
This lets us get exact cases right only platforms where cbrt(x) has sub-ulp accuracy. It doesn't get all the other non-power-of-two roots quite right, and is still dependent on the host system, but 2 and 3 are the most common roots people take by far, so it's a good first step.
2019-11-10 22:02:53 -05:00
Stephen Canon e387654448 More complex testing, and split it apart into multiple files.
Added some performance tests for multiply/divide, and some transparent annotations to the source where necessary for performance reasons. Additionally removed the Linux test information, since that's no longer necessary with test discovery in swiftpm.

Also added a new `var reciprocal: Self?` for Complex that allows for more efficient divisions when a divisor is used repeatedly, while avoiding the accuracy hazard of using `1/self` when a value is poorly scaled.
2019-11-01 21:16:15 -04:00
Stephen Canon 78042238c0 Further README improvements.
Add one README for each module, format READMEs consistently; one sentence per line to minimize diff noise.
2019-10-31 13:38:20 -04:00
Stephen Canon eb76aa632b Update license headers, add CONTRIBUTING.md and umbrella module 2019-10-30 16:11:20 -04:00
Steve (Numerics) Canon 919f13ce2e Restore the NumericShims module, use it instead of silgen_name.
I had thought that we could get away with just using @_silgen_name to wrap the platform libm functions in ElementaryFunctions conformances, but that's now failing in release builds when both ElementaryFunctions and the Platform module are imported (and actually crashing swiftc).

Fall back on the previous strategy of using C header shims. This adds an extra layer of source abstraction, but we're still able to optimize it away at compile time, even in unoptimized builds, so we can live with it for now.
2019-08-01 22:12:03 -04:00
Steve (Numerics) Canon fa9422ec6e Remove NumericShims module; we don't need it thanks to silgen_name. 2019-07-19 16:29:53 -04:00
Steve (Numerics) Canon 8aab7a90f8 Initial project setup for swift-numerics
Two modules to begin with:
- ElementaryFunctions
- Complex
Added README.md files describing each module very roughly, and a project
README to describe goals and process.
2019-07-06 15:27:21 -04:00