Post Reply 
PSLQ
11-29-2017, 08:42 PM
Post: #2
RE: PSLQ
Code for identifying \( x = \sqrt{a} + \sqrt{b} \):

Code:

EXPORT SSQR(x)
BEGIN
  local a:=PSLQ({x^4,x^3,x^2,x,1});
  local r:=sqrt(abs(a(5)));

  if (a(2) OR a(4)) then return(x); end;
  if abs(a(1))<>1 then return(x); end;
  if a(1)<0 then a:=-a; end;
  if a(5)<0 then return(x); end;
  if IP(r)<>r then return(x); end;
  if a(3) MOD 2 then return(x); end;
  a:=-a(3)/2;
  if a<r then
    local t:=r;
    r:=a; a:=t;
  end;

  return(expr("'sqrt(" + (a-r)/2 + ")+sqrt(" + (a+r)/2 + ")'"));

END;

Requires PSLQ above. Example:

Code:
X:=SQRT(3)+SQRT(5);
SSQR(X);

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
PSLQ - Han - 11-29-2017, 08:12 PM
RE: PSLQ - Han - 11-29-2017 08:42 PM
RE: PSLQ - Han - 11-29-2017, 08:52 PM
RE: PSLQ - salvomic - 11-29-2017, 09:28 PM
RE: PSLQ - Han - 11-29-2017, 09:33 PM
RE: PSLQ - salvomic - 11-29-2017, 09:35 PM
RE: PSLQ - salvomic - 11-29-2017, 08:58 PM
RE: PSLQ - AlexFekken - 11-30-2017, 02:16 AM
RE: PSLQ - Han - 11-30-2017, 03:14 AM
RE: PSLQ - AlexFekken - 11-30-2017, 03:56 AM
RE: PSLQ - BruceH - 11-30-2017, 11:10 PM
RE: PSLQ - AlexFekken - 12-02-2017, 11:55 PM
RE: PSLQ - ggauny@live.fr - 11-30-2017, 11:05 AM
RE: PSLQ - Han - 11-30-2017, 12:19 PM
RE: PSLQ - ggauny@live.fr - 11-30-2017, 12:29 PM



User(s) browsing this thread: 1 Guest(s)