Test improvements

Improved how tolerance is applied close to infinity for complex division
(this still could use a more principled approach, but at least we're in
the right ballpark now). Tightened up the tolerance for semi-exhaustive
testing too, since that can be done now.
This commit is contained in:
Stephen Canon committed 2024-05-16 08:39:12 -04:00
1 parent 1ba2178227
commit 3fa18ae9b5
2 files changed
+21 -10

No files matched your search

@@ -42,6 +42,8 @@ extension Complex: AlgebraicField {
return z * w.conjugate.divided(by: lenSq)
}
@_alwaysEmitIntoClient // specialization
@inline(never)
public static func rescaledDivide(_ z: Complex, _ w: Complex) -> Complex {
if w.isZero { return .infinity }
if !w.isFinite { return .zero }