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

  • Home
  • SEARCH
  • 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 8398777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:08:02+00:00 2026-06-09T21:08:02+00:00

I am confused about using expm1 function in java The Oracle java doc for

  • 0

I am confused about using expm1 function in java
The Oracle java doc for Math.expm1 says:

Returns exp(x) -1. Note that for values of x near 0, the exact sum of
expm1(x) + 1 is much closer to the true result of ex than exp(x).

but this page says:

However, for negative values of x, roughly -4 and lower, the algorithm
used to calculate Math.exp() is relatively ill-behaved and subject to
round-off error. It’s more accurate to calculate ex – 1 with a
different algorithm and then add 1 to the final result.

should we use expm1(x) for negative x values or near 0 values?

  • 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-09T21:08:03+00:00Added an answer on June 9, 2026 at 9:08 pm

    The implementation of double at the bit level means that you can store doubles near 0 with much more precision than doubles near 1. That’s why expm1 can give you much more accuracy for near-zero powers than exp can, because double doesn’t have enough precision to store very accurate numbers very close to 1.

    I don’t believe the article you’re citing is correct, as far as the accuracy of Math.exp goes (modulo the limitations of double). The Math.exp specification guarantees that the result is within 1 ulp of the exact value, which means — to oversimplify a bit — a relative error of at most 2^-52, ish.

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

Sidebar

Related Questions

I'm very confused about behaviour of PHP's left shift function. I'm using it on
I am using Oracle Database and I am a bit confused about Drop and
I'm a bit confused about using STL set::find() for a set of my own
I am confused about using php or python for implementing server program . I
I'm confused about the correct way of using asynchronous socket methods in C#. I
I am using a UITextView and I am confused about making the keyboard to
I'm new to SVN and I'm quite confused about a problem. I am using
I am a little confused about the roles of a java application server and
I'm a little confused about using release vs. debug versions of a dll for
I'm a little confused about clean-up order when you're using PThreads with regard 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.