[all-commits] [llvm/llvm-project] 7e2d67: Add polynomial approximation for trigonometric sin...

Ahmed S. Taei via All-commits all-commits at lists.llvm.org
Mon Jun 21 13:00:54 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7e2d672a672c0559f6e5c417c5ee2514402cf18e
      https://github.com/llvm/llvm-project/commit/7e2d672a672c0559f6e5c417c5ee2514402cf18e
  Author: Ahmed S. Taei <ataei at google.com>
  Date:   2021-06-21 (Mon, 21 Jun 2021)

  Changed paths:
    M mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp
    M mlir/test/mlir-cpu-runner/math_polynomial_approx.mlir

  Log Message:
  -----------
  Add polynomial approximation for trigonometric sine and cosine functions

The approximation relays on range reduced version y \in [0, pi/2]. An input x will have
the property that sin(x) = sin(y), -sin(y), cos(y), -cos(y) depends on which quadrable x
is in, where sin(y) and cos(y) are approximated with 5th degree polynomial (of x^2).
As a result a single pattern can be used to compute approximation for both sine and cosine.

Reviewed By: ezhulenev

Differential Revision: https://reviews.llvm.org/D104582




More information about the All-commits mailing list