Average Error: 0.3 → 0.3
Time: 4.5s
Precision: binary64
\[x \cdot \log x \]
\[\begin{array}{l} t_0 := \log \left(\sqrt[3]{x}\right)\\ \mathsf{fma}\left(x, t_0 \cdot 2, x \cdot t_0\right) \end{array} \]
(FPCore (x) :precision binary64 (* x (log x)))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (log (cbrt x)))) (fma x (* t_0 2.0) (* x t_0))))
double code(double x) {
	return x * log(x);
}
double code(double x) {
	double t_0 = log(cbrt(x));
	return fma(x, (t_0 * 2.0), (x * t_0));
}
function code(x)
	return Float64(x * log(x))
end
function code(x)
	t_0 = log(cbrt(x))
	return fma(x, Float64(t_0 * 2.0), Float64(x * t_0))
end
code[x_] := N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[Log[N[Power[x, 1/3], $MachinePrecision]], $MachinePrecision]}, N[(x * N[(t$95$0 * 2.0), $MachinePrecision] + N[(x * t$95$0), $MachinePrecision]), $MachinePrecision]]
x \cdot \log x
\begin{array}{l}
t_0 := \log \left(\sqrt[3]{x}\right)\\
\mathsf{fma}\left(x, t_0 \cdot 2, x \cdot t_0\right)
\end{array}

Error

Bits error versus x

Derivation

  1. Initial program 0.3

    \[x \cdot \log x \]
  2. Applied add-cube-cbrt_binary640.3

    \[\leadsto x \cdot \log \color{blue}{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\right)} \]
  3. Applied log-prod_binary640.4

    \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) + \log \left(\sqrt[3]{x}\right)\right)} \]
  4. Applied distribute-rgt-in_binary640.4

    \[\leadsto \color{blue}{\log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot x + \log \left(\sqrt[3]{x}\right) \cdot x} \]
  5. Simplified0.4

    \[\leadsto \color{blue}{x \cdot \left(\log \left(\sqrt[3]{x}\right) \cdot 2\right)} + \log \left(\sqrt[3]{x}\right) \cdot x \]
  6. Simplified0.4

    \[\leadsto x \cdot \left(\log \left(\sqrt[3]{x}\right) \cdot 2\right) + \color{blue}{x \cdot \log \left(\sqrt[3]{x}\right)} \]
  7. Applied fma-def_binary640.3

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log \left(\sqrt[3]{x}\right) \cdot 2, x \cdot \log \left(\sqrt[3]{x}\right)\right)} \]
  8. Final simplification0.3

    \[\leadsto \mathsf{fma}\left(x, \log \left(\sqrt[3]{x}\right) \cdot 2, x \cdot \log \left(\sqrt[3]{x}\right)\right) \]

Reproduce

herbie shell --seed 2022131 
(FPCore (x)
  :name "Statistics.Distribution.Binomial:directEntropy from math-functions-0.1.5.2"
  :precision binary64
  (* x (log x)))