Stephen Canon
c124585c19
Skeleton of integer shift with rounding.
...
Fairly correct implementation of right-shift with rounding. Also fairly efficient, though I'm sure I'll find some cases where we're generating uncessary overflow checks upon further inspection. Nonetheless, a decent enough start.
2021-09-26 16:23:58 -04:00
Stephen Canon
e22ff866a4
Add GCD files to CMake build.
2021-09-20 12:35:22 -04:00
Stephen Canon
abb899865e
resolve warnings in 5.5 tools build, add skeleton readme for integer utilities
2021-09-20 09:53:38 -04:00
Jeremy Saklad
ae38370107
Fix typo in AlgebraicField documentation
...
“distributitve” should be spelled “distributive”.
2021-09-17 14:21:34 -05:00
Stephen Canon
9d84cefefa
Merge pull request #189 from NevinBR/patch-6
...
GCD function for BinaryInteger
2021-09-10 11:04:07 -04:00
NevinBR
85264c808c
Reworded doc comment for gcd
2021-09-09 23:05:45 -04:00
NevinBR
8552becf91
Documented overflow behavior of gcd
2021-08-31 11:19:22 -04:00
NevinBR
67af2fe0d9
Simplified gcd implementation
2021-08-30 17:32:03 -04:00
NevinBR
b8f452189b
Made gcd a free function
2021-08-30 17:28:44 -04:00
NevinBR
4fbcb11f03
Improved GCD documentation
2021-08-26 19:49:13 -04:00
Stephen Canon
996cf7f5b9
CMake build support for the IntegerUtilities module.
2021-08-26 15:18:40 -04:00
NevinBR
909a77c3d9
Create GCD.swift
...
Binary GCD algorithm
2021-08-26 14:51:05 -04:00
Stephen Canon
84474a3410
Initial setup of IntegerUtilities module.
...
Seeded with rotate(right:) and rotate(left:) on FixedWidthInteger. These implementations are basically sane, but need documentation written for users who are not already familiar with bitwise rotation.
2021-08-25 15:36:24 -04:00
Stephen Canon
32c2b64370
Merge pull request #186 from apple/complex-readme
...
Update README.md
2021-08-20 09:29:44 -04:00
Stephen Canon
3d6bff6cae
Update README.md
2021-08-20 09:18:28 -04:00
Stephen Canon and Xiaodi Wu
12148ffa66
Update Sources/RealModule/Real.swift
...
Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com >
2021-08-20 09:06:44 -04:00
Stephen Canon and Xiaodi Wu
3a5c73964b
Update Sources/RealModule/Real.swift
...
Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com >
2021-08-20 09:06:36 -04:00
Stephen Canon and Xiaodi Wu
32f48e6b73
Update Sources/RealModule/Real.swift
...
Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com >
2021-08-20 09:06:27 -04:00
Stephen Canon and Xiaodi Wu
05440473eb
Update Sources/ComplexModule/Arithmetic.swift
...
Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com >
2021-08-20 09:06:10 -04:00
Stephen Canon and Xiaodi Wu
342d38eb3b
Update Sources/RealModule/AlgebraicField.swift
...
Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com >
2021-08-20 09:05:56 -04:00
Stephen Canon
ecc77886a1
Update Sources/ComplexModule/Arithmetic.swift
2021-08-19 21:20:58 -04:00
Stephen Canon
10e75aa392
Further expand documentation of reciprocal with some example use.
2021-08-19 20:47:36 -04:00
Stephen Canon
faf13772af
Add some documentation for AlgebraicField ops, minor fix for Augmented.
2021-08-19 14:50:24 -04:00
Stephen Canon
702c6fc1d8
Document the Augmented enum in RealModule in advance of 1.0
2021-08-19 14:00:52 -04:00
Steve (Numerics) Canon
5827f9a943
80-column formatting for source doc comments
...
Tidying, plus a few small edits. This commit should not include any code changes.
2021-03-03 14:01:09 -05:00
Steve (Numerics) Canon
97852afaf5
Adjust Float16 availability for Swift 5.4 toolchains.
...
In older toolchains, Float16 is marked unavailable on all mac targets; starting with the 5.4 toolchain, it is available starting in macOS 11.0 when targeting Apple Silicon.
2021-02-19 15:53:15 -05:00
Steve (Numerics) Canon
105b59b8a4
Remove vestigal C complex shims.
...
These used to be used by some test appratus, but they are no longer
used and can be removed.
2021-02-19 15:16:30 -05:00
NevinBR
5a7eb37c19
Cleaned up some comments
2020-11-11 14:05:55 -05:00
Stephen Canon
26c51aca1b
Mark all complex elementary functions inlinable
...
This is kind of dubious, but necessary for performance reasons until we get dependable cross-module specialization. Also has a minor test fix for 32b platforms.
2020-11-09 16:41:45 -05:00
Saleem Abdulrasool
00c6183670
build: update file lists for RealModule and _TestSupport
...
Add new files to the list that were missed in the CMakeLists.txt
updates.
2020-11-09 11:23:48 -08:00
Stephen Canon
ae364a28f0
Merge pull request #162 from apple/complex-elfns
...
Conform Complex to Elementary Functions
2020-11-09 11:39:18 -05:00
Stephen Canon
16837299c1
Added inverse trig and hyperbolics, some rough test coverage.
2020-11-09 11:25:08 -05:00
Stephen Canon
2b4c6701f2
log and log(onePlus:) implementations for Complex
...
These significantly improve on the state of the art for arguments close to the circle where the result vanishes, producing good componentwise relative accuracy as well as relative accuracy in the complex norm.
Also drops the argument parser dependency, which is desirable to avoid possible circular dependencies in the future with algorithms.
2020-11-05 15:14:25 -05:00
Saleem Abdulrasool
0ee972ff92
build: enable building Numerics on Darwin with CMake
...
The `-enable-force-autolink` flag is not supported on Darwin.
Fortunately, it is also unnecessary to work around the SR on Darwin.
Simply exclude the flag when targeting Darwin.
2020-10-12 14:01:56 -07:00
Stephen Canon
209a794eb6
Initial implementation of log(onePlus:)
2020-10-01 16:39:11 -04:00
Stephen Canon
af19aec6ff
WIP
2020-10-01 16:39:11 -04:00
Stephen Canon
ed8fc21f1e
Add TODO for algorithmic improvements on tanh.
2020-10-01 16:39:11 -04:00
Stephen Canon
1cbb94ac71
First pass over hyperbolics and trig functions for Complex.
2020-10-01 16:39:11 -04:00
Stephen Canon
4798b68203
Refactor test support to remove XCTest dependency.
2020-10-01 16:39:11 -04:00
Stephen Canon
09beddce47
WIP on complex elementary functions.
...
Rebased on master, then cleaned up exp and expm1. New algorithm for expm1 that gives good componentwise accuracy as well as normwise. I _think_ that this is fundamentally new; I can't recall seeing it anywhere before, though it's simple enough that I expect someone has thought of it before.
Also beefed up testing for exp and expm1. Left sketches of log/pow/sqrt/root in place, though I'm still working on filling out the testing for those.
2020-10-01 16:39:11 -04:00
Stephen Canon
2179fa1f82
Rename some tests to reflect what they actually do.
2020-10-01 16:39:11 -04:00
Stephen Canon
6d9de5d4ce
Updates to resync with changes on master.
...
- Renamed scaled/unscaled to multiplied/divided
- Adopted new Real module name
- Adopted expMinusOne, log(onePlus:) names
2020-10-01 16:39:11 -04:00
Steve (Numerics) Canon
e20b32d40f
Initial pass over implementing ElementaryFunctions for Complex.
2020-10-01 16:39:11 -04:00
Stephen Canon
e07b39453b
Swap availability for #if check on Float16.
2020-09-18 16:01:51 -04:00
Stephen Canon
0f8ef268d0
Remove muladdf16 for now.
2020-08-24 20:31:40 -04:00
Stephen Canon
a0501be80a
capitalization
2020-08-24 18:55:14 -04:00
Stephen Canon
cda1b5e6f4
Added mulAdd and cosMinusOne operations for Real.
...
These are _mostly_ implementation hooks for Complex, but are generally useful, so I've made them public. Experimental, subject to renaming, especially mulAdd.
2020-08-24 18:52:58 -04:00
Stephen Canon
a4372aa8d6
Added change suggested by Saleem for Windows/CMake build.
2020-08-24 18:31:12 -04:00
Stephen Canon
145156c40e
Fix suggested by Saleem in review.
2020-08-24 16:50:10 -04:00
Stephen Canon
c2d6cb716d
Factor test support out into a module so Real and Complex tests can use it.
2020-08-24 16:21:25 -04:00