This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Heuristic detection of relations between real numbers

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.


misc::pslq(numberlist, precision)


misc::pslq(numberlist, precision) returns a list of integers [k1, ..., kn] such that — denoting the elements of numberlist by a1, ..., an — the absolute value of is less than times the Euclidean norm of numberlist, or FAIL if such integers could not be detected.

This method can be used to get an idea about linear dependencies, before proving them.

Environment Interactions

misc::pslq is not affected by the current value of DIGITS. Numerical computations are carried out with more significant digits such that the output meets the specification given above.


Example 1

Does π satisfy a polynomial equation of degree at most 2 ?

misc::pslq([1, PI, PI^2], 20)

Example 2

Having forgotten the relation between sine and cosine, we can try the heuristic way.

misc::pslq([1, sin(0.32), sin(0.32)^2, cos(0.32), cos(0.32)^2], 10)



List of real numbers or objects that can be converted to real numbers by the function float.


Positive integer

Return Values

List of integers, or FAIL


This function has been written by Raymond Manzoni.

The algorithm has been taken from Bailey and Plouffe, Recognizing numerical constants. See also Helaman R.P. Ferguson and David Bailey, A Polynomial Time, Numerically Stable Integer Relation Algorithm, RNR Technical Report RNR-92-032.

Was this topic helpful?