0

I try to compute a function of type $e^x$. Since its natural fast-growing behaviour, the most natural behaviour is to decompose the resulting number into its mantissa and exponent components. However, due limited computational precision, one may not compute the prior exponential due numerical issues.

Henceforth, the statement follows: find a, b for given x in $x = ln \, a + b \, ln \, 10$, $a \in \mathbb{R}$, $b \in \mathbb{N}$.

I thank in advance.

  • Do you mean $0\leq a \leq 1$ or something similar? – Matti P. Nov 21 '19 at 10:45
  • It is also a necessary condition. – Bruno Lobo Nov 21 '19 at 10:46
  • So I guess your logic here is $$ e^x = a \times 10^b\qquad \text{with} \quad 0 \leq a \leq 1 \qquad \text{and}\quad b \in \mathbb{N} $$ – Matti P. Nov 21 '19 at 10:48
  • Yes, as I wrote above. – Bruno Lobo Nov 21 '19 at 10:49
  • I would start by asking, what is the value of $b$? Let's take for example $x=666$, a fairly large number. Then $$ e^{666} = 10^y \qquad \Rightarrow 666 = y \ln{10} \Rightarrow y = \frac{666}{\ln{10}}\approx 289.23 $$ So in this case it would have an exponent of $289$. – Matti P. Nov 21 '19 at 10:50
  • I thank you sir. The following steps are cristal clear. – Bruno Lobo Nov 21 '19 at 10:51
  • Maybe not as I thought it would be. Your collocation is approximately right. $log_{10} , a \in (0, 1)$ than the expression is naturally $b = x/ln , 10 + log_{10} a$. The first term is the same as you wrote above. The second, the enunciated condition. Than, it might be that the approximation is not precisely right. – Bruno Lobo Nov 21 '19 at 13:34
  • 1
    For future ones with similar doubt, x = ln a + b ln 10 i.e. b = x/ln 10 + log_{10} a. Since b is natural, one must decompose the term x/10 into two terms, a natural and its decimal part, namely c. Then, b = floor(x/ln 10) and a = 10^c. – Bruno Lobo Nov 23 '19 at 18:07

0 Answers0