I have only followed this discussion loosely, but there were some bugs
in you code. (Actually, good that you posted the code in full, otherwise
I wouldn't have taken the time to debug.)

Attached is a corrected version.

In particular, you forgot the colon between coerce and Symbol in

>         if ECFI has coerce Symbol -> ECFI and

ECFI ==> Expression(Complex(Fraction(Integer)))
CFI ==> Complex(Fraction(Integer))
x := 'x :: ECFI
x0 := 0 :: CFI
my_taylor( (5*x^2 + 17*x^7) :: ECFI, 'x, x0)


The output doesn't look correct, but at least it doesn't throw an error
at me.

(6) -> my_taylor( (5*x^2 + 17*x^7) :: ECFI, 'x, x0)
   EINS

   (6)  x

Hope that helps a bit.

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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/68c8481e-fccf-4b64-051f-bc9623e1b3e3%40hemmecke.org.
)abbrev package MYTAYL MyTaylorExpansion

MyTaylorExpansion() : Exports == Implementation where
    FI ==> Fraction(Integer)
    CFI ==> Complex(Fraction(Integer))
    ECFI ==> Expression(Complex(Fraction(Integer)))

    Exports ==> with
        my_taylor : (ECFI, Symbol, CFI) -> ECFI

    Implementation ==> add
        e_pak ==> ExpressionToUnivariatePowerSeries(CFI,ECFI)

        if ECFI has coerce: Symbol -> ECFI and
           ECFI has _^ : (ECFI, Fraction (Integer)) -> ECFI then

            my_taylor(ff, sym, x0) ==
                print("EINS"::Symbol::OutputForm)$OutputForm
                eqn := equation(sym :: ECFI, x0 :: ECFI)$Equation(ECFI)
                uts := UnivariatePuiseuxSeries(ECFI,sym,x0::ECFI)
                any1 := AnyFunctions1(uts)
                ts := retract(puiseux((sym::ECFI), eqn)$e_pak)$any1
                --approx := (ff)^((1/3) :: FI)
                approx := approximate(ts,3/1)$uts
                approx
        else
            my_taylor(ff, sym, x0) ==
                print("ZWEI"::Symbol::OutputForm)$OutputForm
                ff

Reply via email to