USE MATH

FUNCTION REAL maxabs(IN REAL x, OUT REAL z)

BODY
        IF (x > z ) THEN

            z = x
            RETURN x
        END IF
        RETURN z
END FUNCTION

FUNCTION REAL minabs(IN REAL x, OUT REAL z)

BODY
        IF (x < z ) THEN

           z = x
           
	     RETURN x
        END IF
        RETURN z
END FUNCTION

FUNCTION REAL maximo(IN REAL x, IN REAL tiempo, OUT REAL z, OUT REAL aqui)

BODY
        IF (x > z ) THEN

            z = x
				aqui = tiempo
            RETURN x
        END IF
        RETURN z
END FUNCTION

FUNCTION REAL minimo(IN REAL x, IN REAL tiempo, OUT REAL z, OUT REAL aqui)

BODY
        IF (x < z ) THEN

            z = x
				aqui = tiempo
            RETURN x
        END IF
        RETURN z
END FUNCTION