Skip to main content
Article thumbnail
Location of Repository

Factorisation of the Factorial -- an algorithm discovered by playing with transformations

By Eerke Albert Boiten


As an example of the transformational programming method, a previously unknown algorithm for calculating factorials is derived. The derivation is done by the unfold-fold strategy with transformation rules for changing the recursion structure of functions. These transformation rules ( inv.html and splitting recursion) are presented and explained. The derivation which proceeds from a system of linear recursive functions, via tail-recursive functions, to an efficient imperative program. The resulting program is, in our opinion, only intelligible by way of its derivation. It is also shown how a similar derivation leads to a version of the algorithm that may be executed on 2 processors. Technical Report 90-18, Dept. of Informatics, University of Nijmegen, 1990, revised version as chapter 3 in my PhD thesis. A shorter version appeared in Periodica Polytechnica Ser. El. Eng., 35(2):77-99, 1992, Copies available on request by

Topics: QA76
Year: 1990
OAI identifier:
Sorry, our data provider has not provided any external links therefore we are unable to provide a link to the full text.

Suggested articles

To submit an update or takedown request for this paper, please submit an Update/Correction/Removal Request.