symtegration-0.4.0: Library for symbolic integration of mathematical expressions.
CopyrightCopyright 2024 Yoo Chung
LicenseApache-2.0
Maintainerdev@chungyc.org
Safe HaskellNone
LanguageGHC2021

Symtegration.Symbolic.Simplify.AlgebraicRingOrder

Description

 
Synopsis

Documentation

order Source #

Arguments

:: Text

Symbol representing the variable.

-> Expression

Expression to be ordered.

-> Expression

Expression with terms re-ordered.

Order terms in an mathematical expression.

Terms will be ordered according to a deterministic set of rules. The re-ordering aims to make it easier to identify common factors and terms. Terms with higher integral powers of the variable are sorted later. Addition and multiplication will be re-arranged to associate to the left.

>>> toHaskell $ order "x" $ "x" + 1
"1 + x"
>>> toHaskell $ order "x" $ 2 + 3 * "x"**2 + "x"
"2 + x + 3 * x ** 2"