"kees de Kapper" <kees_de_kapper@hotmail.com> wrote in message
news:kk6gdl$8jq$1@newscl01ah.mathworks.com...
> Hi All,
>
> Although this is not purely Matlab related, I need for a matlab script.
> Hopefully some of you could help me with this.
>
> Consider a a formula like: (2*A+(B.^2+1)/3)
>
> How could I split this in separate arithmetic operations on a most
> efficient way.
I have a question and some clarifications requests.
Please clarify what YOU mean by "most efficient way" (wall clock time, CPU
time, number of operations, minimal memory allocation, etc.) and specify
what arithmetic operations you're allowed to use.
For instance, there's no FMA operation
(http://en.wikipedia.org/wiki/Multiply%E2%80%93accumulate_operation) in
MATLAB but certain expressions simplify down to one operation if you're
allowed to include that in your instruction set.
Similarly, do you count sin(x) as one "arithmetic operation" or do you need
to count all the additions, multiplications, etc. required to implement
CORDIC (http://en.wikipedia.org/wiki/CORDIC) or FDLIBM
(http://www.netlib.org/fdlibm/) in your count?
The question I have (I consider all the above as clarification) is why are
you doing this? What is your end goal in doing this?

Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
