Skip to content

Commit

Permalink
Fix Atan2
Browse files Browse the repository at this point in the history
  • Loading branch information
HamletTanyavong committed Nov 10, 2023
1 parent 6dde256 commit 6373583
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Mathematics.NET/AutoDiff/GradientTape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ public Variable Atan(Variable x)
public Variable Atan2(Variable y, Variable x)
{
var u = Real.One / (x.Value * x.Value + y.Value * y.Value);
_nodes.Add(new(-x.Value * u, y.Value * u, y._index, x._index));
_nodes.Add(new(x.Value * u, -y.Value * u, y._index, x._index));
return new(_nodes.Count - 1, Real.Atan2(y.Value, x.Value));
}

Expand Down

0 comments on commit 6373583

Please sign in to comment.