Improve performance of function rationalize
#3261
Replies: 2 comments
-
Thanks for reporting. There may be a clear culprit or some infitite loop occurring there. Help debugging this issue would be very welcome. |
Beta Was this translation helpful? Give feedback.
-
I've done some debugging, but I do not see an obvious issue causing this performance issue. I think the logic works fine but is just to inefficient to be able to process an expression this complex, making it take forever. I'll move this issue into a discussion about improving the performance. For reference: there is already a skipped unit test with this example: mathjs/test/unit-tests/function/algebra/rationalize.test.js Lines 126 to 131 in d1ecf44 |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
The rationalize function is experiencing significant performance issues, causing noticeable slowness. In some cases, this slowness leads to the browser crashing.
To Reproduce
I encountered this issue with a different example, but I found a similar problem in the documentation with the following equation:
math.rationalize('x/(1-x)/(x-2)/(x-3)/(x-4) + 2x/ ( (1-2x)/(2-3x) )/ ((3-4x)/(4-5x) )')
Beta Was this translation helpful? Give feedback.
All reactions