tayfront.red 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. module TayFront;
  2. %*****************************************************************
  3. %
  4. % User interface
  5. %
  6. %*****************************************************************
  7. exports taylorcombine, taylororiginal, taylorprintorder,
  8. taylorseriesp, taylortemplate, taylortostandard;
  9. imports
  10. % from the REDUCE kernel:
  11. eqcar, mk!*sq, mvar, numr, prepsq, simp!*, typerr,
  12. % from the header module:
  13. Taylor!-kernel!-sq!-p, TayOrig, TayTemplate, TayTpElOrder,
  14. TayTpElPoint, TayTpElVars,
  15. % from module Tayintro:
  16. Taylor!-error,
  17. % from module Taysimp:
  18. taysimpsq;
  19. symbolic procedure taylorseriesp u;
  20. (Taylor!-kernel!-sq!-p sq)
  21. where sq := simp!* u;
  22. symbolic procedure taylorcombine u;
  23. mk!*sq taysimpsq simp!* u;
  24. symbolic procedure taylortostandard u;
  25. (prepsq if not eqcar (u, '!*sq) then simp!* u else cadr u)
  26. where convert!-Taylor!* := t;
  27. symbolic procedure taylororiginal u;
  28. (if not Taylor!-kernel!-sq!-p sq
  29. then typerr (u, "Taylor kernel")
  30. else (if TayOrig tay then mk!*sq TayOrig tay
  31. else Taylor!-error ('no!-original, 'taylororiginal))
  32. where tay := mvar numr sq)
  33. where sq := simp!* u;
  34. symbolic procedure taylortemplate u;
  35. (if not Taylor!-kernel!-sq!-p sq
  36. then typerr (u, "Taylor kernel")
  37. else 'list . for each quartet in TayTemplate mvar numr sq collect
  38. {'list,
  39. if null cdr TayTpElVars quartet
  40. then car TayTpElVars quartet
  41. else 'list . TayTpElVars quartet,
  42. TayTpElPoint quartet,
  43. TayTpElOrder quartet})
  44. where sq := simp!* u;
  45. flag ('(taylorseriesp taylorcombine taylortostandard taylororiginal
  46. taylortemplate),
  47. 'opfn);
  48. flag ('(taylorseriesp), 'boolean);
  49. endmodule;
  50. end;