Skip to content

Commit

Permalink
Fix paranthesis for derivative of division operator
Browse files Browse the repository at this point in the history
  • Loading branch information
vaithak committed May 8, 2024
1 parent 3f0e5a1 commit 8c44ce0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Differentiator/ReverseModeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2267,10 +2267,10 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context,
Expr* dr = nullptr;
if (dfdx()) {
Expr* RxR = BuildParens(BuildOp(BO_Mul, RStored, RStored));
dr = BuildOp(
BO_Mul, dfdx(),
BuildOp(UO_Minus,
BuildOp(BO_Div, LStored.getRevSweepAsExpr(), RxR)));
dr = BuildOp(BO_Mul, dfdx(),
BuildOp(UO_Minus,
BuildParens(BuildOp(
BO_Div, LStored.getRevSweepAsExpr(), RxR))));
dr = StoreAndRef(dr, direction::reverse);
}
Rdiff = Visit(R, dr);
Expand Down

0 comments on commit 8c44ce0

Please sign in to comment.