1
$\begingroup$

I cannot get Mathematica (version 11.3.0.0 on Mac OS) to simplify this:

c = (2.71*^10*a)/(1.23*^14*a + 3.14*^12*b)

$$\frac{2.71\times 10^{10} a}{1.23\times 10^{14} a+3.14\times 10^{12} b}$$

Simplify[c]

$$\frac{2.71\times 10^{10} a}{1.23\times 10^{14} a+3.14\times 10^{12} b}$$

Simplify[N[c]]

$$\frac{2.71\times 10^{10} a}{1.23\times 10^{14} a+3.14\times 10^{12} b}$$

I just want it to divide the top and bottom by $10^{10}$.

Is this a bug?

I ask because this does simplify:

c = ( 1.23*^14*a^2)/(3.14*^10*a + 2.71*^8*b)

$$\frac{1.23\times 10^{14} a^2}{3.14\times 10^{10} a+2.71\times 10^8 b}$$

Simplify[c]

$$\frac{3917.2 a^2}{1. a+0.00863057 b}$$

I can't figure out in which cases it simplifies, and in which it doesn't.

$\endgroup$
2
$\begingroup$

factorReal from here, thought it divides by powers of 2 instead of 10 to avoid rounding errors:

factorReal = Plus[x_, y__] :> 
   With[{coeffs = Replace[{x, y}, Times[k_Real, __] :> k, 1]}, 
    With[{p = Round[Log2@GeometricMean@Abs@coeffs, 2]}, 
      2.^p*Distribute[2.^-p*Plus[x, y]]] /; MatchQ[coeffs, {__Real}]];

(2.71*^10*a)/(1.23*^14*a + 3.14*^12*b) /. factorReal
(*  (0.00154046 a)/(6.99174 a + 0.178488 b)  *)

You could change Log2 to Log10 and 2.^... to 10.^... if desired.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.