The TPK algorithm is an early example of a programming chrestomathy.
It was used in Donald Knuth and Luis Trabb Pardo's Stanford tech report The Early Development of Programming Languages.
The report traces the early history of work in developing computer languages in the 1940s and 1950s, giving several translations of the algorithm.

From the wikipedia entry:

ask for 11 numbers to be read into a sequence S
reverse sequence S
for each item in sequence S
    result := call a function to do an operation
    if result overflows
        alert user
    else
        print result

The task is to implement the algorithm:

 Use the function:     



f
(
x
)
=

|

x


|


0.5


+
5

x

3




{\displaystyle f(x)=|x|^{0.5}+5x^{3}}


 The overflow condition is an answer of greater than 400.
 The 'user alert' should not stop processing of other items of the sequence.
 Print a prompt before accepting eleven, textual, numeric inputs.
 You may optionally print the item as well as its associated result, but the results must be in reverse order of input.
 The sequence    S    may be 'implied' and so not shown explicitly.
 Print and show the program in action from a typical run here. (If the output is graphical rather than text then either add a screendump or describe textually what is displayed).


 
REM Trabb Pardo-Knuth algorithm
REM Used "magic numbers" because of strict specification of the algorithm.
DIM S@(10)
PRINT "Enter 11 numbers."
FOR I = 0 TO 10
  I1= I + 1
  PRINT I1;
  PRINT " => ";
  INPUT TMP@
  S@(I) = TMP@
NEXT I
PRINT
REM Reverse
HALFIMAX = 10 / 2
FOR I = 0 TO HALFIMAX
  IREV = 10 - I
  TMP@ = S@(I)
  S@(I) = S@(IREV)
  S@(IREV) = TMP@
NEXT I
REM Results
REM Leading spaces in printed numbers are removed
CLS
FOR I = 0 TO 10
  PRINT "f(";
  STMP$ = STR$(S@(I))
  STMP$ = LTRIM$(STMP$)
  PRINT STMP$;
  PRINT ") = ";
  N@ = S@(I)
  GOSUB CALCF:
  R@ = F@
  IF R@ > 400 THEN
    PRINT "overflow"
  ELSE
    STMP$ = STR$(R@)
    STMP$ = LTRIM$(STMP$)
    PRINT STMP$
  ENDIF
NEXT I
END
 
CALCF:
REM Calculates f(N@)
REM Result in F@
X@ = ABS(N@)
GOSUB CALCSQRT:
F@ = 5.0 * N@
F@ = F@ * N@
F@ = F@ * N@
F@ = F@ + SQRT@
RETURN
 
CALCSQRT:
REM Calculates approximate (+- 0.00001) square root of X@ for X@ >= 0 (bisection method)
REM Result in SQRT@
A@ = 0.0
IF X@ >= 1.0 THEN
  B@ = X@
ELSE
  B@ = 1.0
ENDIF
L@ = B@ - A@
L@ = ABS(L@)
WHILE L@ > 0.00001
  MIDDLE@ = A@ + B@
  MIDDLE@ = MIDDLE@ / 2
  MIDDLETO2@ = MIDDLE@ * MIDDLE@
  IF MIDDLETO2@ < X@ THEN
    A@ = MIDDLE@
  ELSE
    B@ = MIDDLE@
  ENDIF
  L@ = B@ - A@
  L@ = ABS(L@)
WEND
SQRT@ = MIDDLE@
RETURN
 