>
> BTW: Logically Expression(Complex(Fraction(Integer)))
> is the same as Expression(Complex(Integer)), but the
> second is usually more efficient.  So I wonder why
> you use Expression(Complex(Fraction(Integer))).
>

I haven't looked at the internal representation, but from the way the
interpreter/REPL presents
it, Complex(Fraction(Integer)) seems more natural to me because it doesn't
seem to
have to keep track of a (possibly huge) denominator. On the other hand just
saving one (but possibly huge)
denominator is probably cheaper. If they are logically the same,
I should be able to write everything and then check in the end which
version performs better.

(1) -> x^2 + x + 4 + 1/1000 + %i :: Expression(Complex(Fraction(Integer)))
         2       4001
   (1)  x  + x + ---- + %i
                 1000
                                 Type:
Expression(Complex(Fraction(Integer)))

(2) -> x^2 + x + 4 + 1/1000 + %i :: Expression(Complex(Integer))

              2
        1000 x  + 1000 x + 4001 + 1000 %i
   (2)  ---------------------------------
                       1000
                                           Type:
Expression(Complex(Integer))

AFAICS Expression(Complex(Fraction(Integer))) should satisfy your
> constraints without need to add anything.
>
> In slightly different tone: if you feel that some domain/package
> should have some operation and type constraints prevent using it,
> then ask here.  Usually there is good reason why type constraints
> are there, in such case other domain/package may be more appropriate.
> But there are also cases where constraints are not needed, then
> we can improve FriCAS by removing spurious limitations.
>

Coming back to my series expansion wrapper (see below). I get the error
   >> Apparent user error:
   not known that uts has (AND (has (Expression (Complex (Fraction
(Integer)))) (SIGNATURE ^ ((Expression (Complex (Fraction (Integer))))
(Expression (Complex (Fraction (Integer)))) (Fraction (Integer))))) (has
(Expression (Complex (Fraction (Integer)))) (SIGNATURE coerce ((Expression
(Complex (Fraction (Integer)))) (Symbol)))))

Does this ask for a coercion of Expression(Complex(Fraction(Integer))) into
a Symbol?

On the other hand the interpreter seems to just do fine:

(11) -> ser := retract(puiseux((x^2 + x) ::
Expression(Complex(Fraction(Integer))),
'x=0))$AnyFunctions1(UnivariatePuiseuxSeries(Expression(Complex(Fraction(Integer))),'x,0))
(12) ->
approximate(ser,3)$UnivariatePuiseuxSeries(Expression(Complex(Fraction(Integer))),
'x, 0)

>From bottom messages I see that
[1]  signature:   (UPXS(EXPR(COMPLEX(FRAC(INT))),x,0), FRAC(INT)) ->
EXPR(COMPLEX(FRAC(INT)))
      implemented: slot (Expression (Complex (Fraction
(Integer))))$(Fraction (Integer)) from UPXS(EXPR(COMPLEX(FRAC(INT))),x,0)

So here it seems to know that Expression(Complex(Fraction(Integer))) has
the necessary signatures needed for approximate.

Thank you,
Tobias

--- SNIP ---
)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)

        my_taylor(ff, sym, x0) ==
            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 := approximate(ts,3/1)$uts
            approx
---- SNIP----

PS: Some additional questions; I believe you are the author of the rational
reconstruction packages
https://fricas.github.io/api/VectorIntegerReconstructor.html
https://fricas.github.io/api/VectorModularReconstructor.html

I'm currently not in need of any of such functions, but just
curious/interested:

What is the difference between these two packages?
"Each evaluation is done module machine sized prime p"
I am (not yet) particularly familiar with polynomial/rational
reconstruction. Does that
restrict the highest degree of the numerator or denominator in practice, or
does that mean
that just more probes are necessary? It seems like these routines are able
to handle the multivariate case?
 Are these packages in a "working" condition so that I can use them with
"little" effort as a black box?
(For example there is a C++ package that can act as a simple black box
https://gitlab.com/firefly-library/firefly ; arXiv:1904.00009,
 so if the need arises it could be interesting to interface some dedicated
libraries to FriCAS )

-- 
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/CANL0awYbDi_OaqVTzX9TtG3E7AjsASSnmDW2miHBTWQ3M-aJEw%40mail.gmail.com.

Reply via email to