This is an archive of the discontinued LLVM Phabricator instance.

[mlir][math] Modify math.powf to handle negative bases.
ClosedPublic

Authored by bviyer on Aug 24 2023, 4:48 PM.

Details

Summary

Powf expansion currently returns NaN when the base is negative.
This is because taking natural log of a negative number gives
NaN. This patch will square the base and half the exponent, thereby
getting around the negative base problem.

Diff Detail

Event Timeline

bviyer created this revision.Aug 24 2023, 4:48 PM
bviyer requested review of this revision.Aug 24 2023, 4:48 PM
rsuderman accepted this revision.Aug 25 2023, 12:09 PM
This revision is now accepted and ready to land.Aug 25 2023, 12:09 PM
This revision was automatically updated to reflect the committed changes.