Skip to content

Latest commit

 

History

History
77 lines (54 loc) · 2.5 KB

File metadata and controls

77 lines (54 loc) · 2.5 KB

expint

  • 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)である。

戻り値

各要素i0以上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

処理系

関連項目

参照