Feature SS-167
2 votes

If numeric eval fails then simplify symbolically and retry

Created by Martin Kraska on 6/22/2014 11:45 PM Last Updated by Mike Kaganski on 5/10/2016 2:33 PM
Logged: 0   (hrs)


Currently, if an expression is evaluated numerically, the computation is done with the expression as it is, i.e. without any symbolic optimization. This leads to complaints about undefined variables in cases where these variables could easily be cancelled out.

Users fight this by providing arbitrary values but feel like cheating. A milder cheat is to use an intermediate variable with symbolically optimized definition. Both is not intuitive (requires explanation, is sort of a trick).

I propose the following: if a result fails to display numerically, then apply symbolic optimization and retry numeric evaluation.

    Mike Kaganski (Tuesday, May 10, 2016 2:33 PM) #

Ok, thanks Andrey for clarification :)

    smath (Tuesday, May 10, 2016 2:24 PM) #


Yes, as I already mentioned, numeric engine uses symbolic one for units handling only. Numeric cannot include symbolic preprocessing simply because of performance related issues.

SS-2337 closed with solution: "By design". That means I do not want to change application behavior as suggested in the ticket. All optimization modes will remain the same and will be available in context menu. I plan to rework current approach as a complex set of updates in future, but this is out of scope of that ticket.

Best regards.

    Mike Kaganski (Tuesday, May 10, 2016 2:19 AM) #

This is indeed a good news,

but it shows that actually numeric evaluation does not include symbolic preprocessing (unlike was stated in SS-2337, that was closed for unclear reason, while Andrey stated that he plans to eventually do that - so I supposed it should stay alive until it's done). There it was said: "Numeric engine uses symbolic engine inside". Well, maybe it's ONLY used for units now, and I just misunderstood what was written there.

If numeric would actually include symbolic preprocessing, then this second step wouldn't be required at all.

    smath (Friday, May 6, 2016 2:29 PM) #

Done. Works good (see attached screenshot).

All tests passed ok.

    smath (Friday, May 6, 2016 12:20 PM) #

Wow! Very interesting approach!

Furthermore, do not see any negative effects here... Will try it.

Thank you!