Average Error: 0.3 → 0.2
Time: 5.9s
Precision: 64
\[x \cdot \log x\]
\[\mathsf{fma}\left(x \cdot 1, 2 \cdot \log \left(\sqrt[3]{x}\right), x \cdot \log \left(\sqrt[3]{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right) + x \cdot \log \left(\sqrt[3]{\sqrt[3]{x}}\right)\right)\]
x \cdot \log x
\mathsf{fma}\left(x \cdot 1, 2 \cdot \log \left(\sqrt[3]{x}\right), x \cdot \log \left(\sqrt[3]{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right) + x \cdot \log \left(\sqrt[3]{\sqrt[3]{x}}\right)\right)
double code(double x) {
	return (x * log(x));
}
double code(double x) {
	return fma((x * 1.0), (2.0 * log(cbrt(x))), ((x * log(cbrt((cbrt(x) * cbrt(x))))) + (x * log(cbrt(cbrt(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.3

    \[x \cdot \log x\]
  2. Using strategy rm
  3. Applied add-cube-cbrt0.3

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

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

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

    \[\leadsto \color{blue}{x \cdot \left(2 \cdot \log \left(\sqrt[3]{x}\right)\right)} + x \cdot \log \left(\sqrt[3]{x}\right)\]
  7. Using strategy rm
  8. Applied *-un-lft-identity0.4

    \[\leadsto x \cdot \color{blue}{\left(1 \cdot \left(2 \cdot \log \left(\sqrt[3]{x}\right)\right)\right)} + x \cdot \log \left(\sqrt[3]{x}\right)\]
  9. Applied associate-*r*0.4

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot 1, 2 \cdot \log \left(\sqrt[3]{x}\right), x \cdot \log \left(\sqrt[3]{x}\right)\right)}\]
  11. Using strategy rm
  12. Applied add-cube-cbrt0.3

    \[\leadsto \mathsf{fma}\left(x \cdot 1, 2 \cdot \log \left(\sqrt[3]{x}\right), x \cdot \log \left(\sqrt[3]{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}\right)\right)\]
  13. Applied cbrt-prod0.3

    \[\leadsto \mathsf{fma}\left(x \cdot 1, 2 \cdot \log \left(\sqrt[3]{x}\right), x \cdot \log \color{blue}{\left(\sqrt[3]{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}\right)}\right)\]
  14. Applied log-prod0.2

    \[\leadsto \mathsf{fma}\left(x \cdot 1, 2 \cdot \log \left(\sqrt[3]{x}\right), x \cdot \color{blue}{\left(\log \left(\sqrt[3]{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right) + \log \left(\sqrt[3]{\sqrt[3]{x}}\right)\right)}\right)\]
  15. Applied distribute-lft-in0.2

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

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

Reproduce

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