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.
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.
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.
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.
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 are _mostly_ implementation hooks for Complex, but are generally useful, so I've made them public. Experimental, subject to renaming, especially mulAdd.
The `Numerics` module does not provide any symbols. As a workaround,
provide the force link support. Doing so exposes a bug in TBD
validation (SR-12254), which requires a workaround as well. This
enables the use of `import Numerics` on Windows.
The most general version of the API is now defined on AA as:
```
public func isApproximatelyEqual<Magnitude>(
to other: Self,
absoluteTolerance: Magnitude,
relativeTolerance: Magnitude = 0,
norm: (Self) -> Magnitude
) -> Bool where Magnitude: FloatingPoint {
```
Note that AA does not have the magnitude property, so we can't default the norm in this setting. Therefore the following is kept on Numeric:
```
public func isApproximatelyEqual(
to other: Self,
absoluteTolerance: Magnitude,
relativeTolerance: Magnitude = 0
) -> Bool {
self.isApproximatelyEqual(
to: other,
absoluteTolerance: absoluteTolerance,
relativeTolerance: relativeTolerance,
norm: \.magnitude
)
}
```
to provide the operation with norm defaulted (note: it's not optional, because then this would call itself).