Average Error: 0.0 → 0.0
Time: 13.7s
Precision: 64
$-\log \left(\frac{1}{x} - 1\right)$
$-\left(\log \left(\sqrt{\frac{1}{x} - 1}\right) + \log \left(\sqrt{\frac{1}{x} - 1}\right)\right)$
-\log \left(\frac{1}{x} - 1\right)
-\left(\log \left(\sqrt{\frac{1}{x} - 1}\right) + \log \left(\sqrt{\frac{1}{x} - 1}\right)\right)
double f(double x) {
double r1689458 = 1.0;
double r1689459 = x;
double r1689460 = r1689458 / r1689459;
double r1689461 = r1689460 - r1689458;
double r1689462 = log(r1689461);
double r1689463 = -r1689462;
return r1689463;
}


double f(double x) {
double r1689464 = 1.0;
double r1689465 = x;
double r1689466 = r1689464 / r1689465;
double r1689467 = r1689466 - r1689464;
double r1689468 = sqrt(r1689467);
double r1689469 = log(r1689468);
double r1689470 = r1689469 + r1689469;
double r1689471 = -r1689470;
return r1689471;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.0

$-\log \left(\frac{1}{x} - 1\right)$
2. Using strategy rm

$\leadsto -\log \color{blue}{\left(\sqrt{\frac{1}{x} - 1} \cdot \sqrt{\frac{1}{x} - 1}\right)}$
4. Applied log-prod0.0

$\leadsto -\color{blue}{\left(\log \left(\sqrt{\frac{1}{x} - 1}\right) + \log \left(\sqrt{\frac{1}{x} - 1}\right)\right)}$
5. Final simplification0.0

$\leadsto -\left(\log \left(\sqrt{\frac{1}{x} - 1}\right) + \log \left(\sqrt{\frac{1}{x} - 1}\right)\right)$

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "-log(1/x-1)"
(- (log (- (/ 1.0 x) 1.0))))
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}