MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Acos

Function Acos

tensorflow/compiler/xla/client/lib/math.cc:1118–1123  ·  view source on GitHub ↗

acos(x) = 2 * atan(sqrt(1 - x^2) / (1 + x)) if x != -1 pi if x == -1

Source from the content-addressed store, hash-verified

1116// acos(x) = 2 * atan(sqrt(1 - x^2) / (1 + x)) if x != -1
1117// pi if x == -1
1118XlaOp Acos(XlaOp x) {
1119 return Select(Ne(x, FullLike(x, -1)),
1120 ScalarLike(x, 2.0) * Atan2(Sqrt(ScalarLike(x, 1.0) - x * x),
1121 ScalarLike(x, 1.0) + x),
1122 FullLike(x, M_PI));
1123}
1124
1125// asin(x) = 2 * atan(x / (1 + sqrt(1 - x^2)))
1126XlaOp Asin(XlaOp x) {

Callers 3

unary_ops.ccFile · 0.50
TEST_FFunction · 0.50
TestCWiseGradMethod · 0.50

Calls 6

FullLikeFunction · 0.85
ScalarLikeFunction · 0.85
SelectFunction · 0.50
NeFunction · 0.50
Atan2Function · 0.50
SqrtFunction · 0.50

Tested by 2

TEST_FFunction · 0.40
TestCWiseGradMethod · 0.40