Questions tagged [natural-logarithm]

Use this tag for questions related to Natural logarithm which is logarithm to the base `e`. The natural logarithm is generally written as `ln x` or `ln(x)`.

Natural logarithm is logarithm to the base e, where e is approximately equal to 2.718281828 (though, like π, it's a transcendental number). The natural logarithm is generally written as ln x or ln(x).

87 questions
0
votes
1 answer

Convert float to log space in python

I am implementing the Viterbi algorithm (a dynamic algorithm) in Python, and I notice that for large input files, the probabilities keep getting multiplied and shrinking beyond the floating point precision. I need to store the numbers in log space.…
Rock Lee
  • 9,146
  • 10
  • 55
  • 88
0
votes
0 answers

Why does this 3D curve in R show a clear maximum for sigma^2 but not for mu?

So I used the rgl package and created my own likelihood function to output the log likelihood of a sample from a normal distribution. I was doing this really just to learn how to program this myself so I could better understand how likelihood works…
saltthehash
  • 316
  • 5
  • 11
0
votes
6 answers

C++ program which calculates ln for a given variable x without using any ready functions

I've searched for the equation which calculates the ln of a number x and found out that this equation is: and I've written this code to implement it: double ln = x-1 ; for(int i=2;i<=5;i++) { double tmp = 1 ; for(int…
Mohamed Ibrahim Elsayed
  • 2,734
  • 3
  • 23
  • 43
0
votes
0 answers

what does log* (log n) mean,what will it represent

what does log* (log n) mean? what does the * represent? what is its expansion to compare with other logarithmic function like log(log n)??which one is greater among log* (log n) and (log(log n)^log n) My approach to solve which one is…
0
votes
1 answer

Trying to find the ln or natural logarithm of numbers

loge(a) takes a which is a nonzero positive real number. In the function, x = a/3. y = x-1+a*exp(-x). I will continue to subtract them from each other (get absolute difference) and continue until the difference is less than 0.000001. My friends tell…
0
votes
1 answer

Generate Natural Logarithm of 2 Customly

I know I could generate it using Math.log(2) but I when I try to make up my own program to generate a natural log of 2 it continuously print 1. This is my code: import java.math.BigDecimal; import java.util.Scanner; public class Ques11 { …
Mohammad Areeb Siddiqui
  • 9,795
  • 14
  • 71
  • 113
0
votes
2 answers

How do take natural log of a double in MATLAB?

I am attempting to that the natural log of a number, I get the message: tf2 = 60*ln(B1); Undefined function 'ln' for input arguments of type 'double'. So i try to cast the number as a float which the documentation claims it will accept but then i…
CSnewb
  • 147
  • 4
  • 13
0
votes
0 answers

dealing with exponentials in python - infinities and overflows

In a machine learning algorithm that I'm using, I need to get the exponential values of something in one of the steps. This is the step that I'm dealing with right now: I've already have all the 1+g_j(X_i) etc etc calculated, there's no problem in…
user961627
  • 12,379
  • 42
  • 136
  • 210
0
votes
1 answer

Evaluating logarithm of expression, given logarithms of variables

I have to programmatically determine the value of the expression: S = log(x1y1 + x2y2 + x3y3 ...) Using only the values of: lxi = log(xi) lyi = log(yi) Calculating anti-logs of each of lxi and lyi would probably be impractical and is not desired…
0
votes
2 answers

Natural logarithm - strange output

I want to use the natural logaritm in c-language. I searched google and found a question of this at stackoverflow.com But When I implement this I get a very cryptic output here is the code double x = log(100 / 150); printf("d1: %lf", x); and…
0
votes
0 answers

Simplifying equations in Maple

I am using maple (version 12) for the first time. I want to invert the equations using any maths tool. I tried it using MAPLE. I have given two equations in this form: a=x*b^r + y*(b^s)*(c^t) + z*c^u Now I want to flip this equation (invert…
Syeda
  • 341
  • 2
  • 5
  • 14
0
votes
2 answers

I need help for a formula

var a = document.forms[0].elements[0].value; var b = document.forms[0].elements[1].value; var c = document.forms[0].elements[2].value; var d = document.forms[0].elements[3].value; var Xp = document.forms[0].elements[4].value; var Yp =…
user2580684
  • 27
  • 1
  • 6
-1
votes
2 answers

How to compute approximate natural log of 2 n times in java?

The instructions were: 1. Compute the ln of 2, by adding up to n terms in the series. a) You can approximate the natural logarithm of 2 with a series. The more terms you use, the closer you get to the natural logarithm of 2. b) ln 2 = 1 - 1/2 + 1/3…
-1
votes
1 answer

Finding number of digits in javascript

I'm trying to get the number of digits of a number in javascript, but I'm running into some edge cases with the equations I've found online. Here's what I'm using, from this site. getNumDigits(val){ return val === 0 ? 1 :…
mheavers
  • 29,530
  • 58
  • 194
  • 315
-1
votes
2 answers

Solving 'a = b ln [ max (11, b) ]' for b

Given: a = b ln [ max (11, b) ] If a is known, how can one compute b? (Do I need to use an iterative approximation method?)
bestrong
  • 151
  • 10