Post Reply 
Plus42 Equations, Preview Release
06-08-2022, 07:36 PM (This post was last modified: 06-08-2022 07:43 PM by Thomas Okken.)
Post: #724
RE: Plus42 Equations, Preview Release
The plan is to prevent those errors by implementing the check you suggested, to rule out the cases where you know in advance that there is no root, or no unique root. I just need to make sure that that check does the right thing in both BEGIN and END modes, and I haven't had the time to look into that yet.

(06-08-2022 05:58 PM)Albert Chan Wrote:  
do_i_pct_yr() Wrote:phloat h = i / 10000;
phloat f2 = tvm_eq(i + h);
phloat d = (f2 - f) / h;

The problem is h = 0 when i = 0, which produced NaN slope.

The bug exist before the new rate guess.
It is just very rare to be hit by it.

Ah, OK. My original code used a hard-coded starting guess of 1e-4, so that particular failure could not occur.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Plus42 Equations, Preview Release - Thomas Okken - 06-08-2022 07:36 PM



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