File: IUPTSII.c

package info (click to toggle)
qepcad 1.74%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,848 kB
  • sloc: ansic: 27,242; cpp: 2,995; makefile: 1,287; perl: 91
file content (34 lines) | stat: -rw-r--r-- 882 bytes parent folder | download | duplicates (2)
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
31
32
33
34
/*======================================================================
                      t <- IUPTSII(A,I)

Integral univariate polynomial trend in standard isolating interval.

Inputs
  A : a squarefree primitive integral polynomial
  I : an open or one-point standard interval isolating a root of A.

Outputs
  t : the trend of A in I, i.e. the sign of A' at the root of A in I.
======================================================================*/
#include "sac_ext.h"

Word IUPTSII(Word A, Word I)
{
       Word i1,i2,Ap,t;
  
Step1: /* One-point interval. */
       FIRST2(I,&i1,&i2);
       if (LBRNCOMP(i1,i2) == 0) {
	 Ap = IPDER(1,A,1);
	 t = IUPBRES(Ap,i2);
       goto Return; }

Step2: /* Open interval. */
       t = IUPBRES(A,i2);
       if (t == 0) {
	 Ap = IPDER(1,A,1);
	 t = -IUPBRES(Ap,i2); }
       
Return: /* Prepare to return. */
       return t; 
}