All Projects → HarrisonGrodin → Simplify.jl

HarrisonGrodin / Simplify.jl

Licence: mit
Algebraic simplification in Julia

Programming Languages

julia
2034 projects

Labels

Projects that are alternatives of or similar to Simplify.jl

Mather
zzllrr mather(an offline tool for Math learning, education and research)小乐数学,离线可用的数学学习(自学或教学)、研究辅助工具。计划覆盖数学全部学科的解题、作图、演示、探索工具箱。目前是演示Demo版(抛转引玉),但已经支持数学公式编辑显示,部分作图功能,部分学科,如线性代数、离散数学的部分解题功能。最终目标是推动专业数学家、编程专家、教育工作者、科普工作者共同打造出更加专业级的Mather数学工具
Stars: ✭ 270 (+280.28%)
Mutual labels:  algebra
Klein
P(R*_{3, 0, 1}) specialized SIMD Geometric Algebra Library
Stars: ✭ 463 (+552.11%)
Mutual labels:  algebra
Algebrite
Computer Algebra System in Javascript (Coffeescript)
Stars: ✭ 800 (+1026.76%)
Mutual labels:  algebra
Basic Mathematics For Machine Learning
The motive behind Creating this repo is to feel the fear of mathematics and do what ever you want to do in Machine Learning , Deep Learning and other fields of AI
Stars: ✭ 300 (+322.54%)
Mutual labels:  algebra
Algebra
Experimental project to lay out basic algebra type classes
Stars: ✭ 377 (+430.99%)
Mutual labels:  algebra
Ncalc
Power calculator for Android. Solve some problem algebra and calculus.
Stars: ✭ 512 (+621.13%)
Mutual labels:  algebra
Mu Scala
Mu is a purely functional library for building RPC endpoint based services with support for RPC and HTTP/2
Stars: ✭ 266 (+274.65%)
Mutual labels:  algebra
Rings
Rings: efficient JVM library for polynomial rings
Stars: ✭ 50 (-29.58%)
Mutual labels:  algebra
Gap
Main development repository for GAP - Groups, Algorithms, Programming, a System for Computational Discrete Algebra
Stars: ✭ 447 (+529.58%)
Mutual labels:  algebra
Matryoshka
Generalized recursion schemes and traversals for Scala.
Stars: ✭ 764 (+976.06%)
Mutual labels:  algebra
Nerdamer
a symbolic math expression evaluator for javascript
Stars: ✭ 322 (+353.52%)
Mutual labels:  algebra
Fp Resources
Functional programming great resources
Stars: ✭ 369 (+419.72%)
Mutual labels:  algebra
Alga
Algebraic graphs
Stars: ✭ 619 (+771.83%)
Mutual labels:  algebra
Grassmann.jl
⟨Leibniz-Grassmann-Clifford⟩ differential geometric algebra / multivector simplicial complex
Stars: ✭ 289 (+307.04%)
Mutual labels:  algebra
Witchcraft
Monads and other dark magic for Elixir
Stars: ✭ 864 (+1116.9%)
Mutual labels:  algebra
Cmathtuts
trying to collect all useful tutorials for famous C math and linear algebra libraries such as CBLAS, CLAPACK, GSL...
Stars: ✭ 266 (+274.65%)
Mutual labels:  algebra
Derive4j
Java 8 annotation processor and framework for deriving algebraic data types constructors, pattern-matching, folds, optics and typeclasses.
Stars: ✭ 511 (+619.72%)
Mutual labels:  algebra
Rewrite.jl
An efficient symbolic term rewriting engine
Stars: ✭ 61 (-14.08%)
Mutual labels:  algebra
Algebra Latex
Parse and calculate latex formatted math
Stars: ✭ 20 (-71.83%)
Mutual labels:  algebra
Static Land
Specification for common algebraic structures in JavaScript based on Fantasy Land
Stars: ✭ 699 (+884.51%)
Mutual labels:  algebra

Simplify.jl

Travis Build Status AppVeyor Build Status Coverage Status

Simplify.jl implements methods for symbolic algebraic simplification in the Julia language.

Examples

Normalization involves determining the unique normal form of an expression ("simplest" equivalent expression) through repeated application of rules. Simplify.jl will use its internal set of algebraic rules by default, which includes trigonometry, logarithms, differentiation (based on DiffRules.jl), and more.

julia> @syms x y b θ;

julia> normalize(@term(1 / (sin(-θ) / cos(-θ))))
@term(1 / (-(sin(θ)) / cos(θ)))

julia> normalize(@term(log(b, 1 / (b^abs(x^2)))))
@term(log(b, 1 / b ^ abs(x ^ 2)))

julia> normalize(@term(diff(sin(2x) - log(x+y), x)))
@term(1 * -(inv(x + y) * (1 * diff(y, x) + 1 * one(x))) + 1 * cos(2x) * (2 * one(x) + x * 0))

julia> normalize(@term(!x & x | (y & (y | true))))
@term(!x & x | (y | true) & y)

julia> normalize(@term(y^(6 - 3log(x, x^2))))
@term(y ^ (-(6 * log(x, x)) + 6))

In many cases, it is useful to specify entirely custom rules by passing a Term Rewriting System as the second argument to normalize. This may be done either by manually constructing a Rules object or by using the RULES strategy for @term.

julia> @syms f g h;
       @vars x y;

julia> normalize(@term(f(x, f(y, y))), @term RULES [
          f(x, x) => 1
          f(x, 1) => x
       ])
@term(x)

julia> normalize(@term(f(g(f(1), h()))), Rules(
          @term(f(x)) => @term(x),
          @term(h())  => @term(3),
       ))
@term(g(1, 3))

julia> using Simplify: EvalRule

julia> normalize(@term(f(g(f(1), h()))), Rules(
          @term(f(x)) => @term(x),
          @term(h())  => @term(3),
          EvalRule(g, (a, b) -> 2a + b)
       ))
@term(5)

Variables may contain information about their domain, which may result in more specific normalizations.

julia> using SpecialSets

julia> @syms x y z;

julia> ctx = [get_context(); Image(y, GreaterThan(3)); Image(z, Even  LessThan(0))];

julia> with_context(ctx) do
           normalize(@term(abs(x)))
       end
@term(abs(x))

julia> with_context(ctx) do
           normalize(@term(abs(y)))
       end
@term(y)

julia> with_context(ctx) do
           normalize(@term(abs(z)))
       end
@term(-z)
julia> ctx = [get_context(); Image(x, TypeSet(Int)); Image(y, TypeSet(Int))];

julia> with_context(ctx) do
           normalize(@term(diff(sin(2x) - log(x + y), x)))
       end
@term(cos(2x) * 2 + -(inv(x + y) * (diff(y, x) + 1)))

Acknowledgements

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].