This is an archive of the discontinued LLVM Phabricator instance.

[mlir][math] Math expansion for math.tan
ClosedPublic

Authored by rsuderman on Feb 28 2023, 9:58 AM.

Details

Summary

We can implement a polynomial approximation of math.tan by
decomposing to math.sin and math.cos. While it is not
technically a polynomial approximation it should be the most
straight forward approximation.

Diff Detail

Event Timeline

rsuderman created this revision.Feb 28 2023, 9:58 AM
rsuderman requested review of this revision.Feb 28 2023, 9:58 AM

Could we just have it in its own group/approximations pass? (Well and we can populate with patterns from polynomial if needed). Just feels wrong to have this in polynomial

rsuderman updated this revision to Diff 501337.Feb 28 2023, 4:57 PM

Moved decomposition to ExpandPattterns

rsuderman retitled this revision from [mlir][math] Polynomial approximation for math.tan to [mlir][math] Math expansion for math.tan.Feb 28 2023, 4:58 PM

Could we just have it in its own group/approximations pass? (Well and we can populate with patterns from polynomial if needed). Just feels wrong to have this in polynomial

I moved it to the ExpandMath patterns. Should be reasonable enough and it can be included optionally this way.

jpienaar accepted this revision.Feb 28 2023, 5:11 PM

Thanks!

This revision is now accepted and ready to land.Feb 28 2023, 5:11 PM
This revision was landed with ongoing or failed builds.Feb 28 2023, 5:22 PM
This revision was automatically updated to reflect the committed changes.