(10C) Mortgage Loan Interest Rate
|
11-03-2018, 01:51 PM
(This post was last modified: 11-05-2018 12:03 AM by Albert Chan.)
Post: #9
|
|||
|
|||
RE: (10C) Mortgage Loan Interest Rate
PHP Code: def nsolve_i(n, r, eps=1e-8, verbal=True): Tried using Newton's method. It is not as fast, unless f(i) is inlined. Also, if eps is set too small, i will not converge. Code: >>> nsolve_i(n=36, r=86.67/2500) If newton's method apply to √f(i), i converge faster. Just replace above di, with the commented version. Code: >>> nsolve_i(n=36, r=86.67/2500) # √f(i) version Correct i = 0x1.99bfbc11210d4P-7 ~ 0.01250454600290888 Although √f(i) version does 1 less iteration, it is more accurate (-26 ULP vs +45 ULP) Correction: Newton's method is actually faster (with similar error) I had compared the speed with secant's method using same eps = 1e-8 This is not fair to the Newton version, since the result had a few more good digits. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(10C) Mortgage Loan Interest Rate - Gamo - 10-31-2018, 04:49 AM
RE: (10C) Mortgage Loan Interest Rate - Albert Chan - 11-01-2018, 03:22 AM
RE: (10C) Mortgage Loan Interest Rate - Dieter - 11-01-2018, 12:40 PM
RE: (10C) Mortgage Loan Interest Rate - Albert Chan - 11-01-2018, 02:39 PM
RE: (10C) Mortgage Loan Interest Rate - Dieter - 11-01-2018, 08:11 PM
RE: (10C) Mortgage Loan Interest Rate - Gamo - 11-01-2018, 02:00 PM
RE: (10C) Mortgage Loan Interest Rate - Albert Chan - 11-01-2018, 05:02 PM
RE: (10C) Mortgage Loan Interest Rate - Albert Chan - 11-03-2018, 12:02 AM
RE: (10C) Mortgage Loan Interest Rate - Albert Chan - 11-03-2018 01:51 PM
RE: (10C) Mortgage Loan Interest Rate - Dieter - 11-03-2018, 06:11 PM
RE: (10C) Mortgage Loan Interest Rate - Albert Chan - 11-03-2018, 11:34 PM
RE: (10C) Mortgage Loan Interest Rate - Albert Chan - 11-06-2018, 02:26 AM
|
User(s) browsing this thread: 2 Guest(s)