73 Commits
Author SHA1 Message Date
Stephen Canon 2b63fc844e Merge pull request #78 from stephentyrone/lengthSquared
Rename unsafeLengthSquared -> lengthSquared
0.0.2
2019-11-20 16:27:40 -05:00
Stephen Canon f6c2c34910 Rename unsafeLengthSquared -> lengthSquared
Also further tweak polar init for Complex to allow (-infinity, θ) when θ is not finite.
2019-11-20 16:15:10 -05:00
Stephen Canon f1d78c4d98 Merge pull request #77 from stephentyrone/zero-length-polar-init
Address behavior of Complex.init(length:phase:)
2019-11-20 16:03:09 -05:00
Stephen CanonandRichard Wei 5931d036ab Update Sources/Complex/Complex.swift
Co-Authored-By: Richard Wei <rxrwei@gmail.com>
2019-11-20 14:56:31 -05:00
Stephen Canon 565839d673 Address behavior of Complex.init(length:phase:)
Instead of being failable, adopt the following policy:
- If length is zero or infinity, the phase does not matter.
- Otherwise, the phase must be finite or a precondition failure occurs.

Discussion here: https://github.com/apple/swift-numerics/issues/51
2019-11-20 14:32:19 -05:00
Stephen Canon f96c6c2066 Rename swift.yml to macos.yml 2019-11-18 16:34:11 -05:00
Stephen Canon ee54cc2075 Let's tryout workflows 2019-11-13 17:17:32 -05:00
Stephen Canon 4329602833 Merge pull request #74 from ole/delete-alltests
Delete RealTests.allTests
0.0.1
2019-11-12 15:35:38 -05:00
Ole Begemann d875fdbd0b Delete RealTests.allTests
This broke building the tests on Linux because of a missing symbol (ComplexTests.allTests), and with `--enable-test-discovery` we don't need this anyway.
2019-11-12 21:25:42 +01:00
Stephen Canon 39f94b7c7b Merge pull request #73 from stephentyrone/empty-linuxmain
Replace LinuxMain.swift with a fatalError
2019-11-12 14:48:00 -05:00
Stephen Canon 2760aa4ba4 Replace LinuxMain.swift with a fatalError
Direct users to run with --enable-test-discovery until it becomes the default.
2019-11-12 14:45:59 -05:00
Stephen Canon a27ffc7c63 Merge pull request #57 from tachoknight/master
Added LinuxMain.swift so numerics can be used on Linux
2019-11-12 14:27:12 -05:00
Stephen Canon a301489b9a Merge pull request #72 from ole/patch-1
Remove broken link in Real module readme
2019-11-12 14:25:05 -05:00
Ole Begemann 0ed7e786b5 Remove broken link in Real module readme
The link target for `[Real]` wasn't defined. I decided toremove the link altogether because the readme would essentially link to itself.
2019-11-12 17:28:36 +01:00
Stephen Canon 1b99c547b0 Merge pull request #69 from stephentyrone/cbrt
Defer to libm cbrt for root(x,3).
0.0.0
2019-11-11 08:38:04 -05:00
Stephen CanonandXiaodi Wu 5d783ce458 Update Sources/Real/ScalarConformances.swift
Co-Authored-By: Xiaodi Wu <xiaodi.wu@gmail.com>
2019-11-10 22:19:39 -05:00
Stephen CanonandXiaodi Wu 3fbc22cbe3 Update Sources/Real/ScalarConformances.swift
Co-Authored-By: Xiaodi Wu <xiaodi.wu@gmail.com>
2019-11-10 22:19:30 -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 913a62eb5f Merge pull request #67 from stephentyrone/document-additive-arithmetic
Document AdditiveArithmetic conformance of ElementaryFunctions
2019-11-10 21:14:15 -05:00
Stephen Canon 6d904ea56c Add documentation for AdditiveArithmetic conformance of ElementaryFunctions 2019-11-10 21:12:37 -05:00
Stephen Canon d064661dba Merge pull request #66 from NevinBR/patch-2
Made ElementaryFunctions refine AdditiveArithmetic

Discussion here: https://github.com/apple/swift-numerics/issues/56
2019-11-10 20:57:46 -05:00
NevinBR 6195693e3a Made ElementaryFunctions refine AdditiveArithmetic 2019-11-10 19:58:07 -05:00
Stephen Canon 3519620ac6 Merge pull request #65 from stephentyrone/split-codable-make-debugDecription-unconditional
Split Codable conformance of Complex into Encodable and Decodable. NFC.
2019-11-10 14:59:18 -05:00
Stephen Canon 0ddfd0ead7 Split Codable conformance of Complex into Encodable and Decodable. NFC.
Also make conformance to CustomDebugStringConvertible unconditional using String(reflecting:) on x and y.
2019-11-10 14:32:09 -05:00
Stephen Canon db2046b7ed Merge pull request #63 from NevinBR/patch-1
Fixed typo in a comment
2019-11-10 13:58:16 -05:00
NevinBR ab19494638 Fixed typo in a comment 2019-11-10 10:35:22 -05:00
Stephen Canon d065a84750 Merge pull request #61 from Wildchild9/master
Fixed `Complex` division by zero to return .infinity
2019-11-09 15:38:50 -05:00
Noah Wilder 6ac60de457 Added two more test cases for Complex division by zero 2019-11-09 15:18:30 -05:00
Noah Wilder d5e0caa6f8 Added test cases for division by zero 2019-11-09 15:11:55 -05:00
Noah Wilder b46bd9a83e Fixed Complex division by zero to return .infinity 2019-11-09 01:37:27 -05:00
Stephen Canon 41bca53809 Merge pull request #59 from t-ae/complex-signed-numeric
Make Complex SignedNumeric
2019-11-08 21:24:12 -05:00
araki cd4a8b41cf Make Complex SignedNumeric 2019-11-09 10:13:37 +09:00
Ron Olson 86e9087ab5 Added LinuxMain.swift so numerics can be used on Linux 2019-11-08 15:10:38 -06:00
Stephen Canon 4a23df7c2b Merge pull request #45 from Sajjon/update_readme_links_grammar
Update README
2019-11-08 10:56:26 -05:00
Sajjon 44e2454752 Update README
Formatting
Grammar & punctuation
Links
2019-11-08 16:52:30 +01:00
Stephen Canon 5d4368257e Merge pull request #36 from Sajjon/fix_typos_in_code
Fix typos in source code
2019-11-08 09:33:23 -05:00
Stephen Canon fe21f6951b Merge pull request #43 from Wildchild9/master
Added setters for `real` and `imaginary` properties of `Complex`
2019-11-08 08:48:30 -05:00
Sajjon 0cc4950453 Adding MARK in long source file 2019-11-08 08:39:27 +01:00
Sajjon c423f9592b Fix typos in source code 2019-11-08 08:39:07 +01:00
Noah Wilder 0308def714 Added setters for real and imaginary properties of Complex 2019-11-07 23:51:40 -05:00
Stephen Canon 67528d4a53 Merge pull request #34 from Sajjon/markdown_rendering
Add '.xcodesamplecode.plist' file to achieve proper markdown rendering
2019-11-07 19:01:00 -05:00
Sajjon 6ac520ac59 Add '.xcodesamplecode.plist' file to achieve proper markdown rendering within Xcode, e.g. of README 2019-11-08 00:31:01 +01:00
Stephen Canon 0761270055 Merge pull request #31 from ZevEisenberg/patch-1
Add syntax highlighting
2019-11-07 17:27:13 -05:00
Zev Eisenberg 4bc7b77239 Add syntax highlighting. 2019-11-07 16:40:21 -05:00
Stephen Canon 89df234fb6 Merge pull request #30 from stephentyrone/rename-elfns
Rename `ElementaryFunctions` module -> `Real`
2019-11-06 16:50:32 -05:00
Stephen Canon 37253aa0b6 Update Real module README to bring it in line with the Swift Numerics blog post. 2019-11-06 12:58:09 -05:00
Stephen Canon f59e64a1aa Rename ElementaryFunctions module -> Real
No change to the protocols involved, purely a change so that the module that users import shares the name of the feature they are most likely to be using, rather than a somewhat-esoteric implementation detail.
2019-11-06 12:40:12 -05:00
Stephen Canon fe37d9896e Further complex divide benchamark and performance work (#29)
Instead of using @_specialize, mark the rescaled division @_aEIC + inline(never). This more closely matches the semantics of what we want, gets better performance, and fixes the issue for every type, not only the types on which we specialize. This is probably as good as we can do for now.
2019-11-04 11:37:51 -05:00
Stephen Canon a2353c82df Further benchmark improvments, workaround hypot bug. (#28)
Added benchmark version that defeats hoisting part of the divide computation outside of the workloop (but kept the old ones as well, because *both* are good representitives of what we want to track). Also found a bug in macOS hypot very close to the overflow boundary for the naive algorithm, and added a workaround (also reported the bug).
2019-11-02 21:40:00 -04:00
Stephen Canon e3b632a3c4 Merge pull request #27 from stephentyrone/master
More complex testing, and split it apart into multiple files.
2019-11-01 21:22:41 -04:00