Average Error: 1.9 → 1.9
Time: 1.3s
Precision: binary64
\[\left\lceil{2}^{\left(\log_{10} x\right)}\right\rceil\]
\[\left\lceil{2}^{\left(\log_{10} x\right)}\right\rceil\]
\left\lceil{2}^{\left(\log_{10} x\right)}\right\rceil
\left\lceil{2}^{\left(\log_{10} x\right)}\right\rceil
double code(double x) {
	return ((double) ceil(((double) pow(2.0, ((double) log10(x))))));
}
double code(double x) {
	return ((double) ceil(((double) pow(2.0, ((double) log10(x))))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 1.9

    \[\left\lceil{2}^{\left(\log_{10} x\right)}\right\rceil\]
  2. Final simplification1.9

    \[\leadsto \left\lceil{2}^{\left(\log_{10} x\right)}\right\rceil\]

Reproduce

herbie shell --seed 2020153 
(FPCore (x)
  :name "(ceil (pow 2 (log10 x)))"
  :precision binary64
  (ceil (pow 2.0 (log10 x))))