Axel Vogt

5936 Reputation

20 Badges

20 years, 256 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are replies submitted by Axel Vogt

Once I learned from Carl Devore, that 'tryhard' is a master due to Gaston Gonnet.
So it is unlikely to be touched (there is the German word "Verschlimmbessern", it
means to make things worse by trying to improve). And 'array' vs. 'Array' is not
a bug.

But one can use it off the package in several cases. Here is something taken from
an old 'discussion' between Carl Devore & Robert Israel at the Maple newsgroup:

  Tryhard:= proc(expr)
  global E_in_Tryhard;
  subs(pow= `^`,
    codegen[optimize](subs(E_in_Tryhard= expr, ()-> E_in_Tryhard), tryhard))()
  end proc;

Use it with some care (it will not work on diff, int, limit - one needs the inert
forms D, Int and Limit and it certainly has other limitation, which I do not know,
besides things in the core of 'tryhard', may be even bugs).

In *any* case I would try simplify/size before using that (as it is maintained).

If you think it helps you than you can use it as follows (in the uploaded sheet):

  stampa:=map(simplify, stampa,size): 
  eval(stampa): map(length,%);

  stampa:=map(Tryhard,stampa): map(length, stampa);

                          [1903    474    0]
                          [                ]
                          [1378    709    0]
                          [                ]
                          [1193    414    0]


Note that a larger length does not mean higher complexity. After a re-run we have:

  tmp:=stampa[3,1]: codegen[cost](tmp);

    97 multiplications + 2 divisions + 35 additions + 14 functions + 59 subscripts

  tmp:=simplify(tmp,size): codegen[cost](tmp);

    97 multiplications + 2 divisions + 35 additions + 14 functions + 59 subscripts

  tmp:=Tryhard(tmp): codegen[cost](tmp);

    84 multiplications + 2 divisions + 33 additions + 51 subscripts+ 10 functions


The main improvement *may* be by function calls. But one would have to look at it.


A personal remark: probably you expect a bit to much from a CAS and ignore some
of the ability of compilers: they may *destroy or improve* what you feed them by
automatic inputs - which you do through hundreds of procs. Actually that means
that you provide code, that never has been tested - it just has been produced.
It is like blind flying. For example you will *never* have any impression about
the numerical stability, speed is not the glory. 

You may wish to think about the whole approach. Really.

will do - after your try ... just want an independent check, whether I did it 'good' enough

will do - after your try ... just want an independent check, whether I did it 'good' enough

I know it quite well, when one is loosing patients with a system :)

1) Well, if 'tryhard' does not work in reasonable time ... then one either can analyze it + the problem.
Which may need quite a long time and good motivation. Or look for slight workarounds - like the one
I suggested. Or leave it as it is & hope for the compiler. More or less it is the question, whether it is
worth to invest (private) time or accept possible larger CPU time (not sure if one can save some).

2) That's not what I meant: I used the old array for the old package and vaguely remember, that it
would have some problem with the new Array (it was more an addition tp Paulina's comment, that
the old codegen does not work on all new features).

I know it quite well, when one is loosing patients with a system :)

1) Well, if 'tryhard' does not work in reasonable time ... then one either can analyze it + the problem.
Which may need quite a long time and good motivation. Or look for slight workarounds - like the one
I suggested. Or leave it as it is & hope for the compiler. More or less it is the question, whether it is
worth to invest (private) time or accept possible larger CPU time (not sure if one can save some).

2) That's not what I meant: I used the old array for the old package and vaguely remember, that it
would have some problem with the new Array (it was more an addition tp Paulina's comment, that
the old codegen does not work on all new features).

Paulina, you are right - of course :-) I should have read the
help page again. Sorry.

I think the difference between the 2 packages made me use the
older 'array' instead of 'Array' in a former thread answering
the same author on a related problem.

www.mapleprimes.com/forum/mymapleworksheetveryveryveryslowcanyouhelpmespeedit

Paulina, you are right - of course :-) I should have read the
help page again. Sorry.

I think the difference between the 2 packages made me use the
older 'array' instead of 'Array' in a former thread answering
the same author on a related problem.

www.mapleprimes.com/forum/mymapleworksheetveryveryveryslowcanyouhelpmespeedit

That was a good one!

He might have meant, that users become too much unpatient beyond 10 min.

For commercial administrative software one usually expects less than 1 sec
due to such user expectations (not that all will do, try SAP or other stuff ...)

That was a good one!

He might have meant, that users become too much unpatient beyond 10 min.

For commercial administrative software one usually expects less than 1 sec
due to such user expectations (not that all will do, try SAP or other stuff ...)

numerical? no direct way and if using any: a godd justification is needed.

numerical? no direct way and if using any: a godd justification is needed.

Looked at wwwb.math.rwth-aachen.de/homalg/ (once mentioned here at MaplePrimes), but it seems not to have exterior algebras and was directed to GAP, especially www.gap-system.org/Manuals/doc/htm/ref/CHAP061.htm#SECT014 for the most common tensor algebras (over Lie algebras), some of the system packages are siad to wotk on Unix only

may be, that covers your needs - of course I have not looked closer ...

can not say much on that, since I am German ... however translating makes sense for Maple, a Canadian company (while sage seems to have some strange side meanings in English/American ... however I love calf liver with sage and some semi secco wine at the Italians ...):

Maple -> dict.tu-chemnitz.de/dings.cgi

Sage -> dict.tu-chemnitz.de/dings.cgi

I remember vaguely, that's an actual problem for manufacturers: choosing product names and how they might be sensed in foreign countries ... or people off the main customers)

 

well, we have a CRM system distributed by Sage at work, called ACT! (and called Dreckstool by most of my colleagues ...)

Well deserved and nice to read you!

1 posting for each of you ...

First 169 170 171 172 173 174 175 Last Page 171 of 209