Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Arithmetic deduction/extraction
Replies: 3   Last Post: Apr 12, 2013 1:26 PM

 Messages: [ Previous | Next ]
 Steven Lord Posts: 18,038 Registered: 12/7/04
Re: Arithmetic deduction/extraction
Posted: Apr 11, 2013 11:49 AM

"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

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