Skip to content

Commit 53642d5

Browse files
committed
[NFC] Fix the formula for reciprocal calculation.
Differential Revision: https://reviews.llvm.org/D107713
1 parent 15acaad commit 53642d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22877,7 +22877,7 @@ SDValue DAGCombiner::BuildLogBase2(SDValue V, const SDLoc &DL) {
2287722877

2287822878
/// Newton iteration for a function: F(X) is X_{i+1} = X_i - F(X_i)/F'(X_i)
2287922879
/// For the reciprocal, we need to find the zero of the function:
22880-
/// F(X) = A X - 1 [which has a zero at X = 1/A]
22880+
/// F(X) = 1/X - A [which has a zero at X = 1/A]
2288122881
/// =>
2288222882
/// X_{i+1} = X_i (2 - A X_i) = X_i + X_i (1 - A X_i) [this second form
2288322883
/// does not require additional intermediate precision]

0 commit comments

Comments
 (0)