Oops, I forgot to add one line of output

(3) -> distribute(%)::Float

   (3)  0.7681727501_0912254214 E 418
                                                                  Type: Float
                                                                  Time: 0 sec

'distribute' is the operator that "undoes" 'paren'.

On 20 March 2017 at 13:32, Bill Page <bill.p...@newsynthesis.org> wrote:
> The problem is just the expansion of (1+x)^10000.
>
> (1) -> )set message time on
>
> (1) -> g(x) == (1+x)^10000
>                                                                    Type: Void
>                                                                   Time: 0 sec
> (2) -> eval(D(g(x),x), x=0.1)
>    Compiling function g with type Variable x -> Polynomial Integer
>
>                                                        Type: Polynomial Float
>                            Time: 3.09 (IN) + 6.74 (EV) + 0.06 (OT) = 9.89 sec
>
> In FriCAS and OpenAxiom (probably Axiom too) the correct way to avoid
> this is to treat (1+x) as a kernel via the identity operator 'paren'.
>
> (3) -> g(x) == paren(1+x)^10000
>    Compiled code for g has been cleared.
>    1 old definition(s) deleted for function or rule g
>                                                                    Type: Void
>                                                                   Time: 0 sec
> (4) -> eval(D(g(x),x), x=0.1)
>    Compiling function g with type Variable x -> Expression Integer
>                      9999      ,
>    (4)  10000.0 (1.1)    %paren (1.1)
>
>                                                        Type: Expression Float
>                                        Time: 0.09 (IN) + 0.05 (OT) = 0.14 sec
>
> The only trouble here is that neither FriCAS nor OpenAxiom know how to
> differentiate this operator.  This can be fixed with the following
> patch:
>
> https://github.com/billpage/fricas/commit/04c1f9b2d5eb4ece95c6f5dded46a72181cecb06
> https://github.com/billpage/fricas/commit/04c1f9b2d5eb4ece95c6f5dded46a72181cecb06.patch
>
> (1) -> g(x) == paren(1+x)^10000
>                                                                    Type: Void
>                                                                   Time: 0 sec
> (2) -> eval(D(g(x),x), x=0.1)
>    Compiling function g with type Variable(x) -> Expression(Integer)
>
>                      9999
>    (2)  10000.0 (1.1)
>                                                       Type: Expression(Float)
>                            Time: 0.04 (IN) + 0.00 (EV) + 0.12 (OT) = 0.16 sec
>

-- 
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 post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to