Previous Page Contents

misc::pslq -- heuristic detection of relations between real numbers

Introduction

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 a1*k1 + ... + an*kn is less than 10^(-precision), or FAIL if such integers could not be detected.

Call(s)

misc::pslq(numberlist, precision)

Parameters

numberlist - list of real numbers or objects that can be converted to real numbers by the function float.
precision - positive integer

Returns

list of integers, or FAIL

Side Effects

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.

Details

Example 1

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

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

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)
   
                            +-               -+
                            | 1, 0, -1, 0, -1 |
                            +-               -+

Background




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000