- simd[meta header]
- std::simd[meta namespace]
- function template[meta id-type]
- cpp26[meta cpp]
namespace std::simd {
template<math-floating-point V>
deduced-vec-t<V> expint(const V& x); // C++26
}- deduced-vec-t[link /reference/simd/deduced-vec-t.md]
- math-floating-point[link /reference/simd/math-floating-point.md]
浮動小数点要素型のbasic_vec(またはスカラーの浮動小数点数)について、各要素に<cmath>のexpintを適用し、各要素の指数積分(exponential integral)の値を求める。
制約math-floating-pointは、Vが浮動小数点要素型のbasic_vec、またはスカラーの浮動小数点型であることを表す説明専用のコンセプトである。deduced-vec-t<V>は、Vに対応するデータ並列型(Vがスカラーの場合は既定のABIをもつbasic_vec)である。
各要素i(0以上deduced-vec-t<V>::size()未満)について、x[i]に<cmath>のexpintを適用した結果で要素ごとに初期化されたbasic_vecオブジェクトを返す。
ある要素iについて定義域エラー・極エラー・値域エラーが発生する場合、その要素の値は未規定である。
errnoにアクセスするか否かは未規定である。
#include <simd>
#include <print>
namespace simd = std::simd;
int main()
{
simd::vec<double, 2> v([](int i) { return i + 1.0; }); // {1, 2}
// 各要素の指数積分を求める
simd::vec<double, 2> r = simd::expint(v);
for (std::size_t i = 0; i < r.size(); ++i) {
std::print("{} ", r[i]);
}
std::println("");
}- simd::expint[color ff0000]
1.8951178163559366 4.954234356001891
- C++26
- Clang: 22 [mark noimpl]
- GCC: 16.1 [mark noimpl]
- Visual C++: 2026 Update 2 [mark noimpl]