# Convert expression to C-form and simplifying

I have an expression which is the sum of many terms of the form

$$\frac{0.00000000274341}{(0.000363856+(0.611425+z)^2)^{3/2}}$$

My problem is that I need to include this long expression in a C++-program I made, so all the exponents $^2$ and $^{3/2}$ I need to bring on a C++-compatible form. If I use CForm, then the exponents become pow(..., 2) and pow(..., 1.5), respectively.

In order to speed up my program, I would like for all the pow(..., 2) expression to be converted to (...)*(...) and for the pow(..., 1.5) to be converted to (...)*pow(..., 0.5).

Is there an easy way to do this?

-
seems like string replacement can work for you? and why do you think x*pow(x, 0.5) is faster than pow(x, 1.5)? –  asterix314 Oct 22 '13 at 14:52
@asterix314 I found an optimized sqrt-function in C++, so I would like to write it all in terms of that.. I'll dig up the reference –  BillyJean Oct 22 '13 at 16:44

expr = Sum[RandomReal[]/(RandomReal[] + (RandomReal[] + z)^2)^(3/2), {2}]

expr //. {x_^2 :> HoldForm[x*x], x_^(-3/2) :> 1/(x* sqrt[x]) } // CForm