Plus42 Equations, Preview Release
|
02-14-2022, 12:15 PM
Post: #336
|
|||
|
|||
RE: Plus42 Equations, Preview Release
It looks like I was wrong to make L() invertible again. I have come up with a model of the behavior of the HP solver that appears to account for everything I've read and all the results from experiments that I've done so far, and it's actually pretty simple:
The HP solver tries the direct solver if the variable to be solved for appears exactly once, not counting appearances as the parameter of G() or S(), or as the first parameter of L(). The direct solver works its way towards the variable to be solved for, and any problem causes it to abort, but with an important difference: when it encounters a function for which it doesn't have a direct inverse (and that includes L()!), it aborts and moves on to try the numerical solver instead, but when it encounters a division by zero, it aborts and doesn't try the numerical solver, either. This explains its behavior with L(X:A)*L(Y:B)*0+G(X)+G(Y): A and B both appear exactly once, making the function a candidate for the direct solver, but when it tries to isolate A, it gets L(X:A)*L(Y:B)*0+G(X)+G(Y)=0 L(X:A)*L(Y:B)*0+G(X)=0-G(Y) L(X:A)*L(Y:B)*0=0-G(Y)-G(X) L(X:A)*L(Y:B)=(0-G(Y)-G(X))/0 <-- error: division by zero! If that factor is anything other than zero, lets make it 3, the derivation becomes: L(X:A)*L(Y:B)*3+G(X)+G(Y)=0 L(X:A)*L(Y:B)*3+G(X)=0-G(Y) L(X:A)*L(Y:B)*3=0-G(Y)-G(X) L(X:A)*L(Y:B)=(0-G(Y)-G(X))/3 L(X:A)=(0-G(Y)-G(X))/3/L(Y:B) and then it's stuck because L() is considered non-invertible, so it can't isolate A from there. Why the numerical solver is tried when the inverse fails because of a non-invertible function, but not when the inverse fails because of a division by zero, I don't know, but there you are. Adding +A*0+B*0 to the expression works because then both A and B appear more than once, so the direct solver isn't even tried, and the division by zero never happens. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 19 Guest(s)