On 21.06.23 16:24, Waldek Hebisch wrote:
The file just invokes ')compile' but I see no .spad file.

I am sorry. Now the .spad file is attached as well.

Ralf

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/54d1a075-54de-c341-3cba-273a28788654%40hemmecke.org.
)co foo.spad
)set stream calc 4
QQ ==> Fraction Integer
T ==> QEtaTaylorSeries(QQ)
q := monomial(1,1)$T
s := 2*recip(1-q)::T
)set message bottom on
precision s
OF==>OutputForm
display77(x) ==> display((x::OF)::Formatter(Format1D))
yof x ==> x :: Symbol :: OF
dbgPrint(x,y) ==> display77([yof ":> ", yof x, y::OF]$List(OF))
tracePrint(x,y) ==> display77(hconcat([yof"-- ",yof x,yof":=",y::OF]$List(OF)))

rep x ==> (x@%) pretend Rep
per x ==> (x@Rep) pretend %

)abbrev category QETATSC QEtaTaylorSeriesCategory
QEtaTaylorSeriesCategory(C: Ring): Category ==
  UnivariateTaylorSeriesCategory C with
    revert: % -> %

)abbrev domain QETATS QEtaTaylorSeries
QEtaTaylorSeries(C: Ring): Exports == Implementation where
  Exports ==> QEtaTaylorSeriesCategory C
  Implementation ==> UnivariateTaylorSeries(C, 'q, 0$C)

)abbrev domain QETATTS QEtaTruncatedTaylorSeries
QEtaTruncatedTaylorSeries(C: Ring): Exports == Implementation where
  Exports ==> QEtaTaylorSeriesCategory C with
    precision: % -> NonNegativeInteger
  Implementation ==> add
    Rep ==> IndexedVector(C, 0)
    xx ==> rep x
    precision(x: %): NonNegativeInteger == (dbgPrint("QTTS: prec", #xx); #xx)
    1: % == per new(1, 1)
    coerce(x: %): OutputForm == xx::OutputForm
    ((n: Integer) * (x: %)): % == (n::C) * x
    ((c: C) * (x: %)): % ==
        p: NonNegativeInteger := precision x
        dbgPrint("*prec", p)
        dbgPrint("x", x)
        v: Rep := new(p, 0)
        for i in 0.. p-1 repeat v.i := c * xx.i
        per v

Reply via email to