SlideShare a Scribd company logo
1 of 2
Download to read offline
Part2
frommathimport *
fromsimpsonimport *
k=1
deff(x):return(exp(-(x**2)))
E= error(f,-2.0,2.0,k)
while(E> 1e-4):
k += 1
E= error(f,-2.0,2.0,k)
I = simpson(f,-2.0,2.0,k)
print "Integralfrom[-2.0,2.0] ofe^(-x^2) = ",I
print "Error:", E
print "MinimalIntervals for 10^-4 = ",2**k
print ""
k=1
deff(x):return8*(sqrt(1+cos(2*x)))
E= error(f,0.0,4.0,k)
while(E> 1e-4):
k += 1
E= error(f,0.0,4.0,k)
I = simpson(f,0.0,4.0,k)
print "Integralfrom[0.0,4.0] of8*(sqrt(1+cos(2*x))) = ",I
print "Error:", E
print "MinimalIntervals for 10^-4 = ", 2**k
print ""
k=1
deff(x):return(100.0/(x**2))
E= error(f,1.0,3.0,k)
while(E> 1e-4):
k += 1
E= error(f,1.0,3.0,k)
I = simpson(f,1.0,3.0,k)
print "Integralfrom[1,3] of100/x^2 = ",I
print "Error:", E
print "MinimalIntervals for 10^-4 = ",2**k
print ""
k=8
deff(x):return(exp(-(x**2)))
E= error(f,-2.0,2.0,k)
while(E> 1e-8):
k += 1
E= error(f,-2.0,2.0,k)
I = simpson(f,-2.0,2.0,k)
print "Integralfrom[-2.0,2.0] ofe^(-x^2) = ",I
print "Error:", E
print "MinimalIntervals for 10^-8 = ",2**k
print ""
k=8
deff(x):return8*(sqrt(1+cos(2*x)))
E= error(f,0.0,4.0,k)
while(E> 1e-8):
k += 1
E= error(f,0.0,4.0,k)
I = simpson(f,0.0,4.0,k)
print "Integralfrom[0.0,4.0] of8*(sqrt(1+cos(2*x))) = ",I
print "Error:", E
print "MinimalIntervals for 10^-8 = ",2**k
print ""
k=8
deff(x):return(100.0/(x**2))
E= error(f,1.0,3.0,k)
while(E> 1e-8):
k += 1
E= error(f,1.0,3.0,k)
I = simpson(f,1.0,3.0,k)
print "Integralfrom[1,3] of100/x^2 = ",I
print "Error:", E
print "MinimalIntervals for 10^-8 = ",2**k
print ""

More Related Content

What's hot

Regex, Python & Twitter
Regex, Python & TwitterRegex, Python & Twitter
Regex, Python & TwitterStelian Firez
 
Short intro to the Rust language
Short intro to the Rust languageShort intro to the Rust language
Short intro to the Rust languageGines Espada
 
Introducción a Elixir
Introducción a ElixirIntroducción a Elixir
Introducción a ElixirSvet Ivantchev
 
The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)GroovyPuzzlers
 
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий КуриловАсинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий КуриловYandex
 
Excel function
Excel functionExcel function
Excel functionSirajRock
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and CEleanor McHugh
 
Clustering com numpy e cython
Clustering com numpy e cythonClustering com numpy e cython
Clustering com numpy e cythonAnderson Dantas
 
The Ring programming language version 1.5.2 book - Part 41 of 181
The Ring programming language version 1.5.2 book - Part 41 of 181The Ring programming language version 1.5.2 book - Part 41 of 181
The Ring programming language version 1.5.2 book - Part 41 of 181Mahmoud Samir Fayed
 
Simpson and lagranje dalambair math methods
Simpson and lagranje dalambair math methods Simpson and lagranje dalambair math methods
Simpson and lagranje dalambair math methods kinan keshkeh
 
Scala kansai summit-2016
Scala kansai summit-2016Scala kansai summit-2016
Scala kansai summit-2016Naoki Kitora
 
The Ring programming language version 1.2 book - Part 30 of 84
The Ring programming language version 1.2 book - Part 30 of 84The Ring programming language version 1.2 book - Part 30 of 84
The Ring programming language version 1.2 book - Part 30 of 84Mahmoud Samir Fayed
 
Elixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicitElixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicitTobias Pfeiffer
 

What's hot (20)

Unix prog
Unix progUnix prog
Unix prog
 
20151224-games
20151224-games20151224-games
20151224-games
 
Go a crash course
Go   a crash courseGo   a crash course
Go a crash course
 
Py3k
Py3kPy3k
Py3k
 
Regex, Python & Twitter
Regex, Python & TwitterRegex, Python & Twitter
Regex, Python & Twitter
 
Short intro to the Rust language
Short intro to the Rust languageShort intro to the Rust language
Short intro to the Rust language
 
Stack array
Stack arrayStack array
Stack array
 
Introducción a Elixir
Introducción a ElixirIntroducción a Elixir
Introducción a Elixir
 
The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)
 
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий КуриловАсинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
Асинхронность и многопоточность в Яндекс.Такси — Дмитрий Курилов
 
Excel function
Excel functionExcel function
Excel function
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and C
 
oop Lecture 4
oop Lecture 4oop Lecture 4
oop Lecture 4
 
Clustering com numpy e cython
Clustering com numpy e cythonClustering com numpy e cython
Clustering com numpy e cython
 
The Ring programming language version 1.5.2 book - Part 41 of 181
The Ring programming language version 1.5.2 book - Part 41 of 181The Ring programming language version 1.5.2 book - Part 41 of 181
The Ring programming language version 1.5.2 book - Part 41 of 181
 
Simpson and lagranje dalambair math methods
Simpson and lagranje dalambair math methods Simpson and lagranje dalambair math methods
Simpson and lagranje dalambair math methods
 
Scala kansai summit-2016
Scala kansai summit-2016Scala kansai summit-2016
Scala kansai summit-2016
 
The Ring programming language version 1.2 book - Part 30 of 84
The Ring programming language version 1.2 book - Part 30 of 84The Ring programming language version 1.2 book - Part 30 of 84
The Ring programming language version 1.2 book - Part 30 of 84
 
Clang2018 class3
Clang2018 class3Clang2018 class3
Clang2018 class3
 
Elixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicitElixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicit
 

Similar to Simpson's Rule Numerical Integration Examples

関数プログラミングことはじめ revival
関数プログラミングことはじめ revival関数プログラミングことはじめ revival
関数プログラミングことはじめ revivalNaoki Kitora
 
Modul 3 quadratic function
Modul 3 quadratic functionModul 3 quadratic function
Modul 3 quadratic functionHafidz Mukhtar
 
Introductory RxJava
Introductory RxJavaIntroductory RxJava
Introductory RxJavaIntae Kim
 
Go: It's Not Just For Google
Go: It's Not Just For GoogleGo: It's Not Just For Google
Go: It's Not Just For GoogleEleanor McHugh
 
Elixir -Tolerância a Falhas para Adultos - GDG Campinas
Elixir  -Tolerância a Falhas para Adultos - GDG CampinasElixir  -Tolerância a Falhas para Adultos - GDG Campinas
Elixir -Tolerância a Falhas para Adultos - GDG CampinasFabio Akita
 
関数潮流(Function Tendency)
関数潮流(Function Tendency)関数潮流(Function Tendency)
関数潮流(Function Tendency)riue
 
52 notation and algebra of functions
52 notation and algebra of functions52 notation and algebra of functions
52 notation and algebra of functionsmath126
 
chap 2 Ex#1.1
chap 2 Ex#1.1chap 2 Ex#1.1
chap 2 Ex#1.1Ans Ali
 
1.5 notation and algebra of functions
1.5 notation and algebra of functions1.5 notation and algebra of functions
1.5 notation and algebra of functionsmath123c
 
Excel macro for solving a polynomial equation
Excel macro for solving a polynomial equationExcel macro for solving a polynomial equation
Excel macro for solving a polynomial equationUpendra Lele
 
Turning Point of the Pokemon Battle. pptx
Turning Point of the  Pokemon Battle. pptxTurning Point of the  Pokemon Battle. pptx
Turning Point of the Pokemon Battle. pptxPatrickMaravilla1
 
functions limits and continuity
functions limits and continuityfunctions limits and continuity
functions limits and continuityPume Ananda
 
Tarea De Scilab By Sebastian Vasquez
Tarea De Scilab By Sebastian VasquezTarea De Scilab By Sebastian Vasquez
Tarea De Scilab By Sebastian VasquezSebastian Vasquez
 
Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語ikdysfm
 
Interpolation functions
Interpolation functionsInterpolation functions
Interpolation functionsTarun Gehlot
 

Similar to Simpson's Rule Numerical Integration Examples (20)

関数プログラミングことはじめ revival
関数プログラミングことはじめ revival関数プログラミングことはじめ revival
関数プログラミングことはじめ revival
 
Modul 3 quadratic function
Modul 3 quadratic functionModul 3 quadratic function
Modul 3 quadratic function
 
Sary
SarySary
Sary
 
Introductory RxJava
Introductory RxJavaIntroductory RxJava
Introductory RxJava
 
Go: It's Not Just For Google
Go: It's Not Just For GoogleGo: It's Not Just For Google
Go: It's Not Just For Google
 
Elixir -Tolerância a Falhas para Adultos - GDG Campinas
Elixir  -Tolerância a Falhas para Adultos - GDG CampinasElixir  -Tolerância a Falhas para Adultos - GDG Campinas
Elixir -Tolerância a Falhas para Adultos - GDG Campinas
 
関数潮流(Function Tendency)
関数潮流(Function Tendency)関数潮流(Function Tendency)
関数潮流(Function Tendency)
 
52 notation and algebra of functions
52 notation and algebra of functions52 notation and algebra of functions
52 notation and algebra of functions
 
C++ TUTORIAL 10
C++ TUTORIAL 10C++ TUTORIAL 10
C++ TUTORIAL 10
 
chap 2 Ex#1.1
chap 2 Ex#1.1chap 2 Ex#1.1
chap 2 Ex#1.1
 
1.5 notation and algebra of functions
1.5 notation and algebra of functions1.5 notation and algebra of functions
1.5 notation and algebra of functions
 
Excel macro for solving a polynomial equation
Excel macro for solving a polynomial equationExcel macro for solving a polynomial equation
Excel macro for solving a polynomial equation
 
Gilat_ch05.pdf
Gilat_ch05.pdfGilat_ch05.pdf
Gilat_ch05.pdf
 
Functions limits and continuity
Functions limits and continuityFunctions limits and continuity
Functions limits and continuity
 
Turning Point of the Pokemon Battle. pptx
Turning Point of the  Pokemon Battle. pptxTurning Point of the  Pokemon Battle. pptx
Turning Point of the Pokemon Battle. pptx
 
functions limits and continuity
functions limits and continuityfunctions limits and continuity
functions limits and continuity
 
Tarea De Scilab By Sebastian Vasquez
Tarea De Scilab By Sebastian VasquezTarea De Scilab By Sebastian Vasquez
Tarea De Scilab By Sebastian Vasquez
 
Matlab differential
Matlab differentialMatlab differential
Matlab differential
 
Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語
 
Interpolation functions
Interpolation functionsInterpolation functions
Interpolation functions
 

Recently uploaded

Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 

Recently uploaded (20)

Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 

Simpson's Rule Numerical Integration Examples

  • 1. Part2 frommathimport * fromsimpsonimport * k=1 deff(x):return(exp(-(x**2))) E= error(f,-2.0,2.0,k) while(E> 1e-4): k += 1 E= error(f,-2.0,2.0,k) I = simpson(f,-2.0,2.0,k) print "Integralfrom[-2.0,2.0] ofe^(-x^2) = ",I print "Error:", E print "MinimalIntervals for 10^-4 = ",2**k print "" k=1 deff(x):return8*(sqrt(1+cos(2*x))) E= error(f,0.0,4.0,k) while(E> 1e-4): k += 1 E= error(f,0.0,4.0,k) I = simpson(f,0.0,4.0,k) print "Integralfrom[0.0,4.0] of8*(sqrt(1+cos(2*x))) = ",I print "Error:", E print "MinimalIntervals for 10^-4 = ", 2**k print "" k=1 deff(x):return(100.0/(x**2)) E= error(f,1.0,3.0,k) while(E> 1e-4): k += 1 E= error(f,1.0,3.0,k) I = simpson(f,1.0,3.0,k) print "Integralfrom[1,3] of100/x^2 = ",I print "Error:", E print "MinimalIntervals for 10^-4 = ",2**k print "" k=8 deff(x):return(exp(-(x**2))) E= error(f,-2.0,2.0,k) while(E> 1e-8): k += 1 E= error(f,-2.0,2.0,k) I = simpson(f,-2.0,2.0,k) print "Integralfrom[-2.0,2.0] ofe^(-x^2) = ",I print "Error:", E print "MinimalIntervals for 10^-8 = ",2**k print "" k=8 deff(x):return8*(sqrt(1+cos(2*x))) E= error(f,0.0,4.0,k) while(E> 1e-8): k += 1 E= error(f,0.0,4.0,k) I = simpson(f,0.0,4.0,k) print "Integralfrom[0.0,4.0] of8*(sqrt(1+cos(2*x))) = ",I print "Error:", E print "MinimalIntervals for 10^-8 = ",2**k print ""
  • 2. k=8 deff(x):return(100.0/(x**2)) E= error(f,1.0,3.0,k) while(E> 1e-8): k += 1 E= error(f,1.0,3.0,k) I = simpson(f,1.0,3.0,k) print "Integralfrom[1,3] of100/x^2 = ",I print "Error:", E print "MinimalIntervals for 10^-8 = ",2**k print ""