J3/06-184 Date: 30 June 2006 To: J3 From: Armando Celorio-Villasenor. NATURBO Technology Centers. Universidad Anahuac Mexico Norte. Title: FORmula TRANslation improvements. Subject: Mathematical Assigment Expressions Legibility. 1. INTRODUCTION. Considering the new characters added to the FORTRAN 2003 set, this paper presents suggestions and a brief example of their application to mathematical assigment expressions. 2. RATIONALE. Improve formula translation design and presentation. 3. OBJECTIVES. a) Total Interchangeability of: ordinary parenthesis ( ) with square brakets [ ] and braces { } in mathematical assigment expressions. Avoid ((( ))) crowded expressions. b) Alternate use of ^ and ** for exponentiation (power) numerical operations. (^ more intuitive than ** for exponentiation). Avoid * & ** crowded expressions. 4. PURPOSE. BENEFIT. Better FORmula TRANslation presentation and interpretation. Improved design and legibility of methematical expressions. Reduce errors. Easier and better debugging. Better teaching of language (similar expressions from blackboard or paper). Better identification of linear algebra matrices and vectors terms within expressions. 5. EXAMPLE. Program INTEGER(4) n, I, J REAL(8) ss(n,n), a1(n,n), b1(n,n), a2(n,n), b2(n,n), c5(n,n), a3(n,n), b3(n,n), c3(n,n), c4(n,n) REAL(8) uxi, vxi, ueta, veta . . . . Original presentation of an assigment expression: ss(I,J) = DSQRT ( DABS ( a1(I,J) * (uxi**2.5 + vxi) + b1(I,J) * ueta**(vxi * uxi) + & & a2(I,J) * vxi**2.1 + b2(I,J) * veta**2.1 + 2.0_8 * c5(I,J) * ( uxi * ueta + vxi * veta ) + & & 3.0_8 * a3(I,J) * uxi * vxi + 3.0_8 * ( b3(I,J) * (ueta - vxi) + 1.0_8 ) * veta + & & 2.0_8 * c3(I,J) * uxi * veta + 2.0_8 * c4(I,J) * (ueta * vxi + 1.0_8) ) ) New presentation of expression: ss[I,J] = DSQRT [ DABS { a1[I,J] * (uxi^2.5 + vxi) + b1[I,J] * ueta^(vxi * uxi) + & & a2[I,J] * vxi^2.1 + b2[I,J] * veta^2.1 + 2.0_8 * c5[I,J] * ( uxi * ueta + vxi * veta ) + & & 3.0_8 * a3[I,J] * uxi * vxi + 3.0_8 * { b3[I,J] * (ueta - vxi) + 1.0_8 } * veta + & & 2.0_8 * c3[I,J] * uxi * veta + 2.0_8 * c4[I,J] * (ueta * vxi + 1.0_8) } ] 6. REQUIREMENTS. - For every aperture ( [ { has to be the respective identical closure } ] ) pair. (no mixing) 7. REPERCUSSIONS. - Array constructor change to | vertical bars | END