You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b21f383
Browse filesBrowse the repository at this point in the historyBrowse files
mobius, divisorsigma, primenu, primeomega, valuation, prime and primepi
compile in FastExpression and in the LINQ compiler, over Complex and over
double. prime and valuation were refused with UncompilableNodeException;
the other five are new since 2.6.0.
Each is computed by the routines the interpreter uses: Primes.Factorization
for the functions of a factorisation, IsPrime for the valuation's prime,
GetPrime for the n-th prime and CountUpTo for the prime count. So a compiled
value is exact at a whole argument and NaN at any other, as evaluation gives,
and a number too large to factorise or a prime past the millionth is NaN
where the interpreter leaves it as written.
The test compares both compilers with evaluation at 68 arguments for each
function of a factorisation, including 1099511627776 = 2^40, 600851475143
and the non-whole 5/2 and 1 + i; the divisor sigma at six orders, among them
-1, 1/2 and i; the valuation at seven numbers and six bases, two of them not
prime; the n-th prime up to the 10000th; and the prime count up to 100000.
prime(x) at 10: UncompilableNodeException (2.6.0), 29 now.
valuation(x, 2) at 12: UncompilableNodeException (2.6.0), 2 now.
Part of #2195.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
public static System.Numerics.Complex HarmonicNumber(System.Numerics.Complex a, System.Numerics.Complex b) => AngouriMath.Numerics.PolygammaFunction.HarmonicNumber(a, b);
245
248
public static double HarmonicNumber(double a, double b) => AngouriMath.Numerics.PolygammaFunction.HarmonicNumber(a, b);
246
249
250
+
// The functions of a factorisation, the valuation, the n-th prime and the prime-counting function, by the
public static System.Numerics.Complex <#= name #>(System.Numerics.Complex a) => AngouriMath.Numerics.NumberTheoreticFunctions.<#= name #>(a);
254
+
public static double <#= name #>(double a) => AngouriMath.Numerics.NumberTheoreticFunctions.<#= name #>(a);
255
+
<# } #>
256
+
<# foreach (var name in numberTheoreticBinary) { #>
257
+
public static System.Numerics.Complex <#= name #>(System.Numerics.Complex a, System.Numerics.Complex b) => AngouriMath.Numerics.NumberTheoreticFunctions.<#= name #>(a, b);
258
+
public static double <#= name #>(double a, double b) => AngouriMath.Numerics.NumberTheoreticFunctions.<#= name #>(a, b);
259
+
<# } #>
260
+
247
261
/// <summary>
248
262
/// True where <c>System.Numerics.Complex.IsNaN</c> is, spelled out because that overload is
249
263
/// .NET 7 and later and this assembly also targets netstandard2.0. A complex number is NaN
0 commit comments