F# Other
Clone or download
Permalink
Failed to load latest commit information.
.paket Paket: upgrade bootstrapper to v5.142 Feb 23, 2018
build Merge tag 'v0.18.1' Dec 26, 2017
docs Paket: no logner use dependency groups (simpler) Nov 19, 2017
src Merge tag 'v0.18.1' Dec 26, 2017
tools/docu Upgrade Tools and Dependencies Oct 3, 2015
.editorconfig EditorConfig: disable trailing whitespace trimming on markdown files Jan 15, 2017
.gitattributes init Mar 25, 2014
.gitignore Paket install Sep 11, 2017
.travis.yml Build: CI and soft dependencies Mar 6, 2016
CONTRIBUTING.md Bootstrap: add release notes, contributors and contributing files Jul 1, 2014
CONTRIBUTORS.md Update Contributors Nov 8, 2017
LICENSE.md init Mar 25, 2014
MathNet.Symbolics.All.sln Build: zip and NuGet package, FSI load script Jul 2, 2014
MathNet.Symbolics.sln Build: certificate code signing support Nov 8, 2017
README.md Release v0.13.0 Dec 29, 2016
RELEASENOTES.md Release v0.18.1 Dec 23, 2017
Vagrantfile Bootstrap: update ignores, vagrant, travis, appveyor Jul 1, 2014
appveyor.yml Build: migrate to simplified build from Math.NET Numerics Jan 4, 2017
build.cmd Build fix Nov 19, 2017
build.fsx Framework restriction to .Net 4.0, 4.6.1 Nov 20, 2017
build.sh Build fix Nov 19, 2017
paket.dependencies Enable Expecto Test Adapter for VS Test Explorer support #50 Nov 20, 2017
paket.lock Enable Expecto Test Adapter for VS Test Explorer support #50 Nov 20, 2017
paket.sh Build: file permissions Mar 6, 2016
restore.cmd Build: clarify need to run restore.cmd once when using VisualStudio Feb 28, 2016
restore.sh Build: file permissions Mar 6, 2016
vagrant-bootstrap.sh Build: updated vagrant bootstrap to use newest xamarin mono packages Jan 3, 2015

README.md

Math.NET Symbolics

Math.NET Symbolics is a basic opensource computer algebra library for .Net, Silverlight and Mono written entirely in F#.

This project does not aim to become a full computer algebra system. If you need such a system, have a look at Axiom or Maxima instead, or for proprietary commercial solutions Maple, Mathematica or Wolfram Alpha.

You'll find a large set of expression and algebraic operator examples in the Unit Tests (yes, they're actually very readable). A few examples:

  • (3Q + 2)*4/610/3.
  • (a/b/(c*a))*(c*d/a)/d1/(a*b)
  • (a+b)/(b+a)**21/(a + b)
  • Algebraic.expand ((a+b)**3)a^3 + 3*a^2*b + 3*a*b^2 + b^3
  • Exponential.expand (exp(2*x+y))exp(x)^2*exp(y)
  • Exponential.contract (exp(x)*(exp(x) + exp(y)))exp(2*x) + exp(x + y)
  • Exponential.simplify (1/(exp(x)*(exp(y)+exp(-x))) - (exp(x+y)-1)/((exp(x+y))**2-1))0
  • Trigonometric.expand (sin(2*x))2*sin(x)*cos(x)
  • Trigonometric.contract (sin(x)**2*cos(x)**2)1/8 - (1/8)*cos(4*x)
  • Trigonometric.simplify ((cos(x)+sin(x))**4 + (cos(x)-sin(x))**4 + cos(4*x) - 3)0
  • Polynomial.polynomialDivision x (x**3 - 2*x**2 - 4) (x-3)(3 + x + x^2, 5)
  • Polynomial.polynomialExpansion x y (x**5 + 11*x**4 + 51*x**3 + 124*x**2 + 159*x + 86) (x**2 + 4*x + 5)1 + x + (2 + x)*y + (3 + x)*y^2
  • Polynomial.gcd x (x**7 - 4*x**5 - x**2 + 4) (x**5 - 4*x**3 - x**2 + 4)4 - 4*x - x^2 + x^3
  • Rational.rationalize (1+1/(1+1/x))(1 + 2*x)/(1 + x)
  • Rational.simplify x ((x**2-1)/(x+1))-1 + x
let taylor (k:int) symbol x a =
    let rec impl n nf acc dxn =
        if n = k then acc else
        impl (n+1) (nf*(n+1)) (acc + (dxn |> Structure.substitute symbol a)/nf*(symbol-a)**n) (Calculus.differentiate symbol dxn)
    impl 0 1 zero x |> Algebraic.expand

taylor 3 x (1/(1-x)) 0Q       → 1 + x + x^2
taylor 3 x (1/x) 1Q           → 3 - 3*x + x^2
taylor 3 x (ln(x)) 1Q         → -3/2 + 2*x - (1/2)*x^2
taylor 4 x (ln(x)) 1Q         → -11/6 + 3*x - (3/2)*x^2 + (1/3)*x^3
taylor 4 x (sin(x)+cos(x)) 0Q → 1 + x - (1/2)*x^2 - (1/6)*x^3

Literature

  • Computer Algebra and Symbolic Computation - Elementary Algorithms, Joel. S. Cohen
  • Computer Algebra and Symbolic Computation - Mathematical Methods, Joel. S. Cohen
  • Modern Computer Algebra, Second Edition, Joachim von zur Gathen, Jürgen Gerhard
  • Symbolic Integration I - Transcendental Functions, Second Edition, Manuel Bronstein
  • Concrete Mathematics, Second Edition, Graham, Knuth, Patashnik
  • ... and of course the fundamental theory by Euclid, Newton, Gauss, Fermat and Hilbert.

Project

Windows (.Net): AppVeyor build status
Linux (Mono): Travis Build Status

Maintained by Christoph Rüegg and part of the Math.NET initiative (see also Math.NET Numerics). It is covered under the terms of the MIT/X11 open source license. See also the license file in the root folder. We accept contributions!