[mlir][math] Math expansion for math.tan
authorRobert Suderman <suderman@google.com>
Wed, 1 Mar 2023 01:13:42 +0000 (01:13 +0000)
committerRobert Suderman <suderman@google.com>
Wed, 1 Mar 2023 01:13:54 +0000 (01:13 +0000)
commit740e2e908ca49118a6e1f27e380dbb3665a99cc8
tree7804ec72b993f21d2586db578f294aa267555151
parent0b92f8afdc8c4680f283a5ec32406d3e47193841
[mlir][math] Math expansion for math.tan

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.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D144980
mlir/include/mlir/Dialect/Math/Transforms/Passes.h
mlir/lib/Dialect/Math/Transforms/ExpandPatterns.cpp
mlir/test/Dialect/Math/expand-math.mlir
mlir/test/lib/Dialect/Math/TestExpandMath.cpp