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 8730719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:04:54+00:00 2026-06-13T09:04:54+00:00

I am rendering 500×500 points in real-time. I have to compute the position of

  • 0

I am rendering 500×500 points in real-time.
I have to compute the position of points using atan() and sin() functions. By using atan() and sin() I am getting 24 fps (frames per second).

float thetaC = atan(value);
float h = (value) / (sin(thetaC)));

If I don’t use sin() I am getting 52 fps.

and if I dont use atan() I am 30 fps.

So, the big problem is with sin(). How can I use Fast Sin version. Can I create a Look Up Table for that ? I don’t have any specific values to create LUT. what can I do in this situation ?

PS: I have also tried fast sin function of ASM but not getting any difference.

Thanks.

  • 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-13T09:04:55+00:00Added an answer on June 13, 2026 at 9:04 am

    It depends on the accuracy that you need. The maximum derivative of sin is 1, so if if x1 and x2 are within epsilon of one another, then sin(x1) and sin(x2) are also within epsilon. If you just need accuracy to within, say 0.001, then you can create a lookup table of 1000 * PI = 3142 points, and just look up the value closest to the one you need. This can be faster than what the native code does, since the native code (probably) uses a lookup table for polynomial coefficients, and then interpolates, and since this table can be small enough to stay in cache easily.

    If you need complete accuracy over the whole range, then there’s probably nothing better that you can do.

    If you wanted, you could also create a lookup table over (1/sin(x)), since that’s your actual function of interest. Either way, you’ll want to be careful around sin(x) = 0, since a small error in sin(x) can cause a big error in 1/sin(x). Defining your error tolerance is important for figuring out what shortcuts you can take.

    You’d create the lookup table with something like:

    float *table = malloc(1000 * sizeof(float));
    for(int i = 0; i < 1000; i++){
      table[i] = sin(i/1000.0);
    }
    

    and would access it something like

    float fastSin(float x){
      int index = x * 1000.0;
      return table[index];
    }
    

    This code isn’t complete (and will crash for anything outside of 0 < x < 1, because of array bounds), but should get you started.

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

Sidebar

Related Questions

I'm rendering page using ajax and json. Structure of my json is {status:ok,rewards:[{id:201,points:500},{id:202,points:500}] How
I am getting rendering error inconsistently in JSF pages. I am using Trinidad Framework.
Getting a rendering error for this form: 'NoneType' object has no attribute 'widget' http://dpaste.com/88585/
My views are not rendering correctly. I have the same format for both views
I am rendering some meshes (sometimes upwards of 500) and I wanted to know
I have an init() method, and I am trying to create a Perspective rendering.
Rendering contexts usually have a solid color on the background (black or whatever, see
I have a Ruby on Rails application I'm using Ruby 1.9 and Rails 2.3.4
I have a mapping for 500 errors in my UrlMapings which renders a custom
I'm trying to implement a chart that can handle real time data, which comes

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.