MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / ASIN>

Method ASIN>

src/jit/impl/mlir/ir/each_mode.cpp:73–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71//! ASIN: arctan2(x, sqrt(1 - x * x))
72template <>
73mlir::Value lower_mode<Mode::ASIN>(
74 mlir::OpBuilder& builder, mlir::Location loc, ValueRange operands) {
75 ValueBuilderHelper helper(builder, loc);
76 auto x = operands[0];
77 auto one_minus_x_2 = helper.sub(helper.const_f32(1.f), helper.mul(x, x));
78 return atan2_approx(helper, x, helper.sqrt(one_minus_x_2));
79}
80
81//! ERFCINV: inverse of complementary gauss error function
82//! https://github.com/scipy/scipy/blob/master/scipy/special/cephes/erfinv.c

Callers

nothing calls this directly

Calls 5

atan2_approxFunction · 0.85
const_f32Method · 0.80
mulMethod · 0.80
subMethod · 0.45
sqrtMethod · 0.45

Tested by

no test coverage detected