Album of Algorithms and
for Standard Rexx
Vladimir Zabrodsky
Idea, Algorithm, Technique - it is also original Czech Lace from Vamberk


contents index reflexio   download coauthors thanks!

The structure of the Album is twodimensional and permits various paths through the material. Contents shows parts including algorithms having the same orientation, usually they tackle the same problem. There is one special part - techniques, too. It includes general useful methods of accomplishing a desired aim as removal recursion, construction of test data sets, creating of universal routines etc. (Recipe) Index is a list of algorithms sorted in alphabetical order. Descriptions of algorithms contain further reference in the section 'connections'. The Album is completed by the reflections on programming, see the chapter Reflexio

The red pin symbol for new item in Contents and Recipe Index calls our attention to new items. For changed items I will use symbol for changed item the green pin.


Rexx code tends to run slowly. The key to a fast scripts are the efficient algorithms. I have been collecting such algorithms. It isn't a trivial job to translate algorithms from various pseudocodes or programming languages as Ada, ALGOL, BASIC, C, FORTRAN, Modula, Pascal, PL/1, into the useful code in the Rexx language.

'There is the disadvantage of not knowing all languages,' said Conceil, 'or the disadvantage of not having one universal language.'
Jules Verne Twenty Thousand Leagues Under the Sea  

The Album may be useful as a reference, since it contains an organized collection of algorithms. All of this are expressed in the Rexx language. You can try copy and paste this routines from browser into an editor, direct into a concrete program (in detail: Technique: Universal Unit). ATTENTION! Please, when you see the following fragment on the two lines, then you have to decrease font in your browser (Thanks Doug Rickman from NASA for this warning).

  do J = K - 1 to 1 by -1; SubSet = A.J SubSet; end

After the downloading of my album you can change the properties of fonts by the arrangements of the AATSTYLE.CSS file.

The Album can be useful in a college course on algorithms as well in beginning courses of the programming in the Rexx language. The Album is an experiment: I use the Rexx language in an explanations and descriptions of algorithms, too. Hence I say things like "Its time complexity is FORMAT(3*N/2-2,,0) comparisons" or "pattern P. occurs with shift S in text T. if 0<=S<=N-M and if T.SpJ=P.J, where SpJ indicates S+J, for J=1,...,M". The Album proves that the Rexx language is the suitable vehicle for presentation a set useful algorithms in clean, succint, and uniform code.

Note - We therefore reserve the special symbol lgN to denote a logarithm with base 2.


17th September 2001
Short circuiting in Rexx?

12th September 2001
Test environment by Walter Pachl ...

24th August 2001
I finished rewriting and repairing of the whole album

3th August 2001
New solution 3_1 in Technique: Universal unit by Tobias Herp

28th July 2001
Offline version of my www pages with Album of Algorithms and Techniques is available on CD of as freeware

1st July 2001
P+n trick by Walter Pachl added in Reflexio

18th June 2001
Walter Pachl repaired the last digits in the V variable in LN2 and PICONST functions.

12th March 2001
The functions for calculating of the area of a triangle - numerically unstable HERON and numerically stable ATRIAN.

4th March 2001
After reading Kahan's Mathematics Written in Sand I changed the function REPOWER:

if P = "" then P = 9; P = P + 4; numeric digits P

See Reflexio.

22nd February 2001
Danny De Wilde sent me mail with question How to compute function real power? It inspired me to creating the function REPOWER.

1st December 2003
James Barbetti sent me subprogram HEAPSORT_RADIX3 in Visual Basic.



Album as ZIP file
[Album as ZIP file]

There is the Album as ZIP file, Version 2nd April 2018.
     For the comparison of published algorithms I use as a measuring instrument my PC with 6x86MX-PR233 processor and 32MB RAM, Mark Hessling's REXX-Regina_0_08g 4.80 31 Jul 1999, since 12 August 2000 REXX-Regina_2.0 4.80 4 May 2000, and since 26 June 2001 REXX-Regina_2.2 4.80 17 Jun 2001 interpreter, Microsoft Windows 98 4.10.1998.


Roderic A. Davis, New York
the D2R function

Tobias Herp, Bad Homburg, Germany
added new solution 3_1 into Technique: Universal unit

Walter Pachl, Vienna, Austria
Test environment and his P+n trick in Reflexio

Doug Rickman, Global Hydrology and Climate Center, MSFC, NASA
the SPLINE and SPLINT functions

Gerard Schildberger, Hankinson, North Dakota
the CEILING, FLOOR functions

James Barbetti
the HEAPSORT_RADIX3 subprogram



Michael Adams, Cologne, Germany
repaired the subroutine PRIMES and the function PRIMALITY_TEST

Walter Pachl, Vienna, Austria
found errors in LN2 and PICONST functions. He studied the whole album step by step - 78 pages! -, verified the programs in OS/2 environment; found error in the HEAPSORT subprogram; improved the definition of general selection problem and corrected some errors. Walter's mails inspired me to rewriting the whole album (June - August 2001).

George W. Perry, Flintstone, Georgia
reported a bug in the INTERPOLATION_SEARCH

Gerard Schildberger, Hankinson, North Dakota
simplified the PI and SQRT functions. He called my attention to the error in LN10 function. I would like to thank Gerard for reading the whole Album and correcting many mistakes in 50(!) pages. I used all his helpful comments, corrections, and suggestions that resulted in many improvements my English in the Album

Danny De Wilde, Belgium
inspired me to creating the function REPOWER.



Baudoin C., Meyer B. Méthodes de programmation
Edition Eyrolles 61, Bd Saint-Germain Paris 1978

Bentley J., Programming Pearls
CACM, December 1986, Vol. 29, No. 12, p. 1161

Bentley J., Programming Pearls - A Sample of Brilliance
CACM September 1987 No. 9, p. 754-757

Bentley J., More Programming Pearls - Confession of a Coder
Addison-Wesley, 1990

Bird R. S., Notes on Recursion Elimination
CACM, June 1977, vol. 20, No. 6, pp. 434-439.

Brent R. P., Ramanujan and Euler's Constant
Computer Sciences Laboratory, Australian National University, August 1993

Cormen T. H., Leiserson Ch. E., Rivest R. L., Introduction to Algorithms
The MIT Press, Cambridge, 1990

Durstenfeld R., Random Permutation
CACM July 1964 No. 7, p. 420

Faddejev A.K., Sominskij J.S. Sbornik zadac po vyssej algebre
Nauka, Moskva 1964

Feuer A.R., Gehani N. (ed.) Comparing and Assessing Programming Languages Ada, C and Pascal
Prentice-Hall, Inc. Englewood Cliffs, New Jersey 1984

Fiala E.R., Greene D.H., Data Compression with Finite Windows
CACM, April 1989, Vol. 32, No. 4, pp. 490-505

Floyd R. W., Rivest R. L., Algorithm 489 The Algorithm SELECT - for Finding the ith Smallest of n Elements [M1]
CACM, March 1975, Vol. 18, No. 3, p. 173

Floyd R. W., Rivest R. L., Expected Time Bounds for Selection
CACM, March 1975, Vol. 18, No. 3, pp. 165-172

Gehani N., Ada - An Advanced Introduction
Prentice-Hall, Inc. Englewood Cliffs, New Jersey 1983

Jarnik V., Diferencialni pocet I
- Nakladatelstvi Ceske Akademie Ved, Praha, 1963

Kahan W., Mathematics Written in Sand
Version of 22 Nov. 1983.

Knuth D. E., Fundamental Algorithms, vol. 1 of The Art of Computer Programming
- 2nd ed. Addison-Wesley, 1973

Knuth D. E., Seminumerical Algorithms, vol. 2 of The Art of Computer Programming
Addison-Wesley, 1973

Knuth D. E., Sorting and Searching, vol. 3 of The Art of Computer Programming
Addison-Wesley, 1973

Kruse R. L., Data Structures and Program Design
Prentice Hall International Editions, ISBN 0-13-196049-0

Lipski W., Kombinatoryka dla Programistow
Wydawnictwa Naukowo-techniczne, Warszawa, 1982

Martello S., Toth P., Knapsack Problems: Algorithms nad Computer Implementations
Chichester, John Wiley & sons 1990

Olehla M., Tiser J., Prakticke pouziti FORTRANu
Nakladatestvi dopravy a spoju Praha 1976

Park S. K., Miller K. W., Random Number Generators: Good ones are hard to find
CACM October 1988 Vol. 31 No. 10, pp. 1192-1201

Press W.H., Teukolsky S.A., Vetterling W.T., Flannery B.P., Numerical Recipes in C : the art of scientific computing
- 2nd ed. University Press, Cambridge, 1992

Rich R. P., Internal Sorting Methods Illustrated with PL/1 Programs
Prentice Hall, Inc., Engelwood Cliffs, 1972

Sedgewick R., Algorithms
Addison-Wesley, Reading, Massachusetts, 1984

Wirth N., Systematisches Programmieren
- 2nd ed. B.G Teubner, Stuttgart, 1975

Wirth N., Algorithms and data structure
New Jersey, Prentice Hall, Inc., Engelwood Cliffs, 1986

Zabrodsky V., Variace na klasicke tema
Elektronika, c. 6, 1992, 33-34

Zabrodsky V., Problem dvou loupezniku
BAJT, rijen 1993 (36), 134-136

where else ... main page czech

from 1st January 2000, last modified 31st March 2018
Copyright © 2000-2018 Vladimir Zabrodsky
Czech Republic