This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question on valid transformations for cbrt


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]