Keyword: ヤコビシータ関数
概要
本サンプルはヤコビシータ関数を求めるC言語によるサンプルプログラムです。 本サンプルは以下に示されるヤコビシータ関数を求めて出力します。
※本サンプルはnAG Cライブラリに含まれる関数 nag_jacobian_theta() のExampleコードです。本サンプル及び関数の詳細情報は nag_jacobian_theta のマニュアルページをご参照ください。
ご相談やお問い合わせはこちらまで
入力データ
(本関数の詳細はnag_jacobian_theta のマニュアルページを参照)- 1行目はタイトル行で読み飛ばされます。
- 2行目に関数θk(x,q)のkの値、引数x、qの値を指定しています。
出力結果
(本関数の詳細はnag_jacobian_theta のマニュアルページを参照)1 2 3
この出力例をダウンロード |
nag_jacobian_theta (s21ccc) Example Program Results k x q y 2 0.7 0.4 -6.9289e-01
- 3行目に関数θk(x,q)のkの値、引数x、qの値とヤコビシータ関数の値が出力されています。
ソースコード
(本関数の詳細はnag_jacobian_theta のマニュアルページを参照)
※本サンプルソースコードはnAG数値計算ライブラリ(Windows, Linux, MAC等に対応)の関数を呼び出します。
サンプルのコンパイル及び実行方法
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
このソースコードをダウンロード |
/* nag_jacobian_theta (s21ccc) Example Program. * * CLL6I261D/CLL6I261DL Version. * * Copyright 2017 Numerical Algorithms Group. * * nAG C Library * * Mark 26.1, 2017. */ #include <stdio.h> #include <nag.h> #include <nag_stdlib.h> #include <nags.h> int main(void) { Integer exit_status = 0, k; NagError fail; double q, x, y; INIT_FAIL(fail); /* Skip heading in data file */ scanf("%*[^\n] "); printf("nag_jacobian_theta (s21ccc) Example Program Results\n"); printf(" k x q y\n"); while (scanf("%ld%lf%lf%*[^\n]", &k, &x, &q) != EOF) { /* nag_jacobian_theta (s21ccc). * Jacobian theta functions with real arguments */ y = nag_jacobian_theta(k, x, q, &fail); if (fail.code != NE_NOERROR) { printf("Error from nag_jacobian_theta (s21ccc).\n%s\n", fail.message); exit_status = 1; goto END; } printf("%2ld %4.1f %4.1f %13.4e\n", k, x, q, y); } END: return exit_status; }