{"id":19926052,"url":"https://github.com/r-js/standalone-bessel","last_synced_at":"2025-03-01T10:41:24.131Z","repository":{"id":95792748,"uuid":"503476071","full_name":"R-js/standalone-bessel","owner":"R-js","description":"Dissected Bessel functions from R-base as a command line executable (besselK, besselJ, besselI, besselY)","archived":false,"fork":false,"pushed_at":"2022-11-22T22:30:03.000Z","size":114,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-12T00:32:42.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/R-js.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-14T18:28:00.000Z","updated_at":"2022-06-14T19:23:13.000Z","dependencies_parsed_at":"2023-03-13T16:46:46.155Z","dependency_job_id":null,"html_url":"https://github.com/R-js/standalone-bessel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R-js%2Fstandalone-bessel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R-js%2Fstandalone-bessel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R-js%2Fstandalone-bessel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R-js%2Fstandalone-bessel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/R-js","download_url":"https://codeload.github.com/R-js/standalone-bessel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241354990,"owners_count":19949291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T22:27:06.967Z","updated_at":"2025-03-01T10:41:24.112Z","avatar_url":"https://github.com/R-js.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# standalone-bessel\r\nDissected Bessel functions from R-base as a command line executable (besselK, besselJ, besselI, besselY)\r\n\r\n\r\n## Compiling\r\n\r\n```bash\r\ncd \u003cproject-dir\u003e\r\nmake\r\n```\r\n\r\nThere will be a `bessel` executable in the project dir, you can copy this to `/usr/local/bin` or wherever you fancy\r\nIt is fully self contained executable\r\n\r\n\r\n## Usage \r\n\r\nWe show command equivalent and between R and `bessel` command line executable\r\n\r\n\r\n### For BesselI\r\n\r\nR example:\r\n\r\n```R\r\nx \u003c- seq(0,1,0.1)\r\nalpha \u003c- 1.5\r\ny \u003c- besselI(x, alpha, TRUE)\r\n```\r\n\r\nEquivalent `bessel` command line example\r\n\r\n- the -i option selects the `besselI` function_\r\n- the -x option arguments works like the R sequence `seq(start, end , step)`\r\n    - -x=start,stop,step\r\n- the -a option argument is the `alpha` argument\r\n- the -s option argument (true or false) is to scale the answer exponentially to avoid overflow or underflow    \r\n\r\n```bash\r\n./bessel -i -x=0,1,0.1 -a=1.5 -s=TRUE\r\n# -\u003e output to stdout\r\n\r\n#row number, x,                      alpha,                  scale besselI(x,alpha, scale)\r\n\r\n#1,0.0000000000000000000000e+00,1.5000000000000000000000e+00,t,0.0000000000000000000000e+00\r\n#2,1.0000000000000000555112e-01,1.5000000000000000000000e+00,t,7.6176951894028292061600e-03\r\n#3,2.0000000000000001110223e-01,1.5000000000000000000000e+00,t,1.9554246712917208728122e-02\r\n#4,3.0000000000000004440892e-01,1.5000000000000000000000e+00,t,3.2667506227343073854641e-02\r\n#5,4.0000000000000002220446e-01,1.5000000000000000000000e+00,t,4.5827261386007379917462e-02\r\n#6,5.0000000000000000000000e-01,1.5000000000000000000000e+00,t,5.8471662583135769475362e-02\r\n#7,5.9999999999999997779554e-01,1.5000000000000000000000e+00,t,7.0311123038549097619132e-02\r\n#8,6.9999999999999995559108e-01,1.5000000000000000000000e+00,t,8.1206972794260576242742e-02\r\n#9,7.9999999999999993338662e-01,1.5000000000000000000000e+00,t,9.1109494021316142498002e-02\r\n#10,8.9999999999999991118216e-01,1.5000000000000000000000e+00,t,1.0002252762532191920908e-01\r\n#11,9.9999999999999988897770e-01,1.5000000000000000000000e+00,t,1.0798193302637608403938e-01\r\n```\r\n\r\n\r\n### For BesselJ\r\n\r\nR example:\r\n\r\n```R\r\nx \u003c- seq(-1,1,0.2)\r\nalpha \u003c- 1.5\r\ny \u003c- besselJ(x, alpha);\r\n\r\ndata.frame(x,alpha, y);\r\n# //-\u003e\r\n#      x alpha           y\r\n#1  -1.0   1.5        NaN\r\n#2  -0.8   1.5        NaN\r\n#3  -0.6   1.5        NaN\r\n#4  -0.4   1.5        NaN\r\n#5  -0.2   1.5        NaN\r\n#6   0.0   1.5 0.00000000\r\n#7   0.2   1.5 0.02369330\r\n#8   0.4   1.5 0.06621313\r\n#9   0.6   1.5 0.11921470\r\n#10  0.8   1.5 0.17840207\r\n#11  1.0   1.5 0.24029784\r\n```\r\n\r\nEquivalent `bessel` command line example\r\n\r\n- the -j option selects the `besselJ` function_\r\n- the -x option arguments works like the R sequence `seq(start, end , step)`\r\n    - -x=start,stop,step\r\n- the -a option argument is the `alpha` argument\r\n\r\n```bash\r\n\r\n./bessel -j -x=-1,1,0.2 -a=1.5\r\n\r\n# //-\u003e stdout\r\n# nr,  x,                        alpha                        y=besselJ(x, alpha)\r\n# 1,-1.0000000000000000000000e+00,1.5000000000000000000000e+00,nan\r\n# 2,-8.0000000000000004440892e-01,1.5000000000000000000000e+00,nan\r\n# 3,-6.0000000000000008881784e-01,1.5000000000000000000000e+00,nan\r\n# 4,-4.0000000000000007771561e-01,1.5000000000000000000000e+00,nan\r\n# 5,-2.0000000000000006661338e-01,1.5000000000000000000000e+00,nan\r\n# 6,-5.5511151231257827021182e-17,1.5000000000000000000000e+00,nan\r\n# 7,1.9999999999999995559108e-01,1.5000000000000000000000e+00,2.3693304095129236186423e-02\r\n# 8,3.9999999999999996669331e-01,1.5000000000000000000000e+00,6.6213130821221669042309e-02\r\n# 9,5.9999999999999997779554e-01,1.5000000000000000000000e+00,1.1921469870548732916671e-01\r\n# 10,8.0000000000000004440892e-01,1.5000000000000000000000e+00,1.7840206751096521209377e-01\r\n# 11,1.0000000000000000000000e+00,1.5000000000000000000000e+00,2.4029783912342697616005e-01\r\n```\r\n\r\n### For BesselK\r\n\r\n\r\nR example:\r\n\r\n```R\r\nx \u003c- seq(-1,1,0.2);\r\nalpha \u003c- 2.5;\r\ny \u003c- besselK(x, alpha, FALSE);\r\n\r\ndata.frame(x,alpha, y);\r\n# --\u003e\r\n#      x alpha         y\r\n#1  -1.0   2.5       NaN\r\n#2  -0.8   2.5       NaN\r\n#3  -0.6   2.5       NaN\r\n#4  -0.4   2.5       NaN\r\n#5  -0.2   2.5       NaN\r\n#6   0.0   2.5       Inf\r\n#7   0.2   2.5 208.79853\r\n#8   0.4   2.5  36.19751\r\n#9   0.6   2.5  12.72784\r\n#10  0.8   2.5   5.94205\r\n#11  1.0   2.5   3.22748\r\n```\r\n\r\nEquivalent `bessel` command line example\r\n\r\n- the -k option selects the `besselK` function_\r\n- the -x option arguments works like the R sequence `seq(start, end , step)`\r\n    - -x=start,stop,step\r\n- the -a option argument is the `alpha` argument\r\n- the -s option argument (true or false) is to scale the answer exponentially to avoid overflow or underflow    \r\n\r\n\r\n```bash\r\n\r\n./bessel -k -x=-1,1,0.2 -a=2.5 -s=false\r\n\r\n# //-\u003e \r\n# nr, x,                        , alpha                     scale, bessel(x,alpha, scale)\r\n#1,-1.0000000000000000000000e+00,2.5000000000000000000000e+00,f,nan\r\n#2,-8.0000000000000004440892e-01,2.5000000000000000000000e+00,f,nan\r\n#3,-6.0000000000000008881784e-01,2.5000000000000000000000e+00,f,nan\r\n#4,-4.0000000000000007771561e-01,2.5000000000000000000000e+00,f,nan\r\n#5,-2.0000000000000006661338e-01,2.5000000000000000000000e+00,f,nan\r\n#6,-5.5511151231257827021182e-17,2.5000000000000000000000e+00,f,nan\r\n#7,1.9999999999999995559108e-01,2.5000000000000000000000e+00,f,2.0879852992166129865836e+02\r\n#8,3.9999999999999996669331e-01,2.5000000000000000000000e+00,f,3.6197506660978362447167e+01\r\n#9,5.9999999999999997779554e-01,2.5000000000000000000000e+00,f,1.2727843453151882258112e+01\r\n#10,8.0000000000000004440892e-01,2.5000000000000000000000e+00,f,5.9420503042137688964885e+00\r\n#11,1.0000000000000000000000e+00,2.5000000000000000000000e+00,f,3.2274795311352622029233e+00\r\n```\r\n\r\n### For BesselY\r\n\r\nR example:\r\n\r\n```R\r\nx \u003c- seq(-1,1,0.2)\r\nalpha \u003c- 0.8\r\ny \u003c- besselY(x, alpha);\r\ndata.frame(x,alpha, y);\r\n#      x alpha          y\r\n#1  -1.0   0.8        NaN\r\n#2  -0.8   0.8        NaN\r\n#3  -0.6   0.8        NaN\r\n#4  -0.4   0.8        NaN\r\n#5  -0.2   0.8        NaN\r\n#6   0.0   0.8       -Inf\r\n#7   0.2   0.8 -2.4547267\r\n#8   0.4   0.8 -1.4776122\r\n#9   0.6   0.8 -1.0864635\r\n#10  0.8   0.8 -0.8430858\r\n#11  1.0   0.8 -0.6556140\r\n```\r\n\r\nEquivalent `bessel` command line example\r\n\r\n- the -y option selects the `besselY` function_\r\n- the -x option arguments works like the R sequence `seq(start, end , step)`\r\n    - -x=start,stop,step\r\n- the -a option argument is the `alpha` argument\r\n\r\n```bash\r\n\r\n./bessel -y -x=-1,1,0.2 -a=0.8 \r\n\r\n# //-\u003e \r\n# nr,  x,                        alpha                        y=besselY(x, alpha)\r\n#1,-1.0000000000000000000000e+00,8.0000000000000004440892e-01,nan\r\n#2,-8.0000000000000004440892e-01,8.0000000000000004440892e-01,nan\r\n#3,-6.0000000000000008881784e-01,8.0000000000000004440892e-01,nan\r\n#4,-4.0000000000000007771561e-01,8.0000000000000004440892e-01,nan\r\n#5,-2.0000000000000006661338e-01,8.0000000000000004440892e-01,nan\r\n#6,-5.5511151231257827021182e-17,8.0000000000000004440892e-01,nan\r\n#7,1.9999999999999995559108e-01,8.0000000000000004440892e-01,-2.4547267285997373953421e+00\r\n#8,3.9999999999999996669331e-01,8.0000000000000004440892e-01,-1.4776121978062599637838e+00\r\n#9,5.9999999999999997779554e-01,8.0000000000000004440892e-01,-1.0864634678296238856632e+00\r\n#10,8.0000000000000004440892e-01,8.0000000000000004440892e-01,-8.4308583260933500636014e-01\r\n#11,1.0000000000000000000000e+00,8.0000000000000004440892e-01,-6.5561396353696488326079e-01\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-js%2Fstandalone-bessel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-js%2Fstandalone-bessel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-js%2Fstandalone-bessel/lists"}