Sage AMath Sudent Seminar Talk 20120112

134 days ago by WilliamStein

 
       
 
       


Sage:  Creating a Viable Open Source Alternative to
Magma, Maple, Matlab, and Mathematica

University of Washington, January 12, 2012

William Stein (Professor of Mathematics, University of Washington)







Testing, testing, ...

 

1 + 2 + 3 
       
6
6
 
       
 
       
 
       
 
       
 
       
 
       
 
       



Prelude

  • Which do you use more?   Wikipedia or Encyclopædia Britannica?  

  • Which are you more likely to contribute to?

  • The English Wikipedia alone has over 1 billion words, which is over 25 times as many as Encyclopædia Britannica.

 

 

 
       
 
       
 
       
 
       
 
       
 
       
 
       

 

Sage Project Mission Statement

"Create A Viable Free Open Source Alternative to Magma, Maple, Mathematica, and Matlab"

  • Mathematical features: Of Magma, Maple, Mathematica, and Matlab, with comparable speed

  • Graphics: 2d and 3d

  • Notebook: Interactive graphical user interface

  • Documentation: Books, papers, curriculum, etc.

 

Sage is not a drop-in replacement: does not run programs written in the custom languages of the Ma's.

Sage is not like Octave (versus Matlab).  

Sage's culture, architecture, programming language, and feel are different than the Ma's. 

 
       
 
       
 
       
 
       
 
       
 
       

Why not Magma, Maple, Matlab, Mathematica?

  1. Commercial: Expensive for my collaborators and students.  Not community owned.

  2. Closed: Implementation of algorithms often secret

  3. Frustrating: Tight control of development

  4. Copy protection: Hard to run on supercomputer or my new laptop or after my 1-year license expires.

  5. Programming language: All use a special math-only language

  6. Bugs: Bug tracking is secret

  7. Compiler: Lack of compilers for their math-only languages
 
       
 
       
 
       
 
       
 
       
 
       

Have you ever seen this?  I did this morning when preparing this talk:

 

Last login: Fri Nov 18 16:16:32 on ttys008
You have mail.
deep:~ wstein$ math
Mathematica 7.0 for Mac OS X x86 (64-bit)
Copyright 1988-2009 Wolfram Research, Inc.

/Users/wstein/Library/Mathematica/Licensing/mathpass:1:
	The Mathematica license you are using has expired.
	Please contact Wolfram Research or an authorized
	Mathematica distributor to extend your license and
	obtain a new password.

You will need to get a password from your
license certificate or from Wolfram Research
(http://register.wolfram.com).
Machine name:	deep.local
MathID:	5108-53088-04270

You will need a valid license ID and password in order
to proceed. Go to http://register.wolfram.com or
consult your Getting Started documentation.

Enter your name: 
 
       
 
       
 
       
 
       
 
       
 
       
 
       
 
       

  1. Python: a mainstream general purpose programming language (with a compiler: Cython)

  2. Distribution: about 100 open source packages (written by you and your colleagues!)

  3. Interfaces: smoothly tie together all these libraries and packages

  4. New library: implements novel algorithms; over a half million lines; worldwide community of several hundred people.

 
       
 
       
 
       
 
       
 
       
 
       

Distribution

 
       
 
       

Hundreds of Sage Developers

(There are at least 242 contributors in 164 different places from all around the world.)

 

 
       
 
       
 
       

History

  • 2005:SAGE-0.1 released February 1, 2005; SAGE=Software for Arithmetic Geometry Experimentation

  • 2006: (2 Sage Days workshops); Sage is not just for number theory

  • 2007: (4 Sage Days) 100% test requirements; peer review of all new code (see trac); industry funding; NSF; Trophees du Libre

  • 2008: (7 Sage Days) Release managers besides me.

  • 2009: (8 Sage Days) Better foundations; 3d graphics; more developers (e.g., sage-combinat)

  • 2010: (13 Sage Days) More devs and users; nontrivial NSF grants

  • 2011: (12 Sage Days) Much faster http://sagenb.org with >50,000 accounts; very stable releases; undergrad curriculum development

  • 2012: (5 Sage Days already planned)  

  • 2013: (1 Sage Days already planned)

See this article for more details about the (pre-)history of Sage.

 
       
 
       
 
       
 
       
 
       
 
       

Question Break

????

factorial(3) 
       
6
6
A = random_matrix(QQ, 4); b = A^(-1); b 
       
[   0 -1/2    0 -1/2]
[-2/3   -1 -1/3 -1/2]
[   0  1/2    0    0]
[-1/3   -1  1/3 -1/2]
[   0 -1/2    0 -1/2]
[-2/3   -1 -1/3 -1/2]
[   0  1/2    0    0]
[-1/3   -1  1/3 -1/2]
show(b) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\begin{array}{rrrr} 0 & -\frac{1}{2} & 0 & -\frac{1}{2} \\ -\frac{2}{3} & -1 & -\frac{1}{3} & -\frac{1}{2} \\ 0 & \frac{1}{2} & 0 & 0 \\ -\frac{1}{3} & -1 & \frac{1}{3} & -\frac{1}{2} \end{array}\right)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\begin{array}{rrrr} 0 & -\frac{1}{2} & 0 & -\frac{1}{2} \\ -\frac{2}{3} & -1 & -\frac{1}{3} & -\frac{1}{2} \\ 0 & \frac{1}{2} & 0 & 0 \\ -\frac{1}{3} & -1 & \frac{1}{3} & -\frac{1}{2} \end{array}\right)
latex(b) 
       
\left(\begin{array}{rrrr}
0 & -\frac{1}{2} & 0 & -\frac{1}{2} \\
-\frac{2}{3} & -1 & -\frac{1}{3} & -\frac{1}{2} \\
0 & \frac{1}{2} & 0 & 0 \\
-\frac{1}{3} & -1 & \frac{1}{3} & -\frac{1}{2}
\end{array}\right)
\left(\begin{array}{rrrr}
0 & -\frac{1}{2} & 0 & -\frac{1}{2} \\
-\frac{2}{3} & -1 & -\frac{1}{3} & -\frac{1}{2} \\
0 & \frac{1}{2} & 0 & 0 \\
-\frac{1}{3} & -1 & \frac{1}{3} & -\frac{1}{2}
\end{array}\right)
show(integrate(sin(x)*cos(x), x)) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}-\frac{1}{2} \, \cos\left(x\right)^{2}
\newcommand{\Bold}[1]{\mathbf{#1}}-\frac{1}{2} \, \cos\left(x\right)^{2}
G = plot(sin(x)*cos(x), (0, 4)) G 
       
G.save('a.pdf') 
       
sage.interfaces. 
       
 
       
 
       
 
       
 
       
 
       
 
       
 
       
 
       
 
       

Interactive Image Compression

(using numpy

import pylab, numpy X = pylab.imread(DATA + 'wyckoff.png') A_image = numpy.mean(X, 2) u,s,v = numpy.linalg.svd(A_image) S = numpy.zeros(A_image.shape) S[:len(s),:len(s)] = numpy.diag(s) n = A_image.shape[0] @interact def svd_image(i = ("Eigenvalues (quality)", (20,(1..A_image.shape[0]//2)))): A_approx = numpy.dot(numpy.dot(u[:,:i], S[:i,:i]), v[:i,:]) g = graphics_array([matrix_plot(A_approx), matrix_plot(A_image)]) show(g, axes=False, figsize=(6,3)) html("%sx%s image compressed to %.1f%% of size using %s eigenvalues."%( A_image.shape[0], A_image.shape[1],100*(2.0*i*n+i)/(n*n), i)) 
       

Click to the left again to hide and once more to show the dynamic interactive window

 
       
 
       
 
       

Number Theory

factor(2009201020112012) # uses PARI 
       
2^2 * 43 * 2269 * 5148259709
2^2 * 43 * 2269 * 5148259709
# Jon Bober - Rademacher's formula time number_of_partitions(10^6) 
       
147168498635822339863100476060989594348403048443914212533461274735166611\
741891861827633014887398359755584201537413060028809592938734712823227032\
784957800193278439607206422865904871302017097184076102567647986084690814\
282935670692978599129051989944549067221999782345287498297402228822985013\
676756629478188749468787900382469998819772920063206866873599666227381679\
826621348241720844663102742800191813219817718064651123454259502672842445\
259229678119344813999466473010574256435915479498918148528535137055139947\
671998169145902201559910195960141747407571543075002218489581520933901248\
173446944831932328015066538404299405417958775176129491624814247999880293\
650719525707448504757166277176390339144249511382329819526300833648982604\
583771220245530499638214460102853183200451904659196830278753741811848600\
061201685259354274198021504626724547323732184583342751252422746539913017\
407694128084740083154221799928607110833630331629828910244464969680539541\
679187548001085263677402202312846764691977502234856252074774184334365780\
153413070476197553037516970799928704028567784161934747236817177215404666\
4303121315630003467104673818
Time: CPU 0.03 s, Wall: 0.03 s
1471684986358223398631004760609895943484030484439142125334612747351666117418918618276330148873983597555842015374130600288095929387347128232270327849578001932784396072064228659048713020170971840761025676479860846908142829356706929785991290519899445490672219997823452874982974022288229850136767566294781887494687879003824699988197729200632068668735996662273816798266213482417208446631027428001918132198177180646511234542595026728424452592296781193448139994664730105742564359154794989181485285351370551399476719981691459022015599101959601417474075715430750022184895815209339012481734469448319323280150665384042994054179587751761294916248142479998802936507195257074485047571662771763903391442495113823298195263008336489826045837712202455304996382144601028531832004519046591968302787537418118486000612016852593542741980215046267245473237321845833427512524227465399130174076941280847400831542217999286071108336303316298289102444649696805395416791875480010852636774022023128467646919775022348562520747741843343657801534130704761975530375169707999287040285677841619347472368171772154046664303121315630003467104673818
Time: CPU 0.03 s, Wall: 0.03 s
@interact def _(n=(25..10000)): plot(prime_pi, 0, n, gridlines='minor').show(figsize=[8,3]) 
       

Click to the left again to hide and once more to show the dynamic interactive window

E = EllipticCurve('37a'); E 
       
Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field
Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field
v = E.integral_points(both_signs=True); v # mwrank, new code 
       
[(-1 : -1 : 1), (-1 : 0 : 1), (0 : -1 : 1), (0 : 0 : 1), (1 : -1 : 1),
(1 : 0 : 1), (2 : -3 : 1), (2 : 2 : 1), (6 : -15 : 1), (6 : 14 : 1)]
[(-1 : -1 : 1), (-1 : 0 : 1), (0 : -1 : 1), (0 : 0 : 1), (1 : -1 : 1), (1 : 0 : 1), (2 : -3 : 1), (2 : 2 : 1), (6 : -15 : 1), (6 : 14 : 1)]
plot(E, xmax=7, gridlines=True) + points([z[:2] for z in v], color='red', pointsize=50) 
       
 
       
 
       
 
       

Graph Theory

"Sage's graph theory crushes anything I have met from the point of view of methods implemented.  I would say: 'if you found a proprietary graph library and you are convinced that it is better for your needs than Sage, your license is on me.' But those licenses are really expensive :-D"

graphs.ClawGraph( 
       
G = graphs.BuckyBall() G.plot().show(figsize=8) 
       
set_random_seed(1) G = graphs.RandomLobster(8, .6, .3) show(G, figsize=7) 
       
G.automorphism_group() 
       
Permutation Group with generators [(12,26)]
Permutation Group with generators [(12,26)]
G.chromatic_number() 
       
2
2
G.shortest_path(13,20) 
       
[13, 0, 1, 2, 3, 4, 5, 19, 20]
[13, 0, 1, 2, 3, 4, 5, 19, 20]
 
       
 
       
 
       
 
       
 
       
 
       
 
       

Algebraic Combinatorics

The sage-combinat project: "improve the open source mathematical system Sage as an extensible toolbox for computer exploration in (algebraic) combinatorics, and foster code sharing between researchers in this area."

For example, see Combinatorics Chapter of the Reference Manual

s = SFASchur(QQ) h = SFAHomogeneous(QQ) p = SFAPower(QQ) e = SFAElementary(QQ) m = SFAMonomial(QQ) 
       
       
Symmetric Function Algebra over Rational Field, Schur symmetric
functions as basis
Symmetric Function Algebra over Rational Field, Schur symmetric functions as basis
a = s([3,1]); a 
       
s[3, 1]
s[3, 1]
a*a 
       
s[3, 3, 1, 1] + s[3, 3, 2] + s[4, 2, 1, 1] + s[4, 2, 2] + 2*s[4, 3, 1] +
s[4, 4] + s[5, 1, 1, 1] + 2*s[5, 2, 1] + s[5, 3] + s[6, 1, 1] + s[6, 2]
s[3, 3, 1, 1] + s[3, 3, 2] + s[4, 2, 1, 1] + s[4, 2, 2] + 2*s[4, 3, 1] + s[4, 4] + s[5, 1, 1, 1] + 2*s[5, 2, 1] + s[5, 3] + s[6, 1, 1] + s[6, 2]
p(a) 
       
1/8*p[1, 1, 1, 1] + 1/4*p[2, 1, 1] - 1/8*p[2, 2] - 1/4*p[4]
1/8*p[1, 1, 1, 1] + 1/4*p[2, 1, 1] - 1/8*p[2, 2] - 1/4*p[4]
a.inner_plethysm(a) 
       
s[1, 1, 1, 1] + 2*s[2, 1, 1] + s[2, 2] + 2*s[3, 1]
s[1, 1, 1, 1] + 2*s[2, 1, 1] + s[2, 2] + 2*s[3, 1]
 
       
 
       

Cython

  • Smooth transition between Python and compiled C code.
  • Make code that involves lots of manipulation of C-level data structures optimally fast
  • Heavily used in scientific computing using Python.
def python_sum(n): s = int(0) for i in xrange(1, n+1): s += i*i return s 
       
python_sum(3) 
       
14
14
time python_sum(2*10^6) 
       
2666668666667000000
Time: CPU 0.16 s, Wall: 0.16 s
2666668666667000000
Time: CPU 0.16 s, Wall: 0.16 s
timeit('python_sum(2*10^6)') 
       
5 loops, best of 3: 164 ms per loop
5 loops, best of 3: 164 ms per loop
def python_sum2(n): return sum(i*i for i in xrange(1,n+1)) 
       
time python_sum2(2*10^6) 
       
2666668666667000000
Time: CPU 0.19 s, Wall: 0.19 s
2666668666667000000
Time: CPU 0.19 s, Wall: 0.19 s
%cython def cython_sum(long n): cdef long long i, s = 0 for i in range(1, n+1): s += i*i return s 
cython_sum(3) 
       
14L
14L
time cython_sum(2*10^6) 
       
2666668666667000000L
Time: CPU 0.00 s, Wall: 0.00 s
2666668666667000000L
Time: CPU 0.00 s, Wall: 0.00 s
timeit('cython_sum(2*10^6)') 
       
625 loops, best of 3: 671 ns per loop
625 loops, best of 3: 671 ns per loop
165/.663 
       
248.868778280543
248.868778280543
%cython def cython_sum2(long n): cdef long long i return sum(i*i for i in range(1,n+1)) 
time cython_sum2(2*10^6) 
       
2666668666667000000L
Time: CPU 0.16 s, Wall: 0.16 s
2666668666667000000L
Time: CPU 0.16 s, Wall: 0.16 s
 
       
Of course, it is better to choose a different algorithm:
var('k, n') factor(sum(k^2, k, 1, n)) 
       
1/6*(n + 1)*(2*n + 1)*n
1/6*(n + 1)*(2*n + 1)*n
def sum2(n): return n*(2*n+1)*(n+1)/6 
       
sum2(2*10^6) 
       
2666668666667000000
2666668666667000000

Even then, Cython provides a speedup:

%cython def c_sum2(long long n): return n*(2*n+1)*(n+1)/6 
c_sum2(3) 
       
14L
14L
c_sum2(2*10^6) 
       
-407788678951258603L
-407788678951258603L
n = 2*10^6 timeit('sum2(n)') 
       
625 loops, best of 3: 2.01 µs per loop
625 loops, best of 3: 2.01 µs per loop
timeit('c_sum2(n)') 
       
625 loops, best of 3: 218 ns per loop
625 loops, best of 3: 218 ns per loop
2.01/.218 
       
9.22018348623853
9.22018348623853
 
       
 
       

But at a cost!

c_sum2(2*10^6) # WARNING: overflow -- it's just like C... 
       
-407788678951258603L
-407788678951258603L
n=2*10^6; n*(2*n+1)*(n+1) > 2^63 
       
True
True
 
       
 
       
 
       

Solving Equations

Solve a cubic equation:

x = var('x'); show(solve(x^3 + x - 1==0, x)[0]) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}x = -\frac{1}{2} \, {\left(i \, \sqrt{3} + 1\right)} {\left(\frac{1}{18} \, \sqrt{3} \sqrt{31} + \frac{1}{2}\right)}^{\left(\frac{1}{3}\right)} + \frac{-i \, \sqrt{3} + 1}{6 \, {\left(\frac{1}{18} \, \sqrt{3} \sqrt{31} + \frac{1}{2}\right)}^{\left(\frac{1}{3}\right)}}
\newcommand{\Bold}[1]{\mathbf{#1}}x = -\frac{1}{2} \, {\left(i \, \sqrt{3} + 1\right)} {\left(\frac{1}{18} \, \sqrt{3} \sqrt{31} + \frac{1}{2}\right)}^{\left(\frac{1}{3}\right)} + \frac{-i \, \sqrt{3} + 1}{6 \, {\left(\frac{1}{18} \, \sqrt{3} \sqrt{31} + \frac{1}{2}\right)}^{\left(\frac{1}{3}\right)}}

Solve a system of two linear equations with one unknown coefficient \alpha:

var('alpha, y') show(solve([3*x + 7*y == 2, alpha*x + 3*y == 8], x,y)[0]) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left[x = \frac{50}{7 \, \alpha - 9}, y = \frac{2 \, {\left(\alpha - 12\right)}}{7 \, \alpha - 9}\right]
\newcommand{\Bold}[1]{\mathbf{#1}}\left[x = \frac{50}{7 \, \alpha - 9}, y = \frac{2 \, {\left(\alpha - 12\right)}}{7 \, \alpha - 9}\right]

Solve a system of 500 linear equations exactly over the rational numbers:

n = 500 A = random_matrix(QQ,n,n,num_bound=10, den_bound=10) v = random_matrix(QQ,n,1,num_bound=10, den_bound=10) A.visualize_structure() 
       
# IML is used -- http://www.cs.uwaterloo.ca/~astorjoh/iml.html time w = A \ v 
       
Time: CPU 3.08 s, Wall: 2.04 s
Time: CPU 3.08 s, Wall: 2.04 s
print w.str() 
       
WARNING: Output truncated!  
full_output.txt



[
-35170287606880290643755242068605585032607645790467696227510083012754014\
209552613191825054726554034468711333753512138553502268154641926254167854\
277993782242047975648765537789684779947163397757672378207320752013079903\
081977572402942342855631847634917334375567725200949287419814943328710246\
512541588734123916498194827140942961695474389949293216618783927383084043\
024220413380865093288810118537578983181053899461749302374084369069440792\
237427868339146115514095572829020266899391691343555578550571985033802542\
322986415496957988427958692956997351077992010024412064655355050589802049\
508358317945065384321675002925259301795806490140294417796752695156539524\
124805975616026523319266984818092269427921171858577830638088516230508666\
910804343311571401939976470565640553237263742498812830293003722157384120\
429185210964481771118171003582668463237232745438803646481729385618653719\
290569550431763124314799117129173800770979018877161538915171649899855408\
403216755234480553036017941777097575295161000394898303777475031991111715\
673283202172778539539244149073095868925297296767522098873014512743624494\
378981459885929562775838161397883770933575524969337769480812242031564479\
252273748410510731098212486673851810180012969710751643873657697794140827\
437927029350938265391137496664227427915828658742276488248475686560157973\
089515861420506355106163849147350479391005608303463670362810424990990935\
874361744601474243543981369456229165217628375118975466429551361180619892\
765924138532602101463250422678650464862058688845651411983789357111910953\
396775612515997565239932250023269119206135913759515681071311730332720542\
095778561328064652468017842254569967054200239601185206878446429324207574\
638947936431387935201327903186688186655093238897498819582538606101851386\
522984990931250079225108710736421552370716019268202256617920451380280400\
264934805239066202913527971823962068571118081333104312614968911252810197\
919260114909352478204286878986163997358962243406000573598545315761469262\
512000898974810712781639389304729561277038985321773846773824153845455886\
996429984246385692956390637878107844843582575044052722770755619169229082\
572645352435097286438652915089536390796527241696946940261755243886211429\
377669055892193462392590930367528619341645259529861278091441114221626601\
873251672125619208172280955826296174872463796580072215353832080758361490\
836793768058045309403540953539624482725087280283849150746723268448986765\
756108006654291654308142745926766655027874073352324443620082948793916838\
3811194688142700374028190883369685908216732077/4067782875484212326663311\
617328670832844517668982653313360678139263119923699888566280990867348557\
356671155290956430174751875095360251105798206742735127104098165067814139\
492190954219009946130255863282988325207830875101159952490004624838536952\
540322189167758837780462767325132870033488208322866273391516599202161186\
024347828920828687409082348177640217448975984517612915621713638267535188\
696384621721767869207503970464394197565221463313299063259220623341268868\
453072277475331662210633800047415048666800872200330079604203595393425649\
170599073986150285231863177976366609996046241653617055408115480273443479\
448433183797541958284471397140590759568239535749614560724228213798534712\
659574179784679076480303433710416804886662134187828545003714490044646281\
371516932782486114054369191054416345143797859434383214986994913744299749\
414119161883006929184470662076718602932917357060449033794591633297222154\
624870047646066739502278980483284010730068357338544234999822475021177554\
809695612421120881319655519674599009177901845041283483666883997962477143\
483316571162765197083703777482201078935003185060800078772950446193913338\
076783440429812707329238458478406610878319190930005297973995999042181829\
922925855085253491955637538682896690137721577365833486970993840434691443\
445476354882729114398329220660753134328170369143687044568081291245392732\
239105181275126941391265086958312816788605137121813337291057259043654960\
188499418451909765739706155032846814087502063072846200203564230141908136\
118998207860731109237365075922240988708341841893505610938423741879013097\
092493343757109949857355576727886100806294081460120151715544497347937025\
971348203102252030841057764494331195246809761238661819696470413701424802\
298593548776978832108656234910264109556022059115933183860757493359204400\
959331871604592993396432099609960758954401256445405736430656304065302152\
203845027370189816825023356066981542331594468641179158138428277349731703\
737219963018417632363299354714943867832767950499011442952233637773101716\
823994314895126742837911872216663887150068039617770729890166569844868292\
547997093894548850663015207286373345737063021706179180185939364399949813\
105084680637570459098267577867063578291309807040813378428531000012772498\
467389977852687858238520181048432451889263811792822630864822089031199816\
712292749766497072354298239001901713874648443916904411649363916870517743\
837266271394960123062314017832363588783497786530171331707763932291900777\
396289903101605022808141348530967880819658676298623903763230814863880814\
47209515623489102340]
[  
712610966651432576686581628132321785402793642002824123311101829499616957\
296194203263097154402938277462517133906629031143528461511612812504410971\
201690296212642015599269488374044631997250653929142619937585636372657165\
259760691073841792727770914684943077194903011885567683413903408161566172\
523537564191278182816453577246135823555431848608942660362416323159958770\
500561987882304973296652569891818265249685406648807137987870009107289677\
705891454968031969120174028771744292163986168454332964408736836608492509\
718496299166559932718284968262327950389189385731160459107873522458639919\
058384673246335593605544306248175953959132192937554798973358808121397821\
388042781606705545699611222124009081364887351926806664833447256645215110\
538011580734213103731303080345123644450061191805764759618635940911654970\
833887213814530964555309022785903846727494334291292562394176723496961568\
959824018898626086770521194373576446372251042914604915703153885476062853\
490230778617546427313953961477141220016577917174388766746846067138845588\
651518576641175992944254211863382364735259542848132972447762567889903074\
297935825337583158223898524823649696421317905019268225575949674635727905\
934379260876844046257786638738343940822238831524047417433012239111290883\
976253882490558448572993836564761352010708989417267340455376354522362154\
423840684598978509653865006260018636577638045534236784825996951929440578\
377963111137059695989189701677714903162600842545665791977253713704046155\
133944647640404198568449037443067763764648931174206669126829367769730234\
685664104514410692047813979570039090331988105104005473395722303638163389\
246662278865033380377203797273950382074643362086668866711337313498670502\
346009371530178924664026438456290737416249261206459579307745005379571026\
886128547970958807051253992658517356161770490287372688659207578947199321\
559634641604325985949174371261566828980707442353982852604762746772835830\
422216447247488059832754434807297736828906201635260905498818075844120226\
872577149844466426036871066950406704654207888404402664418994348321325570\
883038378386769970199454347565788985364981223380595582536626334971629478\
874484525635643523747947849234549156401250286511306821379510598707319657\
116203529292345720917553955627450972971501421456933471978397792250024964\
999737873585758256625180762997629759070679177507866374069020758583354570\
299629188049817906399126226217253274418040438810779328875787606446771723\
532108968020455531200402217477358150472655607920854112895958122211327089\
39135952750960631854645917841141921884756787/813556575096842465332662323\
465734166568903533796530662672135627852623984739977713256198173469711471\
334231058191286034950375019072050221159641348547025420819633013562827898\
438190843801989226051172656597665041566175020231990498000924967707390508\
064437833551767556092553465026574006697641664573254678303319840432237204\
869565784165737481816469635528043489795196903522583124342727653507037739\
276924344353573841500794092878839513044292662659812651844124668253773690\
614455495066332442126760009483009733360174440066015920840719078685129834\
119814797230057046372635595273321999209248330723411081623096054688695889\
686636759508391656894279428118151913647907149922912144845642759706942531\
914835956935815296060686742083360977332426837565709000742898008929256274\
303386556497222810873838210883269028759571886876642997398982748859949882\
823832376601385836894132415343720586583471412089806758918326659444430924\
974009529213347900455796096656802146013671467708846999964495004235510961\
939122484224176263931103934919801835580369008256696733376799592495428696\
663314232553039416740755496440215787000637012160015754590089238782667615\
356688085962541465847691695681322175663838186001059594799199808436365984\
585171017050698391127507736579338027544315473166697394198768086938288689\
095270976545822879665844132150626865634073828737408913616258249078546447\
821036255025388278253017391662563357721027424362667458211451808730992037\
699883690381953147941231006569362817500412614569240040712846028381627223\
799641572146221847473015184448197741668368378701122187684748375802619418\
498668751421989971471115345577220161258816292024030343108899469587405194\
269640620450406168211552898866239049361952247732363939294082740284960459\
718709755395766421731246982052821911204411823186636772151498671840880191\
866374320918598679286419921992151790880251289081147286131260813060430440\
769005474037963365004671213396308466318893728235831627685655469946340747\
443992603683526472659870942988773566553590099802288590446727554620343364\
798862979025348567582374443332777430013607923554145978033313968973658509\
599418778909770132603041457274669147412604341235836037187872879989962621\
016936127514091819653515573412715658261961408162675685706200002554499693\
477995570537571647704036209686490377852762358564526172964417806239963342\
458549953299414470859647800380342774929688783380882329872783374103548767\
453254278992024612462803566472717756699557306034266341552786458380155479\
257980620321004561628269706193576163931735259724780752646162972776162894\
419031246978204680]
[
-16036847841294577406021754226656561474148033966447388200349679238057528\
978494307205314155482905329393092185760710201540229570946252081842859059\
794708175862609511158421755817192414995999047664470166185737038712093916\
153308039910777872838474144477153790765392231975989492569892037189177735\
329834429998953334110710608345579591893430349013478938178814900175479835\
721916377795569062424309078094003839437874427514339766207403967477832079\
106079326901230674181667029083585928270666694266385062524514678446957588\
738048992210145313498295774207549900459178919575076934807324203377379847\
794992364394100639579636148607209363387038378286670215845854667646188249\
874827894474553349754712203183470031976978325039051384181023781937035902\
246443156099394592116569469685111003118108527780072476808148939938100109\
657940947586172187919491236334471139887152312263238253619950898878488951\
112166498298946124774827549378250570551643712455667323633012464484344071\
735947589590924490516215087768066113258848973943193449150964951442169406\
432459579650807563959797726791175328941361817993760343741477898086610146\
642085550225264630513299469577205354435088030146797253519034255226454862\
663759653864045663969812516804483007700721892103517969144512482275080241\
359076391677085403255039788275043050689936381169062043767445817707951859\
476096404547245327726043250105947135800027722412874062815554684687126752\
257262708371642493514896953067530028745626316376138283328019705134181767\
154778444617247877740539764574072769231630490502748962860332413632773410\
578006364443861219434579735664425998914700296503361351607842061620191971\
730667158388862388230135568795510944079172683433917683920711293203698572\
240419792401006465362811345485772831576684998890052356472893573477570858\
273664567883261067402062703657517592050612624518089349993800850894040920\
630112066295723020349076448030680787062376518881366862665016541365292751\
838448575097932593617138326226219135785934393479378578374769912745818084\
799489268728361059482323527399587113622410072076493427877415599277646731\
184603763363045388249360340731108588362900858279311778067870233400875851\
854945044909003172605025393705225180327886470362580983643222600549149947\
874336491553767768121771427264532775619539624421725460061761984458076341\
568547311337970441519920613575224525655932014263966743699244666052591473\
336798048297309869979834357808092708256214038078184624627189177859528290\
651313244718859058099147116507981906988008288741577378121203657380473143\
7644926508362935501173611761755873866318209749/8135565750968424653326623\
234657341665689035337965306626721356278526239847399777132561981734697114\
713342310581912860349503750190720502211596413485470254208196330135628278\
984381908438019892260511726565976650415661750202319904980009249677073905\
080644378335517675560925534650265740066976416645732546783033198404322372\
048695657841657374818164696355280434897951969035225831243427276535070377\
392769243443535738415007940928788395130442926626598126518441246682537736\
906144554950663324421267600094830097333601744400660159208407190786851298\
341198147972300570463726355952733219992092483307234110816230960546886958\
896866367595083916568942794281181519136479071499229121448456427597069425\
319148359569358152960606867420833609773324268375657090007428980089292562\
743033865564972228108738382108832690287595718868766429973989827488599498\
828238323766013858368941324153437205865834714120898067589183266594444309\
249740095292133479004557960966568021460136714677088469999644950042355109\
619391224842241762639311039349198018355803690082566967333767995924954286\
966633142325530394167407554964402157870006370121600157545900892387826676\
153566880859625414658476916956813221756638381860010595947991998084363659\
845851710170506983911275077365793380275443154731666973941987680869382886\
890952709765458228796658441321506268656340738287374089136162582490785464\
478210362550253882782530173916625633577210274243626674582114518087309920\
376998836903819531479412310065693628175004126145692400407128460283816272\
237996415721462218474730151844481977416683683787011221876847483758026194\
184986687514219899714711153455772201612588162920240303431088994695874051\
942696406204504061682115528988662390493619522477323639392940827402849604\
597187097553957664217312469820528219112044118231866367721514986718408801\
918663743209185986792864199219921517908802512890811472861312608130604304\
407690054740379633650046712133963084663188937282358316276856554699463407\
474439926036835264726598709429887735665535900998022885904467275546203433\
647988629790253485675823744433327774300136079235541459780333139689736585\
095994187789097701326030414572746691474126043412358360371878728799899626\
210169361275140918196535155734127156582619614081626756857062000025544996\
934779955705375716477040362096864903778527623585645261729644178062399633\
424585499532994144708596478003803427749296887833808823298727833741035487\
674532542789920246124628035664727177566995573060342663415527864583801554\
792579806203210045616282697061935761639317352597247807526461629727761628\
94419031246978204680]
[ 
670780905754609967862650398220177131177982831134934789266535389879224675\
773307564662073865692648181233994331697383846839497175338963679798323513\
187899868079464157734043255602408681967520161201925055301342464903570471\
904668198180264901434541450940837169885399568778669797277584818744804151\
520865781157194206457963383958940453038570178726464435502120297975155121\
858149317360619754079230429560868422017095051303456340847868979957454837\
223853465437437654331101665463453971428493185955270172827607409888305744\
587027806884471151602466921702271564609879556828705860943892266695837122\
690078564177545904879325344663082066414135658896061425931644562780728315\
670905927070614377744904990994289022401542062368203773561307846567219499\
395996438129464206420489864647382646396571610758270980794351970912021233\
545865456886524596773516466835470878718792567580333908554121695311325318\
702591696054956415626235577721689430069542015257128482768041386152484643\
086684909751991007395420172135538285912319239017008565968032526765724608\
123929851299

...

928314429244369494603036889639548333673675740224437536949675160523883699\
733750284397994294223069115444032251763258404806068621779893917481038853\
928124090081233642310579773247809872390449546472787858816548056992091943\
741951079153284346249396410564382240882364637327354430299734368176038373\
274864183719735857283984398430358176050257816229457226252162612086088153\
801094807592673000934242679261693263778745647166325537131093989268149488\
798520736705294531974188597754713310718019960457718089345510924068672959\
772595805069713516474888666555486002721584710829195606662793794731701919\
883755781954026520608291454933829482520868247167207437574575997992524203\
387225502818363930703114682543131652392281632535137141240000510899938695\
599114107514329540807241937298075570552471712905234592883561247992668491\
709990659882894171929560076068554985937756676176465974556674820709753490\
650855798404922492560713294543551339911461206853268310557291676031095851\
596124064200912325653941238715232786347051944956150529232594555232578883\
806249395640936]
[ 
945260438484163563044816553270592918001394751912601774911825365496702101\
869516492466616395590211147173762603314811628294546497345263839563666415\
583095090067032994069691334912003870897476485026314210361234918632939627\
113750449192588841359026968866079516989072845040071940793991295151325555\
378155861981887132570589489287106795044073018125006894041466829840435185\
554095249086105918270373351244069950304821688160848574794292595412083193\
782255633569430951497593694134968328311112412111626673937106082001550878\
189006390542393132340296934604234894704844140553852953769601316024676680\
918627892453987630419620020497064502598327996829810101649304391646190740\
797656277617083226079919395211544210888444042385829536994393210450651199\
728670394153493355137383333993363189657749125373009649962059304497351975\
563946123204314316576218152264789694619954476090375233361538701533649288\
116764115532254010558548901149494658657504048591644907239559563758928695\
118666640796415414777980825494750146503022200282376165485639543051257724\
778421157118490532187380404634254768989064965878170952631359925451301370\
623771401054377000604587293230405831288638233961825316508199469981546355\
528511040796390360589193272004060090801171319387281223700624649553757262\
338223923345889066439761405289990288428639070654876921929568265462002905\
768632303202778273065462907624324570343872094765158455209524374765324336\
530325375866974450465948376270177533291727397356838285622914531657541338\
612055138174753528355821001604691566163573615831527923914531595903687486\
584099485877470410018067517554997896868834157780642327548164523905313595\
745654569524691995670963596443444258027097524653552645917906701767500506\
143166159568497263134244759938183252565345294474154600776120953534094860\
058553868504396439566981898063636746218198732319710801586401659041709051\
749207853320770698143933357673936552557367359279288126574362896160724072\
947728043556896394907309356716909208924749626242048197726284571299226330\
550247095469436831654022026719371425964531044734433290481019910059532907\
619013194384163144094845729069342567803937185325801377563775644505083555\
319782084434941824586972864807839554277117559681492762524089402439947751\
920848126754469881251759962560522859110189200270636661740491889398071797\
735958772710053573297443175261338656116565852050642004020743136552986786\
830586614578587320048479176856369922262578475480783237925833497937251244\
233283694508981977343884896964120786817533130298359915273484212275453501\
089851844417605157177929842231947390251620333/40677828754842123266633116\
173286708328445176689826533133606781392631199236998885662809908673485573\
566711552909564301747518750953602511057982067427351271040981650678141394\
921909542190099461302558632829883252078308751011599524900046248385369525\
403221891677588377804627673251328700334882083228662733915165992021611860\
243478289208286874090823481776402174489759845176129156217136382675351886\
963846217217678692075039704643941975652214633132990632592206233412688684\
530722774753316622106338000474150486668008722003300796042035953934256491\
705990739861502852318631779763666099960462416536170554081154802734434794\
484331837975419582844713971405907595682395357496145607242282137985347126\
595741797846790764803034337104168048866621341878285450037144900446462813\
715169327824861140543691910544163451437978594343832149869949137442997494\
141191618830069291844706620767186029329173570604490337945916332972221546\
248700476460667395022789804832840107300683573385442349998224750211775548\
096956124211208813196555196745990091779018450412834836668839979624771434\
833165711627651970837037774822010789350031850608000787729504461939133380\
767834404298127073292384584784066108783191909300052979739959990421818299\
229258550852534919556375386828966901377215773658334869709938404346914434\
454763548827291143983292206607531343281703691436870445680812912453927322\
391051812751269413912650869583128167886051371218133372910572590436549601\
884994184519097657397061550328468140875020630728462002035642301419081361\
189982078607311092373650759222409887083418418935056109384237418790130970\
924933437571099498573555767278861008062940814601201517155444973479370259\
713482031022520308410577644943311952468097612386618196964704137014248022\
985935487769788321086562349102641095560220591159331838607574933592044009\
593318716045929933964320996099607589544012564454057364306563040653021522\
038450273701898168250233560669815423315944686411791581384282773497317037\
372199630184176323632993547149438678327679504990114429522336377731017168\
239943148951267428379118722166638871500680396177707298901665698448682925\
479970938945488506630152072863733457370630217061791801859393643999498131\
050846806375704590982675778670635782913098070408133784285310000127724984\
673899778526878582385201810484324518892638117928226308648220890311998167\
122927497664970723542982390019017138746484439169044116493639168705177438\
372662713949601230623140178323635887834977865301713317077639322919007773\
962899031016050228081413485309678808196586762986239037632308148638808144\
7209515623489102340]
[
-35866972850303396595504615518593250393188388737987227745511821090908391\
025438631814385343476897983272354937453965503548628733252849371612320474\
589369238349883266952627678668367390446683523863911108848950176473066762\
370230956445440152466475196273329776775660504684381032328215734292920010\
392056187444052547725144869442647591090618336371480116268864856733540360\
491930623069692688257792921055691012136515624433592500723474741715873211\
918157674895500365603131503393909304553355275436687725302427573983658299\
429643822873531022568788527826303924868855607756464376751798247344842035\
798461797460274531992372180650235281767642883521062604109504173422218317\
030348342025196503076989619020854232863205955945321324134877213213454953\
189534319755042780036665106438734979071731363725057323339887219836776730\
529560519979482640980742961472518999188334798022792864858155348596929474\
606026648034200292941902247102149233478900710145213482026222132798682798\
714095162149478431817932407493694580950465148417564774981081857404104659\
538973480704992634508545260220249543827081356523822542453738308655755860\
022420529061281492366367703780747014887213101593468663447343329500291417\
231850419299758081787868936813644386646449870509424218337571920062321280\
882979359169576801457318115952795697391410668510379078300665609151589272\
047098068476015378706751142138155718803060435824368105011212026257188370\
085483065393706881291672720506326906686542683042690472575266008774912463\
697447837847618627158298698796088264999801798009135332241589968359731891\
462957690970809002704013043875699516234224246053484472826188110222289265\
975184352710263851545220250093171981441401291901671488664918093548540142\
593796268318225988095430865948238055874443216268733911170675781407010517\
238674884263432621971577544190617780984121717227496191330235278364879896\
558464448316503828685982286052305889326826430555729456537313352688125566\
845790002733763072791819915628815589445906636373254998016360544833171701\
059055933242822998947834696699254815350536419529670749889092656874788342\
477189692561542821803967790356827843121796325442426029433988002989914353\
904213390818854588319001538976735209792232878981588963472878211804412059\
385126526840625891323660000287991501316890275233485048429144743875254470\
829431165215066175496799744632656629037571881596151155659635498334562768\
209728722994360035358953326021490697352569329096733723147730099783744244\
400568304030214742780656982843871408967221790034501278832632833501757302\
2213821202871617596056917140884160335108012469/8135565750968424653326623\
234657341665689035337965306626721356278526239847399777132561981734697114\
713342310581912860349503750190720502211596413485470254208196330135628278\
984381908438019892260511726565976650415661750202319904980009249677073905\
080644378335517675560925534650265740066976416645732546783033198404322372\
048695657841657374818164696355280434897951969035225831243427276535070377\
392769243443535738415007940928788395130442926626598126518441246682537736\
906144554950663324421267600094830097333601744400660159208407190786851298\
341198147972300570463726355952733219992092483307234110816230960546886958\
896866367595083916568942794281181519136479071499229121448456427597069425\
319148359569358152960606867420833609773324268375657090007428980089292562\
743033865564972228108738382108832690287595718868766429973989827488599498\
828238323766013858368941324153437205865834714120898067589183266594444309\
249740095292133479004557960966568021460136714677088469999644950042355109\
619391224842241762639311039349198018355803690082566967333767995924954286\
966633142325530394167407554964402157870006370121600157545900892387826676\
153566880859625414658476916956813221756638381860010595947991998084363659\
845851710170506983911275077365793380275443154731666973941987680869382886\
890952709765458228796658441321506268656340738287374089136162582490785464\
478210362550253882782530173916625633577210274243626674582114518087309920\
376998836903819531479412310065693628175004126145692400407128460283816272\
237996415721462218474730151844481977416683683787011221876847483758026194\
184986687514219899714711153455772201612588162920240303431088994695874051\
942696406204504061682115528988662390493619522477323639392940827402849604\
597187097553957664217312469820528219112044118231866367721514986718408801\
918663743209185986792864199219921517908802512890811472861312608130604304\
407690054740379633650046712133963084663188937282358316276856554699463407\
474439926036835264726598709429887735665535900998022885904467275546203433\
647988629790253485675823744433327774300136079235541459780333139689736585\
095994187789097701326030414572746691474126043412358360371878728799899626\
210169361275140918196535155734127156582619614081626756857062000025544996\
934779955705375716477040362096864903778527623585645261729644178062399633\
424585499532994144708596478003803427749296887833808823298727833741035487\
674532542789920246124628035664727177566995573060342663415527864583801554\
792579806203210045616282697061935761639317352597247807526461629727761628\
94419031246978204680]
[  
948456083330971331734018881781764580588320909786306044139224842128366288\
566062991682255926553835169465103206007869525612855843836725357823704445\
579288455425028003180160337434916022943063120492778660927969608058260137\
368298257755184262696481878833634211368529660852154219102476122015757418\
481391942924820517687214300185279060122694264880467582657475134947986415\
668021998277832298083485852301649129081288055441642799801410027988732992\
323132661816612703280195336359929238106864561502353967309321293752304668\
044678714812907049518162597961100407169308364862195839919945883367663191\
258089021708521732275916004590587754579977128805195393970664633080162475\
901169418521259673165758670749824162596464798216733415944141253675294713\
122451907274139750788252231123678379764340854951146878570500666102520833\
367375150502722099503698118759319851294597060602544848423704890243733555\
676538879762905041010646924691249260232907817155205358753874709316834417\
595347734910531017868082593436477556032782799380419283528412996377697242\
500618503717116977877149950623710209284860395553310724156927742081214222\
212887998942541562609759606279776379376647753253121940351755870942189780\
670229023032013172005462133040555965472732295432583284661369345512370365\
800511141950236266559376215576538963286445503102366695147124237646903970\
043843884191626429015975078989834706618427205158006735274771042369064806\
016106449250931600669532200069860654220492262120082521620208339885718786\
936207969256237041382613823161350119119429459091502271420879637486464151\
958074843369447655210705509623126389735643874879488395661764549712461685\
308109495023525186425720935830282268238183817731741391151438679870522123\
091154030115425650722203916304252746847136597285565388001930648088391820\
791472569938327131704036869703797583699985005576571081508920663934998044\
837074803357914600023011585240851072995510261420620024711857820370964177\
245278356271585944194739806651553306360503970928794388935205268665313696\
710156286479823143881415047539039115126258446514169598498236444498106168\
994042640267869698839419628623163181399562948689541589417374862328392215\
950494778011076793721689152889750953949278629126954830223500316669869623\
940119410274404686226700184816789075440415258291259227494965955772884637\
322703618036141101871946136303255638946038956530286598425547576754297880\
487097649091668425065316975785296912723938211061799263537161789851296346\
270396620190303174980686362274199870611966127380407624398670353899651159\
76196278333457010123362614934679690155154701/406778287548421232666331161\
732867083284451766898265331336067813926311992369988856628099086734855735\
667115529095643017475187509536025110579820674273512710409816506781413949\
219095421900994613025586328298832520783087510115995249000462483853695254\
032218916775883778046276732513287003348820832286627339151659920216118602\
434782892082868740908234817764021744897598451761291562171363826753518869\
638462172176786920750397046439419756522146331329906325922062334126886845\
307227747533166221063380004741504866680087220033007960420359539342564917\
059907398615028523186317797636660999604624165361705540811548027344347944\
843318379754195828447139714059075956823953574961456072422821379853471265\
957417978467907648030343371041680488666213418782854500371449004464628137\
151693278248611405436919105441634514379785943438321498699491374429974941\
411916188300692918447066207671860293291735706044903379459163329722215462\
487004764606673950227898048328401073006835733854423499982247502117755480\
969561242112088131965551967459900917790184504128348366688399796247714348\
331657116276519708370377748220107893500318506080007877295044619391333807\
678344042981270732923845847840661087831919093000529797399599904218182992\
292585508525349195563753868289669013772157736583348697099384043469144344\
547635488272911439832922066075313432817036914368704456808129124539273223\
910518127512694139126508695831281678860513712181333729105725904365496018\
849941845190976573970615503284681408750206307284620020356423014190813611\
899820786073110923736507592224098870834184189350561093842374187901309709\
249334375710994985735557672788610080629408146012015171554449734793702597\
134820310225203084105776449433119524680976123866181969647041370142480229\
859354877697883210865623491026410955602205911593318386075749335920440095\
933187160459299339643209960996075895440125644540573643065630406530215220\
384502737018981682502335606698154233159446864117915813842827734973170373\
721996301841763236329935471494386783276795049901144295223363777310171682\
399431489512674283791187221666388715006803961777072989016656984486829254\
799709389454885066301520728637334573706302170617918018593936439994981310\
508468063757045909826757786706357829130980704081337842853100001277249846\
738997785268785823852018104843245188926381179282263086482208903119981671\
229274976649707235429823900190171387464844391690441164936391687051774383\
726627139496012306231401783236358878349778653017133170776393229190077739\
628990310160502280814134853096788081965867629862390376323081486388081447\
209515623489102340]
WARNING: Output truncated!  
full_output.txt



[ -351702876068802906437552420686055850326076457904676962275100830127540142095526131918250547265540344687113337535121385535022681546419262541678542779937822420479756487655377896847799471633977576723782073207520130799030819775724029423428556318476349173343755677252009492874198149433287102465125415887341239164981948271409429616954743899492932166187839273830840430242204133808650932888101185375789831810538994617493023740843690694407922374278683391461155140955728290202668993916913435555785505719850338025423229864154969579884279586929569973510779920100244120646553550505898020495083583179450653843216750029252593017958064901402944177967526951565395241248059756160265233192669848180922694279211718585778306380885162305086669108043433115714019399764705656405532372637424988128302930037221573841204291852109644817711181710035826684632372327454388036464817293856186537192905695504317631243147991171291738007709790188771615389151716498998554084032167552344805530360179417770975752951610003948983037774750319911117156732832021727785395392441490730958689252972967675220988730145127436244943789814598859295627758381613978837709335755249693377694808122420315644792522737484105107310982124866738518101800129697107516438736576977941408274379270293509382653911374966642274279158286587422764882484756865601579730895158614205063551061638491473504793910056083034636703628104249909909358743617446014742435439813694562291652176283751189754664295513611806198927659241385326021014632504226786504648620586888456514119837893571119109533967756125159975652399322500232691192061359137595156810713117303327205420957785613280646524680178422545699670542002396011852068784464293242075746389479364313879352013279031866881866550932388974988195825386061018513865229849909312500792251087107364215523707160192682022566179204513802804002649348052390662029135279718239620685711180813331043126149689112528101979192601149093524782042868789861639973589622434060005735985453157614692625120008989748107127816393893047295612770389853217738467738241538454558869964299842463856929563906378781078448435825750440527227707556191692290825726453524350972864386529150895363907965272416969469402617552438862114293776690558921934623925909303675286193416452595298612780914411142216266018732516721256192081722809558262961748724637965800722153538320807583614908367937680580453094035409535396244827250872802838491507467232684489867657561080066542916543081427459267666550278740733523244436200829487939168383811194688142700374028190883369685908216732077/406778287548421232666331161732867083284451766898265331336067813926311992369988856628099086734855735667115529095643017475187509536025110579820674273512710409816506781413949219095421900994613025586328298832520783087510115995249000462483853695254032218916775883778046276732513287003348820832286627339151659920216118602434782892082868740908234817764021744897598451761291562171363826753518869638462172176786920750397046439419756522146331329906325922062334126886845307227747533166221063380004741504866680087220033007960420359539342564917059907398615028523186317797636660999604624165361705540811548027344347944843318379754195828447139714059075956823953574961456072422821379853471265957417978467907648030343371041680488666213418782854500371449004464628137151693278248611405436919105441634514379785943438321498699491374429974941411916188300692918447066207671860293291735706044903379459163329722215462487004764606673950227898048328401073006835733854423499982247502117755480969561242112088131965551967459900917790184504128348366688399796247714348331657116276519708370377748220107893500318506080007877295044619391333807678344042981270732923845847840661087831919093000529797399599904218182992292585508525349195563753868289669013772157736583348697099384043469144344547635488272911439832922066075313432817036914368704456808129124539273223910518127512694139126508695831281678860513712181333729105725904365496018849941845190976573970615503284681408750206307284620020356423014190813611899820786073110923736507592224098870834184189350561093842374187901309709249334375710994985735557672788610080629408146012015171554449734793702597134820310225203084105776449433119524680976123866181969647041370142480229859354877697883210865623491026410955602205911593318386075749335920440095933187160459299339643209960996075895440125644540573643065630406530215220384502737018981682502335606698154233159446864117915813842827734973170373721996301841763236329935471494386783276795049901144295223363777310171682399431489512674283791187221666388715006803961777072989016656984486829254799709389454885066301520728637334573706302170617918018593936439994981310508468063757045909826757786706357829130980704081337842853100001277249846738997785268785823852018104843245188926381179282263086482208903119981671229274976649707235429823900190171387464844391690441164936391687051774383726627139496012306231401783236358878349778653017133170776393229190077739628990310160502280814134853096788081965867629862390376323081486388081447209515623489102340]
[   71261096665143257668658162813232178540279364200282412331110182949961695729619420326309715440293827746251713390662903114352846151161281250441097120169029621264201559926948837404463199725065392914261993758563637265716525976069107384179272777091468494307719490301188556768341390340816156617252353756419127818281645357724613582355543184860894266036241632315995877050056198788230497329665256989181826524968540664880713798787000910728967770589145496803196912017402877174429216398616845433296440873683660849250971849629916655993271828496826232795038918938573116045910787352245863991905838467324633559360554430624817595395913219293755479897335880812139782138804278160670554569961122212400908136488735192680666483344725664521511053801158073421310373130308034512364445006119180576475961863594091165497083388721381453096455530902278590384672749433429129256239417672349696156895982401889862608677052119437357644637225104291460491570315388547606285349023077861754642731395396147714122001657791717438876674684606713884558865151857664117599294425421186338236473525954284813297244776256788990307429793582533758315822389852482364969642131790501926822557594967463572790593437926087684404625778663873834394082223883152404741743301223911129088397625388249055844857299383656476135201070898941726734045537635452236215442384068459897850965386500626001863657763804553423678482599695192944057837796311113705969598918970167771490316260084254566579197725371370404615513394464764040419856844903744306776376464893117420666912682936776973023468566410451441069204781397957003909033198810510400547339572230363816338924666227886503338037720379727395038207464336208666886671133731349867050234600937153017892466402643845629073741624926120645957930774500537957102688612854797095880705125399265851735616177049028737268865920757894719932155963464160432598594917437126156682898070744235398285260476274677283583042221644724748805983275443480729773682890620163526090549881807584412022687257714984446642603687106695040670465420788840440266441899434832132557088303837838676997019945434756578898536498122338059558253662633497162947887448452563564352374794784923454915640125028651130682137951059870731965711620352929234572091755395562745097297150142145693347197839779225002496499973787358575825662518076299762975907067917750786637406902075858335457029962918804981790639912622621725327441804043881077932887578760644677172353210896802045553120040221747735815047265560792085411289595812221132708939135952750960631854645917841141921884756787/813556575096842465332662323465734166568903533796530662672135627852623984739977713256198173469711471334231058191286034950375019072050221159641348547025420819633013562827898438190843801989226051172656597665041566175020231990498000924967707390508064437833551767556092553465026574006697641664573254678303319840432237204869565784165737481816469635528043489795196903522583124342727653507037739276924344353573841500794092878839513044292662659812651844124668253773690614455495066332442126760009483009733360174440066015920840719078685129834119814797230057046372635595273321999209248330723411081623096054688695889686636759508391656894279428118151913647907149922912144845642759706942531914835956935815296060686742083360977332426837565709000742898008929256274303386556497222810873838210883269028759571886876642997398982748859949882823832376601385836894132415343720586583471412089806758918326659444430924974009529213347900455796096656802146013671467708846999964495004235510961939122484224176263931103934919801835580369008256696733376799592495428696663314232553039416740755496440215787000637012160015754590089238782667615356688085962541465847691695681322175663838186001059594799199808436365984585171017050698391127507736579338027544315473166697394198768086938288689095270976545822879665844132150626865634073828737408913616258249078546447821036255025388278253017391662563357721027424362667458211451808730992037699883690381953147941231006569362817500412614569240040712846028381627223799641572146221847473015184448197741668368378701122187684748375802619418498668751421989971471115345577220161258816292024030343108899469587405194269640620450406168211552898866239049361952247732363939294082740284960459718709755395766421731246982052821911204411823186636772151498671840880191866374320918598679286419921992151790880251289081147286131260813060430440769005474037963365004671213396308466318893728235831627685655469946340747443992603683526472659870942988773566553590099802288590446727554620343364798862979025348567582374443332777430013607923554145978033313968973658509599418778909770132603041457274669147412604341235836037187872879989962621016936127514091819653515573412715658261961408162675685706200002554499693477995570537571647704036209686490377852762358564526172964417806239963342458549953299414470859647800380342774929688783380882329872783374103548767453254278992024612462803566472717756699557306034266341552786458380155479257980620321004561628269706193576163931735259724780752646162972776162894419031246978204680]
[ -160368478412945774060217542266565614741480339664473882003496792380575289784943072053141554829053293930921857607102015402295709462520818428590597947081758626095111584217558171924149959990476644701661857370387120939161533080399107778728384741444771537907653922319759894925698920371891777353298344299989533341107106083455795918934303490134789381788149001754798357219163777955690624243090780940038394378744275143397662074039674778320791060793269012306741816670290835859282706666942663850625245146784469575887380489922101453134982957742075499004591789195750769348073242033773798477949923643941006395796361486072093633870383782866702158458546676461882498748278944745533497547122031834700319769783250390513841810237819370359022464431560993945921165694696851110031181085277800724768081489399381001096579409475861721879194912363344711398871523122632382536199508988784889511121664982989461247748275493782505705516437124556673236330124644843440717359475895909244905162150877680661132588489739431934491509649514421694064324595796508075639597977267911753289413618179937603437414778980866101466420855502252646305132994695772053544350880301467972535190342552264548626637596538640456639698125168044830077007218921035179691445124822750802413590763916770854032550397882750430506899363811690620437674458177079518594760964045472453277260432501059471358000277224128740628155546846871267522572627083716424935148969530675300287456263163761382833280197051341817671547784446172478777405397645740727692316304905027489628603324136327734105780063644438612194345797356644259989147002965033613516078420616201919717306671583888623882301355687955109440791726834339176839207112932036985722404197924010064653628113454857728315766849988900523564728935734775708582736645678832610674020627036575175920506126245180893499938008508940409206301120662957230203490764480306807870623765188813668626650165413652927518384485750979325936171383262262191357859343934793785783747699127458180847994892687283610594823235273995871136224100720764934278774155992776467311846037633630453882493603407311085883629008582793117780678702334008758518549450449090031726050253937052251803278864703625809836432226005491499478743364915537677681217714272645327756195396244217254600617619844580763415685473113379704415199206135752245256559320142639667436992446660525914733367980482973098699798343578080927082562140380781846246271891778595282906513132447188590580991471165079819069880082887415773781212036573804731437644926508362935501173611761755873866318209749/813556575096842465332662323465734166568903533796530662672135627852623984739977713256198173469711471334231058191286034950375019072050221159641348547025420819633013562827898438190843801989226051172656597665041566175020231990498000924967707390508064437833551767556092553465026574006697641664573254678303319840432237204869565784165737481816469635528043489795196903522583124342727653507037739276924344353573841500794092878839513044292662659812651844124668253773690614455495066332442126760009483009733360174440066015920840719078685129834119814797230057046372635595273321999209248330723411081623096054688695889686636759508391656894279428118151913647907149922912144845642759706942531914835956935815296060686742083360977332426837565709000742898008929256274303386556497222810873838210883269028759571886876642997398982748859949882823832376601385836894132415343720586583471412089806758918326659444430924974009529213347900455796096656802146013671467708846999964495004235510961939122484224176263931103934919801835580369008256696733376799592495428696663314232553039416740755496440215787000637012160015754590089238782667615356688085962541465847691695681322175663838186001059594799199808436365984585171017050698391127507736579338027544315473166697394198768086938288689095270976545822879665844132150626865634073828737408913616258249078546447821036255025388278253017391662563357721027424362667458211451808730992037699883690381953147941231006569362817500412614569240040712846028381627223799641572146221847473015184448197741668368378701122187684748375802619418498668751421989971471115345577220161258816292024030343108899469587405194269640620450406168211552898866239049361952247732363939294082740284960459718709755395766421731246982052821911204411823186636772151498671840880191866374320918598679286419921992151790880251289081147286131260813060430440769005474037963365004671213396308466318893728235831627685655469946340747443992603683526472659870942988773566553590099802288590446727554620343364798862979025348567582374443332777430013607923554145978033313968973658509599418778909770132603041457274669147412604341235836037187872879989962621016936127514091819653515573412715658261961408162675685706200002554499693477995570537571647704036209686490377852762358564526172964417806239963342458549953299414470859647800380342774929688783380882329872783374103548767453254278992024612462803566472717756699557306034266341552786458380155479257980620321004561628269706193576163931735259724780752646162972776162894419031246978204680]
[  670780905754609967862650398220177131177982831134934789266535389879224675773307564662073865692648181233994331697383846839497175338963679798323513187899868079464157734043255602408681967520161201925055301342464903570471904668198180264901434541450940837169885399568778669797277584818744804151520865781157194206457963383958940453038570178726464435502120297975155121858149317360619754079230429560868422017095051303456340847868979957454837223853465437437654331101665463453971428493185955270172827607409888305744587027806884471151602466921702271564609879556828705860943892266695837122690078564177545904879325344663082066414135658896061425931644562780728315670905927070614377744904990994289022401542062368203773561307846567219499395996438129464206420489864647382646396571610758270980794351970912021233545865456886524596773516466835470878718792567580333908554121695311325318702591696054956415626235577721689430069542015257128482768041386152484643086684909751991007395420172135538285912319239017008565968032526765724608123929851299

...

928314429244369494603036889639548333673675740224437536949675160523883699733750284397994294223069115444032251763258404806068621779893917481038853928124090081233642310579773247809872390449546472787858816548056992091943741951079153284346249396410564382240882364637327354430299734368176038373274864183719735857283984398430358176050257816229457226252162612086088153801094807592673000934242679261693263778745647166325537131093989268149488798520736705294531974188597754713310718019960457718089345510924068672959772595805069713516474888666555486002721584710829195606662793794731701919883755781954026520608291454933829482520868247167207437574575997992524203387225502818363930703114682543131652392281632535137141240000510899938695599114107514329540807241937298075570552471712905234592883561247992668491709990659882894171929560076068554985937756676176465974556674820709753490650855798404922492560713294543551339911461206853268310557291676031095851596124064200912325653941238715232786347051944956150529232594555232578883806249395640936]
[  945260438484163563044816553270592918001394751912601774911825365496702101869516492466616395590211147173762603314811628294546497345263839563666415583095090067032994069691334912003870897476485026314210361234918632939627113750449192588841359026968866079516989072845040071940793991295151325555378155861981887132570589489287106795044073018125006894041466829840435185554095249086105918270373351244069950304821688160848574794292595412083193782255633569430951497593694134968328311112412111626673937106082001550878189006390542393132340296934604234894704844140553852953769601316024676680918627892453987630419620020497064502598327996829810101649304391646190740797656277617083226079919395211544210888444042385829536994393210450651199728670394153493355137383333993363189657749125373009649962059304497351975563946123204314316576218152264789694619954476090375233361538701533649288116764115532254010558548901149494658657504048591644907239559563758928695118666640796415414777980825494750146503022200282376165485639543051257724778421157118490532187380404634254768989064965878170952631359925451301370623771401054377000604587293230405831288638233961825316508199469981546355528511040796390360589193272004060090801171319387281223700624649553757262338223923345889066439761405289990288428639070654876921929568265462002905768632303202778273065462907624324570343872094765158455209524374765324336530325375866974450465948376270177533291727397356838285622914531657541338612055138174753528355821001604691566163573615831527923914531595903687486584099485877470410018067517554997896868834157780642327548164523905313595745654569524691995670963596443444258027097524653552645917906701767500506143166159568497263134244759938183252565345294474154600776120953534094860058553868504396439566981898063636746218198732319710801586401659041709051749207853320770698143933357673936552557367359279288126574362896160724072947728043556896394907309356716909208924749626242048197726284571299226330550247095469436831654022026719371425964531044734433290481019910059532907619013194384163144094845729069342567803937185325801377563775644505083555319782084434941824586972864807839554277117559681492762524089402439947751920848126754469881251759962560522859110189200270636661740491889398071797735958772710053573297443175261338656116565852050642004020743136552986786830586614578587320048479176856369922262578475480783237925833497937251244233283694508981977343884896964120786817533130298359915273484212275453501089851844417605157177929842231947390251620333/406778287548421232666331161732867083284451766898265331336067813926311992369988856628099086734855735667115529095643017475187509536025110579820674273512710409816506781413949219095421900994613025586328298832520783087510115995249000462483853695254032218916775883778046276732513287003348820832286627339151659920216118602434782892082868740908234817764021744897598451761291562171363826753518869638462172176786920750397046439419756522146331329906325922062334126886845307227747533166221063380004741504866680087220033007960420359539342564917059907398615028523186317797636660999604624165361705540811548027344347944843318379754195828447139714059075956823953574961456072422821379853471265957417978467907648030343371041680488666213418782854500371449004464628137151693278248611405436919105441634514379785943438321498699491374429974941411916188300692918447066207671860293291735706044903379459163329722215462487004764606673950227898048328401073006835733854423499982247502117755480969561242112088131965551967459900917790184504128348366688399796247714348331657116276519708370377748220107893500318506080007877295044619391333807678344042981270732923845847840661087831919093000529797399599904218182992292585508525349195563753868289669013772157736583348697099384043469144344547635488272911439832922066075313432817036914368704456808129124539273223910518127512694139126508695831281678860513712181333729105725904365496018849941845190976573970615503284681408750206307284620020356423014190813611899820786073110923736507592224098870834184189350561093842374187901309709249334375710994985735557672788610080629408146012015171554449734793702597134820310225203084105776449433119524680976123866181969647041370142480229859354877697883210865623491026410955602205911593318386075749335920440095933187160459299339643209960996075895440125644540573643065630406530215220384502737018981682502335606698154233159446864117915813842827734973170373721996301841763236329935471494386783276795049901144295223363777310171682399431489512674283791187221666388715006803961777072989016656984486829254799709389454885066301520728637334573706302170617918018593936439994981310508468063757045909826757786706357829130980704081337842853100001277249846738997785268785823852018104843245188926381179282263086482208903119981671229274976649707235429823900190171387464844391690441164936391687051774383726627139496012306231401783236358878349778653017133170776393229190077739628990310160502280814134853096788081965867629862390376323081486388081447209515623489102340]
[ -358669728503033965955046155185932503931883887379872277455118210909083910254386318143853434768979832723549374539655035486287332528493716123204745893692383498832669526276786683673904466835238639111088489501764730667623702309564454401524664751962733297767756605046843810323282157342929200103920561874440525477251448694426475910906183363714801162688648567335403604919306230696926882577929210556910121365156244335925007234747417158732119181576748955003656031315033939093045533552754366877253024275739836582994296438228735310225687885278263039248688556077564643767517982473448420357984617974602745319923721806502352817676428835210626041095041734222183170303483420251965030769896190208542328632059559453213241348772132134549531895343197550427800366651064387349790717313637250573233398872198367767305295605199794826409807429614725189991883347980227928648581553485969294746060266480342002929419022471021492334789007101452134820262221327986827987140951621494784318179324074936945809504651484175647749810818574041046595389734807049926345085452602202495438270813565238225424537383086557558600224205290612814923663677037807470148872131015934686634473433295002914172318504192997580817878689368136443866464498705094242183375719200623212808829793591695768014573181159527956973914106685103790783006656091515892720470980684760153787067511421381557188030604358243681050112120262571883700854830653937068812916727205063269066865426830426904725752660087749124636974478378476186271582986987960882649998017980091353322415899683597318914629576909708090027040130438756995162342242460534844728261881102222892659751843527102638515452202500931719814414012919016714886649180935485401425937962683182259880954308659482380558744432162687339111706757814070105172386748842634326219715775441906177809841217172274961913302352783648798965584644483165038286859822860523058893268264305557294565373133526881255668457900027337630727918199156288155894459066363732549980163605448331717010590559332428229989478346966992548153505364195296707498890926568747883424771896925615428218039677903568278431217963254424260294339880029899143539042133908188545883190015389767352097922328789815889634728782118044120593851265268406258913236600002879915013168902752334850484291447438752544708294311652150661754967997446326566290375718815961511556596354983345627682097287229943600353589533260214906973525693290967337231477300997837442444005683040302147427806569828438714089672217900345012788326328335017573022213821202871617596056917140884160335108012469/813556575096842465332662323465734166568903533796530662672135627852623984739977713256198173469711471334231058191286034950375019072050221159641348547025420819633013562827898438190843801989226051172656597665041566175020231990498000924967707390508064437833551767556092553465026574006697641664573254678303319840432237204869565784165737481816469635528043489795196903522583124342727653507037739276924344353573841500794092878839513044292662659812651844124668253773690614455495066332442126760009483009733360174440066015920840719078685129834119814797230057046372635595273321999209248330723411081623096054688695889686636759508391656894279428118151913647907149922912144845642759706942531914835956935815296060686742083360977332426837565709000742898008929256274303386556497222810873838210883269028759571886876642997398982748859949882823832376601385836894132415343720586583471412089806758918326659444430924974009529213347900455796096656802146013671467708846999964495004235510961939122484224176263931103934919801835580369008256696733376799592495428696663314232553039416740755496440215787000637012160015754590089238782667615356688085962541465847691695681322175663838186001059594799199808436365984585171017050698391127507736579338027544315473166697394198768086938288689095270976545822879665844132150626865634073828737408913616258249078546447821036255025388278253017391662563357721027424362667458211451808730992037699883690381953147941231006569362817500412614569240040712846028381627223799641572146221847473015184448197741668368378701122187684748375802619418498668751421989971471115345577220161258816292024030343108899469587405194269640620450406168211552898866239049361952247732363939294082740284960459718709755395766421731246982052821911204411823186636772151498671840880191866374320918598679286419921992151790880251289081147286131260813060430440769005474037963365004671213396308466318893728235831627685655469946340747443992603683526472659870942988773566553590099802288590446727554620343364798862979025348567582374443332777430013607923554145978033313968973658509599418778909770132603041457274669147412604341235836037187872879989962621016936127514091819653515573412715658261961408162675685706200002554499693477995570537571647704036209686490377852762358564526172964417806239963342458549953299414470859647800380342774929688783380882329872783374103548767453254278992024612462803566472717756699557306034266341552786458380155479257980620321004561628269706193576163931735259724780752646162972776162894419031246978204680]
[   94845608333097133173401888178176458058832090978630604413922484212836628856606299168225592655383516946510320600786952561285584383672535782370444557928845542502800318016033743491602294306312049277866092796960805826013736829825775518426269648187883363421136852966085215421910247612201575741848139194292482051768721430018527906012269426488046758265747513494798641566802199827783229808348585230164912908128805544164279980141002798873299232313266181661270328019533635992923810686456150235396730932129375230466804467871481290704951816259796110040716930836486219583991994588336766319125808902170852173227591600459058775457997712880519539397066463308016247590116941852125967316575867074982416259646479821673341594414125367529471312245190727413975078825223112367837976434085495114687857050066610252083336737515050272209950369811875931985129459706060254484842370489024373355567653887976290504101064692469124926023290781715520535875387470931683441759534773491053101786808259343647755603278279938041928352841299637769724250061850371711697787714995062371020928486039555331072415692774208121422221288799894254156260975960627977637937664775325312194035175587094218978067022902303201317200546213304055596547273229543258328466136934551237036580051114195023626655937621557653896328644550310236669514712423764690397004384388419162642901597507898983470661842720515800673527477104236906480601610644925093160066953220006986065422049226212008252162020833988571878693620796925623704138261382316135011911942945909150227142087963748646415195807484336944765521070550962312638973564387487948839566176454971246168530810949502352518642572093583028226823818381773174139115143867987052212309115403011542565072220391630425274684713659728556538800193064808839182079147256993832713170403686970379758369998500557657108150892066393499804483707480335791460002301158524085107299551026142062002471185782037096417724527835627158594419473980665155330636050397092879438893520526866531369671015628647982314388141504753903911512625844651416959849823644449810616899404264026786969883941962862316318139956294868954158941737486232839221595049477801107679372168915288975095394927862912695483022350031666986962394011941027440468622670018481678907544041525829125922749496595577288463732270361803614110187194613630325563894603895653028659842554757675429788048709764909166842506531697578529691272393821106179926353716178985129634627039662019030317498068636227419987061196612738040762439867035389965115976196278333457010123362614934679690155154701/406778287548421232666331161732867083284451766898265331336067813926311992369988856628099086734855735667115529095643017475187509536025110579820674273512710409816506781413949219095421900994613025586328298832520783087510115995249000462483853695254032218916775883778046276732513287003348820832286627339151659920216118602434782892082868740908234817764021744897598451761291562171363826753518869638462172176786920750397046439419756522146331329906325922062334126886845307227747533166221063380004741504866680087220033007960420359539342564917059907398615028523186317797636660999604624165361705540811548027344347944843318379754195828447139714059075956823953574961456072422821379853471265957417978467907648030343371041680488666213418782854500371449004464628137151693278248611405436919105441634514379785943438321498699491374429974941411916188300692918447066207671860293291735706044903379459163329722215462487004764606673950227898048328401073006835733854423499982247502117755480969561242112088131965551967459900917790184504128348366688399796247714348331657116276519708370377748220107893500318506080007877295044619391333807678344042981270732923845847840661087831919093000529797399599904218182992292585508525349195563753868289669013772157736583348697099384043469144344547635488272911439832922066075313432817036914368704456808129124539273223910518127512694139126508695831281678860513712181333729105725904365496018849941845190976573970615503284681408750206307284620020356423014190813611899820786073110923736507592224098870834184189350561093842374187901309709249334375710994985735557672788610080629408146012015171554449734793702597134820310225203084105776449433119524680976123866181969647041370142480229859354877697883210865623491026410955602205911593318386075749335920440095933187160459299339643209960996075895440125644540573643065630406530215220384502737018981682502335606698154233159446864117915813842827734973170373721996301841763236329935471494386783276795049901144295223363777310171682399431489512674283791187221666388715006803961777072989016656984486829254799709389454885066301520728637334573706302170617918018593936439994981310508468063757045909826757786706357829130980704081337842853100001277249846738997785268785823852018104843245188926381179282263086482208903119981671229274976649707235429823900190171387464844391690441164936391687051774383726627139496012306231401783236358878349778653017133170776393229190077739628990310160502280814134853096788081965867629862390376323081486388081447209515623489102340]
 
       
 
       

Symbolic Calculus

Symbolic Calculus makes use of Maxima and Ginac under the hood.

var('x') f = sqrt(1 - x^2) plot(f, thickness=3, color='red', aspect_ratio=1, fill=True) 
       
var('t') assume(t+1 > 0) g = integrate(f, (x, -1, t)); show(g) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{1}{4} \, \pi + \frac{1}{2} \, \sqrt{-t^{2} + 1} t + \frac{1}{2} \, \arcsin\left(t\right)
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{1}{4} \, \pi + \frac{1}{2} \, \sqrt{-t^{2} + 1} t + \frac{1}{2} \, \arcsin\left(t\right)
show(g(t=1) - g(t=-1)) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{1}{2} \, \pi
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{1}{2} \, \pi
 
       
 
       

Plotting in 2D

plot(sin(1/x^2), (x,.1,.5)) 
       
G = sum(circle((random(), random()), random()/3, color=hue(random())) for i in range(25)) G.show(aspect_ratio=1, frame=True) 
       
 
       
 
       

Plotting in 3D

f(x,y) = sin(x - y) * y * cos(x) plot3d(f, (x,-3,3), (y,-3,3), opacity=.9, color='red') 
       
G = sum(sphere((random(), random(), random()), random()/4, color=hue(random()), opacity=.6) for i in range(20)) G.show(aspect_ratio=1, frame=True) 
       
 
       
 
       
 
       
# Yoda! (53,756 vertices) from scipy import io yoda = io.loadmat(DATA + 'yodapose.mat') from sage.plot.plot3d.index_face_set import IndexFaceSet V = yoda['V']; F3=yoda['F3']-1; F4=yoda['F4']-1 Y = IndexFaceSet(F3,V,color=Color('#444444')) + IndexFaceSet(F4,V,color=Color('#007700')) Y = Y.rotateX(-1) Y.show(aspect_ratio=1, frame=False, zoom=1.2) 
       
 
       

Questions

????