Equality - Is this a bug? - Messages
Some equalities are not resulted as "1" but they should be.
If I use eval() they are calculated correctly.
Should I have to use eval() everytime to be sure of boolean calculations?
Below you can find the issue as an example.
Regards
equality.sm (31 KiB) downloaded 29 time(s).
WroteI had encountered this issue last night and tried to simplify it here.
Some equalities are not resulted as "1" but they should be.
If I use eval() they are calculated correctly.
Should I have to use eval() everytime to be sure of boolean calculations?
Below you can find the issue as an example.
Regards
Hi overlord. Usually it's hard to check equalities in math programs. For example, check the issues in Wolfram Mathematica (this picture is from https://reference.wolfram.com/language/ref/Equal.html ):
For numeric testing I use
Best regards.
Alvaro.
WroteHi overlord. Usually it's hard to check equalities in math programs.
That was discussed few months ago ... ULP
ULP in short: Unit (floating numerical) in Last Place
Well explained in Mathematica 4.0 ... Floating maths are granular
Hola Alvaro !
WroteHi overlord. Usually it's hard to check equalities in math programs.
Best regards.
Alvaro.
You are right about arbitrary precision and how computers store numbers, my bad.
But I can't still understand the behavior of SMath in the example below.
As you can see, sqr(3) * sqr(12) = 6. Obviously sqr(36) = 6 too.
But if you subtract them inline, result is not zero unless they are attached to a variable.
When the subtract is assigned to variable c calculation is still not zero.
However if you assign them to a and b, subtraction is magically zero again.
All calculations are set to numerical optimization with SMath by the way.
What I am trying to say, there is an inconsistency between calculations and results.
What I would expect is all answers to be zero or -8.8818x10^-16.
Not to differentiate between expressions. maple() doesn't suffer from this issue.
I have also checked with Wolfram Mathematica 8.0, no matter how I enter result is always 0.
WolframAlpha is showing -8.8818x10^-16 during expression entry but resulted as zero when you press enter.
Regards
Take care Overlord ... Jean
Solve Difficult.sm (9 KiB) downloaded 22 time(s).
Wrote
But I can't still understand the behavior of SMath in the example below.
As you can see, sqr(3) * sqr(12) = 6. Obviously sqr(36) = 6 too.
But if you subtract them inline, result is not zero unless they are attached to a variable.
When the subtract is assigned to variable c calculation is still not zero.
However if you assign them to a and b, subtraction is magically zero again.
All calculations are set to numerical optimization with SMath by the way.
What I am trying to say, there is an inconsistency between calculations and results.
What I would expect is all answers to be zero or -8.8818x10^-16.
Not to differentiate between expressions. ...
SMath convert all numbers to an internal rational representation. This is why, in my opinion, you get different answers doing the roots in one line than store partial results into variables.
Wrote
... maple() doesn't suffer from this issue.
Yes, it have the same issue, but you can't see it inside the maple plugin, because SMath parse values as exact rationals. In maple you can use a dot for indicate floating point numbers
Wrote
I have also checked with Wolfram Mathematica 8.0, no matter how I enter result is always 0.
It's harder to show the same behavior in Mathematica, but you can see it with some other numbers and floating point operations
Hope that this notes helps.
Best regards.
Alvaro.
-
New Posts
-
No New Posts