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
 
5.2 divide and conquer
5.2 divide and conquer5.2 divide and conquer
5.2 divide and conquer
 
03 dc
03 dc03 dc
03 dc
 
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

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 

Recently uploaded (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 

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