Cbrt () cube root function in Visual Studio 2012

I am writing a program in Visual Studio 2012 Professional (Windows) in C / C ++, which consists of computing multiple permissions with pow(). I ran the profiler to find out why it took a long time to run, and I found that it was pow()a bottleneck.

I rewrote powers like

pow(x,1.5) before x*sqrt(x)

and

pow(x,1.75) before sqrt(x*x*x*sqrt(x))

which significantly improved the speed of the program.

Several capacities have a look pow(x,1.0/3.0), so I was looking for a cubic root function cbrt()to speed things up, but it seems this is not available in Visual Studio, which I can hardly imagine, so my question is:

Where can I find a function cbrt()in Visual Studio 2012 Professional, and if not, what are the alternatives besides pow(x,1.0/3.0)?

Yours faithfully,

+3
1

C , .

( : Google " .)

, , Microsoft Visual Studio.

(, pow (x, 1.0/3.0)). , .

. , pow().

32-bit float tests
----------------------------------------
cbrt_5f      8.8 ms    5 mbp   6.223 abp
pow        144.5 ms   23 mbp  23.000 abp
halley x 1  31.8 ms   15 mbp  18.961 abp
halley x 2  59.0 ms   23 mbp  23.000 abp
newton x 1  23.4 ms   10 mbp  12.525 abp
newton x 2  48.9 ms   20 mbp  22.764 abp
newton x 3  72.0 ms   23 mbp  23.000 abp
newton x 4  89.6 ms   23 mbp  23.000 abp

. .

+4

All Articles