Average Error: 0 → 0
Time: 2.1s
Precision: binary64
\[\left|\log x\right| - \log \left(\left|x\right|\right)\]
\[\left|\log x\right| - \log \left(\left|x\right|\right)\]
\left|\log x\right| - \log \left(\left|x\right|\right)
\left|\log x\right| - \log \left(\left|x\right|\right)
double code(double x) {
	return ((double) (((double) fabs(((double) log(x)))) - ((double) log(((double) fabs(x))))));
}
double code(double x) {
	return ((double) (((double) fabs(((double) log(x)))) - ((double) log(((double) fabs(x))))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0

    \[\left|\log x\right| - \log \left(\left|x\right|\right)\]
  2. Final simplification0

    \[\leadsto \left|\log x\right| - \log \left(\left|x\right|\right)\]

Reproduce

herbie shell --seed 2020152 
(FPCore (x)
  :name "(- (fabs (log x)) (log (fabs x)))"
  :precision binary64
  (- (fabs (log x)) (log (fabs x))))