| 1578 | } |
| 1579 | |
| 1580 | XlaOp BesselI1e(XlaOp x) { |
| 1581 | auto& b = *x.builder(); |
| 1582 | return b.ReportErrorOrReturn([&]() -> StatusOr<XlaOp> { |
| 1583 | TF_RETURN_IF_ERROR(EnsureOperandIsRealFp("BesselI1e", x)); |
| 1584 | TF_ASSIGN_OR_RETURN(auto shape, b.GetShape(x)); |
| 1585 | if (shape.element_type() == F64) { |
| 1586 | return I1eImpl64(x); |
| 1587 | } |
| 1588 | // I1eF32Impl don't have enough precision when run with bf16 intermediates |
| 1589 | // (not surprising!), so upcast to f32 in this case. |
| 1590 | return DoWithUpcastToF32(x, {BF16, F16}, |
| 1591 | [](XlaOp x) { return I1eImpl32(x); }); |
| 1592 | }); |
| 1593 | } |
| 1594 | |
| 1595 | // I J Thompson and A R Barnett. 1986. Coulomb and Bessel functions of complex |
| 1596 | // arguments and order. J. Comput. Phys. 64, 2 (June 1986), 490-509. |