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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:56:21+00:00 2026-05-15T22:56:21+00:00

Given log(a) and log(b), return log(a+b) double log_sum(double log_a, double log_b){ double v; if(log_a

  • 0

Given log(a) and log(b), return log(a+b)

double log_sum(double log_a, double log_b){
    double v;
    if(log_a < log_b){
        v=log_b+log(1+exp(log_a-log_b));
    }
    else{
        v=log_a+log(1+exp(log_b-log_a));
    }
    return v;
}

I want to know what are the benefits of the above function?

  • 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-15T22:56:22+00:00Added an answer on May 15, 2026 at 10:56 pm

    The primary (brute force) alternative looks like:

    v = log(exp(log_a) + exp(log_b));
    

    That has three transcendental function evaluations.

    The computation shown uses just two transcendental functions – and should be quicker.

    It may also be more stable numerically.

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

Sidebar

Ask A Question

Stats

  • Questions 491k
  • Answers 491k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try ContactsContract.Contacts.CONTACTS_URI instead. You are using the Android 1.x API,… May 16, 2026 at 10:01 am
  • Editorial Team
    Editorial Team added an answer If you're using the Enterprise Library, you have everything you… May 16, 2026 at 10:01 am
  • Editorial Team
    Editorial Team added an answer Typically (in my experience, YMMV) an hpp file is an… May 16, 2026 at 10:01 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Given the start and the end of an integer range, how do I calculate
I would like to know if anyone has info or experience on how to
How might one use the ip and timestamp from Apache's access log to approximate
I'm adding functions to my (simple) log class to make it usable like a
Is there a way of printing out every character that satifies a given regular
I'm looking for a way to create a new log in the Windows Event
Given an XML layout like this, I'm trying to create a XSD schema to
Given an Entity Data Model (EDMX) with Code Generation Strategy set to None, how
Today I needed a simple algorithm for checking if a number is a power
I'm trying to round a number to the next smallest power of another number.

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.