https://github.com/jake-w-liu/specialfunctions

A minimal special function package for C# with MATLAB-like API.

https://github.com/jake-w-liu/specialfunctions

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in JOSS metadata
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software
Last synced: 8 months ago · JSON representation

Repository

A minimal special function package for C# with MATLAB-like API.

Basic Info
  • Host: GitHub
  • Owner: jake-w-liu
  • License: mit
  • Language: C#
  • Default Branch: main
  • Homepage:
  • Size: 7.44 MB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • Open Issues: 0
  • Releases: 3
Created about 1 year ago · Last pushed 10 months ago
Metadata Files
Readme License

README.md

SpecialFunctions

A minimal C# library providing numerical implementations of common special functions, such as:

Airy Functions

  • airy(z: Complex)
  • airy(z: double)
  • airy(k: int, z: Complex)
  • airy(k: int, z: double)

Bessel Functions (First, Second, Modified, Hankel)

  • besselj(n: double, z: Complex)
  • besselj(n: double, z: double)
  • bessely(n: double, z: Complex)
  • bessely(n: double, z: double)
  • besseli(n: double, z: Complex)
  • besseli(n: double, z: double)
  • besselk(n: double, z: Complex)
  • besselk(n: double, z: double)
  • besselh(n: double, z: Complex)
  • besselh(n: double, k: int, z: Complex)

Spherical Bessel Functions

  • sbesselj(n: double, z: Complex)
  • sbesselj(n: double, z: double)
  • sbessely(n: double, z: Complex)
  • sbessely(n: double, z: double)
  • sbesselh(n: double, z: Complex)
  • sbesselh(n: double, k: int, z: Complex)

Beta and Log-Beta

  • beta(z: double, w: double)
  • betaln(z: double, w: double)

Error Functions

  • erf(x: double)
  • erfc(x: double)
  • erfinv(z: double)
  • erfcinv(z: double)

Legendre Functions

  • legendre0(n: int, x: double)
  • legendre(n: int, x: double)

Gamma Functions

  • gammaln(x: double)
  • gamma(x: double)

The package utilizes core numerical routines from Math.NET Numerics, with updated APIs for functions such as Bessel and error functions. It also includes Legendre polynomial implementations adapted from AminKH's Legendre Polynomials repository. The API is designed to closely mirror MATLAB’s structure and naming conventions, enabling a smooth transition for users familiar with MATLAB syntax. This compatibility facilitates rapid prototyping, intuitive function calls, and straightforward adaptation of existing MATLAB-based codebases to C#.

Installation

To install the package, use the .NET CLI:

bash dotnet add package SpecialFunctions

Supported Frameworks

The library supports the following frameworks:

  • .NET Framework 4.7.2 (net472)
  • .NET Framework 4.8.1 (net481)
  • .NET 8.0 (net8.0)
  • .NET 9.0 (net9.0)

Usage

```csharp using static SpecialFunctions.SF; using System.Numerics;

double result = erf(1.0); Complex bessel = besselj(1.5, new Complex(1.0, 0.5));

```

For detailed functionalities, please visit the manual page.

Build and Test

Prerequisites

To build and test this library from source, you will need the following:

  • .NET SDK: Version 8.0 or higher.
  • .NET Framework: Version 4.7.2 or higher. This is required for legacy hardware driver compatibility.

Building the Library

  1. Clone the repository: bash git clone https://github.com/jake-w-liu/SpecialFunctions.git cd SpecialFunctions

  2. Build the project: bash dotnet build

Running the Tests

To run the tests, use the following command:

bash dotnet test

Contributing

We welcome contributions from the community. Here are some ways you can contribute to the project.

Reporting Issues

If you find a bug or have a problem with the software, please open an issue on our GitHub repository.

When reporting an issue, please include the following information:

  • A clear and descriptive title.
  • A detailed description of the issue, including steps to reproduce it.
  • The version of the software you are using.
  • Any relevant error messages or logs.

Contributing Code

If you would like to contribute code to the project, please follow these.

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them with a clear and descriptive commit message.
  4. Push your changes to your fork.
  5. Open a pull request to the main repository.

Please ensure that your code adheres to the existing coding style and that all tests pass.

Seeking Support

If you have a question or need help with the software, you can:

  • Open an issue on our GitHub repository.
  • Contact the maintainers directly.

We will do our best to respond to your request in a timely manner.

Notes

  • Most functions are overloaded for both real (double) and complex (System.Numerics.Complex) inputs.
  • Many implementations delegate to the Amos library for accurate numerical evaluation.
  • Ensure input values are valid to avoid NaN results.

License

MIT License.

Owner

  • Name: Jake W. Liu
  • Login: jake-w-liu
  • Kind: user

JOSS Publication

SpecialFunctions: A C# package of special functions for scientific computing with MATLAB-compatible API
Published
September 09, 2025
Volume 10, Issue 113, Page 8516
Authors
Jake W. Liu ORCID
Department of Electronic Engineering, National Taipei University of Technology, Taiwan
Editor
Owen Lockwood ORCID
Tags
special functions scientific computing

GitHub Events

Total
  • Create event: 3
  • Issues event: 6
  • Release event: 1
  • Issue comment event: 3
  • Push event: 14
  • Pull request event: 2
Last Year
  • Create event: 3
  • Issues event: 6
  • Release event: 1
  • Issue comment event: 3
  • Push event: 14
  • Pull request event: 2

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 29
  • Total Committers: 3
  • Avg Commits per committer: 9.667
  • Development Distribution Score (DDS): 0.172
Past Year
  • Commits: 29
  • Committers: 3
  • Avg Commits per committer: 9.667
  • Development Distribution Score (DDS): 0.172
Top Committers
Name Email Commits
jake-w-liu a****6@g****m 24
Régis Portalez r****z@p****m 3
Jake W. Liu 1****u@u****m 2

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 4
  • Total pull requests: 1
  • Average time to close issues: 2 days
  • Average time to close pull requests: 2 months
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.5
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 4
  • Pull requests: 1
  • Average time to close issues: 2 days
  • Average time to close pull requests: 2 months
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.5
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • JeWaVe (4)
Pull Request Authors
  • JeWaVe (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

SpecialFunctions.csproj nuget
  • MSTest.TestAdapter 3.9.1
  • MSTest.TestFramework 3.9.1
  • Microsoft.NET.Test.Sdk 17.14.1
  • coverlet.collector 6.0.4
obj/project.assets.json nuget
  • MSTest.Analyzers 3.9.1
  • MSTest.TestAdapter 3.9.1
  • MSTest.TestFramework 3.9.1
  • Microsoft.ApplicationInsights 2.23.0
  • Microsoft.CodeCoverage 17.14.1
  • Microsoft.NET.Test.Sdk 17.14.1
  • Microsoft.TestPlatform.AdapterUtilities 17.13.0
  • Microsoft.TestPlatform.ObjectModel 17.14.1
  • Microsoft.TestPlatform.TestHost 17.14.1
  • Microsoft.Testing.Extensions.Telemetry 1.7.1
  • Microsoft.Testing.Extensions.TrxReport.Abstractions 1.7.1
  • Microsoft.Testing.Extensions.VSTestBridge 1.7.1
  • Microsoft.Testing.Platform 1.7.1
  • Microsoft.Testing.Platform.MSBuild 1.7.1
  • Newtonsoft.Json 13.0.3
  • System.Collections.Immutable 8.0.0
  • System.Diagnostics.DiagnosticSource 5.0.0
  • System.Reflection.Metadata 8.0.0
  • coverlet.collector 6.0.4
.github/workflows/draft-pdf.yml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v4 composite
  • openjournals/openjournals-draft-action master composite
obj/Release/SpecialFunctions.1.0.1.nuspec nuget