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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:16:26+00:00 2026-05-17T19:16:26+00:00

I did a course at university that explained how (amongst other things) to order

  • 0

I did a course at university that explained how (amongst other things) to order your mathematical execution to maximize precision and reduce the risk of rounding errors in a finite precision environment.

We are working on a financial system with your usual interest calculations and such. Can somebody please share/remind me how to structure your calculations as to minimze loss of precision?

I know that, for instance, division must be avoided. Also, when you divide, to divide the largest number first, if possible.

  • 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-05-17T19:16:26+00:00Added an answer on May 17, 2026 at 7:16 pm

    The cardinal rule of numerical computing is to avoid subtracting nearly equal numbers. Multiplication and division are always accurate: you lose at most one bit of precision in performing a multiply or divide. But if two numbers agree to n bits, you can lose up to n bits of precision in their subtraction.

    There are all kinds of tricks for avoiding such subtractions. For example, suppose you need to calculate exp(x) – 1 for small values of x. (This is something you might do in an interest calculation.) If x is so small that exp(x) equals 1 to all the precision of the computer, then the subtraction will give exactly 0, and the resulting relative error will be 100%. But if you use the Taylor approximation exp(x) – 1 = x + x^2/2 + … you could get a more accurate answer. For example, exp(10^-17) – 1 will be completely inaccurate, but 10^-17, the one-term Taylor approximation, would be very accurate. This is how functions like expm1 work. See the explanation of log1p and expm1 here.

    If you’re concerned about numerical accuracy, you need to understand the anatomy of floating point numbers in order to know what is safe and what is not.

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

Sidebar

Related Questions

Did actually someone make already a tutorial that shows how to customize an UITableView?
I have a project for a course, I did almost everything but I have
I'm taking a course that is requiring the use of Checkstyle. I'm quite confused
I observed something last week that I did not expect, and will describe below.
I am new to multilingual data and my confession is that I never did
I wrote an exam paper today, for a university course concerned with the implementation
I'm taking an algorithm course at the university, and for one of my projects
In my code, I did as follows: queried for a course entity populate it
By the question I off course don't mean why the hell they did not
I did a git pull and found that one of my files needs to

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.