File: diophant.cat

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (30 lines) | stat: -rw-r--r-- 616 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

diophant(8)                    Scilab Function                    diophant(8)
NAME
  diophant - diophantine (Bezout) equation

CALLING SEQUENCE
  [x,err]=diophant(p1p2,b)

PARAMETERS

  p1p2      : polynomial vector p1p2 = [p1 p2]

  b         : polynomial

  x         : polynomial vector [x1;x2]

DESCRIPTION
   diophant solves the bezout equation:

  p1*x1+p2*x2=b with  p1p2 a polynomial vector.  If the equation is not solv-
  able

  err=||p1*x1+p2*x2-b||/||b||
  else err=0

EXAMPLE
  s=poly(0,'s');p1=(s+3)^2;p2=(1+s);
  x1=s;x2=(2+s);
  [x,err]=diophant([p1,p2],p1*x1+p2*x2);
  p1*x1+p2*x2-p1*x(1)-p2*x(2)