Skip to content

Commit

Permalink
<cmath> : 残りの数学関数を拡張浮動小数点数型に対応 #1022
Browse files Browse the repository at this point in the history
  • Loading branch information
faithandbrave committed Feb 20, 2023
1 parent ace1860 commit 0567ba8
Show file tree
Hide file tree
Showing 15 changed files with 528 additions and 115 deletions.
40 changes: 34 additions & 6 deletions reference/cmath/cyl_bessel_i.md
Expand Up @@ -7,15 +7,40 @@

```cpp
namespace std {
float cyl_bessel_if(float nu, float x);
double cyl_bessel_i(double nu, double x);
long double cyl_bessel_il(long double nu, long double x);
double
cyl_bessel_i(double nu,
double x); // (1) C++17
floating-point-type
cyl_bessel_i(floating-point-type nu,
floating-point-type x); // (1) C++23

Promoted
cyl_bessel_i(Arithmetic1 nu,
Arithmetic2 x); // (2) C++17

float
cyl_bessel_if(float nu,
float x); // (3) C++17

long double
cyl_bessel_il(long double nu,
long double x); // (4) C++17
}
```
* Promoted[italic]
* Arithmetic1[italic]
* Arithmetic2[italic]
## 概要
第一種変形ベッセル関数 (modified Bessel functions of the first kind) を求める。
- (1) :
- C++17 : `double`に対するオーバーロード
- C++23 : 浮動小数点数型に対するオーバーロード
- (2) : 算術型に対するオーバーロード (対応する大きい方の精度の浮動小数点数型にキャストして計算される)
- (3) : `float`型規定
- (4) : `long double`型規定
## 戻り値
引数 `nu`, `x` の第一種変形ベッセル関数
Expand All @@ -28,7 +53,8 @@ $J$ は第一種ベッセル関数 ([`cyl_bessel_j`](cyl_bessel_j.md)) である
## 備考
`nu >= 128` の場合、この関数の呼び出しの効果は実装定義である。
- `nu >= 128` の場合、この関数の呼び出しの効果は実装定義である
- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された
## 例
Expand Down Expand Up @@ -84,11 +110,13 @@ GCC 7.1.0–8.0.0 では `nu < 0` のときに [`std::domain_error`](/reference/


## 関連項目
* 第一種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md)
* 第二種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md)
- 第一種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md)
- 第二種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md)


## 参照
- [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf)
- [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf)
- [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html)
- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html)
- C++23で導入された拡張浮動小数点数型への対応として、`float``double``long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした
44 changes: 36 additions & 8 deletions reference/cmath/cyl_bessel_j.md
Expand Up @@ -7,15 +7,40 @@

```cpp
namespace std {
float cyl_bessel_jf(float nu, float x);
double cyl_bessel_j(double nu, double x);
long double cyl_bessel_jl(long double nu, long double x);
double
cyl_bessel_j(double nu,
double x); // (1) C++17
floating-point-type
cyl_bessel_j(floating-point-type nu,
floating-point-type x); // (1) C++23

Promoted
cyl_bessel_j(Arithmetic1 nu,
Arithmetic2 x); // (2) C++17

float
cyl_bessel_jf(float nu,
float x); // (3) C++17

long double
cyl_bessel_jl(long double nu,
long double x); // (4) C++17
}
```
* Promoted[italic]
* Arithmetic1[italic]
* Arithmetic2[italic]
## 概要
第一種ベッセル関数 (Bessel functions of the first kind) を求める。
- (1) :
- C++17 : `double`に対するオーバーロード
- C++23 : 浮動小数点数型に対するオーバーロード
- (2) : 算術型に対するオーバーロード (対応する大きい方の精度の浮動小数点数型にキャストして計算される)
- (3) : `float`型規定
- (4) : `long double`型規定
## 戻り値
引数 `nu`, `x` の第一種ベッセル関数
Expand All @@ -27,7 +52,8 @@ $$
## 備考
`nu >= 128` の場合、この関数の呼び出しの効果は実装定義である。
- `nu >= 128` の場合、この関数の呼び出しの効果は実装定義である
- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された
## 例
Expand Down Expand Up @@ -85,13 +111,15 @@ GCC 7.1.0–8.0.0 では `nu < 0` のときに [`std::domain_error`](/reference/


## 関連項目
* 第一種変形ベッセル関数 [`cyl_bessel_i`](cyl_bessel_i.md)
* 第二種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md)
* 第二種ベッセル関数 [`cyl_neumann`](cyl_neumann.md)
* 第一種球ベッセル関数 [`sph_bessel`](sph_bessel.md)
- 第一種変形ベッセル関数 [`cyl_bessel_i`](cyl_bessel_i.md)
- 第二種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md)
- 第二種ベッセル関数 [`cyl_neumann`](cyl_neumann.md)
- 第一種球ベッセル関数 [`sph_bessel`](sph_bessel.md)


## 参照
- [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf)
- [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf)
- [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html)
- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html)
- C++23で導入された拡張浮動小数点数型への対応として、`float``double``long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした
42 changes: 35 additions & 7 deletions reference/cmath/cyl_bessel_k.md
Expand Up @@ -7,15 +7,40 @@

```cpp
namespace std {
float cyl_bessel_kf(float nu, float x);
double cyl_bessel_k(double nu, double x);
long double cyl_bessel_kl(long double nu, long double x);
double
cyl_bessel_k(double nu,
double x); // (1) C++17
floating-point-type
cyl_bessel_k(floating-point-type nu,
floating-point-type x); // (1) C++23

Promoted
cyl_bessel_k(Arithmetic1 nu,
Arithmetic2 x); // (2) C++17

float
cyl_bessel_kf(float nu,
float x); // (3) C++17

long double
cyl_bessel_kl(long double nu,
long double x); // (4) C++17
}
```
* Promoted[italic]
* Arithmetic1[italic]
* Arithmetic2[italic]
## 概要
第二種変形ベッセル関数 (modified Bessel functions of the second kind) を求める。
- (1) :
- C++17 : `double`に対するオーバーロード
- C++23 : 浮動小数点数型に対するオーバーロード
- (2) : 算術型に対するオーバーロード (対応する大きい方の精度の浮動小数点数型にキャストして計算される)
- (3) : `float`型規定
- (4) : `long double`型規定
## 戻り値
引数 `nu`, `x` の第二種変形ベッセル関数
Expand All @@ -33,7 +58,8 @@ $I$, $J$, $N$ はそれぞれ
## 備考
`nu >= 128` の場合、この関数の呼び出しの効果は実装定義である。
- `nu >= 128` の場合、この関数の呼び出しの効果は実装定義である
- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された
## 例
Expand Down Expand Up @@ -89,12 +115,14 @@ GCC 7.1.0–8.0.0 では `nu < 0` のときに [`std::domain_error`](/reference/


## 関連項目
* 第一種変形ベッセル関数 [`cyl_bessel_i`](cyl_bessel_i.md)
* 第一種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md)
* 第二種ベッセル関数 [`cyl_neumann`](cyl_neumann.md)
- 第一種変形ベッセル関数 [`cyl_bessel_i`](cyl_bessel_i.md)
- 第一種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md)
- 第二種ベッセル関数 [`cyl_neumann`](cyl_neumann.md)


## 参照
- [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf)
- [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf)
- [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html)
- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html)
- C++23で導入された拡張浮動小数点数型への対応として、`float``double``long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした
36 changes: 32 additions & 4 deletions reference/cmath/cyl_neumann.md
Expand Up @@ -7,15 +7,40 @@

```cpp
namespace std {
float cyl_neumannf(float nu, float x);
double cyl_neumann(double nu, double x);
long double cyl_neumannl(long double nu, long double x);
double
cyl_neumann(double nu,
double x); // (1) C++17
floating-point-type
cyl_neumann(floating-point-type nu,
floating-point-type x); // (1) C++23

Promoted
cyl_neumann(Arithmetic1 nu,
Arithmetic2 x); // (2) C++17

float
cyl_neumannf(float nu,
float x); // (3) C++17

long double
cyl_neumannl(long double nu,
long double x); // (4) C++17
}
```
* Promoted[italic]
* Arithmetic1[italic]
* Arithmetic2[italic]
## 概要
第二種ベッセル関数 (Bessel functions of the second kind)、ノイマン関数 (Neumann functions) を求める。
- (1) :
- C++17 : `double`に対するオーバーロード
- C++23 : 浮動小数点数型に対するオーバーロード
- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される)
- (3) : `float`型規定
- (4) : `long double`型規定
## 戻り値
引数 `x` の第二種ベッセル関数
Expand All @@ -28,7 +53,8 @@ $J$ は第一種ベッセル関数 ([`cyl_bessel_j`](cyl_bessel_j.md)) である
## 備考
`nu >= 128` の場合、この関数の呼び出しの効果は実装定義である。
- `nu >= 128` の場合、この関数の呼び出しの効果は実装定義である
- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された
## 例
Expand Down Expand Up @@ -95,3 +121,5 @@ GCC 7.1.0–8.0.0 では `nu < 0` のときに [`std::domain_error`](/reference/
- [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf)
- [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf)
- [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html)
- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html)
- C++23で導入された拡張浮動小数点数型への対応として、`float``double``long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした
38 changes: 33 additions & 5 deletions reference/cmath/ellint_1.md
Expand Up @@ -7,15 +7,40 @@

```cpp
namespace std {
float ellint_1f(float k, float phi);
double ellint_1(double k, double phi);
long double ellint_1l(long double k, long double phi);
double
ellint_1(double k,
double phi); // (1) C++17
floating-point-type
ellint_1(floating-point-type k,
floating-point-type phi); // (1) C++23

Promoted
ellint_1(Arithmetic1 k,
Arithmetic2 phi); // (2) C++17

float
ellint_1f(float k,
float phi); // (3) C++17

long double
ellint_1l(long double k,
long double phi); // (4) C++17
}
```
* Promoted[italic]
* Arithmetic1[italic]
* Arithmetic2[italic]
## 概要
第一種不完全楕円積分 (incomplete elliptic integral of the first kind) を計算する。
- (1) :
- C++17 : `double`に対するオーバーロード
- C++23 : 浮動小数点数型に対するオーバーロード
- (2) : 算術型に対するオーバーロード (対応する大きい方の精度の浮動小数点数型にキャストして計算される)
- (3) : `float`型規定
- (4) : `long double`型規定
## 戻り値
引数 `k`, `phi` の第一種不完全楕円積分
Expand All @@ -27,7 +52,8 @@ $$
## 備考
$ F(k, \pi/2) = K(k)$ (第一種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md))。
- $ F(k, \pi/2) = K(k)$ (第一種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md))
- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された
## 例
Expand Down Expand Up @@ -85,10 +111,12 @@ GCC 7.1.0–8.0.0 では `|k| == 1 && |phi| >= π / 2` の場合 `nan` を返す


## 関連項目
* 第一種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md)
- 第一種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md)


## 参照
- [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf)
- [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf)
- [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html)
- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html)
- C++23で導入された拡張浮動小数点数型への対応として、`float``double``long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした

0 comments on commit 0567ba8

Please sign in to comment.