Average Error: 0.3 → 0.3
Time: 2.0s
Precision: binary64
\[x \cdot \log x\]
\[x \cdot \log \left(\sqrt{x}\right) + x \cdot \log \left(\sqrt{x}\right)\]
x \cdot \log x
x \cdot \log \left(\sqrt{x}\right) + x \cdot \log \left(\sqrt{x}\right)
double code(double x) {
	return ((double) (x * ((double) log(x))));
}
double code(double x) {
	return ((double) (((double) (x * ((double) log(((double) sqrt(x)))))) + ((double) (x * ((double) log(((double) sqrt(x))))))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program Error: 0.3 bits

    \[x \cdot \log x\]
  2. Using strategy rm
  3. Applied add-sqr-sqrtError: 0.3 bits

    \[\leadsto x \cdot \log \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}\]
  4. Applied log-prodError: 0.3 bits

    \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt{x}\right) + \log \left(\sqrt{x}\right)\right)}\]
  5. Applied distribute-lft-inError: 0.3 bits

    \[\leadsto \color{blue}{x \cdot \log \left(\sqrt{x}\right) + x \cdot \log \left(\sqrt{x}\right)}\]
  6. Final simplificationError: 0.3 bits

    \[\leadsto x \cdot \log \left(\sqrt{x}\right) + x \cdot \log \left(\sqrt{x}\right)\]

Reproduce

herbie shell --seed 2020200 
(FPCore (x)
  :name "Statistics.Distribution.Binomial:directEntropy from math-functions-0.1.5.2"
  :precision binary64
  (* x (log x)))