{"id":21769199,"url":"https://github.com/antonovanton/math.evaluation","last_synced_at":"2025-06-24T06:07:21.330Z","repository":{"id":240090452,"uuid":"483379297","full_name":"AntonovAnton/math.evaluation","owner":"AntonovAnton","description":"This .NET library allows you to evaluate and compile any mathematical expression from a string dynamically at runtime. It supports a wide range of operations and allows for the use of custom variables, operators, and functions. The evaluator can be configured for different contexts, such as scientific, programming, boolean math expressions.","archived":false,"fork":false,"pushed_at":"2025-05-12T23:15:12.000Z","size":602,"stargazers_count":61,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-14T01:16:25.605Z","etag":null,"topics":["c-sharp","compiler","complex-numbers","csharp","csharp-code","csharp-library","dotnet","dotnetcore","eval","evaluation","evaluator","expression-evaluator","expressions","math","math-expressions","math-library","math-parser","ncalc","parser","runtime"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AntonovAnton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null},"funding":{"github":"AntonovAnton"}},"created_at":"2022-04-19T19:17:40.000Z","updated_at":"2025-06-07T09:08:58.000Z","dependencies_parsed_at":"2025-05-09T23:24:09.549Z","dependency_job_id":"71c6a95e-4c61-499e-ba71-84c07acced95","html_url":"https://github.com/AntonovAnton/math.evaluation","commit_stats":null,"previous_names":["antonovanton/evaluate.math.expression"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/AntonovAnton/math.evaluation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonovAnton%2Fmath.evaluation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonovAnton%2Fmath.evaluation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonovAnton%2Fmath.evaluation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonovAnton%2Fmath.evaluation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AntonovAnton","download_url":"https://codeload.github.com/AntonovAnton/math.evaluation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonovAnton%2Fmath.evaluation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261618124,"owners_count":23185094,"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":["c-sharp","compiler","complex-numbers","csharp","csharp-code","csharp-library","dotnet","dotnetcore","eval","evaluation","evaluator","expression-evaluator","expressions","math","math-expressions","math-library","math-parser","ncalc","parser","runtime"],"created_at":"2024-11-26T14:07:59.816Z","updated_at":"2025-06-24T06:07:21.316Z","avatar_url":"https://github.com/AntonovAnton.png","language":"C#","readme":"﻿\u003cimg src=\"logo.png\" alt=\"logo\" style=\"width:64px;height:64px;\"/\u003e\r\n\r\n# Math Expression Evaluator in .NET\r\n\r\nNuGet packages:\r\n\r\n- MathEvaluator [![NuGet Version](https://img.shields.io/nuget/v/MathEvaluator)](https://www.nuget.org/packages/MathEvaluator) [![NuGet Downloads](https://img.shields.io/nuget/dt/MathEvaluator)](https://www.nuget.org/packages/MathEvaluator)\r\n- MathEvaluator.FastExpressionCompiler [![NuGet Version](https://img.shields.io/nuget/v/MathEvaluator.FastExpressionCompiler)](https://www.nuget.org/packages/MathEvaluator.FastExpressionCompiler) [![NuGet Downloads](https://img.shields.io/nuget/dt/MathEvaluator.FastExpressionCompiler)](https://www.nuget.org/packages/MathEvaluator.FastExpressionCompiler)\r\n\r\nMathEvaluator is a .NET library that allows you to evaluate and compile any mathematical expressions from a string dynamically.\r\n\r\n## Features\r\n- Supports different mathematical contexts, such as scientific, programming, and other custom contexts.\r\n- Evaluates Boolean logic, as well as Double, Decimal, and Complex numbers.\r\n- Compiles a math expression string into executable code and produces a delegate that represents the math expression.\r\n- Provides variable support within math expressions.\r\n- Extensible with custom functions and operators.\r\n- Fast and comprehensive. More than 3000 tests are passed, including complex math expressions (for example, -3^4sin(-π/2) or sin-3/cos1).\r\n\r\n## Articles\r\n[Evaluating Boolean logical expressions.](https://medium.com/@AntonAntonov88/evaluate-boolean-expression-from-string-in-c-net-af80e08453ea)\r\n\r\n## Perfomance\r\nThis math expression evaluator is designed for exceptional performance by leveraging modern .NET features and best practices, which is why it targets .NET Standard 2.1 or higher. \r\n\r\nThis high-performance evaluator stands out due to its use of `ReadOnlySpan\u003cchar\u003e`, and avoidance of regular expressions. These design choices collectively ensure minimal memory allocation, fast parsing, and efficient execution.\r\n\r\nThe evaluator uses recursive method calls to handle mathematical operations based on operator precedence and rules, an operator with highest precedence is evaluating first. This approach avoids the overhead associated with stack or queue data structures.\r\n\r\nThe evaluator uses a prefix tree, also known as a trie (pronounced \"try\"), for efficient searching of variables, operators, and functions by their keys (names) when providing a specific mathematical context or adding custom variables, operators, and functions is required.\r\n\r\nLet's compare, for example, performance of calculating the mathematical expression:\r\n\r\n    22888.32 * 30 / 323.34 / .5 - -1 / (2 + 22888.32) * 4 - 6\r\n\r\nBelow are the results of the comparison with the NCalc library: \r\n\r\n| Method        | Job      | Runtime  | Mean       | Error     | StdDev    | Gen0   | Allocated |\r\n|-------------- |--------- |--------- |-----------:|----------:|----------:|-------:|----------:|\r\n| MathEvaluator | .NET 8.0 | .NET 8.0 |   608.8 ns |   1.77 ns |   1.48 ns | 0.0067 |      88 B |\r\n| NCalc         | .NET 8.0 | .NET 8.0 | 6,262.8 ns |  47.27 ns |  44.22 ns | 0.3510 |    4496 B |\r\n| MathEvaluator | .NET 9.0 | .NET 9.0 |   526.4 ns |   2.81 ns |   2.63 ns | 0.0067 |      88 B |\r\n| NCalc         | .NET 9.0 | .NET 9.0 | 5,643.3 ns |  29.76 ns |  27.84 ns | 0.3510 |    4496 B |\r\n\r\n***NOTE:** NCalc includes built-in caching, enabled by default in recent versions. While this can improve benchmark performance, in real-world scenarios, caching may increase memory usage and is not effective if the evaluation results depend on variable values. In such cases, compilation is a better alternative.*\r\n\r\n## Compilation\r\nAdded in version [2.0.0](https://github.com/AntonovAnton/math.evaluation/releases/tag/2.0.0)\r\n\r\nBy using compilation, you can convert any mathematical expression string into a delegate, such as `Func\u003cT, TResult\u003e` or `Func\u003cTResult\u003e`, which significantly improves performance when evaluating the expression. \r\nHowever, since compilation takes time, it is beneficial to compile the expression beforehand if you plan to evaluate it multiple times, especially for 200 or more iterations. Refer to the [benchmarks](https://github.com/AntonovAnton/math.evaluation/tree/main/BenchmarkDotNet.Artifacts/results) for detailed performance insights.\r\n\r\nThe compiled delegate can be executed with different parameters, allowing you to pass variables and functions as arguments. This feature is particularly useful for scenarios where the same expression needs to be evaluated with different variable values or functions.\r\n\r\nIn version [2.3.0](https://github.com/AntonovAnton/math.evaluation/releases/tag/2.3.0) you can also use a `Dictionary\u003cstring, TResult\u003e` as a parameter. This allows you to pass variables and their values in a more flexible way, especially when dealing with dynamic or unknown variable names at compile time.\r\n\r\nIn version [2.3.1](https://github.com/AntonovAnton/math.evaluation/releases/tag/2.3.1) added `IExpressionCompiler` interface, which allows you to inject your own compiler. This is useful if you want to use a different compiler or if you want to customize the compilation process in some way.\r\n\r\n**MathEvaluator.FastExpressionCompiler** is an extension of the MathEvaluator library that uses the [FastExpressionCompiler](https://github.com/dadhi/FastExpressionCompiler) to provide performance improvements of up to 10-40x compared to the built-in .NET `LambdaExpression.Compile()` method.  \r\n\r\nThis library includes all features of the MathEvaluator library but adds a dependency on FastExpressionCompiler. For more details, refer to the [documentation](https://github.com/AntonovAnton/math.evaluation/tree/main/MathEvaluation.FastExpressionCompiler).\r\n\r\n## How to use\r\nExamples of using string extentions:\r\n\r\n    \"22888.32 * 30 / 323.34 / .5 - -1 / (2 + 22888.32) * 4 - 6\".Evaluate();\r\n\r\n    \"22888.32 * 30 / 323.34 / .5 - -1 / (2 + 22888.32) * 4 - 6\".EvaluateDecimal();\r\n\r\n    \"$22,888.32 * 30 / 323.34 / .5 - - 1 / (2 + $22,888.32) * 4 - 6\".Evaluate(null, new CultureInfo(\"en-US\"));\r\n\r\n    \"22’888.32 CHF * 30 / 323.34 / .5 - - 1 / (2 + 22’888.32 CHF) * 4 - 6\".EvaluateDecimal(null, new CultureInfo(\"de-CH\"));\r\n\r\n    \"ln(1/-0.5 + √(1/(0.5^2) + 1))\".Evaluate(new ScientificMathContext());\r\n    \r\n    \"P * (1 + r/n)^d\".EvaluateDecimal(new { P = 10000, r = 0.05, n = 365, d = 31 }, new DecimalScientificMathContext());\r\n    \r\n    \"4 % 3\".Evaluate(new ProgrammingMathContext());\r\n    \r\n    \"4 mod 3\".Evaluate(new ScientificMathContext());\r\n\r\n    \"4 \u003c\u003e 4 OR 5.4 = 5.4 AND NOT 0 \u003c 1 XOR 1.0 - 1.95 * 2 \u003e= -12.9 + 0.1 / 0.01\".EvaluateBoolean(new ProgrammingMathContext());\r\n\r\n    \"¬⊥∧⊤∨¬⊤⇒¬⊤\".EvaluateBoolean(new ScientificMathContext());\r\n    \r\n    \"sin(2 + 3i) * arctan(4i)/(1 - 6i)\".EvaluateComplex(new ComplexScientificMathContext());\r\n\r\nExamples of using an instance of the MathExpression class:\r\n        \r\n    new MathExpression(\"22888.32 * 30 / 323.34 / .5 - -1 / (2 + 22888.32) * 4 - 6\").Evaluate();\r\n\r\n    new MathExpression(\"22888.32 * 30 / 323.34 / .5 - -1 / (2 + 22888.32) * 4 - 6\").EvaluateDecimal();\r\n\r\n    new MathExpression(\"$22,888.32 * 30 / 323.34 / .5 - - 1 / (2 + $22,888.32) * 4 - 6\", null, new CultureInfo(\"en-US\")).Evaluate();\r\n\r\n    new MathExpression(\"22’888.32 CHF * 30 / 323.34 / .5 - - 1 / (2 + 22’888.32 CHF) * 4 - 6\", null, new CultureInfo(\"de-CH\")).EvaluateDecimal();\r\n    \r\n    new MathExpression(\"ln(1/-0.5 + √(1/(0.5^2) + 1))\", new ScientificMathContext()).Evaluate();\r\n\r\n    new MathExpression(\"P * (1 + r/n)^d\", new DecimalScientificMathContext()).EvaluateDecimal(new { P = 10000, r = 0.05, n = 365, d = 31 });\r\n    \r\n    new MathExpression(\"4 % 3\", new ProgrammingMathContext()).Evaluate();\r\n    \r\n    new MathExpression(\"4 mod 3\", new ScientificMathContext()).Evaluate();\r\n\r\n    new MathExpression(\"4 \u003c\u003e 4 OR 5.4 = 5.4 AND NOT 0 \u003c 1 XOR 1.0 - 1.95 * 2 \u003e= -12.9 + 0.1 / 0.01\", new ProgrammingMathContext()).EvaluateBoolean();\r\n\r\n    new MathExpression(\"¬⊥∧⊤∨¬⊤⇒¬⊤\", new ScientificMathContext()).EvaluateBoolean();\r\n    \r\n    new MathExpression(\"sin(2 + 3i) * arctan(4i)/(1 - 6i)\", new ComplexScientificMathContext()).EvaluateComplex();\r\n\r\nExamples of passing custom variables and functions as parameters:\r\n        \r\n    var x1 = 0.5;\r\n    var x2 = -0.5;\r\n    var sqrt = Math.Sqrt;\r\n    Func\u003cdouble, double\u003e ln = Math.Log;\r\n\r\n    var value1 = \"ln(1/-x1 + sqrt(1/(x2*x2) + 1))\"\r\n        .Evaluate(new { x1, x2, sqrt, ln });\r\n\r\n    var parameters = new MathParameters();\r\n    parameters.BindVariable(x1);\r\n    parameters.BindVariable(x2);\r\n    parameters.BindFunction(Math.Sqrt);\r\n    parameters.BindFunction(d =\u003e Math.Log(d), \"ln\");\r\n\r\n    var value2 = \"ln(1/-x1 + Math.Sqrt(1/(x2*x2) + 1))\"\r\n        .Evaluate(parameters);\r\n\r\nExample of using custom context:\r\n\r\n    var context = new MathContext();\r\n    context.BindFunction(Math.Sqrt);\r\n    context.BindFunction(d =\u003e Math.Log(d), \"ln\");\r\n\r\n    \"ln(1/-x1 + Math.Sqrt(1/(x2*x2) + 1))\"\r\n        .Evaluate(new { x1 = 0.5, x2 = -0.5 }, context);\r\n\r\nExample of compilation with an object as a parameter:\r\n\r\n    var fn = \"ln(1/x1 + √(1/(x2*x2) + 1))\"\r\n        .Compile(new { x1 = 0.0, x2 = 0.0 }, new ScientificMathContext());\r\n        \r\n    var value = fn(new { x1 = -0.5, x2 = 0.5 });\r\n\r\nExample of compilation with a Dictionary as a parameter (Added in version [2.3.0](https://github.com/AntonovAnton/math.evaluation/releases/tag/2.3.0)):\r\n\r\n    var dict = new Dictionary\u003cstring, double\u003e();\r\n    dict.Add(\"x1\", 3.0);\r\n    dict.Add(\"x2\", 2.0);\r\n\r\n    var fn = \"x1 + Math.Sin(x2) * 0.5\"\r\n        .Compile(dict, new DotNetStandardMathContext());\r\n\r\n    var value = fn(dict);\r\n    Console.WriteLine(value); // 3.4546487...\r\n\r\n## How to debug or log\r\n\r\nAdded in version [2.1.0](https://github.com/AntonovAnton/math.evaluation/releases/tag/2.1.0)\r\n\r\nBy using the Evaluating event, you can debug or log the steps of a math expression's evaluation. This event is triggered at each step during the evaluation process. The following code demonstrates how to use to this event:\r\n\r\n    using var expression = new MathExpression(\"-3^4sin(-PI/2)\", new ScientificMathContext());\r\n\r\n    expression.Evaluating += (object? sender, EvaluatingEventArgs args) =\u003e\r\n    {\r\n        Console.WriteLine(\"{0}: {1} = {2};{3}\",\r\n            args.Step,\r\n            args.MathString[args.Start..(args.End + 1)],\r\n            args.Value,\r\n            args.IsCompleted ? \" //completed\" : string.Empty);\r\n    };\r\n    \r\n    var value = expression.Evaluate();\r\n\r\nOutput:\r\n\r\n    1: 3^4 = 81;\r\n    2: PI = 3.141592653589793;\r\n    3: PI/2 = 1.5707963267948966;\r\n    4: -PI/2 = -1.5707963267948966;\r\n    5: sin(-PI/2) = -1;\r\n    6: 3^4sin(-PI/2) = -81;\r\n    7: -3^4sin(-PI/2) = 81; //completed\r\n\r\n***NOTE**: To prevent memory leaks, it’s important to unsubscribe from the event after subscribing to it. The Evaluating event is cleaned up in the Dispose method, so I recommend using the **using** statement to ensure proper disposal and efficient resource management.*\r\n\r\n## Complex numbers\r\n\r\nAdded in version [2.2.0](https://github.com/AntonovAnton/math.evaluation/releases/tag/2.2.0)\r\n\r\nComplex numbers are written in the form **a ± bi**, where **a** is the real part and **bi** is the imaginary part. \r\nIn mathematical expressions involving complex numbers, it's advisable to use parentheses () to ensure clarity and obtain the expected result.\r\n\r\n## Supported math functions, operators, and constants\r\n\r\n#### When no mathematical context is specified:\r\n|          | Notation | Precedence |\r\n|--------- |--------- | --------- |\r\n| Addition | + | 0 |\r\n| Subtraction, Negativity | - | 0 |\r\n| Multiplication  | * | 100 |\r\n| Division  | / | 100 |\r\n| Parentheses  | ( ) | 200 |\r\n| Currency symbol  | depends on culture info | |\r\n\r\n#### Programming Math Context (using ProgrammingMathContext class):\r\n|          | Notation | Precedence |\r\n|--------- |--------- |--------- |\r\n| Addition | + | 0 |\r\n| Subtraction, Negativity | - | 0 |\r\n| Multiplication  | * | 100 |\r\n| Division  | / | 100 |\r\n| Parentheses  | ( ) | 200 |\r\n| Currency symbol  | depends on culture info | |\r\n| Exponentiation | ** | 400 |\r\n| Modulus | % | 100 |\r\n| Floor Division  | // | 100 |\r\n| Logical constants  | true, false, True, False, TRUE, FALSE | 300 |\r\n| Equality  | = | -100 |\r\n| Inequality  | \\\u003c\u003e | -100 |\r\n| Less than  | \\\u003c | -100 |\r\n| Greater than  | \u003e | -100 |\r\n| Less than or equal  | \\\u003c= | -100 |\r\n| Greater than or equal  | \u003e= | -100 |\r\n| Logical negation  | not, Not, NOT | -200 |\r\n| Logical AND  | and, And, AND | -300 |\r\n| Logical exclusive OR  | xor, Xor, XOR | -400 |\r\n| Logical OR  | or, Or, OR | -500 |\r\n| Conditional operation: `IIF(condition, valueIfTrue, valueIfFalse)`, where the `valueIfTrue` and `valueIfFalse` args are optional | iif, Iif, IIF | 200 |\r\n\r\n#### Scientific Math Context (using ScientificMathContext class):\r\n\r\n|          | Notation | Precedence |\r\n|--------- |--------- | --------- |\r\n| Addition | + | 0 |\r\n| Subtraction, Negativity | - | 0 |\r\n| Multiplication  | *, ×, or · | 100 |\r\n| Division  | / or ÷ | 100 |\r\n| Parentheses | ( ) | 200 |\r\n| Currency symbol  | depends on culture info | |\r\n| Exponentiation | ^ | 400 |\r\n| Modulus | mod, Mod, MOD, modulo, Modulo, or MODULO | 100 |\r\n| Floor Division  | // | 100 |\r\n| Absolute  | \\| \\|, abs, Abs, ABS | 200 |\r\n| Ceiling | ⌈ ⌉ | 200 |\r\n| Floor | ⌊ ⌋ | 200 |\r\n| Square root, cube root, fourth root | √, ∛, ∜ | 200 |\r\n| Natural logarithmic base | e | 300 |\r\n| Natural logarithm | ln, Ln, LN | 200 |\r\n| Common logarithm (base 10) | log, Log, LOG | 200 |\r\n| Factorial | ! | 500 |\r\n| Infinity | ∞ | 300 |\r\n| Logical constants  | true, false, True, False, TRUE, FALSE, T, F, ⊤, ⊥ | 300 |\r\n| Equality  | = | -100 |\r\n| Inequality  | ≠ | -100 |\r\n| Less than  | \\\u003c | -100 |\r\n| Greater than  | \u003e | -100 |\r\n| Less than or equal  | ≤, ⪯ | -100 |\r\n| Greater than or equal  | ≥, ⪰ | -100 |\r\n| Logical negation  | ¬, not, Not, NOT | 500 for ¬, -200 |\r\n| Logical AND  | ∧, and, And, AND | -300 |\r\n| Logical exclusive OR  | ⊕, xor, Xor, XOR | -400 |\r\n| Logical OR  | ∨, or, Or, OR | -500 |\r\n| Logical implication  | →, ⇒, ←, ⟸ | -800 |\r\n| Logical biconditional equivalence  | ↔, ⇔ | -900 |\r\n| Logical biconditional inequivalence  | ↮, ⇎ | -900 |\r\n| Logical equivalence  | ≡ | -1000 |\r\n| Logical inequivalence  | ≢ | -1000 |\r\n| Degree | ° | 500 |\r\n| Pi constant | π, pi, Pi, PI | 300 |\r\n| Tau constant | τ | 300 |\r\n| Sine | sin, Sin, SIN | 200 |\r\n| Cosine | cos, Cos, COS | 200 |\r\n| Tangent | tan, Tan, TAN | 200 |\r\n| Secant | sec, Sec, SEC | 200 |\r\n| Cosecant | csc, Csc, CSC | 200 |\r\n| Cotangent | cot, Cot, COT | 200 |\r\n| Hyperbolic sine | sinh, Sinh, SINH | 200 |\r\n| Hyperbolic cosine | cosh, Cosh, COSH | 200 |\r\n| Hyperbolic tangent | tanh, Tanh, TANH | 200 |\r\n| Hyperbolic secant | sech, Sech, SECH | 200 |\r\n| Hyperbolic cosecant | csch, Csch, CSCH | 200 |\r\n| Hyperbolic cotangent | coth, Coth, COTH | 200 |\r\n| Inverse sine | arcsin, Arcsin, ARCSIN, sin\\^-1, Sin\\^-1, SIN\\^-1 | 200 |\r\n| Inverse cosine | arccos, Arccos, ARCCOS, cos\\^-1, Cos\\^-1, COS\\^-1 | 200 |\r\n| Inverse tangent | arctan, Arctan, ARCTAN, tan\\^-1, Tan\\^-1, TAN\\^-1 | 200 |\r\n| Inverse secant | arcsec, Arcsec, ARCSEC, sec\\^-1, Sec\\^-1, SEC\\^-1 | 200 |\r\n| Inverse cosecant | arccsc, Arccsc, ARCCSC, csc\\^-1, Csc\\^-1, CSC\\^-1 | 200 |\r\n| Inverse cotangent | arccot, Arccot, ARCCOT, cot\\^-1, Cot\\^-1, COT\\^-1 | 200 |\r\n| Inverse Hyperbolic sine | arsinh, Arsinh, ARSINH, sinh\\^-1, Sinh\\^-1, SINH\\^-1 | 200 |\r\n| Inverse Hyperbolic cosine | arcosh, Arcosh, ARCOSH, cosh\\^-1, Cosh\\^-1, COSH\\^-1 | 200 |\r\n| Inverse Hyperbolic tangent | artanh, Artanh, ARTANH, tanh\\^-1, Tanh\\^-1, TANH\\^-1 | 200 |\r\n| Inverse Hyperbolic secant | arsech, Arsech, ARSECH, sech\\^-1, Sech\\^-1, SECH\\^-1 | 200 |\r\n| Inverse Hyperbolic cosecant | arcsch, Arcsch, ARCSCH, csch\\^-1, Csch\\^-1, CSCH\\^-1 | 200 |\r\n| Inverse Hyperbolic cotangent | arcoth, Arcoth, ARCOTH, coth\\^-1, Coth\\^-1, COTH\\^-1 | 200 |\r\n\r\n#### How to evaluate a C# math expression string\r\nDotNetStandardMathContext is the .NET Standard 2.1 programming math context supports all constants and functions provided by the System.Math and System.Numerics.Complex class, and supports equlity, comparision, logical boolean operators.\r\n\r\nExample of evaluating C# expression:\r\n\r\n    \"-2 * Math.Log(1/0.5f + Math.Sqrt(1/Math.Pow(0.5d, 2) + 1L))\".Evaluate(new DotNetStandardMathContext());\r\n\r\n***NOTE**: More math functions could be added to the math expression evaluator based on user needs.*\r\n\r\n## Contributing\r\nContributions are welcome! Please fork the repository and submit pull requests for any enhancements or bug fixes.\r\nIf you enjoy my work and find it valuable, please consider becoming my [sponsor on GitHub](https://github.com/sponsors/AntonovAnton). Your support will enable me to share more open-source code. Together, we can make a positive impact in the developer community!\r\n\r\nLooking to localize your project? Check out [l10n.dev](https://l10n.dev), an AI-powered localization service. [Translate JSON](https://l10n.dev/ws/translate-json) files while preserving format, keys, and placeholders. Supports 165 languages with an easy-to-use API and UI. Get started for free!\r\n\r\n## License\r\nThis project is licensed under the Apache License, Version 2.0 - see the [LICENSE](https://github.com/AntonovAnton/math.evaluation?tab=License-1-ov-file) file for details.\r\n\r\n## Contact\r\nIf you have any questions or suggestions, feel free to open an issue or contact me directly.\r\n","funding_links":["https://github.com/sponsors/AntonovAnton"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonovanton%2Fmath.evaluation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantonovanton%2Fmath.evaluation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonovanton%2Fmath.evaluation/lists"}