-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
determinant of matrix with tiny numbers #3135
Comments
Thanks for reporting. That is indeed odd. When changing this first value to math.det([[0,-1,1],[-0.8660253882408142,0.5,1],[-0.6495190262794495, -0.3749999701976776,1]])
// 0.43301264595909744 I also tried to evaluate this as bignumbers, that works correct. Anyone able to help debug this issue? |
Hi, I did run into a solution: The function function isZeroNumber (x) {
return x === 0
} That doesn't take into account function isZero(x){
return equalScalar(x, 0) // takes epsilon into account
} Then it works math.det([
[6.123234262925839e-17,-1,1],
[-0.8660253882408142,0.5,1],
[-0.6495190262794495, -0.3749999701976776,1]
]);
// 0.4330126459590976 So a simple change would be to use the made up function
If that's the case maybe some other functions should also follow that rule. |
O wow, thanks for debugging this issue David! My preference has to improve |
|
Including a relevant discussion #2838 |
I think the three of
|
This is fixed by #3139 |
Ah yes! Closing |
math.det([[6.123234262925839e-17,-1,1],[-0.8660253882408142,0.5,1],[-0.6495190262794495, -0.3749999701976776,1]]);
returns
0
, while (the only change is in the first number frome-17
toe-10
)math.det([[6.123234262925839e-10,-1,1],[-0.8660253882408142,0.5,1],[-0.6495190262794495, -0.3749999701976776,1]]);
returns
0.433
(the correct result).The first result is mathematically incorrect, and I am not aware of any numerical issues that could be causing this. Therefore, I believe it is a bug.
The text was updated successfully, but these errors were encountered: