Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7851509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:12:05+00:00 2026-06-02T19:12:05+00:00

I have a control loop running at high frequency and need to compute a

  • 0

I have a control loop running at high frequency and need to compute a square root each cycle. Typical square root functions work fine but take excessive time. Since the value I’m taking the square root of doesn’t change too much on each cycle, I would like to find an iterative square root that will converge and then track the correct result. This way I could do a single iteration at each time step, rather than many.

The problem is that all of the iterative square root methods I’ve seen will probably fail when the input is changing. In particular it looks like there will be problems when the input goes to zero and then increases again – the methods don’t like to start with a guess of zero.

My input range is 0-4.5 and I need a precision of around 0.01 so using an increment/decrement of 0.01 could take far too long – I want it to mostly converge in 10 cycles or less.

FYI I’m using 16/32bit fixed point the input is 16bit q12. It’s on a micro-controller so I’m not interested in using 1K for a lookup table. The code is also generated from a simulink model and their table lookup functions are rather full of overhead.

Is there a nice solution to this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:12:07+00:00Added an answer on June 2, 2026 at 7:12 pm

    You can use one shot of Halley method. It has cubic convergence and therefore should be quite precise if the value moves slightly:

    x_{n+1} = x_n * (x_n^2 + 3Q) / (3 x_n^2 + Q)
    

    This converges cubcially to sqrt(Q).

    Reference: http://www.mathpath.org/Algor/squareroot/algor.square.root.halley.htm

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I running into an infinite loop problem. I have two numeric up/down controls (Height
I have few asynchronous tasks running and I need to wait until at least
I have a custom control where I loop thru an configuration object to build
I have control over the HttpServer but not over the ApplicationServer or the Java
I have control, subclassed from CDialogBar, it has some buttons(like on toolbar). When I
I have a WCF service hosted for internal clients - we have control of
I'm trying to skin HTML output which I don't have control over. One of
In WinForms, you have Control.BeginInvoke() , which means you can marshall a call from
Is there a way to Minimize an external application that I don't have control
I want to read UTF-8 strings from a server that I have control of,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.