Skip to content

Testing equivalance could be more smart, easily #159

@davidbludlow

Description

@davidbludlow

Evaluating test(1/m = d/(m*d), 1, 0) and test(1/m = (m-1)/(m*(m-1)), 1, 0) on http://algebrite.org/sandboxes/latest-stable/sandbox.html you will get
image
As you can see, Algebrite was smart enough to know how to evaluate the first command, even but it wasn't smart enough to know how to evaluate the second one, even though the second one is the same as the first, assuming you substitute m-1 in for d.

Obviously it would be too much to ask Algebrite to be perfectly smart all the time, but here is a little trick to use the smarts that it already has to solve this problem. See the command test(0 = simplify(1/m - (m-1)/(m*(m-1))), 1, 0). It yields
image
so it does work for testing equivalence between 1/m and (m-1)/(m*(m-1)).

I propose the the equivalence testing logic is changed to use this different strategy of subtracting the things to see if they simplify to 0, to test for equivalence. (or we can do something else to make it smart enough to be able to handle that equivalence test.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions