Formulator An Expression Compiler for Newtonª This application uses pickers and pen input to build an expression which we then compile and Formulator displays the result. As quick to use as any calculator, a better display, easier editing, etc. Flexible storage via A Customizable Picker or the Notepad, and you can cut and paste results and formulae. Ê ÉBuild the expression, include the variables, press the Crunch Button and Read the Result. Kind of like a single cell Spread sheetÉ Ê Technically, all the functions available to a Newton Programmer are also available to you. Nevertheless, you would not require most and so only the basic Math and Logic functions are easily available via two menus. These functions have been split Alphabetically between two Pickers, A..K and L..Z. The 'function' and format of most of them are obvious but a Function Reference is included to show you the details. Ê ¥¥¥ Caution! ¥¥¥ Some expressions may be so full of bugs that if you press the Crunch button, Formulator will replace the expression with something that it does understand. If your Newton starts to beep, non-stop, save or backup whatever you can, before pressing the power switch or reset button. No liability for lost data or incorrect information or bad results, I am too poor to take to court. Ê To enable you to Dial-your-own functions, a third group of pickers allows you to, Add the selected part or the whole of an expression, as it appears in the top area, to the Custom Functions Menu. This can include any text item, constants, key words, values, or any Selected item in the Results area. A Remove picker completes this group of tools. In the REGISTERED version of this application we store the content of Custom Function Picker in a Soup, making it almost permanent. The Soup that we create is accessible from other applications and will be used by me in other projects. The format for the Soup, 'formula:PBJONES', is a single entry made up of (name:"Test") and (form:(an array of strings that are the items in the Custom Functions picker)). At the close of the application the old entries are deleted and replaced with a single, new entry. Ê The use of a '?' followed by a letter, substitutes for a variable, you could use anything you want butÉ To make finding these variables easier when preparing an expression there is a Find ?x button that selects each variable as it finds them. If a keypad is in use then any entry on that keypad or an entry item will go into the selected area. Ê The Options picker contains items that help put expressions together and cleans up expressions when you have completed them. Compile, just compiles the expression but does not process the result. It's here for hysterical reasons. Crunch, compiles the expression and puts the result into the Result area, in the format that is set by the controls. Clear Screen,É Alpha keys, brings up an Alphanumeric keyboard, for the use of. Numeric Keys, brings up a keypad which when combined with the Find ?x button makes a powerful data entry combination. Épress the Find ?x button, the variable is selected, information is entered, press the button for the next variable, etcÉ Ê Variable Variable, allows you to alter a selected value using a slide control, 50%-200% of the original. It also allows you to watch the result change with each new value. Insert Blanks, inserts blanks into the expression, around brackets and commas, to make it easier to select values for editing. Remove Blanks, just makes it all work better, see above. Copy to NotePad, copies the Expression and the Result to the NotePad. I bet you knew that. Ê The buttons in the status area at the base of the screen allow you to quickly add characters to the expression. The 'V' button displays a variable entry area that allows single digit entry, in any order, left to right or right to left, and the ability to change any single digit. Entries in this item replace selected text or are added to the end of the body of the expression if no text is selected. Double tap on a cell to bring up the Numeric keypad. Formulator will format the value for Pi the same way as the Result area, ie number of decimal places, etc. The '?' button shows the AboutÉ Box. Ê Display Format. There is the ability to restrict the number of decimal places shown or if Formulator needs it to be shown in an exponential format, or if you wish to see all the digits. These are found just below the Results box. The font used to display is the same as that which is set by the Styles item in the Extras Draw of your Newton ÉBuild the expression, include the variables, press the Crunch Button and Read the Result. Kind of like a single cell Spread sheetÉ Note: The UNREGISTERED version relies on keeping Custom Functions information in the application itself, Reinstall the application or Reset the Newton and this info reverts to the data that I entered when I compiled the application. Ê The Freebies. Because I have used Pen Input boxes, it means that you can select and edit any of the entries or results and drag them around in your Newton. Thus, you can Import figures and Export figures via the Clipboard or the Notepad. NB.Watch out for spaces and commas between the digits in a single value. Formulator © 1995 Paul B Jones P.O. box 208 Moora 6510 Western Australia. This application is Shareware, $20, a naive notion, but thanks to the few who do send anything. You get a fully working version and printed Docs. Greatest thanks to Deborah F. Iwatate for suggesting the name. Newtonª, Apple Computer. A Function Reference Acos - Acos(X) Returns the arccosine of X. Acosh - Acosh(X) Returns the arc-hyperbolic-cosine of X. Annuity Annuity(rate, periods) Calculates the Present Value Factor of an annuity at a given interest rate over the specified number of periods. rate The interest rate per period (for example, 12% per year would be specified as a monthly rate of .01). periods An integer specifying the number of periods. Asin - Asin(X) Returns the arcsine of X. Asinh - Asinh(X) Returns the arc-hyperbolic-sine of X. Atan - Atan(X) Returns the arctangent of X Atan2 - Atan2(X,Y) Returns the arctangent of X/Y in [-pi, pi] using the sign of both parameters to determine the quadrant of the computed value. Atanh - Atanh(X) Returns the arc-hyperbolic-tangent of X. Compound Compound(rate, periods) Calculates compounded interest factor over the specified number of periods. rate The interest rate per period (for example, 12% per year would be specified as a monthly rate of .01). periods An integer specifying the number of periods. Cos - Cos(X) Returns the cosine of X. Cosh - Cosh(X) Returns the hyperbolic cosine of X. Fmod - Fmod(X,Y) Returns the floating-point modulus of X and y. That is, If m = fmod(X, Y) and q = trunc(X / Y) then q * y + m = X. Exp - Exp(X) Returns ex. Expm1 - Expm1(X) Returns the base e exponential of X - 1, that is: exp(X) - 1 Fabs - Fabs(X) Returns the floating-point absolute value of X. FDim - FDim(X,Y) Returns the Òpositive differenceÓ between its parameters: n X > y returns X - y n X <= y returns +0 n If one parameter is a NaN, returns that NaN. n If both parameters are NaNs, returns the first parameter. Gamma - Gamma(X) Returns the gamma function of X. Hypot - Hypot(X,Y) Returns the square root of the sum of the squares of x and y, without undue overflow or underflow. LGamma - LGamma(X) Returns the base-e logarithm of the absolute value of the gamma of its parameter x, for x > 0>Logb(X). Log - Log(X) Returns the logarithm of x. Logb - Logb(X) Returns the binary exponent of x as a signed integral value. When the input parameter is a denormalized number, the exponent is determined as if the input parameter had first been normalized. Log1p - Log1p(X) Returns the base e logarithm of 1+x, that is: log (1+x) For small enough parameters, log1p is expected to be more accurate than the straightforward computation of log (1+x). Log10 - Log10(X) Returns the base-10 logarithm of x. Pow - Pow(X,Y) Returns xy. Random - Random(X,Y) Returns an Integer within the range X:Y this is the Integer Maths function, not the RandomX function Remainder - Remainder(X,Y) Returns the remainder of x divided by y. Rint - Rint(X) Returns x rounded to the nearest long int and delivers the result as a real. For example, 12345678.875 rounds to 12345679.0. RintToL - RintToL(X) Returns x rounded to the nearest int. The result is undefined if the rounded value is outside the range of int. Round - Round(X) Returns x rounded to the nearest integral value in double format similar to the Fortran anint function. That is: add half to the magnitude and truncate. Scalb - Scalb(X,Y) Scales y by a given integer power x of 2, returning x * 2y. This is more efficient than a straightforward computation of x * 2y. Sin - Sin(X) Returns the sine of x. Sinh - Sinh(X) Returns the hyperbolic sine of x. Sqrt - Sqrt(X) Returns the square root of x. Tan - Tan(X) Returns the tangent of x. Tanh - Tanh(X) Returns the hyperbolic tangent of x. Trunc - Trunc(X) Returns a real number that contains the integral value nearest to but no larger in magnitude than x. Thanks Much of the Functions Ref text is from the Newton ProgrammerÕs Guide © Apple Computer Inc. Sorry, It is very hard to summarise a summary. ---oo000oo--- Formulator An Expression Compiler for the Newtonª by Paul B Jones 1995