Open alshedivat opened 4 months ago
when qrot[r, r] is close to 0, ruby might represent it with a small negative value (e.g., -2.8475347e-16), which results in error when passed to Math.sqrt. adding a small epsilon constant to qrot[r, r] inside Math.sqrt solves the issue.
qrot[r, r]
-2.8475347e-16
Math.sqrt
when
qrot[r, r]
is close to 0, ruby might represent it with a small negative value (e.g.,-2.8475347e-16
), which results in error when passed toMath.sqrt
. adding a small epsilon constant toqrot[r, r]
insideMath.sqrt
solves the issue.