File: seconddegre

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (47 lines) | stat: -rw-r--r-- 1,251 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
35
36
37
38
39
40
41
42
43
44
45
46
47
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!! Generation of the trinomial function !!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!set gl_rand1 =!randint 0,1
!set gl_rand2=!randint 1,9

!set gl_a =$[(-1)^$gl_rand1 * $gl_rand2]
!set gl_b =!randint -9,9
!set gl_c =!randint -9,9
!set gl_expr =!exec pari $gl_a*x^2+$gl_b*x+$gl_c

!!!!!!!!!!!!!!!!!!!!!!
!!!! Discriminant !!!!
!!!!!!!!!!!!!!!!!!!!!!
!set gl_delta =!exec pari $[($gl_b)^2-4*$gl_a*$gl_c]
!if $gl_a>0
  !set gl_itema=!texmath $gl_a
!else
  !set gl_itema= ($gl_a)
!endif
!if $gl_b>=0
  !set gl_itemb=!texmath $gl_b
!else
  !set gl_itemb=($gl_b)
!endif
!if $gl_c>=0
  !set gl_itemc=!texmath $gl_c
!else
  !set gl_itemc=($gl_c)
!endif

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!! Generation of non trinomial function !!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!set gl_d=!randint -9,9

!set gl_choix=!randint 1,3
!set gl_expr1 =!exec pari $gl_a*x+$gl_b
!set gl_expr2 =!exec pari $gl_a*x^3+$gl_b*x^2+$gl_c*x+$gl_d
!set gl_expr3 =$gl_a/x+$gl_b*x+$gl_c

!!!!!!!!!!!!!!!!!!!!!!!!
!!!! Canonical form !!!!
!!!!!!!!!!!!!!!!!!!!!!!!
!set gl_coef1=!exec pari $gl_b/(2*$gl_a)
!set gl_coef2=!exec pari -1*$gl_delta/(4*($gl_a)^2)
!set gl_coef3=!exec pari -1*$gl_delta/(4*$gl_a)