% File INTMORE.INT	(c)	07/31/81	The Soft Warehouse %


FUNCTION DEFINT (EX1, EX2, EX3, EX4,
  % Local: %  EX5),
  WHEN FREE (EX5:INT(EX1,EX2), 'INT),
    WHEN INTEGER(#LIM),
      WHEN POSITIVE(SIGN(EX4-EX3)),
        LIM (LIM(EX5,EX2,EX4,TRUE) - LIM(EX5,EX2,EX3))  EXIT,
      LIM (LIM(EX5,EX2,EX4) - LIM(EX5,EX2,EX3,TRUE))  EXIT,
    EVSUB(EX5,EX2,EX4) - EVSUB(EX5,EX2,EX3)  EXIT,
  LIST ('DEFINT, EX1, EX2, EX3, EX4),
ENDFUN $

PROPERTY INT, ASIN, FUNCTION (EX2,
  % Local: %  EX3),
  % Fluid var from INT1:  EX1 %
  WHEN FREE (EX3:DIF(EX2,INDET), INDET),
    (EX1*EX2 + (1-EX2^2)^HALF) / EX3  EXIT,
ENDFUN $

PROPERTY INT, ATAN, FUNCTION (EX2,
  % Local: %  EX3),
  % Fluid var from INT1:  EX1 %
  WHEN FREE (EX3:DIF(EX2,INDET), INDET),
    (EX1*EX2 - HALF*LN(EX2^2+1)) / EX3  EXIT,
ENDFUN $

FUNCTION INTPROD (EX2, EX3,
  % Local: %  EX4, EX5),
  % Fluid var from INT:  INDET %
  WHEN EX2 = INDET,
    APPLY (GET(INTMONTMS,FIRST(EX3)), ADJOIN(1,ARGEX(EX3)))  EXIT,
  WHEN POWER(EX2),
    WHEN FREE (THIRD(EX2), INDET),
      WHEN SECOND(EX2)=INDET,
        APPLY (GET(INTMONTMS,FIRST(EX3)),
          ADJOIN (THIRD(EX2), ARGEX(EX3)))  EXIT,
      APPLY (GET(INTPWRTMS,FIRST(SECOND(EX2))),
        ADJOIN (THIRD(EX2), ARGEX(SECOND(EX2))))  EXIT,
    WHEN FREE (EX4:SECOND(EX2), INDET),
      WHEN FREE (EX5:DIF(THIRD(EX2),INDET), INDET),
        APPLY (GET(INTEXPTMS,FIRST(EX3)), ARGEX(EX3)) EXIT EXIT EXIT,
ENDFUN $

PROPERTY INT, *, FUNCTION (EX2, EX3),
  WHEN PRODUCT(EX3), FALSE EXIT,
  WHEN INTPROD(EX2,EX3) EXIT,
  INTPROD(EX3,EX2),
ENDFUN $

PION4: #PI/4 $

PROPERTY INTPWR, COS, FUNCTION (EX4),
  % Fluid vars from property "INT^":  EX2, EX3, EX5 %
  WHEN FREE (EX5:DIF(EX4,INDET), INDET),
    WHEN EX3 EQ -1,  LN (TAN (PION4 + HALF*EX4)) / EX5  EXIT,
    WHEN NEGATIVE(EX3),
      ((EX3+2)*INT1(EX2^(EX3+2)) - SIN(EX4)*EX2^(EX3+1)/EX5)
        / (EX3+1)  EXIT EXIT,
ENDFUN $

PROPERTY INTPWR, SIN, FUNCTION (EX4),
  % Fluid vars from property "INT^":  EX2, EX3, EX5 %
  WHEN FREE (EX5:DIF(EX4,INDET), INDET),
    WHEN EX3 EQ -1, LN (TAN(HALF*EX4)) / EX5  EXIT,
    WHEN NEGATIVE(EX3),
      ((EX3+2)*INT1(EX2^(EX3+2)) + COS(EX4)*EX2^(EX3+1)/EX5)
        / (EX3+1)  EXIT EXIT,
ENDFUN $

PROPERTY INTPWR, LOG, FUNCTION (EX4, EX5),
  % Fluid vars from INT1 & property "INT^":  EX1, EX2, EX3 %
  WHEN EX5 EQ #E,
    WHEN POSITIVE(EX3),
      WHEN FREE (EX5:DIF(EX4,INDET), INDET),
        EX1*EX4/EX5 - EX3*INT1(EX2^(EX3-1))  EXIT EXIT EXIT,
ENDFUN $

PROPERTY INTEXPTMS, COS, FUNCTION (EX6,EX7),
  % Fluid vars, from INT and INTPROD:  INDET, EX1, EX2, EX3, EX4 %
  WHEN FREE (EX7:DIF(EX6,INDET), INDET),
    EX2 * EX4^(INDET-EX6/EX7) * (EX3*EX5*LN(EX4) + EX7*SIN(EX6))
      / ((EX5*LN(EX4))^2 + EX7^2)  EXIT,
ENDFUN $

PROPERTY INTEXPTMS, SIN, FUNCTION (EX6, EX7),
  % Fluid vars, from INT and INTPROD:  INDET, EX1, EX2, EX3, EX4 %
  WHEN FREE (EX7:DIF(EX6,INDET), INDET),
    EX2 * EX4^(INDET-EX6/EX7) * (EX3*EX5*LN(EX4) - EX7*COS(EX6))
      / ((EX5*LN(EX4))^2 + EX7^2)  EXIT,
ENDFUN $

PROPERTY INTMONTMS, LOG, FUNCTION (EX5, EX6, EX7),
  % Fluid vars from INT and INTPROD:  INDET, EX1, EX2 %
  WHEN EX7 EQ #E,
    WHEN FREE (EX7:DIF(EX6,INDET), INDET),
      WHEN ZERO (EX4: EXPD(EX6-INDET*EX7)),
        INDET * (EX1 - EX2/(EX5+1)) / (EX5+1)  EXIT,
      WHEN POSITIVE (EX5),
        EVSUB (INT1(EXPAND(((INDET-EX4)/EX7)^EX5*LN(INDET))),
          INDET, EX6) / EX7  EXIT EXIT EXIT,
ENDFUN $

PROPERTY INTMONTMS, ^, FUNCTION (EX6, EX7, EX8, EX9),
  % Fluid vars from INT, INT1, & INTPROD:
    INDET, EX1, EX2, EX3, EX4, EX5 %
  WHEN NEGATIVE (EX8),
    WHEN FREE (EX4:DIF(EX7,INDET), INDET),
      WHEN POSITIVE (EX6),
        EX4^(-1-EX6) * EVSUB (INT1((INDET-EX7+EX4*INDET)^EX6
          * INDET^EX8), INDET, EX7)  EXIT,
      WHEN NEGATIVE (EX6),
        -(EX7-EX4*INDET)^(1+EX6+EX8) * EVSUB (INT1(
          (INDET-EX4)^(-2-EX6-EX8)*INDET^EX8), INDET, EX7/INDET)
        EXIT EXIT,
    WHEN FREE (EX5:DIF(EX4,INDET), INDET),
      EX9: EX4 - EX5*INDET,
      WHEN NEGATIVE (EX6),
        WHEN EX6 EQ -1,
          WHEN EX8 EQ -1,
            (LN(INDET^2*EX3) - EX9*INT1(EX3))
              / (2*EX7 - INDET*(EX4+EX9))  EXIT,
          (EX7^(EX8+1)/(EX8+1) - EX9*INT1(EX3)
            + 2*INT1(EX2*EX7^(EX8+1))) / (2*EX7-INDET*(EX4+EX9)) EXIT,
        (2*(INDET^(EX6+1)*EX7^(EX8+1)
          - 2*(2+EX6+EX8)*EX9*INT1(INDET^(EX6+1)*EX3))
          - EX5*(3+EX6+2*EX8)*INT1(INDET^(EX6+2)*EX3))
          / (EX6+1) / (2*EX7 - INDET*(EX4+EX9))  EXIT,
      WHEN POSITIVE (EX6),
        WHEN ZERO (EX6+1+2*EX8),
          WHEN EX6 EQ 1,
            (LN(EX7) - EX9*INT1(EX3)) / EX5  EXIT EXIT,
        2 * (INDET^(EX6-1)*EX7^(EX8+1)
          + (1-EX6)*(EX7-HALF*INDET*(EX4+EX9))
          * INT1(INDET^(EX6-2)*EX3)
          - (EX6+EX8)*EX9*INT1(INDET^(EX6-1)*EX3)) / EX5
          / (EX6 + 2*EX8 + 1)  EXIT EXIT EXIT,
  WHEN FREE (EX7,INDET),
    WHEN POSITIVE(EX6),
      WHEN FREE (EX4:DIF(EX8,INDET), INDET),
        (EX1 - EX6*INT1(EX1/INDET)) / EX4 / LN(EX7)  EXIT EXIT EXIT,
  WHEN POSITIVE (EX8),
    WHEN LOGARITHM (EX7),
      WHEN THIRD(EX7) EQ #E,
        WHEN SECOND(EX7) = INDET,
          (INDET*EX1 - EX8*INT1(EX1/EX7)) / (EX6+1)  EXIT,
        WHEN FREE (EX5:DIF(SECOND(EX7),INDET), INDET),
          WHEN POSITIVE(EX6),
            EVSUB (INT1((INDET-SECOND(EX7)+EX5*INDET)^EX6
              * LN(INDET)^EX8), INDET, SECOND(EX7)) / EX5^(EX6+1)
            EXIT EXIT EXIT EXIT EXIT,
ENDFUN $

PROPERTY INTMONTMS, COS, FUNCTION (EX5, EX6),
  % Fluid vars from INT & INTPROD: EX2, EX4, INDET %
  WHEN POSITIVE (EX5),
    WHEN EX6 = INDET,
      EX2*SIN(EX6) - EX5*INT1(EX2/INDET*SIN(EX6))  EXIT,
    WHEN FREE (EX4:DIF(EX6,INDET), INDET),
      EVSUB (INT1(EXPAND((INDET+INDET*EX4-EX6)^EX5*COS(INDET))),
        INDET, EX6) / EX4^(EX5+1)  EXIT EXIT,
ENDFUN $

PROPERTY INTMONTMS, SIN, FUNCTION (EX5, EX6),
  % Fluid vars from INT & INTPROD:  EX2, EX4, INDET %
  WHEN POSITIVE (EX5),
    WHEN EX6 = INDET,
      EX5*INT1(EX2/INDET*COS(EX6)) - EX2*COS(EX6)  EXIT,
    WHEN FREE (EX4:DIF(EX6,INDET), INDET),
      EVSUB (INT1(EXPAND((INDET+INDET*EX4-EX6)^EX5*SIN(INDET))),
        INDET, EX6) / EX4^(EX5+1)  EXIT EXIT,
ENDFUN $

PROPERTY INTPWRTMS, SIN, FUNCTION (EX6, EX7),
  % Fluid vars from INT & INTPROD:  EX2, EX3, EX4, EX5, INDET %
  WHEN POWER(EX3),
    WHEN FIRST(SECOND(EX3)) EQ 'COS,
      WHEN SECOND(SECOND(EX3))=EX7,
        WHEN FREE (EX4:DIF(EX7,INDET), INDET),
          WHEN POSITIVE (EX5:THIRD(EX3)),
            WHEN EX6 EQ -1,
              ((EX5-1)*INT1(EX2*SECOND(EX3)^(EX5-2))
                + SECOND(EX2)^(EX6+1)*SECOND(EX3)^(EX5-1)/EX4)
                / (EX5+EX6)  EXIT,
            WHEN NEGATIVE(EX6),
              (SECOND(EX2)^(EX6+1)*SECOND(EX3)^(EX5-1)/EX4
              + (EX5-1)*INT1(SECOND(EX2)^(EX6+2)*SECOND(EX3)^(EX5-2)))
              / (EX6+1)  EXIT EXIT,
          WHEN POSITIVE (EX6),
            WHEN EX5 EQ -1,
              ((EX6-1)*INT1(SECOND(EX2)^(EX6-2)*EX3)
                - SECOND(EX2)^(EX6-1)*SECOND(EX3)^(EX5+1)/EX4)
                / (EX5+EX6)  EXIT,
            WHEN NEGATIVE (EX5),
              ((EX6-1)*INT1(SECOND(EX2)^(EX6-2)*SECOND(EX3)^(EX5+2))
                - SECOND(EX2)^(EX6-1)*SECOND(EX3)^(EX5+1)/EX4)
                / (EX5+1)  EXIT EXIT,
          WHEN EX6 EQ -1,
            WHEN EX5 EQ -1,  FALSE  EXIT,
            WHEN NEGATIVE (EX5),
              ((EX5+EX6+2)*INT1(EX2*SECOND(EX3)^(EX5+2))
                - SECOND(EX2)^(EX6+1)*SECOND(EX3)^(EX5+1)/EX4)
                / (EX5+1)  EXIT EXIT,
          WHEN NEGATIVE (EX6),
            WHEN NEGATIVE(EX5),
              ((EX5+EX6+2)*INT1(SECOND(EX2)^(EX6+2)*EX3)
                + SECOND(EX2)^(EX6+1)*SECOND(EX3)^(EX5+1)/EX4)
                / (EX6+1)  EXIT EXIT EXIT EXIT EXIT EXIT,
ENDFUN $

RDS () $

