| 59 | //! ACOS: pi / 2 - arctan2(x, sqrt(1 - x * x)) |
| 60 | template <> |
| 61 | mlir::Value lower_mode<Mode::ACOS>( |
| 62 | mlir::OpBuilder& builder, mlir::Location loc, ValueRange operands) { |
| 63 | ValueBuilderHelper helper(builder, loc); |
| 64 | auto x = operands[0]; |
| 65 | auto one_minus_x_2 = helper.sub(helper.const_f32(1.f), helper.mul(x, x)); |
| 66 | auto asin = atan2_approx(helper, x, helper.sqrt(one_minus_x_2)); |
| 67 | auto pi_over_2 = helper.const_f32(1.57079637f); |
| 68 | return helper.sub(pi_over_2, asin); |
| 69 | } |
| 70 | |
| 71 | //! ASIN: arctan2(x, sqrt(1 - x * x)) |
| 72 | template <> |
nothing calls this directly
no test coverage detected