Commit Graph
44 Commits
Author SHA1 Message Date
Stephen Canon f6b0aeb607 Remove _mulAdd in favor of Relaxed.multiplyAdd. 2023-04-26 08:56:43 -04:00
Steve (Numerics) Canon 30c01a9fc5 Possible spelling: Relaxed.sum/product. 2023-04-26 08:56:43 -04:00
Stephen Canon e601f16e20 Mark Complex Sendable when the underlying RealType is. 2022-09-30 14:07:49 -04:00
Stephen Canon 60a3edbaa9 Further improvement to Complex.pow(_:Self,_:Self) edge cases.
Bring pow(zero, w) in line with the behavior of pow for the underlying real type.
2022-09-17 14:56:29 -04:00
Stephen Canon b9e8b970f2 Fixup indentation. 2022-09-15 15:39:34 -04:00
Stephen Canon d34f5636c4 Fix the edge-case handling of Complex.pow(.zero, <int>) 2022-09-15 15:07:06 -04:00
Stephen Canon 48003e8b7a Fixup banner comment on Scale.swift. 2022-04-07 10:18:54 -04:00
Stephen Canon 027bcc5b8e Remove conformance of Complex to Differentiable
The conformance was breaking CI testing, because the CI bots use a macOS version that predates availability of the _Differentiation module, and the compiler-generated differentation operations have neither availability attributes nor checks, so any reference to those operations simply crashes in dyld because the library is not present. We can add availability, but that's not really accurate either, because these operations are not actually binary-stable, so while we wouldn't crash in dyld, we also might not work correctly in the future. We could mark them unavailable on Apple platforms, but that's also not quite right (and further means that they're not going to get a lot of attention). The best solution seems to be to remove the conformance (which was never source-stable).
2022-04-06 14:41:04 -04:00
Stephen Canon 270972dd8a Minor documentation formatting cleanup. 2022-04-06 11:50:25 -04:00
Stephen Canon 27f8192a63 Attempt to work around CI misconfiguration by removing Complex Differentiable conformance. 2022-04-06 09:58:40 -04:00
Stephen Canon c4f8886a11 Move baseline supported tools version to 5.4. 2022-03-05 10:18:13 -05:00
Stephen Canon 445b0da15d Update complex cmake for refactoring. 2021-12-16 13:38:20 -05:00
Stephen Canon d329698498 remove F16/F80 stubs for complex elfns. 2021-12-11 14:57:36 -05:00
Stephen Canon ba65b0fc77 Refactor Complex module for finer granularity. 2021-12-11 11:19:29 -05:00
Markus Winter 63df367680 Fix a typo in the comments of sinh expression 2021-10-13 11:47:45 +02:00
ਰਾਹੁਲ ਭੇਲੇ c3806f23ff Removed number lines for easy clipboard copying. 2021-09-25 15:11:26 +05:30
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 CanonandXiaodi 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 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 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
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
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
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 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 7e032e20fc Merge remote-tracking branch 'upstream/swift-5.3' 2020-08-04 08:26:26 -04:00
Stephen Canon 1ec79f5270 Add Swift version check for differentiable features. 2020-08-04 08:26:22 -04:00
Stephen Canon 40b5a03063 Merge pull request #105 from compnerd/cmake
build: add initial CMake based build system
2020-07-03 09:49:53 -04:00
Stephen Canon 085f6dab2e Merge branch 'master' into swift-5.3 2020-07-01 09:31:40 -04:00
Saleem Abdulrasool f30f73ed10 build: add initial CMake based build system
This adds a CMake based build, which enables the build of swift-numerics
on Windows.  This currently does not add the test suite to the build as
there are still some issues to work out in building the full test suite
which require additional math operations to fully build.
2020-06-25 09:46:54 -07:00
Dan Zheng 86f0b33c65 Define Complex.zeroTangentVectorInitializer.
The `Differentiable.zeroTangentVectorInitializer` protocol requirement is a
closure producing a zero tangent vector, capturing minimal information from
`self`.

Fixes the `Complex: Differentiable` conformance for master toolchains.
2020-06-08 19:53:43 -07:00
Markus Winter 5f09b7ef22 Update documentation in ComplexModule
Replace the now deprecated unsafeLengthSquared reference with the newer lengthSquared in the README.md of the Complex module.
2020-05-26 15:45:37 +02:00
Stephen Canon 750170404a The derivative of Complex.init(_:_:) is broken with the current Xcode toolchain.
Remove it for now; it'll still be present on the -5.3 branch, so we'll pick it up again when we're able to.
2020-05-01 08:50:32 -04:00
Stephen Canon a5cc950a86 Merge pull request #111 from rxwei/complex-derivatives
Make 'Complex' differentiable.
2020-04-22 16:43:46 -04:00
Richard Wei 488e250259 Make 'Complex' differentiable.
* Conform `Complex` to `Differentiable`.
* Define derivatives for `init(_:_:)`, `real`, `imaginary`, `conjugate`, `+(_:_:)`, `-(_:_:)`, `*(_:_:)`, `/(_:_:)`.

Gated under `#if canImport(_Differentiation)`.
2020-04-22 13:35:36 -07:00
Stephen Canon 9dba38cc1a Update README.md 2020-02-21 09:22:40 -05:00
Stephen Canon 76954c06a7 Back to trailing 'Module' 2020-02-21 09:22:40 -05:00