Fix typo expMinusOne/exp in near-overflow check.

This commit is contained in:
Stephen Canon committed 2020-10-01 16:39:11 -04:00
1 parent 4798b68203
commit efbe11a734
1 file changed
+1 -1
@@ -48,7 +48,7 @@ final class ElementaryFunctionTests: XCTestCase {
// exp((log(gfm) + log(9/8), π/4) = exp((log(gfm*9/8), π/4))
// = gfm*9/8 * (1/sqrt(2), 1/(sqrt(2))
let x = T.log(.greatestFiniteMagnitude) + T.log(9/8)
let huge = Complex<T>.expMinusOne(Complex(x, .pi/4))
let huge = Complex<T>.exp(Complex(x, .pi/4))
let mag = T.greatestFiniteMagnitude/T.sqrt(2) * (9/8)
XCTAssert(huge.real.isApproximatelyEqual(to: mag))
XCTAssert(huge.imaginary.isApproximatelyEqual(to: mag))