The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Free42 SOLVE: Better sign reversal detection
10-16-2022, 03:05 PM
Post: #1
Free42 SOLVE: Better sign reversal detection
I didn't have anything planned today and so I decided to finally try to do something about the eternally open issue of SOLVE in Free42 failing to identify sign reversals.

To recap: the issue is with functions, like 1/x, where the solver may end up converging on a point where the function is always positive on one side of the point and always negative on the other, but is actually not continuous across that point. As long as the function always returns without error, SOLVE will return the value where the sign changes, as if it were a root, never reporting Sign Reversal.

I implemented logic to try to identify such sign reversals by keeping track of the difference between f(x1) and f(x2) as x1 and x2 approach the point where the function changes sign. If the difference between f(x1) and f(x2) gets larger three consecutive times right before x1 becomes equal to x2, Sign Reversal is reported.

(Of course none of this applies if SOLVE actually finds an x where the function returns exactly 0; this issue is to tell the difference between cases where the function never returns exactly 0 because of finite precision, and cases where the function actually has a vertical asymptote.)

The change will be in the next releases of Free42 and Plus42, but for now, I uploaded test builds of Free42 for Windows in case anyone is interested in checking out this fix, here.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Free42 SOLVE: Better sign reversal detection - Thomas Okken - 10-16-2022 03:05 PM



User(s) browsing this thread: 1 Guest(s)