Post Reply 
Most impressive/complex/amazing C-series program?
04-18-2018, 06:37 AM
Post: #21
RE: Most impressive/complex/amazing C-series program?
Ha ha! But I asked it for 16 digits, so perhaps it did quite well?
Find all posts by this user
Quote this message in a reply
04-19-2018, 10:24 PM
Post: #22
RE: Most impressive/complex/amazing C-series program?
(04-15-2018 11:23 AM)pier4r Wrote:  I always think that bored people are boring as well.

Speaking for myself, I'm never bored. "Bored", in the usual sense, doesn't apply to me.

Quote:Instead I am amazed by the way Gerson, Valentin and others have a question or a path to find some formulas.

Finding interesting numerical coincidences is vastly overrated, there are an infinite number of them lying around and they're only somewhat noticeable when their "Merit Value" is high and/or their components or results are interesting constants, like \(\pi\) or e, for example.

Re the Merit Value (MV), if you need lots of digits and/or lots of operations to get a low-N-digit result, then the MV is low, everyone can do that, even Wolfram Alpha. On the other hand, if you use just 5 digits and a couple' operations to get a 12-digit result, that's more remarkable and the fewer the digits/operations the better. I can easily post any number of never-seen remarkable ones at a moment's notice

Quote:Too many times I see people saying "I do not know what to do".

You'll never see me like that. Matter of fact, I have a "To Do" list about 18 pages long and am always adding new items to the list faster than I can remove "Done" ones.

Anyway, I'm done with "hijacking" this thread (sorry for that), if you want to discuss it further please create a new thread on the subject, don't answer here.

Regards.
V.
.
Find all posts by this user
Quote this message in a reply
04-20-2018, 10:02 PM
Post: #23
RE: Most impressive/complex/amazing C-series program?
(04-04-2018 11:06 PM)michaelzinn Wrote:  What's the most impressive/complex/amazing/intricate/brilliant program for the 10C/11C/12C/15C/16C in your opinion and why?

01: 0
02: g y,r
03: x<>y
04: g s
05: ÷
06: ×
07: R/S

From here: http://www.hpmuseum.org/forum/thread-618...l#pid55272

(04-04-2018 11:06 PM)michaelzinn Wrote:  and why?

Because this is brillant.

Cs.
Find all posts by this user
Quote this message in a reply
04-21-2018, 10:44 PM (This post was last modified: 04-21-2018 10:45 PM by Gerson W. Barbosa.)
Post: #24
RE: Most impressive/complex/amazing C-series program?
(04-05-2018 11:30 AM)EdS2 Wrote:  It must be worth also mentioning Valentin Albillo's
HP-12C Tried & Tricky Trigonometrics (pdf)
as mentioned in this thread.

Yes, Valentin's program is quite an awesome achievement! If rather than radians its angular mode were degrees, that would have been my trigs program of choice on the HP-12C. Being technically-oriented, I needed my trigonometric functions in degrees, so I decided to write my own program, even though it was kind of reinventing the wheel. Later I finally got a 15C again (and an 11C, and a 42S...), but it was fun to keep trying. My best attempt on the Voyagers was the program for the HP-12C Platinum. It's a pity the Platinum never appealed to Valentin, I wonder what he might have done with 400 steps and two guard digits accessible to the programmer, not to mention a possible new article, "Long Live the HP-12C Platinum !" :-)

Thanks for digging out that old post from 2005! Unfortunately most GWB's posts have been deleted. I wonder why he did that, as he received only kind remarks from everyone, despite his first feeble attempt at trigs. Go figure! :-)

G. W. Barbosa
Find all posts by this user
Quote this message in a reply
04-21-2018, 11:11 PM
Post: #25
RE: Most impressive/complex/amazing C-series program?
(04-21-2018 03:51 PM)Mike (Stgt) Wrote:  
(04-20-2018 10:02 PM)Csaba Tizedes Wrote:  01: 0
02: g y,r
03: x<>y
04: g s
05: ÷
06: ×
07: R/S

This is (for me and up to now) the winner within this survey. Three reasons:
  1. in contrast to compute \(\pi\) by Vieta this routine has probably more purpose in day-to-day life,
  2. it is unbeatable short, and
  3. (less important) it is just the inverse how I get r on the HP41 (lines 23..27).

Just for the record, here is the impressive 12-step 12C program by Katie Wasserman:

[f][P/R]        |              | 
[f]CLEAR[PRGM]  |00-           | 
2               |01-         2 | 
[STO]0          |02-    44   0 | 
[g][SQRT]       |03-    43  21 | 
[STO][/]0       |04- 44 10   0 | 
2               |05-         2 | 
[STO][x]0       |06- 44 20   0 | 
[g][x<=y]       |07-    43  34 | 
[g][GTO]11      |08- 43,33  11 | 
[+]             |09-        40 | 
[g][GTO]03      |10- 43,33  03 | 
[RCL]0          |11-    45   0 | 
[g][GTO]00      |12- 43,33  00 | 
[f][P/R]        |              | 


Sure not of practical utility as your choice, but as beautiful as it can be!

Gerson.
Find all posts by this user
Quote this message in a reply
04-22-2018, 04:58 PM
Post: #26
RE: Most impressive/complex/amazing C-series program?
(04-22-2018 08:36 AM)Mike (Stgt) Wrote:  What belongs to C-series? Only the Voyagers or also an HP-41C?

The original poster explicitly asks:
Quote:What's the most impressive/complex/amazing/intricate/brilliant program for the 10C/11C/12C/15C/16C in your opinion and why?

V.
.
Find all posts by this user
Quote this message in a reply
04-22-2018, 05:48 PM
Post: #27
RE: Most impressive/complex/amazing C-series program?
(04-22-2018 04:58 PM)Valentin Albillo Wrote:  
(04-22-2018 08:36 AM)Mike (Stgt) Wrote:  What belongs to C-series? Only the Voyagers or also an HP-41C?

The original poster explicitly asks:
Quote:What's the most impressive/complex/amazing/intricate/brilliant program for the 10C/11C/12C/15C/16C in your opinion and why?

Sure. But it looks like the OP was not aware that these calculators are usually not called "the C-series".

@michaelzinn: these calculators are commonly referred to as the Voyager series. The "C" only stands for "continuous memory", which is a feature of many other HP calculators and thus part of their model name (19C, 25C, 29C, 33C, 34C, 41C...). Later this became so common that it was not explicitely mentioned (32s, 42s, 48g, 19b...).

If you want to know more about this you may take a look at the respective page on this site.

Dieter,
always confusing Voyagers and Pioneers. #-)
Find all posts by this user
Quote this message in a reply
04-22-2018, 06:05 PM (This post was last modified: 04-22-2018 06:06 PM by Dieter.)
Post: #28
RE: Most impressive/complex/amazing C-series program?
(04-21-2018 03:51 PM)Mike (Stgt) Wrote:  (less important) it is just the inverse how I get r on the HP41 (lines 23..27).

Yes, that's a quite elegant way of doing a linear regression on the '41. Only the slope m has to be calculated directly, then the y-intercept is ybar – m·xbar and r is m · sx/sy.

(04-21-2018 03:51 PM)Mike (Stgt) Wrote:  BTW, I would replace step 7 by GTO 00 as it acts almost like a RTN, it set the program pointer to line 00 and halts execution...

A GTO 00 definitely would make sense here. Whether this resembles a RTN on other calculators depends on the device itself: The 34C, 15C, 35s and others indeed return to the top of memory ("step 0") if they encounter a RTN (without a pending subroutine call). On the other hand the 67/97 and the 41-series in this case behave as if there was a simple R/S, i.e. they stop at this line and another R/S would continue with the following step. I always wondered why HP did it once this way and once the other way.

Dieter
Find all posts by this user
Quote this message in a reply
04-24-2018, 11:47 PM
Post: #29
RE: Most impressive/complex/amazing C-series program?
(04-24-2018 11:37 AM)Mike (Stgt) Wrote:  ...
Note 2: This routine is published under the Q Public License version 1.0. Basically this obliges you to inform me if you are able to improve this routine. This MoHPC forum gives you the chance to do so.

Ciao.....Mike

*headdesk*

I thought we were done with these licencing issues. /grump

(Post 205)

Regards, BrickViking
HP-50g |Casio fx-9750G+ |Casio fx-9750GII (SH4a)
Visit this user's website Find all posts by this user
Quote this message in a reply
04-25-2018, 10:25 AM
Post: #30
RE: Most impressive/complex/amazing C-series program?
That's the forum thread that prompted my comment. It hasn't been a happy week for us here.
I'm not going to be stupid enough to pretend that I'll get along with everyone on this forum, but
neither am I going to throw my toys out of the cot if someone disagrees with me. That's simply childish.
Personally, I'd hope that Thomas Okken rethinks his initial request to disconnect from this forum.

I once came across a question that raised an interesting discussion here in the BrickViking household:
Would you rather be happy, or would you rather be right? (Presuming you can have only one).
I would ordinarily have fallen on the side of "right", but in this case, I think "happy" gets people further
especially when there isn't universal acceptance of one opinion being "right".

(Post 206)

Regards, BrickViking
HP-50g |Casio fx-9750G+ |Casio fx-9750GII (SH4a)
Visit this user's website Find all posts by this user
Quote this message in a reply
04-25-2018, 10:55 PM
Post: #31
RE: Most impressive/complex/amazing C-series program?
(04-25-2018 09:48 PM)Mike (Stgt) Wrote:  ...it is my kind to show my disdain for these hotheads.

Over here, we call that a p*ss-take.

(04-25-2018 09:48 PM)Mike (Stgt) Wrote:  Hope you recover soon from your *headdesk*.

/M.

And yes, my helmet absorbed the shock from the headdesk. Not sure about my keyboard though. Still, they must make them tough in Logitech-land, this is only my second K750 (solar powered wireless keyboard).

(Post 207)

Regards, BrickViking
HP-50g |Casio fx-9750G+ |Casio fx-9750GII (SH4a)
Visit this user's website Find all posts by this user
Quote this message in a reply
08-10-2018, 06:03 PM
Post: #32
RE: Most impressive/complex/amazing C-series program?
The HP-11C can solve a linear, symmetric 2×2 system using the built-in linear regression with a single operation:
Code:
L.R.

For this to work we have to fill the registers R0 - R5 with the corresponding values of the equation:

\(\begin{bmatrix}
R_2 & R_1 \\
R_1 & R_0
\end{bmatrix}\cdot\begin{bmatrix}
Y \\
X
\end{bmatrix}=\begin{bmatrix}
R_5 \\
R_3
\end{bmatrix}\)

Example:

\(\begin{bmatrix}
2 & -3 \\
-3 & 5
\end{bmatrix}\cdot\begin{bmatrix}
2 \\
-3
\end{bmatrix}=\begin{bmatrix}
13 \\
-21
\end{bmatrix}\)

CLEAR Σ
2 STO 2
-3 STO 1
5 STO 0
13 STO 5
-21 STO 3
L.R.

Y: 2
X: -3


This is used in Bairstow's Method.

Kind regards
Thomas

BTW: Not all models allow this trick as they check the values for consistency prior to calculating the result. E.g. the value of n in register R0 can't be negative.
Find all posts by this user
Quote this message in a reply
08-11-2018, 12:28 PM
Post: #33
RE: Most impressive/complex/amazing C-series program?
(08-10-2018 06:03 PM)Thomas Klemm Wrote:  The HP-11C can solve a linear, symmetric 2×2 system using the built-in linear regression with a single operation ...

This is used in Bairstow's Method.

Just a comment of using linear regression to solve linear problems.
Linear regression routine involves subtraction, that may lose significant digits.

Example, this is from the post that led me to signup for this forum: Five Minutes Challenge

Solve sin(x)/x = 5280/5281, correct value for x ~ 0.03370775881 radians

x value y = sin(x)/x
0.0337 0.9998107291
0.0338 0.9998096042

2-points fitted linear regression, we get 0.03370764002, error ~ -1.19e-7
Interpolated for y = 5280/5281, we get 0.03370774834, error ~ -1.05e-8, 11X better

We can reduce linear regression errors, by making y values different.

x value y = sin(x)/x - 5280/5281
0.0337 +8.7159e-8
0.0338 -1.037714e-6

With these values, solve for y = 0, both methods get the same 0.03370774834
Find all posts by this user
Quote this message in a reply
08-11-2018, 07:01 PM
Post: #34
RE: Most impressive/complex/amazing C-series program?
(08-10-2018 06:03 PM)Thomas Klemm Wrote:  The HP-11C can solve a linear, symmetric 2×2 system using the built-in linear regression with a single operation:
Code:
L.R.

This should also work for non-symmetric matrices: Just multiply the second equation by a12/a21 so that the matrix becomes symmetric. This does not take more than

RCL 1 a21 ÷ STO×0 STO×3

I haven't tested this yet (can't find my 34C at the moment), maybe someone else wants to try this.

Dieter
Find all posts by this user
Quote this message in a reply
08-12-2018, 11:40 AM
Post: #35
RE: Most impressive/complex/amazing C-series program?
(08-11-2018 07:01 PM)Dieter Wrote:  Just multiply the second equation by a12/a21 so that the matrix becomes symmetric.

This doesn't work though if \(a_{12}=0\) or \(a_{21}=0\).
But then you can rearrange the columns such that this is not the case:

\(\begin{bmatrix}
a&b\\
0&d
\end{bmatrix}
\begin{bmatrix}
x\\
y
\end{bmatrix}
=
\begin{bmatrix}
e\\
f
\end{bmatrix}\)



\(\begin{bmatrix}
b&a\\
d&0
\end{bmatrix}
\begin{bmatrix}
y\\
x
\end{bmatrix}
=
\begin{bmatrix}
e\\
f
\end{bmatrix}\)

If both \(c\) and \(d\) are \(0\) the system is degenerate and we probably don't even think of solving it with a calculator.

(08-11-2018 07:01 PM)Dieter Wrote:  This does not take more than

RCL 1 a21 ÷ STO×0 STO×3

Handling all these cases properly gets probably a bit messy soon.

Cheers
Thomas
Find all posts by this user
Quote this message in a reply
08-12-2018, 12:13 PM
Post: #36
RE: Most impressive/complex/amazing C-series program?
(08-11-2018 12:28 PM)Albert Chan Wrote:  Just a comment of using linear regression to solve linear problems.

Not sure if that was not made clear but we're not using the linear regression the way described in your example.
Instead we use the internal algorithm used to solve the linear equations that appear in the context of linear regression with values completely unrelated to that subject.

The internal 13 digit accuracy allows to solve equations where a naïve approach (e.g. by using explicit formulas) would fail due to cancellation.

Example:

\(\begin{bmatrix}
1000001&1000000\\
1000000&999999
\end{bmatrix}
\begin{bmatrix}
x\\
y
\end{bmatrix}
=
\begin{bmatrix}
3000002\\
2999999
\end{bmatrix}\)

The determinant \(1000001\times999999-1000000^2\) turns out to be \(0\) on the HP-11C.

However you can still solve the system by entering:

CLEAR ∑
999999
STO 0
1000000
STO 1
1000001
STO 2
2999999
STO 3
3000002
STO 5
L.R.

Y: 2
X: 1

Thus the solutions are \(x=2, y=1\).

Kind regards
Thomas
Find all posts by this user
Quote this message in a reply
08-12-2018, 02:21 PM
Post: #37
RE: Most impressive/complex/amazing C-series program?
(08-12-2018 12:13 PM)Thomas Klemm Wrote:  Not sure if that was not made clear but we're not using the linear regression the way described in your example.
Instead we use the internal algorithm used to solve the linear equations that appear in the context of linear regression
with values completely unrelated to that subject.

Oh, I see. You are "borrowing" a formula from L.R ... Brilliant
This trick, I could not do on the Casio :-(

Quote:The determinant \(1000001\times999999-1000000^2\) turns out to be \(0\) on the HP-11C.

I recently discovered a trick to get more precision out of a calculator.
This example is from your Quadratic Solver Article:

Calculate B^2 - AC = 735246^2 - 11713 * 46152709

On my Casio, both B^2 and AC got R = 5405866805e2
The tenth digit (5e2) could be off. So, find out last 3 digits:

B^2 % 1e3 = 246 ^ 2 % 1e3 = 516 = 16 + 5e2 (matching R last digit)
AC % 1e3 = 713 * 709 % 1e3 = 517 = 17 + 5e2 (matching R last digit)

So, B^2 - AC = (R + 16) - (R + 17) = -1
Find all posts by this user
Quote this message in a reply
08-12-2018, 05:30 PM
Post: #38
RE: Most impressive/complex/amazing C-series program?
(08-12-2018 02:21 PM)Albert Chan Wrote:  Calculate B^2 - AC = 735246^2 - 11713 * 46152709

On my Casio, both B^2 and AC got R = 5405866805e2
The tenth digit (5e2) could be off. So, find out last 3 digits:

B^2 % 1e3 = 246 ^ 2 % 1e3 = 516 = 16 + 5e2 (matching R last digit)
AC % 1e3 = 713 * 709 % 1e3 = 517 = 17 + 5e2 (matching R last digit)

So, B^2 - AC = (R + 16) - (R + 17) = -1

For the record: such calculations with "extended precision" are easily done on the 35s using vectors. For instance, B^2–AC can be calculated via [B, –A]x[B, C]. This uses the internal 15-digit precision. No Σ+ tricks required. ;-)

Maybe something similar can be done on the 42s with complex numbers.

Dieter
Find all posts by this user
Quote this message in a reply
08-13-2018, 07:15 PM
Post: #39
RE: Most impressive/complex/amazing C-series program?
And that umber is what I call a "NEAR INTEGER".

I was thinking about writing a fiction novel where some geeks were searching for a secret NEAR INTEGER whose calculations would blow up the computer ... if then can infect the computers of the world with a virus that calculates that secret near integer, they can cripple our civilization!!!
Find all posts by this user
Quote this message in a reply
Yesterday, 10:13 AM
Post: #40
RE: Most impressive/complex/amazing C-series program?
(08-13-2018 07:15 PM)Namir Wrote:  And that umber is what I call a "NEAR INTEGER".

I was thinking about writing a fiction novel where some geeks were searching for a secret NEAR INTEGER whose calculations would blow up the computer ... if then can infect the computers of the world with a virus that calculates that secret near integer, they can cripple our civilization!!!

[Spoiler alert...]












You might enjoy the stories of Greg Egan: he has a couple of short stories which resonate with this idea. Unfortunately, the one which is online is the second of the pair, the sequel. You might need to buy his anthology Luminous to read the first. My own copy seems to be out on loan.
Find all posts by this user
Quote this message in a reply
Post Reply 




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