(15C) Halley's Method
|
02-26-2022, 11:09 AM
(This post was last modified: 06-18-2022 10:01 AM by Thomas Klemm.)
Post: #1
|
|||
|
|||
(15C) Halley's Method
Halley's Method
References
Formula We start with Halley's Irrational Formula: \(C_f(x)=x-\frac{2f(x)}{f{'}(x)+\sqrt{[f{'}(x)]^2-2f(x)f{''}(x)}}\) However, we reduce the fraction with \(f{'}(x)\) to get: \(C_f(x)=x-\frac{\frac{2f(x)}{f{'}(x)}}{1 + \sqrt{1 - \frac{2f(x)f{''}(x)}{[f{'}(x)]^2}}}\) This allows us to reuse the following expression: \(\frac{2f(x)}{f{'}(x)}\) Also the expression avoids cancellation if \(f(x) \to 0\). This is not the case for the alternative expression: \(C_f(x)=x-\frac{1 - \sqrt{1 - \frac{2f(x)f{''}(x)}{[f{'}(x)]^2}}}{\frac{f{''}(x)}{f{'}(x)}}\) Definitions These definitions are used:
Registers Intermediate results are kept in these registers: \(\begin{matrix} R_0 & h \\ R_1 & x \\ R_2 & y \\ R_3 & f^{-}_x \\ R_4 & f^{-}_y \\ R_5 & f_x \\ R_6 & f_y \\ I & \text{program} \\ \end{matrix}\) Description These are the steps of program A: 002 - 004: store \(z\) 005 - 062: calculate the next approximation 006 - 011: \(f(z - h)\) 012 - 016: \(f(z)\) 017 - 018: \(f(z + h)\) 019 - 029: \(f{'}\) 030 - 036: \(f{''}\) 037 - 040: \(2f \div f{'}\) 041 - 043: \(f{''} \div f{'}\) 045 - 053: \(dz\) 054 - 056: \(z = z - dz\) 057 - 062: loop until it is good enough 063 - 066: return \(z\) 067 - 075: calculate \(f(z + w) | w \in \{-h, 0, h\}\) The programs B - E are examples from Valentin's article. Example The step-size h is stored in register 0, while the name/number of the program is specified in the variable I. So let's assume we want to solve program B with step-size h = 10-4 and starting guess 2: RCL MATRIX B STO I EEX 4 CHS STO 0 2 A Intermediate values of |dz| are displayed: (( running )) 0.148589460 (( running )) 0.002695411 (( running )) 0.000000017 (( running )) 0.000000000 (( running )) 1.854105968 Should that annoy you just remove the PSE-command in line 058. Programs A: Halley's Method Code: 001 { 42 21 11 } f LBL A B: Find a root of : \(x^x = \pi\) Code: 076 { 42 21 12 } f LBL B C: Find all roots of: \(( 2 + 3i ) x^3 - (1 + 2i ) x^2 - ( 3 + 4i ) x - ( 6 + 8i ) = 0\) Code: 081 { 42 21 13 } f LBL C D: Attempt to find a complex root of: \(x^3 - 6x - 2 = 0\) Code: 105 { 42 21 14 } f LBL D E: Solve Leonardo di Pisa's equation: \(x^3 + 2 x^2 + 10 x - 20 = 0\) Code: 113 { 42 21 15 } f LBL E |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(15C) Halley's Method - Thomas Klemm - 02-26-2022 11:09 AM
RE: (15C) Halley's Method - Albert Chan - 02-26-2022, 03:48 PM
RE: (15C) Halley's Method - Albert Chan - 06-11-2022, 04:12 PM
RE: (15C) Halley's Method - Albert Chan - 06-14-2022, 06:22 PM
RE: (15C) Halley's Method - Gil - 06-14-2022, 01:20 AM
RE: (15C) Halley's Method - Albert Chan - 06-14-2022, 02:59 AM
RE: (15C) Halley's Method - Albert Chan - 06-18-2022, 03:37 PM
RE: (15C) Halley's Method - Gil - 06-14-2022, 07:33 AM
|
User(s) browsing this thread: 1 Guest(s)