The current evalf() is used to evaluate a numerical expression into a floating-point number using an arbitrary precision library mpmath.
What I want to do is to get the best answer for different ranges that varies from (-inf, inf) without increasing precision. for example: expr1 = (x + 1)**0.5 - x**0.5 when we calculate it for x = 10000000000000000.98698698, we get 0 - expr1.subs(x,10000000000000000.98698698) = 0 but if we rewrite the expr1 as 1/(x**0.5 + (x + 1)**0.5), we get a better answer without catastrophic cancellation as in the previous case. - expr2 = 1/(x**0.5 + (x + 1)**0.5) - expr2.subs(x,10000000000000000.98698698) = 5.00000000000000e-9 I am proposing to implement this paper: https://herbie.uwplse.org/pldi15-paper.pdf - Where an expression can be rewritten to get the best possible answer without increasing the precision. - The rewriting database will have different function and properties like commutativity, associativity, distributivity, (x + y) = (x**2 - y**2)/(x - y), (x - y) = (x**3 - y**3)/(x**2 + y**2 + x*y), x = exp(log( x )) etc. - I want to create a class where a symbolic expression along with its optional range is given as an input, which will be rewritten to get the best possible expression. Please correct me if I have made mistake in understanding the things, also suggest the scope and changes for this. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/bf9bcb66-d1d4-4f29-b752-b8db55c7b554%40googlegroups.com.