Skip to content

Commit 4a2cbc1

Browse files
Merge pull request #166 from NevinBR/patch-5
Cleaning up some comments
2 parents 198da2a + 5a7eb37 commit 4a2cbc1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/ComplexModule/ElementaryFunctions.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
import RealModule
3737

38-
// TODO: uncomment conformance once all implementations are provided.
3938
extension Complex: ElementaryFunctions {
4039

4140
// MARK: - exp-like functions
@@ -343,10 +342,11 @@ extension Complex: ElementaryFunctions {
343342
// be quite painful to calculate. Instead, we can use an approach that
344343
// NevinBR suggested on the Swift forums:
345344
//
346-
// Re(log 1+z) = (log 1+z + log 1+z̅)/2
347-
// = log((1+z)(1+z̅)/2
348-
// = log(1+z+z̅+zz̅)/2
349-
// = log((2+x)x + y²)/2
345+
// Re(log(1+z)) = (log(1+z) + log(1+z̅)) / 2
346+
// = log((1+z)(1+z̅)) / 2
347+
// = log(1 + z + z̅ + zz̅) / 2
348+
// = log(1 + 2x + x² + y²) / 2
349+
// = log(onePlus: (2+x)x + y²) / 2
350350
//
351351
// So now we need to evaluate (2+x)x + y² accurately. To do this,
352352
// we employ augmented arithmetic; the key observation here is that

0 commit comments

Comments
 (0)