| Alternative 1 | |
|---|---|
| Accuracy | 100.0% |
| Cost | 12992 |
\[\log \left(\frac{x}{\log x}\right)
\]

(FPCore (x) :precision binary64 (- (log x) (log (log x))))
(FPCore (x) :precision binary64 (- (log (/ (log x) x))))
double code(double x) {
return log(x) - log(log(x));
}
double code(double x) {
return -log((log(x) / x));
}
real(8) function code(x)
real(8), intent (in) :: x
code = log(x) - log(log(x))
end function
real(8) function code(x)
real(8), intent (in) :: x
code = -log((log(x) / x))
end function
public static double code(double x) {
return Math.log(x) - Math.log(Math.log(x));
}
public static double code(double x) {
return -Math.log((Math.log(x) / x));
}
def code(x): return math.log(x) - math.log(math.log(x))
def code(x): return -math.log((math.log(x) / x))
function code(x) return Float64(log(x) - log(log(x))) end
function code(x) return Float64(-log(Float64(log(x) / x))) end
function tmp = code(x) tmp = log(x) - log(log(x)); end
function tmp = code(x) tmp = -log((log(x) / x)); end
code[x_] := N[(N[Log[x], $MachinePrecision] - N[Log[N[Log[x], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_] := (-N[Log[N[(N[Log[x], $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision])
\log x - \log \log x
-\log \left(\frac{\log x}{x}\right)
Herbie found 2 alternatives:
| Alternative | Accuracy | Speedup |
|---|
Results
Initial program 99.6%
Applied egg-rr98.1%
[Start]99.6 | \[ \log x - \log \log x
\] |
|---|---|
add-cube-cbrt [=>]98.0 | \[ \color{blue}{\left(\sqrt[3]{\log x - \log \log x} \cdot \sqrt[3]{\log x - \log \log x}\right) \cdot \sqrt[3]{\log x - \log \log x}}
\] |
pow3 [=>]98.0 | \[ \color{blue}{{\left(\sqrt[3]{\log x - \log \log x}\right)}^{3}}
\] |
diff-log [=>]98.1 | \[ {\left(\sqrt[3]{\color{blue}{\log \left(\frac{x}{\log x}\right)}}\right)}^{3}
\] |
Applied egg-rr100.0%
[Start]98.1 | \[ {\left(\sqrt[3]{\log \left(\frac{x}{\log x}\right)}\right)}^{3}
\] |
|---|---|
rem-cube-cbrt [=>]100.0 | \[ \color{blue}{\log \left(\frac{x}{\log x}\right)}
\] |
clear-num [=>]100.0 | \[ \log \color{blue}{\left(\frac{1}{\frac{\log x}{x}}\right)}
\] |
log-rec [=>]100.0 | \[ \color{blue}{-\log \left(\frac{\log x}{x}\right)}
\] |
Final simplification100.0%
| Alternative 1 | |
|---|---|
| Accuracy | 100.0% |
| Cost | 12992 |
herbie shell --seed 2023161
(FPCore (x)
:name "Jmat.Real.lambertw, estimator"
:precision binary64
(- (log x) (log (log x))))