RIES  Find Algebraic Equations, Given Their Solution
Quick Links
Recent Changes
RIES Source Code (build instructions in header comment),
MSAL (optional Maths functions Standalone Library),
Windows Wrapper (with instructions);
and License: RIES License (GPL v3).
RIES profiles (settings files):
Latin,
Mathematica
Manual:
PDF,
PostScript,
Plain ASCII,
Source (nroff),
and License: FDL 1.3
RIES was featured on xkcd on Wed 2012.0425...
... which is ((^{7}√π+1/2 × π)^{2} × π)^{2}
Enter a number that you want to approximate:
Examples: 2.5062 1.855404429 6.022e+23
(Hint: RIES handles "1.2345678" more easily than "1234.5678")
Contents
Overview
RIES Profiles
Benchmarks
Searching for Solutions of a Restricted Class
RIES Background and Philosophy
Motivation and History
Algorithm
An Exact Answer is Unlikely
Optimizing the Bidirectional Search
Source Code
Approximating Multiple Unknowns
Detailed Examples of RestrictedClass Searches
Searching for Integer Solutions
Searching for Rational Solutions
Searching for "Constructible" Solutions
Searching for Algebraic Solutions
Variations of the a Option
Chow's "ClosedForm" or "ExponentialLogarithmic" Numbers
Liouvillian Numbers
Elementary Numbers
Stupid Math Tricks
"Classical" Approximations
Mystical PreDestiny
Four Fours
Secret Code
Area 51
A Visit by Dr. Matrix
Semiserious Math Tricks
Formal Hypothesis
Wild Guessing
Successive Refinement
Forgotten Identities
The Broken Calculator
Enlightened Discovery
Debugging
Kolmogorov Complexity
Some Examples for Pi Day 2013
Some Examples for Pi Day 2015
Details and Surprises
A Detailed Example of the RIES Algorithm
Effects of Changing the Symbol Set
Links
See Also
Overview
ries (or RIES, an acronym for RILYBOT Inverse Equation Solver) takes any number and produces a list of equations that approximately solve to that number, like the following example:
bash# ries 2.5063 Your target value: T = 2.5063 mrob.com/ries 2 x = 5 for x = T  0.0063 {49} 8 x = e^3 for x = T + 0.00439212 {66} x^2 = 2 pi for x = T + 0.000328275 {55} x^x = 1+9 for x = T  0.000115854 {69} (x1)^2 = tanpi(1/e) for x = T + 0.000108368 {75} x^2+e = 9 for x = T + 3.56063e05 {63} ln(6) x = sqrt(pi)+e for x = T + 2.73037e05 {93} x/4+1 = 4"/7 for x = T + 6.24679e06 {91} ln(sqrt(x)1) = (phi/3) for x = T + 1.4647e06 {97} 1/(1ln(x)) = (1/e+pi)^2 for x = T  3.89197e07 {106} x+e"/4 = 7sqrt(8) for x = T  3.26098e07 {109} x+pi/8 = 8 cospi(phi) for x = T + 3.89451e08 {111} 1/(2x)+1 = cospi(7"/phi) for x = T + 6.16902e09 {116} x+1/e^(1/x) = 5^(e2) for x = T  2.25977e09 {118} x sqrt(phi x) = 2(pi1/phi) for x = T  1.71971e09 {126} (for more results, use the option 'l3') e = base of natural logarithms, 2.71828... cospi(X) = cos(pi * x) ln(x) = natural logarithm or log base e tanpi(X) = tan(pi * x) phi = the golden ratio, (1+sqrt(5))/2 sqrt(x) = square root A"/B = Ath root of B pi = 3.14159... LHS RHS Total max complexity: 67 61 128 deadends: 2848836 4250702 7099538 CPU time: 0.296 expressions: 228357 318227 546584 distinct: 111700 89860 201560 Memory: 12608KiB Total equations tested: 10037362000 (1.004e+10)Notice the answers are ordered by increasing closeness to the given number. It should also be apparent that the simplest equations tend to come first and the more complex ones later on. ries follows the example of continued fractions — as you go to longer equations, you get a closer approximaion to your number, and each approximation is the closest approximation that is available with an equation of that "complexity".
ries is highly customizable. You can have it omit functions and symbols (like the sine and cosine functions, or the symbol for phi, the Golden Ratio) if you don't want it to use them in solutions. You can give it an integer and specify that it limit its search to calculations that come out to be exact integers, and it will figure out the shortest way to construct your number from the digits 1 through 9. If you want easily inverted solutions you can specify that there be only one x on the lefthand side, omitting things like "xsin(x)". ries can find the simplest way to (for example) express the value 27 using only the digit 4 and the four basic operators plus, minus, times and divide.
ries Profiles
It is common to want to use several ries options together, and to use the same options in many different commands. To facilitate this, ries supports the use of "profiles" specified by the p option. A profile is a text file containing one or more ries commandline options, with whatever spacing you desire and optional comments delimited by the '#' character. Here is an example:
# old.ries Profile for all the old RIES behaviour trigargumentscale 1 # Radians NT # old RIES had no tangent function l1 # The default searchlevel was l1 significancelossmargin 15 # There were no sigloss checksIf this file is in the current directory, adding the option pold.ries (or include old.ries) will give nearly the same results as a pre2012 version of ries.
Note that you can override options in a profile: the command ries 1.2345 pold.ries l2 overrides the l1 option in old.ries by giving the option l2.
Searching for Solutions of a Restricted Class
ries makes it easy to limit your search to certain welldefined types of numbers, expressions, and equations. Two popular examples are rational numbers and algebraic numbers. This table summarizes the options; at the top of each column is a link to a section with details on how ries handles that specific type of number; a Y indicates that numbers in this row are found by ries using the option at the top of the column:

For more on how to use ries for each of these types of problems,
select the links: integral, rational,
constructible, algebraic,
Chow's
"closedform", Liouville, and
elementary.
. . . Forward to page 2 . . . Last page (page 6)
Contents: ries overview Benchmarks History Stupid Math Tricks Semiserious Math Tricks Links and miscellaneous
This page was written in the "embarrassingly readable" markup language RHTF, and some sections were last updated on 2016 Apr 22. s.11