RIES(1) | General Commands Manual | RIES(1) |
ries - find algebraic equations, given their solution
ries [-ln] [-i[e]] [-s] [-x] [-Fn] [-Ssss] [-Nsss] [-Osss] [-Dxxx] [-pfilename] [--extended-options [...]] value
ries --find-expression [expression [...]]
ries --eval-expression [expression [...]]
Given a number, ries searches for algebraic equations in one variable that have a solution (root) near that number. It avoids trivial or reducible solutions like ``x/x = 1''. If value is an integer, ries can find an exact solution expressed in terms of single-digit integers.
For example, if you supply the value 2.5063, the first part of ries's output will resemble the following:
$ 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}
x^2+e = 9 for x = T + 3.56063e-05 {63}
ln(6) x = sqrt(pi)+e for x = T + 2.73037e-05 {93}
x/4+1 = 4,/7 for x = T + 6.24679e-06 {91}
sinpi(ln(x))^2 = 1/(5 pi) for x = T + 2.75665e-06 {92}
The output gives progressively ``more complex'' solutions (as described below) that come progressively closer to matching your number. There are four columns: equations in symbolic form (two columns of expressions with '=' in the middle), solution of equation (value of x expressed as T plus a small error term), and total complexity score (described below).
Each match is checked by solving for x using the Newton-Raphson method, and the closeness of the match is judged by the difference between the root (the value of x for which the two sides are equal) and your target value T.
Options allow complete control over what symbols, constants and functions are used in solutions, or to limit solutions to integer, rational, constuctible, or algebraic values.
Options must be separate: `ries -l1 -i -Ox 27', not `ries -l1iOx 27'.
memory equations tested digits run time
-l0 1.2M 89,400,000 6+ 0.025 sec
-l1 4.0M 932,000,000 7+ 0.08 sec
-l2 14 M 11,400,000,000 8+ 0.33 sec
-l3 45 M 134,000,000,000 9+ 1.8 sec
-l4 158M 1,600,000,000,000 11+ 8.8 sec
-l5 490M 15,000,000,000,000 12+ 37.1 sec
-l6 1.7G 184,000,000,000,000 13+ 190 sec
(these times are a little quicker than a 2.33-GHz Core 2 Duo; on a 733-MHz Pentium 3, the times were about 5 times longer. If compiled for an environment with 32-bit pointers, memory usage figures are about 20% lower. ries also works on much older and smaller systems, and can test billions of equations in less than a minute on 1990's hardware)
Use a fractional argument (like -l5.5) for more precise control of how much memory ries will use before stopping its search. When free memory is exhausted; performance will degrade significantly and ries might exit, depending on your operating system. Under Linux and Mac OS, ries keeps running but the system slows to a crawl. If you don't know what your OS will do, be careful before running ries with higher levels. In extreme cases your computer's response might slow down so much that you are unable to save your work in other applications.
The memory limits are not reached nearly as quickly when the symbolset is greatly limited with -S, -O and -N or when -i is specified. -i in particular should allow about two more levels in any given amount of memory. Large arguments tend to lengthen runtime: for example, ries -l4 1058073667 takes about three times as long as ries -l4 1.058073667.
Several options are used to choose which symbols (constants, operations, and functions) ries is allowed to use when searching for equations.
There are lots of potential uses for -N. For example, if you invoke ries on a small irrational number, you might get several solutions that involve the unary and binary logarithm operators 'ln' (natural logarithm) and 'log_' (log to base A of B). If you decide you aren't interested in such solutions you can just add -NlL to your command line, and all such solutions will be skipped.
If you are checking an unknown number that you found in the context of some larger problem, you probably have some idea what constants and operators may be involved, or not involved, in the phenomenon that produced your number. Use -N to rule out functions you don't think are relevant.
Note that ries will often run considerably slower when you limit it to a very small set of symbols, mainly because it cannot use its optimization rules (described below under ALGORITHM). Also, with fewer symbols the average length of expressions is longer, and that makes the search slower.
-S can be used to solve those old problems of the sort ``How can the number 27 be expressed using only the four basic operators and the digit 4?'' The answer is given by:
ries '-S4+-*/' 27 -Ox
(The -Ox option is described next). To solve the same problem using the -N option, you'd have to type:
ries -Npef12356789rsqlL^v 27 -Ox
If you give the -S option with no symbols, ries will display a table of all available symbols (as modified by any -E, -N, -O and -S options) with their definition and weights. This lone -S can be given along with a normal -S option, but in any case ries will exit after showing the table.
One additional symbol is available with -O:
Thus, you can use -Ox to limit ries's output to equations that have only one 'x' in them and are therefore easy to solve for x using only the most basic algebra techniques. This also makes ries's output more like that of traditional expression-finders, which search for expressions equal to x rather than equations in x. Here's an example: ries -i 16 gives the answer ``x^2 - x = 3^5'' with x very close to 16, because 16^2-16 is close to 3^5. ries -i 16 -Ox replaces that answer with ``5 x^2 = 6^4''.
Several options are used to choose what types of expression can be used in the equations that are presented as solutions.
Format 0: Compressed FORTH-like postfix format: Each operator and constant is just a single symbol. The symbols are as listed above under the -N option.
x1- = 2r for x = T - 0.00659165 {50}
xlr = 6q for x = T - 0.00241106 {62}
x4^ = p2+ for x = T - 0.000766951 {68}
x1+s = p2* for x = T + 3.66236e-05 {69}
Format 1: Infix format, but with single-letter symbols. If this format is specified, a table of symbols will be printed after the main table of results. The rest of the expression syntax is the same as the normal format. For example, ``q(l(x)) = p-1'' means ``sqrt(ln(x)) = pi - 1''.
x-1 = 1/2 for x = T - 0.00659165 {50}
1/l(x) = q(6) for x = T - 0.00241106 {62}
x^4 = 2+p for x = T - 0.000766951 {68}
(x+1)^2 = 2.p for x = T + 3.66236e-05 {69}
Format 2: Standard infix expression format (this is the default).
x-1 = 1/2 for x = T - 0.00659165 {50}
1/ln(x) = sqrt(6) for x = T - 0.00241106 {62}
x^4 = 2+pi for x = T - 0.000766951 {68}
(x+1)^2 = 2 pi for x = T + 3.66236e-05 {69}
Format 3: Print solutions in postfix format, similar to that used in FORTH and on certain old pocket calculators. This is close to the format used internally by ries (to get the exact, condensed format, use -F0). This is intended mainly for use by scripts that use ries as an engine to generate equations and then perform further manipulation on them. However, this option will also help you distinguish what symbols were actually used internally to generate an answer. For example, 'squared' and 'to the power of 2' both show up as '^2' in the normal output, but in postfix they appear as "dup*" and "2 **" respectively.
x 1 - = 2 recip for x = T - 0.00659165 {50}
x ln recip = 6 sqrt for x = T - 0.00241106 {62}
x 4 ** = pi 2 + for x = T - 0.000766951 {68}
x 1 + dup* = pi 2 * for x = T + 3.66236e-05 {69}
Most of the symbols used by -F3 are self-explanatory. The nonobvious ones are: neg for negate, recip for reciprocal, dup* for square, sqrt for square root, ** for power (A^B), root for Bth root of A, logn for logarithm (to base B) of A. For these last three, A is the first operand pushed on the stack and B is the second.
The setting of -F does not affect expressions displayed
by the various -D diagnostic options (most of these use
-F0, and -Ds (``show your work'') uses -F2).
You may use the --symbol-names option (described below) to
redefine the appearance of formats 2 and 3.
Of these, -Ds is probably the most useful and fun to look at. -Dy gives a nice top-level view of the statistics of the search. Most of the options that generate lots of output are useful if filtered through grep; this can tell you why a certain subexpression is or is not appearing in results. -DG and -Dg can be useful if you want to use ries to generate a massive list of expressions for processing by another program; for this reason its output uses infix notation. Most other -D options print subexpressions in the -F0 terse postfix format.
Longer names are used for options that are thought to be less commonly wanted, or are more likely to be used only within --include files.
# hst.ries: High School Trigonometry settings
--trig-argument-scale 1.74532925199433e-2 # pi/180
-NLleEv # No log, ln, e, e^x or arbitrary roots
-Ox # Only allow one 'x' on the left-hand-side
-x # Show equation roots as "x = 123.456"
# rather than "x = T + 1.23e-4"
then giving the option ``-phst'' is equivalent to
giving the options ``--trig-argument-scale 1.74532925199433e-2
-NLleEv -Ox -x'', in that order.
A parameter file may additionally invoke another parameter file with the
--include option. When it encounters this option, ries
will apply the options in the included file, then continue with the rest
of the first file. These may be nested up to 25 levels deep. If a file
includes itself recursively (either directly or indirectly) ries
will exit with an error.
It is an error for --include or the end of an included file to
come between an option and its arguments. For example, ``ries 1.2345
--eval-expression --include expressions.txt'' will produce an error
regardless of the contents of ``expressions.txt'', because
--eval-expression must be followed immediately by its
argument(s). On the other hand, if ``expressions.txt'' contains the
--eval-expression option, like so:
# expressions.txt: Useful functions of one argument
--eval-expression
xsr # 1/(x^2)
1xq-r # 1/(1-sqrt(x))
2xl1+^ # 2^(ln(x)+1)
then the command ``ries 1.2345 --include expressions.txt''
works, and shows the values of the three expressions where x is
1.2345.
If you have a file called ``.ries_profile'' or ``ries_profile.txt'' in
your home directory, ries will load it as if you specified it
with a --include at the very beginning of the parameters. If you
have such a file and wish to prevent it from being used, give a bare
-p (without a filename) at the very beginning of your ries
options. If you wish to give some parameters and have .ries_profile
loaded after your parameters, include -p again at the
point where you want ries to use the profile. For example, if
your .ries_profile contains ``--trig-argument-scale 1'' and you
have a hst.ries with contents as shown above, then giving the optiions
``-phst -p'' will use all of the settings in hst.ries
except the --trig-argument-scale.
Two more example profiles are the ``Latin'' and ``Mathematica'' settings
files linked from the top of the main RIES webpage.
In these descriptions, the words when possible refer to
the fact that --canon-reduction will respect any limits imposed
by the symbolset options -N, -O and -S. So if you
use the option -On together with --canon-reduction n, the
negation operator will still be used only once per expression.
Although it makes ries more efficient, this option also causes the
printed results to have greater complexity scores, and complexity scores
will increase somewhat more erratically. ries will try to
simplify its printed results by undoing --canon-reduction
transformations on both sides of the equal sign. For example, ries
2.50618 --canon-reduction nr25 might yield the result
``x^x/2 = (1+9)/2'', which simplifies to
``x^x = 1+9''. But when only one side has a ``/2'',
ries cannot fix it, so the same example gives an overly complex
``1/(pi-x) = pi/2''.
expression value d/dx(expr.) ratio
x^2 152399025 24690 1.62e-4
x 12345 1.0 8.1e-5
sqrt(x) 111.108 0.0045 4.05e-5
Indeed, the results of ries 12345 include the equation ``2(sqrt(x)-9) = (2 e)^pi'', but with the option --derivative-margin 8e-5 that answer is left out.
x-3 = 1/6 for x = 3.16666666666667
x-3 = 1/7 for x = 3.14285714285714
ln(ln(x)) = 1/e^2 for x = 3.14219183392327
x^2+1 = 4 e for x = 3.14215329254258
e^x+2 = 8 pi for x = 3.14124898321672
x/phi^2 = 1/5+1 for x = 3.14164078649987
e^x-pi = 4*5 for x = 3.14163154625921
e^(x^2)+1 = e^(pi^2) for x = 3.14158442136535
pi-x = 1/e^(4^2) for x = 3.14159254105462
sqrt(1+pi) x = e^3/pi for x = 3.14159272240341
x^2/e^3 = 1/sqrt(1+pi) for x = 3.1415926879966
9(x-pi) = 1/-(e^(4^2)) for x = 3.14159264108588
Among these results (after solving for x) are the
ancient approximations 19/6 and 22/7, and the more modern curiosity
e^pi = 20 + pi (which is called ``Gelfond's
constant''). Other interesting results can be found by omitting
symbols with -N or by using restricted classes. For example
ries 3.1415926 -NSCTlLfEevp --min-match-distance 1e-8 (excluding
most of the scientific functions) gives the fraction approximation
355/113 in the form ``1/(x-3)-1 = 1/4^2+6''; and ries
3.1415926 -r --min-match-distance 1e-8 (requesting only rational
approximations) gives 355/113 in the form ``1/(x-3)-3 =
1/(4*4)+4''.
You will often get multiple equivalent results. In the above example, the
equations sqrt(1+pi) x = e^3/pi and x^2/e^3
= 1/sqrt(1+pi) can both be converted into the approximate
relation:
(which does not converge on the true value of pi
if iterated).
If you give a value of 0: ``--min-match-distance 0'', and ries
finds an ``exact'' match, it will exit and report no further results.
Note that this is different from --max-match-distance 0, which
will only print the ``exact'' match and will not print any inexact
matches.
There is also a --max-match-distance option (described above),
which serves an entirely different purpose.
ries 17 -ie --numeric-anagram 4444
x = 4*4+4/4 ('exact' match) {92}
ries 17 -ie --numeric-anagram 111223
x = 2^(1+3)+1 ('exact' match) {77}
ries 12 --numeric-anagram 44s
x = 4^2-4
ries 12 --numeric-anagram 442
x = 2*4+4
--numeric-anagram can be used to set hard limits on the digits, the constants e, phi, and pi, and the ``squared'' and ``reciprocal'' symbols. When you use --numeric-anagram, any of these symbols that you do not list will be forbidden just as if you had used the -N option. The last two examples here show the use of ``s'' to specify the squaring operation x^2 as distinguished from any use of ``2''.
ries -l0 2.5063
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}
x^2+e = 9 for x = T + 3.56063e-05 {63}
ln(6) x = sqrt(pi)+e for x = T + 2.73037e-05 {93}
ries -l0 2.5063 --symbol-names ':^:**' ':(:[' ':):]'
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}
x**2+e = 9 for x = T + 3.56063e-05 {63}
ln[6] x = sqrt[pi]+e for x = T + 2.73037e-05 {93}
More examples of the use of --symbol-names are found in the ``Latin'' and ``Mathematica'' settings files linked from the top of the main RIES webpage.
ries -l0 2.5063
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}
x^2+e = 9 for x = T + 3.56063e-05 {63}
ries -l0 2.5063 --symbol-weights 5:x 25:2 15:s
x sqrt(x) = 4 for x = T + 0.0135421 {39}
-x-x = -5 for x = T - 0.0063 {46}
x/x^x = 1/4 for x = T + 0.00150933 {49}
x x^x = 5^2 for x = T - 0.00118185 {57}
x^x = 1+9 for x = T - 0.000115854 {49}
x (1/x-x) = e-8 for x = T + 3.56063e-05 {71}
With the smaller weight of 5, x is considered ``less
expensive'', and ries uses x more often in its answers;
and with the number 2 and squaring more expensive, these show up
less often in the results. In many cases the new results are equivalent,
and ries has simply found a different way to get there.
Since the arguments of --symbol-weights start with a digit, your
target value will be treated as a symbol-weight specifier unless you
place it somewhere else in the parameter list (as shown in the example),
or use a single dash ``-'' to signal the end of the parameters.
NOTE: Changing the symbol weights can greatly reduce ries's
efficiency, causing it to run for a very long time and giving little or
no output. If this happens, it usually can be fixed by using weights
closer to the default values. You can also experiment with changing just
one symbol-weight at a time to find which is causing the problem.
If you use this option, ries will call the functions sin, cos and tan in its output, and the scale will be displayed after the function definitions at the end.
ries provides some functions that supplement its main purpose. Commands and their parameters must be separate: `ries 1.23 --trig-argument-scale 0.5', not `ries 1.23 --trig-argument-scale 0.5'. Because the parameters are given separately, your target value might be interpreted as a parameter if you give it right after a special command. To avoid this, use a single dash ``-'' to signal the end of the parameters.
The ries source code includes an auxiliary file, msal_math64.c, which can be downloaded from the same place as the main RIES source code and this manual. It provides some of the standard trignonmetric functions, whose implementation have been found to vary across different releases of the standard libm. This is useful if you are running ries on a variety of newer or older systems and want to be able to rely on consistent results.
msal_math64.c also provides the Lambert W function, defined to the symbol 'W'.
To use msal_math64.c, compile ries in the normal way but with the additional compiler option -DRIES_USE_SA_M64. The resulting ries binary will report ``mathlib: stand-alone'' when given the --version option.
Once ries has been compiled with the stand-alone maths library, the Lambert W function is available by giving the option -EW on the ries command-line. Its default weight is set to make it occur a little more often than the two-argument exponential and root functions; use the --symbol-weights option if you want to change this.
ries begins its search with small, simple equations and proceeds to longer, more complex ones. It uses a set of complexity rules to compute a measure (similar to Kolmogorov complexity), which determines the order in which various candidate expressions are considered by ries. For example:
x + 1 = 3 is more complex than x = 3
x + 1 = ln(3) is more complex than x + 1 = 3
x - 7 = 4^2 is more complex than x - 7 = 4
x + 1 = 5 is more complex than x + 1 = 3
x^3 + 1 = 3 is more complex than x^2 + 1 = 3
x ^ 5 = 3 is more complex than x + 5 = 3
As ries searches it finds solutions -- these are equations for which x is close to being an exact answer. Each time it finds a solution it prints it out. Then ries raises its standard for the next answer: The next answer ries prints must be a closer match to your supplied value than all the answers it has given so far. (The only exception to this rule is an 'exact' match, one for which both sides match to within the limits of numerical precision. ries will print at most one of these, and will then continue to print more inexact solutions. Sometimes the approximations are of greater interest than the exact match.)
Instead of trying complete equations, ries actually constructs half-equations, called left-hand-side expressions and right-hand-side expressions, abbreviated LHS's and RHS's. It keeps a list of LHS's and a list of RHS's, and it keeps these lists in numerical order at all times. This enables ries to find matches much faster. All LHS's contain x and all RHS's do not. Thus, 1000 LHS's and 1000 RHS's make a total of 1000000 possible equations, and all 1000000 combinations can be quickly checked just by scanning through the two lists in numerical order. This is why ries is able to check billions of equations in such a short time.
The closeness of an LHS match depends on the value of x, and also on the derivative with respect to x of the LHS expression. Because of this, ries calculates derivatives of LHS's as well as their values.
There are dozens of optimization rules ries uses, like the following:
There are over 50 rules like this, and together they make the search about 10 times faster. However, if the symbol set is limited via -N, -O or -S, some of these rules cannot be used. For each optimization rule there are one or more symbolset exclude rules like the following:
In order to maintain maximum efficiency, ries checks each rule individually against the symbolset, and uses as many rules as it can. You can see this process in action by trying a command like ries 1.4142135, which gives the answer ``x^2 = 2''. If you disable the 's' (squared) and '^' (power) symbols with ries 1.4142135 -Ns^, rule b^ goes away, and the answer becomes ``x x = 2''. If you also disable '*' (multiplication) the answer becomes ``x = sqrt(2)''. Disable 'q' (square root) and you get ``log_2(x) = 1/2'' (the logarithm to base 2 of x is 1/2). Disable 'L' and it becomes ``x = 2,/2'' (square root of 2, this time using the generalized root function). Disable 'v' and you get ``x/(1/x) = 2''. Disabling '/', we get a trignometric identity involving pi/4; disabling the trig functions as well, the command becomes ries 1.4142135 '-Ns^q*Lv/SCT' and we finally get an answer that most people probably would not guess: x-1/(x+1) = 1 (note that the '/' in this answer is actually part of '1/', which is the reciprocal operator 'r'). Throughout this progression the complexity score of the equation increases as the solution becomes more and more obscure, and simpler but poorly matching ``solutions'' like 1/cos(x) = 6 begin to appear.
Sometimes a more complex equation will be given before the (simpler) equation that you expect. For example, tan(sqrt(2)) = sin(sqrt(2))/cos(sqrt(2)) is 6.334119167042..., so you might expect the command ries 6.334119167042 --trig-argument-scale 1 -NT to report something like ``cos(sqrt(2)) x = sin(sqrt(2))''. Instead, ries gives ``sqrt(x^2+1) = 1/cos(sqrt(2))'', which is equivalent by trigonometric identity, because it considers this equation to be ``more balanced'' (complexity score 45+38) than the other (which has a score of 48+29). Please read the preceding section ``ALGORITHM'' for more details.
Adding or changing the symbolset with the -S, -O and
-N options often causes unexpected changes in the output. For
example, ries 2.2772 yields the solution ``1/(x-2) = 2+phi''
but ries 2.2772 '-N*/T' does not give this solution in any form. This seems
counterintuitive: there was no *, /, or tan() in the ``1/(x-2) =
2+phi'' solution, so why did ries decide not to report it?
In fact, the solution is still generated internally, but because you have
told it to exclude some operators, ries has to try other, more exotic
expressions sooner than it otherwise would. As it happens, the next solution
``x+1/e = sqrt(7)'' (which matches the target value 2.2772 more
closely than ``1/(x-2) = 2+phi'') ends up getting found
earlier.
The mysterious behavior results from the fact that ries always tries
to keep the number of LHS and RHS expressions equal as it performs its
search. Eliminating operators with the -N option means that more
complex expressions must be generated to reach the ``quota''. In this
particular case, the symbolset restriction has a greater effect on the LHS
than on the RHS, so as the search is progressing, LHS complexity grows a
little more quickly than RHS complexity. The complexity of
``1/(x-2)'' is 40, while the complexity of ``x+1/e'' is only a
little more complex at 42. But the right-hand-side ``sqrt(7)'' is considered
less complex (27) than ``2+phi'' (35). Since both pieces of an
equation need to be found before an equation can be reported, ries is
able to locate both pieces of ``x+1/e = sqrt(7)'' sooner when the -N
option is given.
This is all made plain with the --find-expression option, giving the
expressions ``1/(x-2)'', ``2+phi'', ``x+1/e'' and
``sqrt(7)'' in postfix form, to reveal the order in which they are generated
by the search algorithm:
ries 2.2772 --find-expression x2-r f2+ xer+ 7q
[7q] = 2.64575131106459, complexity = {27}
[x2-r] = 3.60750360750361, d/dx = -13.0141, complexity = {40}
[f2+] = 3.61803398874989, complexity = {35}
[xer+] = 2.64507944117144, d/dx = 1, complexity = {42}
Then, repeating the same command with '-N*/T' shows that the [xer+] is generated before [f2+].
In the case of two equivalent solutions (like the 6.334119167042... example earlier in this section), both equations come equally close to the supplied value, but only one can be found first. Once the first one is reported, the other is not, because ries only reports solutions that are at least a 0.1% closer match than the previously-reported solution.
The -l option is meant to give control over the number of solutions searched, but it actually controls the number of LHS and RHS expressions generated. Because two RHS's often have the same value, and only one (the first) gets kept, the number of solutions checked (which is the RHS count times the LHS count) depends on how often you get two LHS's or RHS's with the same value. This happens particularly often when the symbol set is severely restricted. If ries tried to compensate for this, the result would be that severely limited symbolsets would take a very long time to run and would generate really long equations. This is an important issue for those using ries to solve special problems, like the ``four fours problem'' exemplified by the command ries --numeric-anagram 4444 -Ox 17. The current implementation represents the author's attempt at a reasonable tradeoff.
Performance does not degrade gracefully when the physical memory limit is hit, because expression nodes are allocated in sequential order in memory, without regard to where they will end up in the tree. This could be improved in the future with percentile demographics and a sort performed one time only, after the tree reaches a healthy (but not excessive) size.
Although it tries to avoid it, ries will often print more
than one equivalent solution. It misses the fact that the multiple solutions
are equivalent because of roundoff error. For example, ries '-S4+-*/' -Ox 17
gives ``x-4*4 = 4/4'' and ``(4/(4-4*4)) x+4 = (4*4+4)/(4-4*4)'' (or a
similar long form), only recognizing the first as an exact match (the more
complex one involves divisions by multiples of 3, which require rounding).
This problem is common when the target is already known very precisely by the
user. For example, ries 0.00088953230706449 gives the (correct) answer
``ln(x)/pi = -sqrt(5)'', followed by redundant/equivalent answers such as
``ln(x)/pi-2 = -(phi^3)'' (if ries was compiled with regular
precision) or ``sqrt(5),/x+4 = 1/e^pi+4'' (if compiled with the
-DRIES_WANT_LDBL option); but ries 0.000889532307 only gives the first,
simplest form of the answer.
Related to this, ries sometimes gives an overly-complex
answer, again because of roundoff error. For example, ries gets
slightly different values for ``2/3'' and ``1-1/3'', and stores both of
these in its database of RHS values. When reporting a solution in which both
sides of the equation equal 2/3, it might give ``1-1/3'' for the right-hand
side if it is closer to the (rounded) value of the left-hand side.
This is particularly common if you request an exact match with a zero or very
small --max-match-distance value, while giving an imprecise target
value. For example, ries 1.9739208802178 --max-match-distance 0 might give
``cospi(1/(5 x)^2) = cospi(1/pi^4)'' whereas ries 1.9739208802178715
--max-match-distance 0 gives the expected ``5 x = pi^2''. However, I've only
gotten complaints about this from users who give ries a problem to
which they already know an answer.
If you know that 1.9739208802178... is pi^2/5, then you don't really
need ries to tell you that, do you? And if you're searching for
things that approximate pi^2/5, such as sqrt(sqrt(e^2+1)+1) =
1.9739267..., you can use the --min-match-distance option.
In deeper searches or with target values larger than 10^5,
ries might occasionally report ``solutions'' that are actually
tautologies empty in meaning. A typical example is
``x^(4/ln(sqrt(x))) = sqrt(e)^(4^2)'' (which is true for any
value of x), but ries handles that case and most others like
it. If you suspect the solutions it gives, use the -Ds option to show
all calculations behind each proposed solution. The options
--derivative-margin, --min-match-distance, and
--significance-loss-margin may help avoid meaningless results.
You can also use -Ox to force ries to use only a single
x in each equation, which will prevent these tautologies entirely,
but will also prevent the discovery of interesting solutions like
x^x = 10.
ries (pronounced ``reese'' or ``reeze'') is an acronym for ``RILYBOT Inverse Equation Solver''. The expansion of RILYBOT includes two more acronyms whose combined length is greater than 11. The full expansion of ries grows without limit and is well-defined but not primitive-recursive. Contact the author for more information.
Robert P. Munafo (contact information on mrob.com)
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts.
ries itself is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
ries and this document are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
If you got ries.c from the website mrob.com, the GNU General Public License may be retrieved at mrob.com/ries/COPYING.txt and the GNU Free Documentation License may be found at mrob.com/ries/FDL-1.3.txt ; you may also find copies of both licenses at www.gnu.org/licenses/
Manual version: 2018 Aug 05 |