Question on valid transformations for cbrt

Segher Boessenkool segher@kernel.crashing.org
Wed Mar 10 15:32:00 GMT 2004


> The problem with cbrt, unlike sqrt, is that its is more expressive than
> pow.  i.e. cbrt(-29.7) = -3.1 but pow(-29.7,1.0/3.0) => EDOM.  Hence
> we can't normalize cbrt(x) as pow(x,1.0/3.0),

You can "normalize" cbrt(x) as  sign(x) * pow(abs(x), 1.0/3)  -- maybe 
that
helps some further optimizations?

> but we can safely go the
> other way pow(x,1.0/3.0) => cbrt(x).


Segher



More information about the Gcc mailing list