math
library module lib/math
lib/math
The SLeeLa standard-library mathematics package: 243 classes with real,
compiler-verified implementations spanning numeric types through advanced
numerical methods. Every class carries the Metadata Class record (see
.kiro/steering/metadata-class-standard.md and SLEELA.syntax §15).
The package facade is SLPackage.sleela; a runnable tour is in
examples/MathDemo.sleela.
Domains
| Area | Representative classes |
|---|---|
| Arithmetic & number theory | SLGcd, SLLcm, SLFactorial, SLFibonacci, SLPrime, SLPrimeFactorization, SLDivisor, SLModulo, SLPower, SLBinomialCoefficient |
| Elementary functions | SLExponential, SLLogarithm, SLRoot, SLSine, SLCosine, SLTangent, SLTrigonometry |
| Statistics & probability | SLMean, SLVariance, SLStandardDeviation, SLMedian, SLPercentile, SLCovariance, SLCorrelation, SLSkewness, SLKurtosis, SLZScore, SLBayes, SLHistogram |
| Distributions | SLNormalDistribution, SLUniformDistribution, SLBinomialDistribution, SLPoissonDistribution |
| Regression & tests | SLLinearRegression, SLPolynomialRegression, SLLeastSquares, SLHypothesisTest, SLTTest, SLChiSquareTest, SLANOVA, SLConfidenceInterval |
| Linear algebra | SLVector2/3/4, SLVector, SLMatrix, SLMatrixOperations, SLDeterminant, SLInverse, SLTranspose, SLEigenvalue, SLEigenvector, SLConditionNumber |
| Calculus & numerics | SLDerivative, SLIntegral, SLNumericalIntegration, SLSimpsonRule, SLTrapezoidRule, SLNewtonMethod, SLSecantMethod, SLBisectionSolver, SLInterpolation, SLLagrangeInterpolation |
| ODE / PDE | SLODESolver, SLRungeKutta, SLOrdinaryDifferentialEquation, SLPDE |
| Transforms & signal | SLDiscreteFourier, SLFastFourier, SLFourier, SLFourierSeries, SLLaplace, SLZTransform, SLSignal |
| Optimization | SLGradientDescent, SLCoordinateDescent, SLNewtonOptimization, SLLinearProgram, SLQuadraticProgram, SLObjective, SLConstraint, SLRegularization |
| Sequences, series, combinatorics | SLSequence, SLProgression, SLSeries, SLRecurrence, SLCombinatorics, SLCombination, SLPermutation, SLCombinationGenerator |
| Set theory & relations | SLSetTheory, SLSetOperations, SLUnion, SLIntersection, SLFiniteSet, SLCardinality, SLRelation |
| Geometry & transforms | SLGeometry, SLPoint, SLLine, SLDistance, SLPolarCoordinate, SLRotation, SLTransform, SLQuaternion, SLBezier, SLCubicSpline |
| Number types | SLComplex, SLRational, SLBigInteger, SLBigDecimal, SLFixedPoint, SLNumber, SLNumeric |
| Expressions & symbolic | SLExpression, SLExpressionTree, SLExpressionEvaluator, SLFormula, SLFormulaParser, SLSymbolicMath, SLLambda, SLPredicate |
| Fields | SLScalarField, SLVectorField, SLGradientField, SLGradient |
| Numeric infrastructure | SLPrecision, SLMachineEpsilon, SLOverflow, SLUnderflow, SLNumericFormatter, SLNumericParser, SLMathContext, SLMathEngine |
| Units & constants | SLUnit, SLUnitConverter, SLQuantity, SLMetric, SLConstant, SLPhysicalConstant |
| Graphs & tensors | SLGraph, SLGraphNode, SLGraphEdge, SLAdjacencyMatrix, SLTensor, SLMarkovChain |
Implementation notes
- Pure SLeeLa (
#sleela 2.5). No native builtins are assumed:sqrt,exp,ln,sin/cos, andnth-rootare implemented inline (Newton iteration / range-reduced Taylor series). - Matrices and tensors are flat row-major
double[]arrays with an explicit shape, which keeps them within the language's array support. - Functions that are inherently "bring your own f(x)" take sampled data
(paired
xs[]/ys[]) or caller-supplied evaluated slopes, since the SLeeLa front end has no first-class function values. - Three class names (
SLNumber,SLFunction,SLOptimizationProblem) also exist in other/libpackages (core,deliberation); refer to the math versions through a versioned import when a program pulls in several packages.
All implementations were validated with the source-built compiler
(impl/build/sleela run) against known values.
Files 255
- examples/BigArrayGCVerify.sleela
- examples/BigIntegerDemo.sleela
- examples/BigMulVerify.sleela
- examples/BigNumOpsVerify.sleela
- examples/MathDemo.sleela
- examples/PiReferenceDemo.sleela
- math-precision-norms.json
- MATH.PRECISION.NORMS.md
- README.md
- SLAbsoluteValue.sleela
- SLAccumulation.sleela
- SLAdjacencyMatrix.sleela
- SLAlgebra.sleela
- SLAngle.sleela
- SLANOVA.sleela
- SLApproximation.sleela
- SLArithmetic.sleela
- SLAverage.sleela
- SLBayes.sleela
- SLBezier.sleela
- SLBigDecimal.sleela
- SLBigInteger.sleela
- SLBinomialCoefficient.sleela
- SLBinomialDistribution.sleela
- SLBisectionSolver.sleela
- SLCardinality.sleela
- SLCartesianCoordinate.sleela
- SLChiSquareTest.sleela
- SLClamp.sleela
- SLCoefficient.sleela
- SLCombination.sleela
- SLCombinationGenerator.sleela
- SLCombinatorics.sleela
- SLComparator.sleela
- SLComplex.sleela
- SLConditionNumber.sleela
- SLConfidenceInterval.sleela
- SLConfidenceLevel.sleela
- SLConstant.sleela
- SLConstraint.sleela
- SLConvergence.sleela
- SLCoordinate.sleela
- SLCoordinateDescent.sleela
- SLCorrelation.sleela
- SLCorrelationMatrix.sleela
- SLCosine.sleela
- SLCovariance.sleela
- SLCovarianceMatrix.sleela
- SLCrossProduct.sleela
- SLCubicSpline.sleela
- SLDataSummary.sleela
- SLDerivative.sleela
- SLDeterminant.sleela
- SLDifference.sleela
- SLDimension.sleela
- SLDiscreteFourier.sleela
- SLDistance.sleela
- SLDistribution.sleela
- SLDivisor.sleela
- SLDotProduct.sleela
- SLDoubleMath.sleela
- SLEigenvalue.sleela
- SLEigenvector.sleela
- SLEquation.sleela
- SLErrorBound.sleela
- SLExpectation.sleela
- SLExponential.sleela
- SLExpression.sleela
- SLExpressionEvaluator.sleela
- SLExpressionTree.sleela
- SLFactor.sleela
- SLFactorial.sleela
- SLFastFourier.sleela
- SLFibonacci.sleela
- SLFiniteSet.sleela
- SLFixedPoint.sleela
- SLFloatMath.sleela
- SLFormula.sleela
- SLFormulaParser.sleela
- SLFormulaSimplifier.sleela
- SLFourier.sleela
- SLFourierSeries.sleela
- SLFunction.sleela
- SLGcd.sleela
- SLGeometry.sleela
- SLGradient.sleela
- SLGradientDescent.sleela
- SLGradientField.sleela
- SLGraph.sleela
- SLGraphEdge.sleela
- SLGraphNode.sleela
- SLHessian.sleela
- SLHistogram.sleela
- SLHypothesisTest.sleela
- SLInequality.sleela
- SLInfiniteSet.sleela
- SLIntegerMath.sleela
- SLIntegral.sleela
- SLInterpolation.sleela
- SLInterpolationTable.sleela
- SLIntersection.sleela
- SLInterval.sleela
- SLIntervalArithmetic.sleela
- SLInverse.sleela
- SLIteration.sleela
- SLJacobian.sleela
- SLKurtosis.sleela
- SLLagrangeInterpolation.sleela
- SLLambda.sleela
- SLLaplace.sleela
- SLLcm.sleela
- SLLeastSquares.sleela
- SLLimit.sleela
- SLLine.sleela
- SLLinearAlgebra.sleela
- SLLinearProgram.sleela
- SLLinearRegression.sleela
- SLLogarithm.sleela
- SLLongMath.sleela
- SLLTangent.sleela
- SLMachineEpsilon.sleela
- SLMarkovChain.sleela
- SLMath.sleela
- SLMathContext.sleela
- SLMathEngine.sleela
- SLMathEvaluator.sleela
- SLMathNorms.sleela
- SLMatrix.sleela
- SLMatrixOperations.sleela
- SLMax.sleela
- SLMean.sleela
- SLMedian.sleela
- SLMetric.sleela
- SLMin.sleela
- SLMode.sleela
- SLModulo.sleela
- SLMoment.sleela
- SLMonteCarlo.sleela
- SLMonteCarloSampler.sleela
- SLNewtonInterpolation.sleela
- SLNewtonMethod.sleela
- SLNewtonOptimization.sleela
- SLNewtonSolver.sleela
- SLNormalDistribution.sleela
- SLNumber.sleela
- SLNumeric.sleela
- SLNumericalDerivative.sleela
- SLNumericalIntegration.sleela
- SLNumericalMath.sleela
- SLNumericalPrecision.sleela
- SLNumericalRoot.sleela
- SLNumericalSequence.sleela
- SLNumericalSolver.sleela
- SLNumericFormatter.sleela
- SLNumericParser.sleela
- SLObjective.sleela
- SLODESolver.sleela
- SLOptimization.sleela
- SLOptimizationProblem.sleela
- SLOrder.sleela
- SLOrdinaryDifferentialEquation.sleela
- SLOverflow.sleela
- SLPackage.sleela
- SLPartialDerivative.sleela
- SLPathLength.sleela
- SLPDE.sleela
- SLPercentile.sleela
- SLPermutation.sleela
- SLPermutationGenerator.sleela
- SLPhysicalConstant.sleela
- SLPiReference.sleela
- SLPlane.sleela
- SLPoint.sleela
- SLPoissonDistribution.sleela
- SLPolarCoordinate.sleela
- SLPolynomial.sleela
- SLPolynomialRegression.sleela
- SLPower.sleela
- SLPrecision.sleela
- SLPredicate.sleela
- SLPrime.sleela
- SLPrimeFactorization.sleela
- SLProbability.sleela
- SLProbabilityDensity.sleela
- SLProbabilityMass.sleela
- SLProduct.sleela
- SLProgression.sleela
- SLQuadraticProgram.sleela
- SLQuantity.sleela
- SLQuaternion.sleela
- SLRandomDistribution.sleela
- SLRandomGenerator.sleela
- SLRandomVariable.sleela
- SLRational.sleela
- SLRay.sleela
- SLReciprocal.sleela
- SLRecurrence.sleela
- SLRecurrenceSolver.sleela
- SLRegression.sleela
- SLRegressionModel.sleela
- SLRegularization.sleela
- SLRelation.sleela
- SLResidual.sleela
- SLRoot.sleela
- SLRootFinder.sleela
- SLRotation.sleela
- SLRounding.sleela
- SLRungeKutta.sleela
- SLScalarField.sleela
- SLScale.sleela
- SLSecantMethod.sleela
- SLSeededRandom.sleela
- SLSequence.sleela
- SLSeries.sleela
- SLSeriesExpansion.sleela
- SLSetOperations.sleela
- SLSetTheory.sleela
- SLSignal.sleela
- SLSignum.sleela
- SLSimpsonRule.sleela
- SLSine.sleela
- SLSkewness.sleela
- SLSpline.sleela
- SLStandardDeviation.sleela
- SLStandardError.sleela
- SLStatistics.sleela
- SLSum.sleela
- SLSymbolicMath.sleela
- SLSymmetricDifference.sleela
- SLTangent.sleela
- SLTensor.sleela
- SLTerm.sleela
- SLTopology.sleela
- SLTransform.sleela
- SLTranslation.sleela
- SLTranspose.sleela
- SLTrapezoidRule.sleela
- SLTrigonometry.sleela
- SLTTest.sleela
- SLUnderflow.sleela
- SLUniformDistribution.sleela
- SLUnion.sleela
- SLUnit.sleela
- SLUnitConverter.sleela
- SLVariable.sleela
- SLVariance.sleela
- SLVector.sleela
- SLVector2.sleela
- SLVector3.sleela
- SLVector4.sleela
- SLVectorField.sleela
- SLVectorNorm.sleela
- SLVectorProjection.sleela
- SLZScore.sleela
- SLZTransform.sleela