Post Reply 
Articles or book(s) about the functions behind a scientific calculator
08-27-2018, 08:29 AM
Post: #21
RE: Articles or book(s) about the functions behind a scientific calculator
(08-26-2018 10:05 AM)sasa Wrote:  However, for early BCD based chips used in calculators, suitable algorithms are a bit different and much slower due extremely limited resources, on the contrary very cheap nowadays MCUs have.

I used BCD and CORDIC algorithms in the firmware I recently completed for the AriCalculator. I will rewrite the algorithms for multiplication and division using the multiplication and division assembly instructions (I used shift and add algorithms in the original firmware), but I think CORDIC algorithms are the best option for the transcendental functions for microcontrollers without a floating-point coprocessor.
Find all posts by this user
Quote this message in a reply
11-23-2018, 03:03 PM (This post was last modified: 11-23-2018 03:04 PM by SlideRule.)
Post: #22
RE: Articles or book(s) about the functions behind a scientific calculator
An eclectic, pedagogical tome (perhaps) & apropos …
An Analysis of Algorithms for Hardware Evaluation of Elementary Functions
Richard Franke
NAVAL POSTGRADUATE SCHOOL Monterey, CA

"Abstract: Algorithms for the automatic evaluation of elementary functions were studied. Available algorithms obtained from current literature were analyzed to determine their suitability for hardware implementation, in terms of their accuracy, convergence rate, and hardware requirements. The functions considered were quotient, arctangent, cosine/sine, exponential, power function, logarithm, tangent, square root, and product".

A decent SE should locate the web repository.

BEST!
SlideRule
Find all posts by this user
Quote this message in a reply
11-23-2018, 04:54 PM
Post: #23
RE: Articles or book(s) about the functions behind a scientific calculator
First hit here looks right. Thanks!

(11-23-2018 03:03 PM)SlideRule Wrote:  An eclectic, pedagogical tome (perhaps) & apropos …
An Analysis of Algorithms for Hardware Evaluation of Elementary Functions
Richard Franke
NAVAL POSTGRADUATE SCHOOL Monterey, CA

"Abstract: Algorithms for the automatic evaluation of elementary functions were studied. Available algorithms obtained from current literature were analyzed to determine their suitability for hardware implementation, in terms of their accuracy, convergence rate, and hardware requirements. The functions considered were quotient, arctangent, cosine/sine, exponential, power function, logarithm, tangent, square root, and product".

A decent SE should locate the web repository.

BEST!
SlideRule
Find all posts by this user
Quote this message in a reply
11-23-2018, 05:04 PM
Post: #24
RE: Articles or book(s) about the functions behind a scientific calculator
(11-23-2018 04:54 PM)KF6GPE Wrote:  First hit … looks right. Thanks!
Gern geschehen

BEST!
SlideRule
Find all posts by this user
Quote this message in a reply
11-23-2018, 06:00 PM (This post was last modified: 11-23-2018 09:11 PM by SlideRule.)
Post: #25
RE: Articles or book(s) about the functions behind a scientific calculator
Chapter 7 The CORDIC Algorithm (pgs 133-156) of Elementary Functions algorithms & implementation 2e by Jean-Michel Muller {© 2006 Birkhäuser} may also be of interest.
excerpt from Chapter 1
This book is devoted to the computation of the elementary functions. Here, we
call elementary functions the most commonly used mathematical functions: sin, cos, tan, sin⁻¹,
cos⁻¹, tan⁻¹, sinh, cosh, tanh, sinh⁻¹, cosh⁻¹, tanh⁻¹, exponentials, and logarithms (we should
merely say “elementary transcendental functions”: from a mathematical point of view, ¹/x is an
elementary function as well as e^x. We do not deal with the basic arithmetic functions in this
book). Theoretically, the elementary functions are not much harder to compute than quotients: it
was shown by Alt [4] that these functions are equivalent to division with respect to Boolean
circuit depth. This means that, roughly speaking, a circuit can output n digits of a sine, cosine,
or logarithm in a time proportional to log n (see also Okabe et al. [249], and Beame et al. [25]).
For practical implementations, however, it is quite different, and much care is necessary if we
want fast and accurate elementary functions.

BEST!
SlideRule
Find all posts by this user
Quote this message in a reply
11-25-2018, 06:11 AM
Post: #26
RE: Articles or book(s) about the functions behind a scientific calculator
Nice. I'm also looking for info on algorithms for solving equations. I think HP journal from late 70's, early 80's had some articles about that. Also looking to write an editor for entering equations for the solver and for graph sketching, e.g. typing x^2 + 1 results in ENTER 2 ^ 1 + . I recall seeing flowcharts from expired HP patents, but not sure if it was for an editor or something else.
Find all posts by this user
Quote this message in a reply
11-25-2018, 11:21 AM
Post: #27
RE: Articles or book(s) about the functions behind a scientific calculator
(11-25-2018 06:11 AM)Dan Wrote:  .... Also looking to write an editor for entering equations for the solver and for graph sketching, e.g. typing x^2 + 1 results in ENTER 2 ^ 1 + . I recall seeing flowcharts from expired HP patents, but not sure if it was for an editor or something else.

https://en.m.wikipedia.org/wiki/Shunting-yard_algorithm
Find all posts by this user
Quote this message in a reply
11-25-2018, 02:52 PM
Post: #28
RE: Articles or book(s) about the functions behind a scientific calculator
Is this project language dependent, ie JAVA, C++, etc? If not, I suggest FORTH as a basis … FORTH Dimension … magazine …

[attachment=6626] vol-3_no-6_pgs-11 … cont.12 …

[attachment=6625] vol-4_no-6_pg-14 … etc.

A decent SE should locate the web-archives of the entire series.

BEST!
SlideRule
Find all posts by this user
Quote this message in a reply
11-25-2018, 06:57 PM
Post: #29
RE: Articles or book(s) about the functions behind a scientific calculator
(11-25-2018 06:11 AM)Dan Wrote:  Also looking to write an editor for entering equations for the solver and for graph sketching, e.g. typing x^2 + 1 results in ENTER 2 ^ 1 + .

On the HP-48 you can install examples by executing the TEACH command.
They are installed in a new directory EXAMPLES.
Further down in PRGS is a program →RPN that allows to translate algebraic expressions to RPN.

Example:

'X^2+1'
→RPN
{ X 2 ^ 1 + }


And then there's the AECROM module for the HP-41 that allows to generate program code based on an equation:

Example:

PROG EXAMPLE
ENTER:FORMULA
X↑2+1
R/S
ENTER:LBL,CONS
X . .=
R/S
ANS=
R/S
PROGRAMMING. .
PACKING
RUN SIZE>=01


This results in the following program:
Code:
LBL "EXAMPLE"
"X=?"
PROMPT
STO 00
2
Y↑X
1
+

How cool is that?

Cheers
Thomas
Find all posts by this user
Quote this message in a reply
11-25-2018, 07:45 PM
Post: #30
RE: Articles or book(s) about the functions behind a scientific calculator
Addendum:
A while ago I've written a Python to FOCAL Compiler.
The program is still online: just click run ▸ and define your function.
Code:
def example(x): 
    return x**2 + 1

And then run:
Code:
translate(example.__code__)

This will produce the following HP-41 program:
Code:
LBL "EXAMPLE"
STO 00 ; x
RDN
RCL 00 ; x
2
Y↑X
1
+
RTN


And then there's tcab's fancy Python to RPN - source code converter.

It will translate:
Code:
LBL("EXAMPLE")
x**2+1
to:
Code:
LBL "EXAMPLE"
RCL 00
X↑2
1
+
LBL 50
"-Utility Funcs-"
RTN

HTH
Thomas
Find all posts by this user
Quote this message in a reply
11-27-2018, 12:02 AM
Post: #31
RE: Articles or book(s) about the functions behind a scientific calculator
Thanks Will, SlideRule and Thomas. The "shunting-yard" algorithm by Dijkstra for converting infix to postfix is exactly what I am looking for. It's for the AriCalculator, which I am writing in assembly.
Find all posts by this user
Quote this message in a reply
11-28-2018, 11:05 AM
Post: #32
RE: Articles or book(s) about the functions behind a scientific calculator
Dear All,

thanks for sharing the link to the "shunting-yard" algorithm. After reading the article I searched for further sources about the the topic and found this article which sheds some light upon the time and process when the stack machine and the reverse polish notation was developed.

Enjoy.

Best regards

Karl
Find all posts by this user
Quote this message in a reply
11-28-2018, 04:37 PM
Post: #33
RE: Articles or book(s) about the functions behind a scientific calculator
(11-28-2018 11:05 AM)Karl-Ludwig Butte Wrote:  …thanks for sharing the link to the "shunting-yard" algorithm …. I searched for further sources … found … this article … when the stack machine and the reverse polish notation was developed … Karl

A modest SE query should locate this manual for the KDF9
[attachment=6642]
for further edification.

BEST!
SlideRule
Find all posts by this user
Quote this message in a reply
11-29-2018, 03:40 AM
Post: #34
RE: Articles or book(s) about the functions behind a scientific calculator
(11-28-2018 04:37 PM)SlideRule Wrote:  A modest SE query should locate this manual for the KDF9

for further edification.

BEST!
SlideRule

According to Wikipedia, the KDF9 "weighed more than 10,300 pounds (5.2 short tons; 4.7 t). Control desk with interruption typewriter 300 lb (136 kg), main store and input/output control unit 3,500 (1,587 kg), arithmetic and main control unit 3,500 (1,587 kg), power supply unit 3,000 (1,360 kg)."
Find all posts by this user
Quote this message in a reply
11-29-2018, 08:16 AM
Post: #35
RE: Articles or book(s) about the functions behind a scientific calculator
Quote:A modest SE query should locate this manual for the KDF9

for further edification.

BEST!
SlideRule
Hi SlideRule,

I have found the KDF9 Programming Manual at the Wayback-Machine (aka archive.org). Unfortunately the file format is djvu but this can be converted online with an online converter especially for this case.

By the way, what do you mean by "A modest SE query..."?

Best regrds

Karl
Find all posts by this user
Quote this message in a reply
11-29-2018, 09:08 AM
Post: #36
RE: Articles or book(s) about the functions behind a scientific calculator
(11-29-2018 08:16 AM)Karl-Ludwig Butte Wrote:  
Quote:A modest SE query should locate this manual for the KDF9

for further edification.

BEST!
SlideRule
By the way, what do you mean by "A modest SE query..."?

SE query... Search Engine query. I wouldn't exactly have called it modest though. I'd never heard of either ICL or the KDF9.

(Post 320)

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
11-29-2018, 12:30 PM
Post: #37
RE: Articles or book(s) about the functions behind a scientific calculator
(11-29-2018 09:08 AM)brickviking Wrote:  
(11-29-2018 08:16 AM)Karl-Ludwig Butte Wrote:  By the way, what do you mean by "A modest SE query..."?

SE query... Search Engine query. I wouldn't exactly have called it modest though. I'd never heard of either ICL or the KDF9.

(Post 320)

Hi Brickviking,

if you are generally interested in computer history, you can use this as a pretext to dive into British computer history. Along the way you'll meet the Cambridge Computer Lab's EDSAC computer and its builder Maurice Wilkes, meet the first Office Computer LEO built by Oliver Standingford, Raymond Thompson and David Caminer at J. Lyons and Co. (and perhaps read the highly recommended book "A Computer named Leo" by Georgina Ferry), and finally arrive at ICL and KDF9, descendants of LEO and Leo Computers Ltd.

Best regards

Karl

P.S. Use the underlined words as search words and you'll find plenty of information.
Find all posts by this user
Quote this message in a reply
11-29-2018, 01:12 PM
Post: #38
RE: Articles or book(s) about the functions behind a scientific calculator
(11-29-2018 12:30 PM)Karl-Ludwig Butte Wrote:  … interested in computer history … British computer history … (and perhaps read the highly recommended book "A Computer named Leo" by Georgina Ferry), …
Karl … P.S. Use the underlined words as search words and you'll find plenty of information.

I queried for A Computer named Leo and was presented with A Computer Called Leo in reply.

BEST!
SlideRule
Find all posts by this user
Quote this message in a reply
11-29-2018, 01:42 PM
Post: #39
RE: Articles or book(s) about the functions behind a scientific calculator
(11-29-2018 08:16 AM)Karl-Ludwig Butte Wrote:  … found the … KDF9 Programming Manual … file format is djvu … Karl

The reference archive generally offers multi-format retrieval, I recommend the Torrent option for a PDF.

BEST!
SlideRule
Find all posts by this user
Quote this message in a reply
11-29-2018, 02:11 PM
Post: #40
RE: Articles or book(s) about the functions behind a scientific calculator
(11-29-2018 01:42 PM)SlideRule Wrote:  The reference archive generally offers multi-format retrieval, I recommend the Torrent option for a PDF.

BEST!
SlideRule

Even simpler:

Shorten the url to: https://web.archive.org/web/201707010706.../Documents

which presents an unformatted page with a list of documents, including the desired document in PDF format for direct download.

A nice (intended?) side-effect of how archive.org renders content; works for many, but not all, pages in the archive.

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




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