Average Error: 0.0 → 0.0
Time: 2.2s
Precision: binary64
Cost: 6784
\[-\log \left(\frac{1}{x} - 1\right)\]
\[-\log \left(\frac{1}{x} - 1\right)\]
-\log \left(\frac{1}{x} - 1\right)
-\log \left(\frac{1}{x} - 1\right)
(FPCore (x) :precision binary64 (- (log (- (/ 1.0 x) 1.0))))
(FPCore (x) :precision binary64 (- (log (- (/ 1.0 x) 1.0))))
double code(double x) {
	return -log((1.0 / x) - 1.0);
}
double code(double x) {
	return -log((1.0 / x) - 1.0);
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error0.3
Cost26432
\[\log \left(\sqrt[3]{\frac{1}{x} - 1}\right) \cdot -2 - \log \left(\sqrt[3]{\frac{1}{x} - 1}\right)\]
Alternative 2
Error0.0
Cost26368
\[-\left(\log \left(1 + \frac{1}{\sqrt{x}}\right) + \log \left(\frac{1}{\sqrt{x}} - 1\right)\right)\]
Alternative 3
Error0.6
Cost6592
\[x + \log x\]
Alternative 4
Error1.2
Cost6464
\[\log x\]
Alternative 5
Error63.0
Cost64
\[1\]
Alternative 6
Error62.0
Cost64
\[0\]
Alternative 7
Error55.0
Cost64
\[-1\]

Error

Derivation

  1. Initial program 0.0

    \[-\log \left(\frac{1}{x} - 1\right)\]
  2. Simplified0.0

    \[\leadsto \color{blue}{-\log \left(\frac{1}{x} - 1\right)}\]
  3. Final simplification0.0

    \[\leadsto -\log \left(\frac{1}{x} - 1\right)\]

Reproduce

herbie shell --seed 2021022 
(FPCore (x)
  :name "neg log"
  :precision binary64
  (- (log (- (/ 1.0 x) 1.0))))