Re: Optimize evaluation of symbolic expressions
- To: mathgroup at smc.vnet.net
 - Subject: [mg101994] Re: Optimize evaluation of symbolic expressions
 - From: Roland Franzius <roland.franzius at uos.de>
 - Date: Sun, 26 Jul 2009 03:53:23 -0400 (EDT)
 - References: <h4ef4m$t1b$1@smc.vnet.net>
 
Harrie Kraai schrieb:
> Hello all,
> 
> With a specific example I countered today I want to introduce a question 
> that I have had for a longer time.
> 
>  From some composition of functions (and a subsequent FullSimplify) I 
> get the following expression:
> 
> {ArcTan[-1 + 2/(1 + x^2 + y^2), 2 Sqrt[(x^2 + y^2)/(1 + x^2 + y^2)^2]],
>   ArcTan[x/(1 + x^2 + y^2), y/(1 + x^2 + y^2)]}
> 
> which I need to evaluate many times inside a Manipulate.
Define something like
f[x_,y_]:=
({ArcTan[-1+2/#, 2 Sqrt[(#-1)/#^2], ArcTan[x/#,y/#]}&)[1+x^2+y^2]
but for an interpreting language the gain will be moderate if more than 
  this single function only has to be evaluated during an inner loop.
-- 
Roland Franzius