Post Reply 
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:
Program LBL A
Program LBL B

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:

<<"stack stuff"  DUP 2 IDN SIZE ->ARR DET>>

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: pascalstriangle.jpg]

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

Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Programming with HP50g - tigger - 08-07-2015, 09:53 AM
RE: Programming with HP50g - Gerald H - 08-07-2015, 10:05 AM
RE: Programming with HP50g - rprosperi - 08-07-2015, 03:19 PM
RE: Programming with HP50g - Allen - 08-29-2015, 08:11 PM
RE: Programming with HP50g - Allen - 08-30-2015 02:02 PM
RE: Programming with HP50g - Allen - 08-31-2015, 12:57 AM
RE: Programming with HP50g - BartDB - 08-07-2015, 01:27 PM
RE: Programming with HP50g - tigger - 08-28-2015, 05:38 PM
RE: Programming with HP50g - BartDB - 08-28-2015, 05:48 PM
RE: Programming with HP50g - tigger - 08-31-2015, 09:26 AM
RE: Programming with HP50g - Valfisio - 08-09-2015, 08:56 AM
RE: Programming with HP50g - Jlouis - 08-09-2015, 01:06 PM
RE: Programming with HP50g - Brad Barton - 08-10-2015, 03:43 AM
RE: Programming with HP50g - Tugdual - 08-10-2015, 05:53 AM
RE: Programming with HP50g - Maro - 08-10-2015, 06:03 AM
RE: Programming with HP50g - DavidM - 08-10-2015, 11:21 PM
RE: Programming with HP50g - Gilles - 08-09-2015, 08:17 PM
RE: Programming with HP50g - Gerald H - 08-10-2015, 06:40 AM
RE: Programming with HP50g - Tugdual - 08-10-2015, 07:23 AM
RE: Programming with HP50g - Tugdual - 08-29-2015, 05:31 PM
RE: Programming with HP50g - Brad Barton - 08-11-2015, 02:31 PM
RE: Programming with HP50g - Brad Barton - 08-16-2015, 01:43 AM
RE: Programming with HP50g - tigger - 08-29-2015, 09:33 AM
RE: Programming with HP50g - BartDB - 08-29-2015, 03:56 PM
RE: Programming with HP50g - Gerald H - 08-30-2015, 05:10 AM



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