Basic trig functions for the HP-12C - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: Basic trig functions for the HP-12C (/thread-68672.html) |
Basic trig functions for the HP-12C - GWB - 02-05-2005
Regards, GWB
Edited: 6 Feb 2005, 10:06 p.m. after one or more responses were posted
Re: Basic trig functions for the HP-12C - Vieira, Luiz C. (Brazil) - 02-05-2005 Olá, Gerson; (Hello) There is an excellent part of this site named Articles Forum where contributors add important information. One of these is from Viktor Toth and explore the same theme. I'm sure you will appreciate having a look at it here. Also, Valentin Albillo proposed another great solution, but I failled finding the link for it. It's an e-paper (a PDF) available at HPCC. Your version is closer to Valentin's because both use [n!] and [y^x]. Viktor Toth uses a sequence of multiplications in the loop, so it also computes both n! and y^x without using the 'native' HP12C functions themselves. The idea was so interesting for me that I actually used Viktor's scheme to produce this one my own for the HP16C. I'm still in debt with the inverses... It's always good to see new versions of classical problems. I once wrote a program to compute sin(x) for the HP38C, but I lost it. What I cannot forget is the big smille in the beautifull face of the HP38C's owner... Good to see your listings here, 'cumpádi' (fella). Cheers.
Luiz (Brazil) Edited: 5 Feb 2005, 7:51 p.m.
Re: Basic trig functions for the HP-12C - GWB - 02-05-2005 Olá Luiz,
Thanks for your remarks. Machine limitations is always an invite to creativeness. I have not submit anything to the Articles Forum just because I don't have anything realling important. I'll take a closer look to your program, it should run faster, since it avoids both y^x and n!. Well, I bought the 12C this morning, while they are still avaible, and wrote this program in the afternoon (too much to learn to creating something really innovative). See you,
Gerson.
Re: Basic trig functions for the HP-12C - Vieira, Luiz C. (Brazil) - 02-06-2005 Hi, Gerson; Hey, thanks for telling me that my book is still available... I was not sure it was. About the HP12C: is it a Platinum or a plain HP12C? You see, I have both, and I like the additional features available with the HP12Cp. I don't use the algebraic mode unless it is strictly necessary (students with doubts, for exemple), but the extra memory allows for new, bold 'adventures'. I agree with you when you say: 'Machine limitations is always an invite to creativeness.' The 'taste of victory' when reducing the number of steps or the quantity of bytes in a program is unique. Sometimes we, the 'creators', are the only ones to understand the meaning of this, but what to do? Today we have so much memory available with computers and portable devices that just a few 'entrepreneurs' go ahead with the job... About the articles forum: I guess your version of the trig functions for the HP12C deserves a place in there (I see I did not even suggested this fact in my last post... Sorry!). It is original, so it has different approaches. Best regards.
Luiz
Re: Basic trig functions for the HP-12C - Vassilis Prevelakis - 02-06-2005 GWB wrote:
Re: Basic trig functions for the HP-12C - GWB - 02-06-2005 Thanks Vassilis, I had just figured it out when I was rewriting the program about half an hour ago. I read your mind :) I included automatic accuracy based on the number of decimal places in the display. Also deleted an extra ENTER and ROLLDN. Please see the version. Any remark is welcome,
Gerson W. Barbosa
Here is the link to the PDF :-) - Valentin Albillo - 02-07-2005 Hi Luiz, Gerson: Luiz posted:
Thanks for your kind words, here is the link to the PDF version of my 10-page article " HP-12C Tried & Tricky Trigonometrics", which was published in Datafile V21N1, January-February 2002: HP-12C Tried & Tricky Trigonometrics Apart from a discussion of the program itself, it includes performance tables (timing/accuracy) plus some very interesting examples. You'll find it extremely tricky to beat my times and the numerical precision of my results ! :-)
Best regards from V.
(deleted post) - deleted - 02-07-2005 This Message was deleted. This empty message preserves the threading when a post with followup(s) is deleted.
Re: Here is the link to the PDF :-) - Vieira, Luiz C. (Brazil) - 02-07-2005 Hi, Gerson; just wondering about the HP38C program... The HP12C programming features are exactly the same found in the HP38E/C (I own one of each). They both have GTO nn, being nn the number of the step you want it to jump to. Except for bonds, depreciation and computing [n] (the HP12C gives only integer values when computing [n], while the HP38E/C may return non-integer values), all of the rest is the same. Also, the HP38E/C have a switch for selecting both BEG/END and D.MY/M.DY modes simultaneously and they have no [ON]&[key] self tests, only [STO][ENTER]. I tried to find the TRIG program for the HP38C and did not succeed. Do you still have the link OR the listing itself? I'd like to take a look at it. Reference purposes... Best regards.
Luiz
38c trig program - Gene - 02-07-2005 ...came from an old PPC Journal. Can be found at www.rskey.org/gene Just scroll down a bit on the page.
Gene
Re: Here is the link to the PDF :-) - Valentin Albillo - 02-07-2005 Hi, Gerson: Gerson posted: "Thanks for the link. I had been looking for it, but all I could find was (good) references to it."
You're welcome. Should you want any of my past Datafile articles in PDF format, just ask. Besides the trigonometrics one I've explored several other interesting aspects of HP-12C programming in these two articles as well:
Oh, but they are. At eBay ... Besides complex numbers and matrix operations (which includes solving systems of linear equations), it also does numerical integration and root finding, gamma, hyperbolics, linear regression, permutations, combinations, random number generation, etc, etc. A passable machine, methinks ! ;-)
"I think HP could have included some basic scientific functions in their new 12C Platinum." Other brands did much better. SHARP, for instance, had a number of "Business/Financial Pocket Computers", like this SHARP PC-1421 model, a slim, all-metallic, dot-matrix alphanumeric display, large RAM, fast machine which featured a full set of financial functions (including NPV, IRR, etc) plus a full-featured BASIC-language programming environment which of course included 2-dimensional dinamic arrays, strings, and all the usual mathematical functions, trigonometrics included. Needless to say, you could use the financial functions as keywords in your BASIC programs, which meant incredible computing power for financial applications. By the way, contrary to what most people believe, trigonometric functions are indeed used in advanced financial applications, just have a look at this paper published in the Journal of Financial Economics: Spanning and Derivative-Security Valuation These kind of applications can be programmed in a SHARP PC-1421, not so in any of HP's financial models.
Best regards from V.
Link has additional (weird) characters...(was: 38c trig program) - Vieira, Luiz C. (Brazil) - 02-07-2005 Hi, Gene; thanks for the additional info. I tried to jump through the link you post but it failed. If you use it directly you'll have: http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/www.rskey.org/gene and it generates an error. I used "copy and paste" and changed it to what you wrote: http://www.rskey.org/gene and it worked fine. It jumped to your own page, right? Thanks. I'll reach the artiocle, now. Best regards.
Luiz.
I saw the trig program... - Vieira, Luiz C. (Brazil) - 02-07-2005 Hi Gene, Gerson, folks; the trig program mentioned there (earlier at HPCC) uses a fixed number of therms (four) in the sin(x) and cos(x) series. It has no loop for error control/reduction. Made me "remember the days of the old school yard" (Cat Stevens, right?), at the university, when we had to compute sin(x), cos(x) and the like, and the intermediate therms might be written down on paper (three, sometimes four) so the teacher could "see" what we had done. Wow! Some 'nostalgic' moments... Cheers and thanks again, Gene! It's always good to see how things actualy work. Best regards.
Luiz (Brazil)
(deleted post) - deleted - 02-07-2005 This Message was deleted. This empty message preserves the threading when a post with followup(s) is deleted.
(deleted post) - deleted - 02-07-2005 This Message was deleted. This empty message preserves the threading when a post with followup(s) is deleted.
Re: I saw the trig program... - Vieira, Luiz C. (Brazil) - 02-07-2005 Hey, Gerson; you bet... at least about me. I'm having fun at home, dealing with my stuff. Each one has his own way to get inner satisfaction with outer activities. I like usefull activities in general. Of course, I'm talking about doing things by my own... I include posting and reading messages here as pleasant and rewarding. We always read or write something usefull. Even this off-topic words of mine... Best regards and thanks. I did not notice the link you added to your post... Sorry! Cheers.
Luiz.
Re: Here is the link to the PDF :-) - Valentin Albillo - 02-08-2005 Hi, Gerson: Gerson posted: "I've taken a look at your papers. Really impressive work! Are you a mathematicien? (You are acquainted with heavy subjects like quintics)." Just an amateur. Quintics have always been a pet topic of mine since I was 15 or so, I'm fairly acquainted with them by now. As for heavy subjects, just have a look at fractional calculus for a change. Or if you want to do a little I+D, try your hand at writing a program to compute the permanent of an NxN square matrix in polynomial (not exponential) time, you'll get instant recognition.
"I had one 15C in 1984 but I sold it to my youngest brother two years later. I also gave to another brother an
"It is quite a challenge. I wonder if I ever will take it." You're welcome to try, under the same specifications of functionality, range, and accuracy, of course.
Thanks for your posts and best regards from V.
Re: Here is the link to the PDF :-) - Vieira, Luiz C. (Brazil) - 02-08-2005 Quote:Bad Valentin, bad Valentin... Made me remember Adams' books. BTW, I'm reading them and comparing the original text to the translated one. I got into two conclusions:
1- the translator is a hell-of-a writer; he wrote a damn good piece of good stuff. He uses Portuguese terms common in Brazilian speech that make the translated text completely hilarious; You see, I laugh a lot when reading the original Hitchhiker's Guide, but in some descriptive passages, the translator used non-conventional terms that made the translation hilarious as well. Now I have two good readings! Best regards.
Luiz (Brazil)
(deleted post) - deleted - 02-08-2005 This Message was deleted. This empty message preserves the threading when a post with followup(s) is deleted.
Re: HP-15C !? (twas: It'll be back!) - Valentin Albillo - 02-09-2005 Hi again, Gerson: Gerson posted: "By what he told me he used mostly +, -, *, /, %, D%, 1/x, no SIN, COS, etc, so I think he'll do well with the 12C."
Good. I'm glad if my "arm-twisting" suggestion played a part, however small, in your getting the HP-15C back where it belongs. "By the way, I enjoyed your time travel adventure with Sir Isaac Newton. Just think you shoud have taken the 15C along." No, that would've been a terrible mistake, as the one fundamental precaution you must adhere to whenever time travel is involved, as in Time Voyager, is that you must avoid changing history at all costs. The HP-15C boasts root finding using (precisely!) Newton's own method, which he hadn't "invented" at the time of the rendezvous ! He was to use the machine to help him discover it, not reverse-engineer it ! :-) Also, the HP-15C includes matrix operations, and matrix algebra was unknown to Newton, since he died in 1727 and it wasn't until 1850 when Silvester and Cailey formulated the concept of matrices, so exposing him to their concept and uses well ahead of their proper time would probably result in major disturbances to the timeline, and that would be a big no-no. An HP48/49 is also out of the question.
Thanks for your interest and best regards from V.
|