SlideShare a Scribd company logo
1 of 3
Download to read offline
Convergence methods for approximated
reciprocal and reciprocal-square-root
Keigo Nitadori
February 4, 2014
Since most hardware of today supports instructions for approximating reciprocal (hereafter rcp) y ∼ 1/x, and reciprocal-square-root (rsqrt)
√
y ∼ 1/ x, convergence methods for these have some interests.

1

General form

Provided an approximation
yapp = (1 + ε)

1
x1/n

,

n = 1 gives rcp and n = 2 rsqrt. Then, calculate a small number
n
h = 1 − xyapp = 1 − (1 + ε)n .

Hence,

1 + ε = (1 − h)1/n .

The true value of y is obtained in
y = yapp /(1 + ε) = (1 − h)−1/n · yapp .
The factor (1 − h)−1/n is expanded in Taylor series to a certain order, as in
p(h) = 1 + a1 h + a2 h2 · · ·

1

(1 − h)−1/n .
n = 1, reciprocal

2

For n = 1, we have a very simple series ak = 1. A second order method
y =(1 + h) · yapp
=(2 − xyapp ) · yapp ,
is well-known as the Newton–Raphson method. A polynomial for a fourth
order convergence is factorized in
p(h) = (1 + h)(1 + h2 ),
and an eighth order one
p(h) = (1 + h)(1 + h2 )(1 + h4 ).
Here, an m-th order convergence means that the effective digits grow m
times per iteration. We remark that h = 1 − xyapp is very accurately calculated in FMA (fused multiply-add) hardware.

n = 2, reciprocal-square-root

3

For n = 2, the polynomial takes a form
1
3
5
35
+h +h
+h
+ h ...
2
8
16
128

p(h) = 1 + h

,

with general coefficients
ak =

(2k − 1)!! k(2k − 1)!
= 2k−1
.
2k k!
2
(k!)2

Here, (·)!! is a double factorial 1 .
The second order one
3
2
y yapp − (x/2) yapp
2
1
2
=yapp + yapp − (x/2) yapp ,
2
is known as the Newton–Raphson method. The (x/2) can be reused over
iterations. The form in the second line is slightly suitable for FMA hardware.
1

0!! = 1!! = 1, n!! = n(n − 2)!!

2
4

Other cases

We put a sequence for n = 3, a reciprocal of cbrt() function.
1 2 14 35 91
,
,...
{ak } = 1, , , ,
3 9 81 243 729

(k ≥ 0),

which we obtained from Maxima with
taylor((1-h)ˆ(-1/3), h, 0, 5);
Also, it is fun to see
powerseries((1-h)ˆ(-1/3), h, 0);
which outputs
∞

(%)
i=0

hi (−1)i
β

2
3

− i, i i

where β(·, ·) is the beta function 2 .
Finally, we remark that higher order methods can cause pressure for
registers to store the coefficients. The application need to find a suitable
points for the order of convergence and the number of iterations.

Reference
Japanese readers should also refer to:
http://www.finetune.co.jp/˜lyuka/technote/fract/sqrt.html

2

http://en.wikipedia.org/wiki/Beta_function

3

More Related Content

What's hot

Trilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operatorsTrilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operatorsVjekoslavKovac1
 
Topic: Fourier Series ( Periodic Function to change of interval)
Topic: Fourier Series ( Periodic Function to  change of interval)Topic: Fourier Series ( Periodic Function to  change of interval)
Topic: Fourier Series ( Periodic Function to change of interval)Abhishek Choksi
 
Quantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averagesQuantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averagesVjekoslavKovac1
 
Response Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty QuantificationResponse Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty QuantificationAlexander Litvinenko
 
Toward an Improved Computational Strategy for Vibration-Proof Structures Equi...
Toward an Improved Computational Strategy for Vibration-Proof Structures Equi...Toward an Improved Computational Strategy for Vibration-Proof Structures Equi...
Toward an Improved Computational Strategy for Vibration-Proof Structures Equi...Alessandro Palmeri
 
07 periodic functions and fourier series
07 periodic functions and fourier series07 periodic functions and fourier series
07 periodic functions and fourier seriesKrishna Gali
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra Sahil Kumar
 
Unit 2 analysis of continuous time signals-mcq questions
Unit 2   analysis of continuous time signals-mcq questionsUnit 2   analysis of continuous time signals-mcq questions
Unit 2 analysis of continuous time signals-mcq questionsDr.SHANTHI K.G
 
On maximal and variational Fourier restriction
On maximal and variational Fourier restrictionOn maximal and variational Fourier restriction
On maximal and variational Fourier restrictionVjekoslavKovac1
 
The lattice Boltzmann equation: background and boundary conditions
The lattice Boltzmann equation: background and boundary conditionsThe lattice Boltzmann equation: background and boundary conditions
The lattice Boltzmann equation: background and boundary conditionsTim Reis
 
The lattice Boltzmann equation: background, boundary conditions, and Burnett-...
The lattice Boltzmann equation: background, boundary conditions, and Burnett-...The lattice Boltzmann equation: background, boundary conditions, and Burnett-...
The lattice Boltzmann equation: background, boundary conditions, and Burnett-...Tim Reis
 
Application of analytic function
Application of analytic functionApplication of analytic function
Application of analytic functionDr. Nirav Vyas
 
Understanding lattice Boltzmann boundary conditions through moments
Understanding lattice Boltzmann boundary conditions through momentsUnderstanding lattice Boltzmann boundary conditions through moments
Understanding lattice Boltzmann boundary conditions through momentsTim Reis
 
Minimum spanning tree algorithms by ibrahim_alfayoumi
Minimum spanning tree algorithms by ibrahim_alfayoumiMinimum spanning tree algorithms by ibrahim_alfayoumi
Minimum spanning tree algorithms by ibrahim_alfayoumiIbrahim Alfayoumi
 
Norm-variation of bilinear averages
Norm-variation of bilinear averagesNorm-variation of bilinear averages
Norm-variation of bilinear averagesVjekoslavKovac1
 
A Note on the Derivation of the Variational Inference Updates for DILN
A Note on the Derivation of the Variational Inference Updates for DILNA Note on the Derivation of the Variational Inference Updates for DILN
A Note on the Derivation of the Variational Inference Updates for DILNTomonari Masada
 
Bellman ford
Bellman fordBellman ford
Bellman fordKiran K
 
Longest common subsequence
Longest common subsequenceLongest common subsequence
Longest common subsequenceKiran K
 
Johnson's algorithm
Johnson's algorithmJohnson's algorithm
Johnson's algorithmKiran K
 

What's hot (20)

Trilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operatorsTrilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operators
 
Topic: Fourier Series ( Periodic Function to change of interval)
Topic: Fourier Series ( Periodic Function to  change of interval)Topic: Fourier Series ( Periodic Function to  change of interval)
Topic: Fourier Series ( Periodic Function to change of interval)
 
Quantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averagesQuantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averages
 
Response Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty QuantificationResponse Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty Quantification
 
Toward an Improved Computational Strategy for Vibration-Proof Structures Equi...
Toward an Improved Computational Strategy for Vibration-Proof Structures Equi...Toward an Improved Computational Strategy for Vibration-Proof Structures Equi...
Toward an Improved Computational Strategy for Vibration-Proof Structures Equi...
 
07 periodic functions and fourier series
07 periodic functions and fourier series07 periodic functions and fourier series
07 periodic functions and fourier series
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
 
Unit 2 analysis of continuous time signals-mcq questions
Unit 2   analysis of continuous time signals-mcq questionsUnit 2   analysis of continuous time signals-mcq questions
Unit 2 analysis of continuous time signals-mcq questions
 
On maximal and variational Fourier restriction
On maximal and variational Fourier restrictionOn maximal and variational Fourier restriction
On maximal and variational Fourier restriction
 
The lattice Boltzmann equation: background and boundary conditions
The lattice Boltzmann equation: background and boundary conditionsThe lattice Boltzmann equation: background and boundary conditions
The lattice Boltzmann equation: background and boundary conditions
 
The lattice Boltzmann equation: background, boundary conditions, and Burnett-...
The lattice Boltzmann equation: background, boundary conditions, and Burnett-...The lattice Boltzmann equation: background, boundary conditions, and Burnett-...
The lattice Boltzmann equation: background, boundary conditions, and Burnett-...
 
Application of analytic function
Application of analytic functionApplication of analytic function
Application of analytic function
 
Understanding lattice Boltzmann boundary conditions through moments
Understanding lattice Boltzmann boundary conditions through momentsUnderstanding lattice Boltzmann boundary conditions through moments
Understanding lattice Boltzmann boundary conditions through moments
 
Minimum spanning tree algorithms by ibrahim_alfayoumi
Minimum spanning tree algorithms by ibrahim_alfayoumiMinimum spanning tree algorithms by ibrahim_alfayoumi
Minimum spanning tree algorithms by ibrahim_alfayoumi
 
Norm-variation of bilinear averages
Norm-variation of bilinear averagesNorm-variation of bilinear averages
Norm-variation of bilinear averages
 
A Note on the Derivation of the Variational Inference Updates for DILN
A Note on the Derivation of the Variational Inference Updates for DILNA Note on the Derivation of the Variational Inference Updates for DILN
A Note on the Derivation of the Variational Inference Updates for DILN
 
ENFPC 2010
ENFPC 2010ENFPC 2010
ENFPC 2010
 
Bellman ford
Bellman fordBellman ford
Bellman ford
 
Longest common subsequence
Longest common subsequenceLongest common subsequence
Longest common subsequence
 
Johnson's algorithm
Johnson's algorithmJohnson's algorithm
Johnson's algorithm
 

Similar to Convergence methods for approximated reciprocal and reciprocal-square-root

C222529
C222529C222529
C222529irjes
 
Number Theory for Security
Number Theory for SecurityNumber Theory for Security
Number Theory for SecurityAbhijit Mondal
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquerVikas Sharma
 
Newton's Raphson method
Newton's Raphson methodNewton's Raphson method
Newton's Raphson methodSaloni Singhal
 
A transference result of Lp continuity from the Jacobi Riesz transform to the...
A transference result of Lp continuity from the Jacobi Riesz transform to the...A transference result of Lp continuity from the Jacobi Riesz transform to the...
A transference result of Lp continuity from the Jacobi Riesz transform to the...Wilfredo Urbina
 
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 1. KKR法
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 1. KKR法第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 1. KKR法
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 1. KKR法Computational Materials Science Initiative
 
Fixed points and two-cycles of the self-power map
Fixed points and two-cycles of the self-power mapFixed points and two-cycles of the self-power map
Fixed points and two-cycles of the self-power mapJoshua Holden
 
Approximate Bayesian Computation with Quasi-Likelihoods
Approximate Bayesian Computation with Quasi-LikelihoodsApproximate Bayesian Computation with Quasi-Likelihoods
Approximate Bayesian Computation with Quasi-LikelihoodsStefano Cabras
 
5.2 divide and conquer
5.2 divide and conquer5.2 divide and conquer
5.2 divide and conquerKrish_ver2
 
Natural and Clamped Cubic Splines
Natural and Clamped Cubic SplinesNatural and Clamped Cubic Splines
Natural and Clamped Cubic SplinesMark Brandao
 

Similar to Convergence methods for approximated reciprocal and reciprocal-square-root (20)

Chris Sherlock's slides
Chris Sherlock's slidesChris Sherlock's slides
Chris Sherlock's slides
 
Pairing scott
Pairing scottPairing scott
Pairing scott
 
C222529
C222529C222529
C222529
 
Number Theory for Security
Number Theory for SecurityNumber Theory for Security
Number Theory for Security
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
Newton's Raphson method
Newton's Raphson methodNewton's Raphson method
Newton's Raphson method
 
lecture6.ppt
lecture6.pptlecture6.ppt
lecture6.ppt
 
S 7
S 7S 7
S 7
 
App8
App8App8
App8
 
A transference result of Lp continuity from the Jacobi Riesz transform to the...
A transference result of Lp continuity from the Jacobi Riesz transform to the...A transference result of Lp continuity from the Jacobi Riesz transform to the...
A transference result of Lp continuity from the Jacobi Riesz transform to the...
 
LPS talk notes
LPS talk notesLPS talk notes
LPS talk notes
 
Quadrature
QuadratureQuadrature
Quadrature
 
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 1. KKR法
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 1. KKR法第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 1. KKR法
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 1. KKR法
 
Sol68
Sol68Sol68
Sol68
 
Sol68
Sol68Sol68
Sol68
 
Fixed points and two-cycles of the self-power map
Fixed points and two-cycles of the self-power mapFixed points and two-cycles of the self-power map
Fixed points and two-cycles of the self-power map
 
Approximate Bayesian Computation with Quasi-Likelihoods
Approximate Bayesian Computation with Quasi-LikelihoodsApproximate Bayesian Computation with Quasi-Likelihoods
Approximate Bayesian Computation with Quasi-Likelihoods
 
03 dc
03 dc03 dc
03 dc
 
5.2 divide and conquer
5.2 divide and conquer5.2 divide and conquer
5.2 divide and conquer
 
Natural and Clamped Cubic Splines
Natural and Clamped Cubic SplinesNatural and Clamped Cubic Splines
Natural and Clamped Cubic Splines
 

More from Keigo Nitadori

Hermite integrators and 2-parameter subgroup of Riordan group
Hermite integrators and 2-parameter subgroup of Riordan groupHermite integrators and 2-parameter subgroup of Riordan group
Hermite integrators and 2-parameter subgroup of Riordan groupKeigo Nitadori
 
上三角 Pascal 行列による多項式のシフト
上三角 Pascal 行列による多項式のシフト上三角 Pascal 行列による多項式のシフト
上三角 Pascal 行列による多項式のシフトKeigo Nitadori
 
Higher order derivatives for N -body simulations
Higher order derivatives for N -body simulationsHigher order derivatives for N -body simulations
Higher order derivatives for N -body simulationsKeigo Nitadori
 
Snake eats leapfrog (in Japanese)
Snake eats leapfrog (in Japanese)Snake eats leapfrog (in Japanese)
Snake eats leapfrog (in Japanese)Keigo Nitadori
 

More from Keigo Nitadori (6)

Hermite integrators and 2-parameter subgroup of Riordan group
Hermite integrators and 2-parameter subgroup of Riordan groupHermite integrators and 2-parameter subgroup of Riordan group
Hermite integrators and 2-parameter subgroup of Riordan group
 
上三角 Pascal 行列による多項式のシフト
上三角 Pascal 行列による多項式のシフト上三角 Pascal 行列による多項式のシフト
上三角 Pascal 行列による多項式のシフト
 
Higher order derivatives for N -body simulations
Higher order derivatives for N -body simulationsHigher order derivatives for N -body simulations
Higher order derivatives for N -body simulations
 
FMMの実装と導出
FMMの実装と導出FMMの実装と導出
FMMの実装と導出
 
Snake eats leapfrog (in Japanese)
Snake eats leapfrog (in Japanese)Snake eats leapfrog (in Japanese)
Snake eats leapfrog (in Japanese)
 
Rh typing
Rh typingRh typing
Rh typing
 

Recently uploaded

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
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
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
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
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
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
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
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
 
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
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 

Recently uploaded (20)

Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
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
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
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
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).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
 
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
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
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
 
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
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

Convergence methods for approximated reciprocal and reciprocal-square-root

  • 1. Convergence methods for approximated reciprocal and reciprocal-square-root Keigo Nitadori February 4, 2014 Since most hardware of today supports instructions for approximating reciprocal (hereafter rcp) y ∼ 1/x, and reciprocal-square-root (rsqrt) √ y ∼ 1/ x, convergence methods for these have some interests. 1 General form Provided an approximation yapp = (1 + ε) 1 x1/n , n = 1 gives rcp and n = 2 rsqrt. Then, calculate a small number n h = 1 − xyapp = 1 − (1 + ε)n . Hence, 1 + ε = (1 − h)1/n . The true value of y is obtained in y = yapp /(1 + ε) = (1 − h)−1/n · yapp . The factor (1 − h)−1/n is expanded in Taylor series to a certain order, as in p(h) = 1 + a1 h + a2 h2 · · · 1 (1 − h)−1/n .
  • 2. n = 1, reciprocal 2 For n = 1, we have a very simple series ak = 1. A second order method y =(1 + h) · yapp =(2 − xyapp ) · yapp , is well-known as the Newton–Raphson method. A polynomial for a fourth order convergence is factorized in p(h) = (1 + h)(1 + h2 ), and an eighth order one p(h) = (1 + h)(1 + h2 )(1 + h4 ). Here, an m-th order convergence means that the effective digits grow m times per iteration. We remark that h = 1 − xyapp is very accurately calculated in FMA (fused multiply-add) hardware. n = 2, reciprocal-square-root 3 For n = 2, the polynomial takes a form 1 3 5 35 +h +h +h + h ... 2 8 16 128 p(h) = 1 + h , with general coefficients ak = (2k − 1)!! k(2k − 1)! = 2k−1 . 2k k! 2 (k!)2 Here, (·)!! is a double factorial 1 . The second order one 3 2 y yapp − (x/2) yapp 2 1 2 =yapp + yapp − (x/2) yapp , 2 is known as the Newton–Raphson method. The (x/2) can be reused over iterations. The form in the second line is slightly suitable for FMA hardware. 1 0!! = 1!! = 1, n!! = n(n − 2)!! 2
  • 3. 4 Other cases We put a sequence for n = 3, a reciprocal of cbrt() function. 1 2 14 35 91 , ,... {ak } = 1, , , , 3 9 81 243 729 (k ≥ 0), which we obtained from Maxima with taylor((1-h)ˆ(-1/3), h, 0, 5); Also, it is fun to see powerseries((1-h)ˆ(-1/3), h, 0); which outputs ∞ (%) i=0 hi (−1)i β 2 3 − i, i i where β(·, ·) is the beta function 2 . Finally, we remark that higher order methods can cause pressure for registers to store the coefficients. The application need to find a suitable points for the order of convergence and the number of iterations. Reference Japanese readers should also refer to: http://www.finetune.co.jp/˜lyuka/technote/fract/sqrt.html 2 http://en.wikipedia.org/wiki/Beta_function 3