Programming with HP50g
|
08-30-2015, 02:02 PM
(This post was last modified: 08-30-2015 02:04 PM by Allen.)
Post: #27
|
|||
|
|||
RE: Programming with HP50g
(08-30-2015 07:24 AM)Gerson W. Barbosa Wrote: These make for nice HP-42S solutions: Gerson, yes, nicely written! Your program LBL A is exactly the approach used by the "less complex" approach on the 48g. I was looking for a way to calculate \(A^3B-AB^3 = AB(A^2-B^2) \) and thought.. wouldn't it be nice if we could make \(B\) imaginary before squaring to save a subtraction. Happily, both \(A^2-B^2 \) and \(AB\) appear in the real and imaginary part of \( z^2=(A+iB)^2 = A^2-B^2 +i2AB \), however it is necessary to halve the product just as you did in Program LBL A: \begin{equation} \frac{\operatorname{Im}(z^2) \operatorname{Re}(z^2)}{2} =A^3B-AB^3 \end{equation} I had explored a way to use the matrix determinant to calculate \begin{equation} \operatorname{det} \begin{bmatrix} A^2 & B^2 \\ AB & AB \end{bmatrix} = A^3B-AB^3 \end{equation} But, alas, the "stack stuff" needed to get A^2, B^2 and AB onto the stack was going to exceed 1 command. Code:
I also found if one expands \(z^n\) in the manner of this solution, it creates a multi-dimensional, multi-variate complex pascal's triangle. The solutions here only deal with a few elements: Image from: "Pascal's triangle 5" by User:Conrad.Irwin originally User:Drini - Extracted from Image:PascalSimetria.svg with minor alterations. Licensed under CC BY-SA 3.0 via Commons - https://commons.wikimedia.org/wiki/File:...ngle_5.svg 17bii | 32s | 32sii | 41c | 41cv | 41cx | 42s | 48g | 48g+ | 48gx | 50g | 30b |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)