Thank you, Jason and Aaron for the elaborate reply.

I am now a bit clear as to what has to be done if one takes this up. 
I also understood why you have considered AST as a better option than 
templating.

Also, this is what I construed:

1)An optimization pipeline has to be formulated. 

I have thought about this and think that it should be somewhat like this:

<https://lh3.googleusercontent.com/-AgfQj9H_ASc/Vt8ul0j5ebI/AAAAAAAAAL4/aiSoMWFyInA/s1600/Screenshot%2Bfrom%2B2016-03-09%2B01%253A26%253A36.png>





2)The optimizer can implement the following with individual switches:


i)unrolled pow(x, n)

ii)fused add multiply for floating point calculations

iii)intelligent guess about whether to use exp2

iv)horner

v)horner with fused add multiply, maybe?

vi)fast matrix exponentiation that takes in an AST 

vii)trignometric simplification

viii)pre-computing constant expressions

ix)using cse with 'basic' optimization.

x)splitting very large expressions into number of Augmented Assignments

xi)fractional power optimization (a=x**(1/2), b=x**(3/2) => a=x**(1/2), 
b=x*a)

xii)integer power optimization (a=x**8, b=x**10 => t1=x**2, t2=t1**2, 
a=t2**2, b=a*t1

xiii)Sub-product optimization (a=xyz, b=wyz => t1=yz, a=xt1, b=wt1)

xiv)Sum multiple optimization (a =x-y, b=2y-2x => a=x-y, b=-2a)


The last four are taken from 
http://www.jnaiam.org/new/uploads/files/16985fffb53018456cf3506db1c5e42b.pdf 
which is a paper by Allan Wittkopf on code generation in Maple.


I understand that these optimizations need to be tested and might not 
necessarily provide a speed up in all contexts.

I would like to ask if you have any comments on how you think the 
optimization pipeline should be (improvements on the naive model I drew on 
Pinta) and according to you, which of the above optimizations are worth 
being included ( after being tested ). 


Thank you,

Tanu Hari Dixit.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/0f1bfdb2-4e04-4822-94fd-8d8dcc006ac3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to