Skip to content
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

Conform Complex to Elementary Functions #162

Merged
merged 29 commits into from Nov 9, 2020
Merged

Conform Complex to Elementary Functions #162

merged 29 commits into from Nov 9, 2020

Conversation

stephentyrone
Copy link
Member

This retains a few todos, and additional testing coverage is needed, but constitutes a basically sane first pass on elementary functions support for Complex.

- Renamed scaled/unscaled to multiplied/divided
- Adopted new Real module name
- Adopted expMinusOne, log(onePlus:) names
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.
First pass over hyperbolics and trig functions for Complex.
- Renamed scaled/unscaled to multiplied/divided
- Adopted new Real module name
- Adopted expMinusOne, log(onePlus:) names
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.
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.
Augmented arithmetic implementations of log and log(onePlus:) for enhanced accuracy close to the circle where the real part of the result vanishes.
@stephentyrone stephentyrone merged commit ae364a2 into main Nov 9, 2020
@stephentyrone stephentyrone deleted the complex-elfns branch November 9, 2020 16:39
texasmichelle added a commit to tensorflow/swift-apis that referenced this pull request Nov 9, 2020
The CMake build is currently broken on `main`, so use a commit prior to
the addition of `Augmented` in apple/swift-numerics#162.

Resolves the error:
swift-numerics/Sources/ComplexModule/ElementaryFunctions.swift:304:17: error: cannot find 'Augmented' in scope
    let (a,b) = Augmented.twoProdFMA(u, u)
                ^~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant