HMath.Symbolic¶
Module index · Numerical conventions
Description
Bounded symbolic real algebra over the common Expr language.
This is a reference CAS with explicit unsupported results, not a decision procedure for arbitrary elementary expressions. Variables are real; assumptions are caller assertions, checked for contradictions and retained as proof premises. Cancellation and log/power rewrites require domain proofs. Generic expansion and ring collection preserve partial-function domains by refusing to erase an unproved undefined subexpression. All public transformations validate input and output against caller limits. Polynomial operations additionally bound degrees and rational coefficient growth before entering existing exact algorithms.
Integration handles rational polynomials, affine elementary primitives,
polynomial-times-expsincos by parts, and rational partial fractions with linear
or simple quadratic denominators. Limits and Laurent jets are exact for rational
functions; regular elementary Taylor jets use symbolic derivatives. General
transcendental limits, non-elementary integrals, higher-dimensional eigensystems,
and branch-dependent identities return Unsupported. There are no hidden
numerical guesses or silently discarded branch conditions.
On this page¶
| API | Purpose |
|---|---|
| Property | Symbolic domain fact such as real,positive,nonzero,or sign restrictions, used to guard domain-sensitive identities. |
| Real | Declaration and type contract below. |
| NonZero | Declaration and type contract below. |
| Positive | Declaration and type contract below. |
| NonNegative | Declaration and type contract below. |
| Integral | Declaration and type contract below. |
| Negative | Declaration and type contract below. |
| NonPositive | Declaration and type contract below. |
| Assumptions | Validated variable-property environment. |
| assumptions | Only variable assertions are accepted. |
| noAssumptions | Construct an empty variable-property environment. |
| proves | Given assumptions,requested Property,then Expr, conservatively test whether the fact is established. |
| SymbolicOptions | Expression budgets together with permitted variable assumptions for checked symbolic operations. |
| SymbolicOptions | Declaration and type contract below. |
| symbolicLimits | Expression resource/numeric budgets used by symbolic operations. |
| symbolicAssumptions | Variable facts permitted when proving domain-sensitive rewrites. |
| defaultSymbolicOptions | Default expression budgets with no assumptions; domain-sensitive rules require their preconditions to be proved before rewriting. |
| normalize | Bottom-up folding and conservative canonical ring collection. |
| simplify | Given SymbolicOptions then Expr, simplify within its resource limits and supplied assumptions, preserving domain-sensitive conditions. |
| expand | Distribute products over sums and nonnegative integer powers <=32, with a checked output size at every convolution. |
| collectTerms | Alias of simplify, combining supported like terms under the same assumption and budget checks. |
| factorPolynomial | Exact factorization over Q via the existing bounded Kronecker algorithm. |
| PolynomialFactorization | Exact leading coefficient and symbolic factor/multiplicity pairs; unfactored remainder behavior follows the factorization function. |
| PolynomialFactorization | Declaration and type contract below. |
| factorLeading | Exact scalar leading factor outside the polynomial factors. |
| factorTerms | Symbolic factors paired with positive multiplicities. |
| rationalSimplify | Cancel a rational quotient only when its original denominator is proved nonzero; this preserves holes that ordinary field cancellation would erase. |
| trigonometricSimplify | Given options then Expr, apply supported trigonometric identities such as matching sin-squared plus cos-squared terms, after input validation. |
| logarithmicSimplify | Given options then Expr, apply log productquotientpower rules only when the supplied assumptions establish required real-domain facts. |
| substitute | Alpha-renaming makes simultaneous substitution capture-safe. |
| Pattern | Symbolic rewrite pattern with literalvariableoperator/call structure and binding placeholders. |
| Any | Declaration and type contract below. |
| Exactly | Declaration and type contract below. |
| UnaryPattern | Declaration and type contract below. |
| BinaryPattern | Declaration and type contract below. |
| CallPattern | Declaration and type contract below. |
| matchPattern | Repeated wildcard names must match structurally identical subtrees. |
| RewriteRule | Pattern,replacement expression,and property requirements needed for a valid bounded symbolic rewrite. |
| RewriteRule | Declaration and type contract below. |
| rewritePattern | Pattern to match before applying this rewrite rule. |
| rewriteReplacement | Replacement expression, with matched bindings substituted. |
| rewriteRequirements | Variable properties required to justify the rewrite. |
| applyRewrite | Apply one caller-supplied rule at the root only. |
| differentiate | Differentiate supported elementary real functions. |
| gradient | Given symbolic options,ordered variable names,then scalar expression, return symbolic partial derivatives in that order. |
| jacobian | Given options,ordered variable names,then output-expression list, return one gradient row per output. |
| hessian | Given options,ordered variables,then scalar Expr, return derivatives of each gradient component in the same rowcolumn variable order. |
| integrateBasic | Polynomial primitives and affine expsincos and reciprocal powers. |
| integrateByParts | Integrate a supplied u*dv by recursively reducing polynomial degree when v is an affine exponentialsinecosine primitive. |
| integrateSubstitution | Verified substitution: callers supply an outer expression in a fresh variable t; the integrand must simplify to outer(inner)*inner'. |
| integrateRational | Exact partial fractions; supports all repeated linear poles and simple irreducible quadratic factors. |
| Direction | Limit approach direction: from left,from right,or two-sided. |
| FromLeft | Declaration and type contract below. |
| FromRight | Declaration and type contract below. |
| TwoSided | Declaration and type contract below. |
| LimitResult | Symbolic finite/infinite limit classification,including an explicit does-not-exist or unresolved result. |
| FiniteLimit | Declaration and type contract below. |
| PositiveInfinity | Declaration and type contract below. |
| NegativeInfinity | Declaration and type contract below. |
| DoesNotExist | Declaration and type contract below. |
| symbolicLimit | Exact finite-point rational limits by root multiplicity. |
| Series | Finite symbolic Taylor/Laurent coefficient list with exact center and starting power; no analytic convergence is implied by storage alone. |
| Series | Declaration and type contract below. |
| seriesCenter | Exact Rational expansion center. |
| seriesMinimumPower | Power corresponding to the first coefficient, including negative powers for Laurent series. |
| seriesTerms | Coefficient expressions ordered from seriesMinimumPower upward. |
| taylorSeries | Truncated Taylor coefficients f^(k)(c)/k!, order 0..20. |
| maclaurinSeries | Given options,variable name,order,then Expr, compute the Taylor series centered at zero via taylorSeries. |
| laurentSeries | Rational Laurent coefficients at a rational center, from the lowest power through that power+order. |
| formalPowerSeries | Given options then Rational coefficient list, construct a finite formal jet with at most 64 coefficients, subject to expression numeric budgets. |
| multiplyFormalSeries | Given options then two formal Rational jets, validate and convolve coefficients under the 64-coefficient cap. |
| reciprocalFormalSeries | Given options then formal Rational series with nonzero constant term, compute its reciprocal jet. |
| toPolynomial | Given options,variable name,then Expr, convert a supported univariate exact Rational polynomial. |
| fromPolynomial | Given variable name then exact Rational Polynomial, build an Expr in Horner form. |
| exactPolynomialRoots | Given options,variable name,then polynomial Expr, return rational roots with multiplicities plus the remaining deflated Expr. |
| numericalPolynomialRoots | Bounded Durand-Kerner roots, degree <=32; nonconvergence is explicit. |
| RelationOp | Comparison relation selector: equality,inequality,or ordered less/greater comparisons. |
| Equal | Declaration and type contract below. |
| NotEqual | Declaration and type contract below. |
| Less | Declaration and type contract below. |
| LessEqual | Declaration and type contract below. |
| Greater | Declaration and type contract below. |
| GreaterEqual | Declaration and type contract below. |
| Relation | Symbolic comparison of two expressions; use simplifyRelation to decide or preserve unresolved conditions. |
| Relation | Declaration and type contract below. |
| RelationResult | Decided truth value or unresolved symbolic relation under the provided assumptions. |
| Truth | Declaration and type contract below. |
| Unresolved | Declaration and type contract below. |
| simplifyRelation | Given options then Relation, simplify both sides and return a Boolean Truth when decidable, otherwise a symbolic unresolved relation/conditions. |
| solveLinearInequality | Isolate a single affine variable; multiplying by a negative coefficient flips the inequality. |
| LinearSolution | Symbolic linear-system outcome distinguishing a determined/parametric solution from inconsistency or unresolved computation. |
| Inconsistent | Declaration and type contract below. |
| ParametricSolution | Declaration and type contract below. |
| solveLinearEquations | Exact rational RREF for at most 16 variables/equations. |
| SymbolicMatrix | Checked bounded rectangular expression matrix, constructed with symbolicMatrix. |
| symbolicMatrix | Given options then nonempty rectangular Expr rows, construct a checked symbolic matrix bounded to 8-by-8. |
| matrixExpressions | Extract row-major symbolic expressions without evaluation or simplification. |
| matrixAdd | Given options then equally shaped symbolic matrices, add and simplify corresponding expressions. |
| matrixMultiply | Given options then compatible symbolic matrices, form simplified dot-product entries. |
| symbolicDeterminant | Cofactor determinant, at most 6x6. |
| Guarded | Value paired with mathematical property conditions required for its unconditional use. |
| Guarded | Declaration and type contract below. |
| guardedValue | Result whose validity depends on requiredConditions. |
| requiredConditions | Expression/property facts that must hold before using guardedValue unconditionally. |
| symbolicEigenvalues | Exact 1x1/2x2 real eigenvalue formulas; an unproved discriminant is returned as an explicit NonNegative condition. |
| numericalSubstitution | Given options,precision,bindings list,then Expr, evaluate using the default builtin registry and symbolic limits. |
| toLaTeX | TeX with escaped identifiers; expressions are never interpreted as raw TeX. |
| toMathML | Content MathML, including an explicit lambda application for lexical let. |
Documentation
module HMath.Expression
Property
Symbolic domain fact such as real,positive,nonzero,or sign restrictions, used to guard domain-sensitive identities.
Constructors
| Real | |
| NonZero | |
| Positive | |
| NonNegative | |
| Integral | |
| Negative | |
| NonPositive |
Assumptions
data Assumptions Source #
Validated variable-property environment. Build through the assumptions API; noAssumptions proves no additional variable facts.
Instances
| Show Assumptions Source # | |
Defined in HMath.Symbolic Methods showsPrec :: Int -> Assumptions -> ShowS # show :: Assumptions -> String # showList :: [Assumptions] -> ShowS # | |
| Eq Assumptions Source # | |
Defined in HMath.Symbolic | |
assumptions
assumptions :: [(String, [Property])] -> Either ExprError Assumptions Source #
Only variable assertions are accepted. Positivenegativezero constraints are checked for contradictions, including repeated entries for a variable.
noAssumptions
noAssumptions :: Assumptions Source #
Construct an empty variable-property environment. Simplifications requiring positivity/nonzero facts remain guarded or unchanged without proof.
proves
proves :: Assumptions -> Property -> Expr -> Bool Source #
Given assumptions,requested Property,then Expr, conservatively test whether the fact is established. False means not proved, not a proof of its negation.
SymbolicOptions
data SymbolicOptions Source #
Expression budgets together with permitted variable assumptions for checked symbolic operations.
Constructors
| SymbolicOptions | |
Fields
| |
Instances
| Show SymbolicOptions Source # | |
Defined in HMath.Symbolic Methods showsPrec :: Int -> SymbolicOptions -> ShowS # show :: SymbolicOptions -> String # showList :: [SymbolicOptions] -> ShowS # | |
| Eq SymbolicOptions Source # | |
Defined in HMath.Symbolic Methods (==) :: SymbolicOptions -> SymbolicOptions -> Bool # (/=) :: SymbolicOptions -> SymbolicOptions -> Bool # | |
defaultSymbolicOptions
defaultSymbolicOptions :: SymbolicOptions Source #
Default expression budgets with no assumptions; domain-sensitive rules require their preconditions to be proved before rewriting.
normalize
normalize :: SymbolicOptions -> Expr -> Either ExprError Expr Source #
Bottom-up folding and conservative canonical ring collection. It never rewrites x/x or removes an unproved partial function from a zero product.
simplify
simplify :: SymbolicOptions -> Expr -> Either ExprError Expr Source #
Given SymbolicOptions then Expr, simplify within its resource limits and supplied assumptions, preserving domain-sensitive conditions. Return ExprError for invalidbudget-exceeding inputoutput.
expand
expand :: SymbolicOptions -> Expr -> Either ExprError Expr Source #
Distribute products over sums and nonnegative integer powers <=32, with a checked output size at every convolution. Other powers remain symbolic.
collectTerms
collectTerms :: SymbolicOptions -> Expr -> Either ExprError Expr Source #
Alias of simplify, combining supported like terms under the same assumption and budget checks.
factorPolynomial
factorPolynomial :: SymbolicOptions -> String -> Expr -> Either ExprError PolynomialFactorization Source #
Exact factorization over Q via the existing bounded Kronecker algorithm.
PolynomialFactorization
data PolynomialFactorization Source #
Exact leading coefficient and symbolic factor/multiplicity pairs; unfactored remainder behavior follows the factorization function.
Constructors
| PolynomialFactorization | |
Fields
| |
Instances
| Show PolynomialFactorization Source # | |
Defined in HMath.Symbolic Methods showsPrec :: Int -> PolynomialFactorization -> ShowS # show :: PolynomialFactorization -> String # showList :: [PolynomialFactorization] -> ShowS # | |
| Eq PolynomialFactorization Source # | |
Defined in HMath.Symbolic Methods (==) :: PolynomialFactorization -> PolynomialFactorization -> Bool # (/=) :: PolynomialFactorization -> PolynomialFactorization -> Bool # | |
rationalSimplify
rationalSimplify :: SymbolicOptions -> String -> Expr -> Either ExprError Expr Source #
Cancel a rational quotient only when its original denominator is proved nonzero; this preserves holes that ordinary field cancellation would erase.
trigonometricSimplify
trigonometricSimplify :: SymbolicOptions -> Expr -> Either ExprError Expr Source #
Given options then Expr, apply supported trigonometric identities such as matching sin-squared plus cos-squared terms, after input validation. This is a bounded rule set, not a general identity prover.
logarithmicSimplify
logarithmicSimplify :: SymbolicOptions -> Expr -> Either ExprError Expr Source #
Given options then Expr, apply log productquotientpower rules only when the supplied assumptions establish required real-domain facts. Unproved transformations are left unchanged; budget errors propagate.
substitute
substitute :: Limits -> [(String, Expr)] -> Expr -> Either ExprError Expr Source #
Alpha-renaming makes simultaneous substitution capture-safe. Replacement expressions are inserted once; substitution does not recurse into them.
Pattern
Symbolic rewrite pattern with literalvariableoperator/call structure and binding placeholders.
Constructors
| Any String | |
| Exactly Expr | |
| UnaryPattern UnaryOp Pattern | |
| BinaryPattern BinaryOp Pattern Pattern | |
| CallPattern String [Pattern] |
matchPattern
matchPattern :: Limits -> Pattern -> Expr -> Either ExprError (Maybe [(String, Expr)]) Source #
Repeated wildcard names must match structurally identical subtrees.
RewriteRule
data RewriteRule Source #
Pattern,replacement expression,and property requirements needed for a valid bounded symbolic rewrite.
Constructors
| RewriteRule | |
Fields
| |
Instances
| Show RewriteRule Source # | |
Defined in HMath.Symbolic Methods showsPrec :: Int -> RewriteRule -> ShowS # show :: RewriteRule -> String # showList :: [RewriteRule] -> ShowS # | |
| Eq RewriteRule Source # | |
Defined in HMath.Symbolic | |
applyRewrite
applyRewrite :: SymbolicOptions -> RewriteRule -> Expr -> Either ExprError Expr Source #
Apply one caller-supplied rule at the root only. Rules are trusted algebraic assertions; requirements are checked against the matched expressions.
differentiate
differentiate :: SymbolicOptions -> String -> Expr -> Either ExprError Expr Source #
Differentiate supported elementary real functions. Noninteger powers and logarithms require a positive argument; abs requires a nonzero argument.
gradient
gradient :: SymbolicOptions -> [String] -> Expr -> Either ExprError [Expr] Source #
Given symbolic options,ordered variable names,then scalar expression, return symbolic partial derivatives in that order. At most 32 variables are supported; expressiondomainresource failures return ExprError.
jacobian
jacobian :: SymbolicOptions -> [String] -> [Expr] -> Either ExprError [[Expr]] Source #
Given options,ordered variable names,then output-expression list, return one gradient row per output. Validate variable/expression budgets; failures return ExprError.
hessian
hessian :: SymbolicOptions -> [String] -> Expr -> Either ExprError [[Expr]] Source #
Given options,ordered variables,then scalar Expr, return derivatives of each gradient component in the same rowcolumn variable order. Validationdifferentiation/resource failures propagate.
integrateBasic
integrateBasic :: SymbolicOptions -> String -> Expr -> Either ExprError Expr Source #
Polynomial primitives and affine expsincos and reciprocal powers. The logarithmic primitive log(abs x) has the original nonzero domain.
integrateByParts
integrateByParts :: SymbolicOptions -> String -> Expr -> Expr -> Either ExprError Expr Source #
Integrate a supplied u*dv by recursively reducing polynomial degree when v is an affine exponentialsinecosine primitive. Degree is capped at 16.
integrateSubstitution
integrateSubstitution :: SymbolicOptions -> String -> String -> Expr -> Expr -> Expr -> Either ExprError Expr Source #
Verified substitution: callers supply an outer expression in a fresh variable t; the integrand must simplify to outer(inner)*inner'.
integrateRational
integrateRational :: SymbolicOptions -> String -> Expr -> Expr -> Either ExprError Expr Source #
Exact partial fractions; supports all repeated linear poles and simple irreducible quadratic factors. Unsupported higher quadratic powers are explicit.
Direction
Limit approach direction: from left,from right,or two-sided.
Instances
LimitResult
data LimitResult Source #
Symbolic finite/infinite limit classification,including an explicit does-not-exist or unresolved result.
Constructors
| FiniteLimit Rational | |
| PositiveInfinity | |
| NegativeInfinity | |
| DoesNotExist |
Instances
| Show LimitResult Source # | |
Defined in HMath.Symbolic Methods showsPrec :: Int -> LimitResult -> ShowS # show :: LimitResult -> String # showList :: [LimitResult] -> ShowS # | |
| Eq LimitResult Source # | |
Defined in HMath.Symbolic | |
symbolicLimit
symbolicLimit :: SymbolicOptions -> String -> Rational -> Direction -> Expr -> Either ExprError LimitResult Source #
Exact finite-point rational limits by root multiplicity. Non-rational transcendental limits are explicitly unsupported.
Series
Finite symbolic Taylor/Laurent coefficient list with exact center and starting power; no analytic convergence is implied by storage alone.
Constructors
| Series | |
Fields
| |
taylorSeries
taylorSeries :: SymbolicOptions -> String -> Rational -> Int -> Expr -> Either ExprError Series Source #
Truncated Taylor coefficients f^(k)(c)/k!, order 0..20. Missing regularity assumptions or a pole produce an error rather than a fictitious Taylor jet.
maclaurinSeries
maclaurinSeries :: SymbolicOptions -> String -> Int -> Expr -> Either ExprError Series Source #
Given options,variable name,order,then Expr, compute the Taylor series centered at zero via taylorSeries. Unsupported symbolic derivatives or exceeded order/resource bounds return ExprError.
laurentSeries
laurentSeries :: SymbolicOptions -> String -> Rational -> Int -> Expr -> Either ExprError Series Source #
Rational Laurent coefficients at a rational center, from the lowest power through that power+order. Exact finite jets reuse HMath.Polynomial division.
formalPowerSeries
formalPowerSeries :: SymbolicOptions -> [Rational] -> Either ExprError (PowerSeries Rational) Source #
Given options then Rational coefficient list, construct a finite formal jet with at most 64 coefficients, subject to expression numeric budgets. No analytic convergence is claimed.
multiplyFormalSeries
multiplyFormalSeries :: SymbolicOptions -> PowerSeries Rational -> PowerSeries Rational -> Either ExprError (PowerSeries Rational) Source #
Given options then two formal Rational jets, validate and convolve coefficients under the 64-coefficient cap. Oversized input/output or numeric-limit failures return ExprError.
reciprocalFormalSeries
reciprocalFormalSeries :: SymbolicOptions -> PowerSeries Rational -> Either ExprError (PowerSeries Rational) Source #
Given options then formal Rational series with nonzero constant term, compute its reciprocal jet. Invalid constant/size or numeric budgets return ExprError.
toPolynomial
toPolynomial :: SymbolicOptions -> String -> Expr -> Either ExprError (Polynomial Rational) Source #
Given options,variable name,then Expr, convert a supported univariate exact Rational polynomial. Other variables/functions, invalid exponents or resource-limit violations return ExprError.
fromPolynomial
fromPolynomial :: String -> Polynomial Rational -> Expr Source #
Given variable name then exact Rational Polynomial, build an Expr in Horner form. This pure builder does not itself validate SymbolicOptions limits.
exactPolynomialRoots
exactPolynomialRoots :: SymbolicOptions -> String -> Expr -> Either ExprError ([(Rational, Int)], Expr) Source #
Given options,variable name,then polynomial Expr, return rational roots with multiplicities plus the remaining deflated Expr. Irrational/non-rational roots remain in the remainder; unsupported conversion or work-budget exhaustion returns ExprError.
numericalPolynomialRoots
numericalPolynomialRoots :: SymbolicOptions -> String -> Expr -> Either ExprError [Complex Double] Source #
Bounded Durand-Kerner roots, degree <=32; nonconvergence is explicit.
RelationOp
data RelationOp Source #
Comparison relation selector: equality,inequality,or ordered less/greater comparisons.
Instances
| Show RelationOp Source # | |
Defined in HMath.Symbolic Methods showsPrec :: Int -> RelationOp -> ShowS # show :: RelationOp -> String # showList :: [RelationOp] -> ShowS # | |
| Eq RelationOp Source # | |
Defined in HMath.Symbolic | |
Relation
Symbolic comparison of two expressions; use simplifyRelation to decide or preserve unresolved conditions.
Constructors
| Relation RelationOp Expr Expr |
RelationResult
data RelationResult Source #
Decided truth value or unresolved symbolic relation under the provided assumptions.
Constructors
| Truth Bool | |
| Unresolved Relation |
Instances
| Show RelationResult Source # | |
Defined in HMath.Symbolic Methods showsPrec :: Int -> RelationResult -> ShowS # show :: RelationResult -> String # showList :: [RelationResult] -> ShowS # | |
| Eq RelationResult Source # | |
Defined in HMath.Symbolic Methods (==) :: RelationResult -> RelationResult -> Bool # (/=) :: RelationResult -> RelationResult -> Bool # | |
simplifyRelation
simplifyRelation :: SymbolicOptions -> Relation -> Either ExprError RelationResult Source #
Given options then Relation, simplify both sides and return a Boolean Truth when decidable, otherwise a symbolic unresolved relation/conditions. Invalid expressions or resource failures return ExprError.
solveLinearInequality
solveLinearInequality :: SymbolicOptions -> String -> Relation -> Either ExprError RelationResult Source #
Isolate a single affine variable; multiplying by a negative coefficient flips the inequality. Equality and zero slopes are handled explicitly.
LinearSolution
data LinearSolution Source #
Symbolic linear-system outcome distinguishing a determined/parametric solution from inconsistency or unresolved computation.
Constructors
| Inconsistent | |
| ParametricSolution [(String, Expr)] [String] |
Instances
| Show LinearSolution Source # | |
Defined in HMath.Symbolic Methods showsPrec :: Int -> LinearSolution -> ShowS # show :: LinearSolution -> String # showList :: [LinearSolution] -> ShowS # | |
| Eq LinearSolution Source # | |
Defined in HMath.Symbolic Methods (==) :: LinearSolution -> LinearSolution -> Bool # (/=) :: LinearSolution -> LinearSolution -> Bool # | |
solveLinearEquations
solveLinearEquations :: SymbolicOptions -> [String] -> [(Expr, Expr)] -> Either ExprError LinearSolution Source #
Exact rational RREF for at most 16 variables/equations. Free variables keep their original names; a zero row with nonzero RHS certifies inconsistency.
SymbolicMatrix
data SymbolicMatrix Source #
Checked bounded rectangular expression matrix, constructed with symbolicMatrix.
Instances
| Show SymbolicMatrix Source # | |
Defined in HMath.Symbolic Methods showsPrec :: Int -> SymbolicMatrix -> ShowS # show :: SymbolicMatrix -> String # showList :: [SymbolicMatrix] -> ShowS # | |
| Eq SymbolicMatrix Source # | |
Defined in HMath.Symbolic Methods (==) :: SymbolicMatrix -> SymbolicMatrix -> Bool # (/=) :: SymbolicMatrix -> SymbolicMatrix -> Bool # | |
symbolicMatrix
symbolicMatrix :: SymbolicOptions -> [[Expr]] -> Either ExprError SymbolicMatrix Source #
Given options then nonempty rectangular Expr rows, construct a checked symbolic matrix bounded to 8-by-8. Emptyraggedoversized or invalid expressions fail.
matrixExpressions
matrixExpressions :: SymbolicMatrix -> [[Expr]] Source #
Extract row-major symbolic expressions without evaluation or simplification.
matrixAdd
matrixAdd :: SymbolicOptions -> SymbolicMatrix -> SymbolicMatrix -> Either ExprError SymbolicMatrix Source #
Given options then equally shaped symbolic matrices, add and simplify corresponding expressions. Shape mismatch or symbolic resource/domain failure returns ExprError.
matrixMultiply
matrixMultiply :: SymbolicOptions -> SymbolicMatrix -> SymbolicMatrix -> Either ExprError SymbolicMatrix Source #
Given options then compatible symbolic matrices, form simplified dot-product entries. Inner-dimension mismatch or expression/output limits return ExprError.
symbolicDeterminant
symbolicDeterminant :: SymbolicOptions -> SymbolicMatrix -> Either ExprError Expr Source #
Cofactor determinant, at most 6x6. This bounded reference algorithm permits arbitrary symbolic entries without assuming nonzero division pivots.
Guarded
Value paired with mathematical property conditions required for its unconditional use.
Constructors
| Guarded | |
Fields
| |
symbolicEigenvalues
symbolicEigenvalues :: SymbolicOptions -> SymbolicMatrix -> Either ExprError (Guarded [Expr]) Source #
Exact 1x1/2x2 real eigenvalue formulas; an unproved discriminant is returned as an explicit NonNegative condition. Negative numeric discriminants fail.
numericalSubstitution
numericalSubstitution :: SymbolicOptions -> Precision -> [(String, Value)] -> Expr -> Either ExprError Value Source #
Given options,precision,bindings list,then Expr, evaluate using the default builtin registry and symbolic limits. Later duplicate binding names replace earlier ones. Evaluationnamedomain/resource errors remain ExprError.