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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:23:20+00:00 2026-06-08T13:23:20+00:00

In a C++ CPU-bound simulation that I’m writing, I’ve traced a bottleneck via valgrind

  • 0

In a C++ CPU-bound simulation that I’m writing, I’ve traced a bottleneck via valgrind in my program to cmath::exp. It currently eats over 40% of my simulation time. I can bound the input to a relatively small domain, but I’d like to control the accuracy. I was considering moving to a LUT (lookup table) to replace exp but I’m not quite sure how to do this the “right way”(tm). Concerns I have:

  1. Large lookup tables will not fit in the cache thus slowing access
  2. Best way to convert a double input to an integer for access into the lookup table
  3. Does the answer to (2) depend on the slope of the input function?
  4. Am I reinventing the wheel – has this already been done before?

What is the best way to implement/(include from a library) a LUT for exp?

  • 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-08T13:23:21+00:00Added an answer on June 8, 2026 at 1:23 pm

    A very similar question has been asked before. Here’s my answer:

    • Fast Exp calculation: possible to improve accuracy without losing too much performance?

    The approach was suggested by the author of that question, and I was able to implement it efficiently (small lookup table and minimal extra work after lookup). It’s in C#, but translation to C++ should be straightforward and I can help if you run into trouble.

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

Sidebar

Related Questions

I am running simulation code that is largely bound by CPU speed. I am
I have a Django app running on Windows (via Apache + mod_wsgi) that's CPU-bound.
I understand that for a CPU-bound task that you typically want 1 thread per
I have CPU bound application that I wish to speedup using multiprocessing+threading instead of
Profiling my cpu-bound code has suggested I that spend a long time checking to
I'm working with an app that is cpu-bound more than memory bound, and I'm
This is more a style question. For CPU bound processes that really benefit for
We have a website that currently serves drawings to users via the SVG Viewer
I have c# Console app, Monte Carlo simulation entirely CPU bound, execution time is
I'm developing non-interactive cpu-bound application which does only computations, almost no IO. Currently it

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.