Average Error: 5.6 → 0
Time: 989.0ms
Precision: binary64
\[\log \left(2 \cdot x\right) - \log x\]
\[\log 2\]
\log \left(2 \cdot x\right) - \log x
\log 2
double code(double x) {
	return ((double) (((double) log(((double) (2.0 * x)))) - ((double) log(x))));
}
double code(double x) {
	return ((double) log(2.0));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 5.6

    \[\log \left(2 \cdot x\right) - \log x\]
  2. Simplified0

    \[\leadsto \color{blue}{\log 2}\]
  3. Final simplification0

    \[\leadsto \log 2\]

Reproduce

herbie shell --seed 2020152 
(FPCore (x)
  :name "(- (log (* 2 x)) (log x))"
  :precision binary64
  (- (log (* 2.0 x)) (log x)))