LINPROG is a program that solves linear programming problems.  As far as
G/S series compatability is concerned, I cannot say.  This program was
compiled using JAZZ 6.5 (included is the source) on the GX and works on
the GX.  While all of the tokens are supported, some of the USR-RPL
commands may not be available to the S series, although I don't own one
so I cannot be certain.

The syntax of the argument is:
        2: 'expr'
        1: { 'inequality1' 'inequality2' ... 'inequalityN' }

        -->

        1: { { root1 expr1 } { root2 expr2 } ... { rootM exprM } }

'expr'          the expression that is to be maximized or minimized
                (also called the objective function)
'inequalityN'   the inequality that is one of the constraints
root1           (x,y) that is a possible root
expr1           the expression evaulated at root1

The reason the output is a list of possible roots and its corresponding
is that the objective function may be either minized or maximized, so
the user must examine the roots to find the maximum or minum.  Moreover
most math textbook problems require you to find all the possible
maximizing or minimizing point, hence the list of all possible answers.

NOTE: YOU MUST USE 'X' AND 'Y' AS YOUR VARIABLES AND _NOT_ 'x' and 'y'
OR ANY OTHER VARIABLE(S).

WARNING: BECAUSE 'X' AND 'Y' ARE GLOBAL VARIABLES USED IN THE PROGRAM,
ANY NON-DIRECTORY OBJECT STORED IN THESE TWO VARIABLES WILL BE DELETED!

EXAMPLE (Example 4 in Precalculus, 2nd. ed by Larson and Hostetler; p. 530)

A manufacturer wants to maximize the profit for two products.  The first
poduct yields a profit of $1.50 per unit, and the second product yields
a pofit of $2.00 per unit.  Market tests and available resources have
indicated the following constraints.

1.  The combined production level should not exceed 1200 units per month.
2.  The demad for product II is, at most, half of that for product I.
3.  The production levlel of product I can exceed three times the
    production level of product II by, at most, 600 units.

X = number of units of product I
Y = number of units of product II

Objective function P = 1.5X + 2Y

Constraints are:
        X + Y  1200
        Y  1/2*X
        X  3*Y+600
        X  0
        Y  0

HP stack input:
        2: 'P=1.5*X+2*Y'  (you may use simply '1.5*X+2*Y' just as well)
        1: { 'X+Y1200' 'Y1/2*X' 'X3*Y+600' 'X0' 'Y0' }

HP output on stack level 1 (13 seconds to solve):

        {
          { (800,400) 'P=2000' }          Maximum profit at (800,400)
          { (1050,150) 'P=1875' }
          { (0,0) 'P=0' }
          { (600,0) 'P=900' }
        }

BUG FIXES:
 - removed double root bug; doesn't remove roots that are the same but
   due to roundoff appear the different to the HP
   e.g. 2.9999998 and 3.0 will both be added into the list since they
   are not the same numbers (literally) to the HP
 - blatant error in the documentation fixed; the second constraint was
   incorrect -- the old documentation had 'Y  X' when in fact it should
   have been Y  1/2*X

NOTE FROM AUTHOR

I hope this program will be of some use to someone out there... I wrote it
because my little sister was going through theprecalculus sequence and
needed to check her answers.  If you have any use for it, suggestions, or
comments, please email me at hduong@junix.ju.edu

Han "HPSolo" Duong
