Skip to content

Commit

Permalink
[NFC] Fix the formula for reciprocal calculation.
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D107713
  • Loading branch information
LuoYuanke committed Aug 9, 2021
1 parent 15acaad commit 53642d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Expand Up @@ -22877,7 +22877,7 @@ SDValue DAGCombiner::BuildLogBase2(SDValue V, const SDLoc &DL) {

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

0 comments on commit 53642d5

Please sign in to comment.