LinuxCommandLibrary

yacas

Perform symbolic mathematics calculations

TLDR

Start an interactive yacas session

$ yacas
copy

While in a yacas session, execute a statement
$ [Integrate(x)Cos(x)];
copy

While in a yacas session, display an example
$ Example();
copy

Quit from a yacas session
$ quit
copy

Execute one or more yacas scripts (without terminal or prompts), then exit
$ yacas -p -c [path/to/script1 path/to/script2 ...]
copy

Execute and print the result of one statement, then exit
$ echo "[Echo( Deriv(x)Cos(1/x) );]" | yacas -p -c /dev/stdin
copy

SYNOPSIS

yacas [options] [file ...]

PARAMETERS

-h, --help
    Display a help message and exit.

-v, --version
    Show version information and exit.

-e expression, --execute expression
    Execute the given expression and exit. Useful for non-interactive scripting.

-s file, --script file
    Execute commands from the specified file. This is an alternative to passing files as arguments.

-i, --interactive
    Force interactive mode after processing any specified files or expressions.

-c, --check
    Check the syntax of input files without executing them, useful for debugging scripts.

-q, --quiet
    Suppress the startup banner and other informative messages.

-l file, --load file
    Load an additional file at startup, similar to the Load() command inside yacas.

-p, --pretty-print
    Enable pretty-printing of output, if the terminal supports it.

DESCRIPTION

yacas (Yet Another Computer Algebra System) is a free, general-purpose computer algebra system. It is designed to perform symbolic manipulation of mathematical expressions, arbitrary-precision arithmetic, and offers a powerful, extensible programming language. Users can interact with yacas through an interactive shell, or execute commands from scripts. Its core philosophy emphasizes a lightweight design, making it suitable for integration into other applications and for various computing environments. yacas supports a wide range of mathematical operations including calculus (differentiation, integration), solving equations, series expansions, matrix algebra, and number theory, making it a versatile tool for research, education, and scientific computing.

CAVEATS

yacas is primarily a command-line tool, lacking a graphical user interface which might be preferred by some users. Its custom programming language requires a learning investment. While powerful, for extremely large-scale or computationally intensive symbolic tasks, specialized commercial software might offer better performance and broader functionality.

USAGE EXAMPLES

To start an interactive yacas session:
yacas

To execute a yacas script file (e.g., my_script.ys):
yacas my_script.ys

To execute a single expression from the command line:
yacas -e "Simplify(Sin(x)^2 + Cos(x)^2)"

INTERNAL PROGRAMMING LANGUAGE

yacas features its own powerful, Lisp-like programming language. This allows users to extend its functionality, define new functions, and write complex algorithms directly within the system. The language supports pattern matching, rule-based rewriting, and various control structures, making it highly flexible for symbolic manipulation and custom mathematical problem-solving.

HISTORY

yacas was initially developed by Ayal Pinkus around 1999, with the goal of creating a lightweight, extensible, and free computer algebra system. Its design emphasizes a small core, an intuitive syntax, and a powerful, Lisp-like programming language for extensibility. Over the years, it has been maintained and improved by a community of developers, expanding its mathematical capabilities and refining its programming environment. Its open-source nature and portability have contributed to its widespread availability in various Linux distributions and other operating systems.

SEE ALSO

maxima(1), octave(1), bc(1)

Copied to clipboard