Average Error: 45.1 → 45.1
Time: 2.4m
Precision: 64
Internal Precision: 2432
\[\left(x \cdot 1.0\right) \cdot \log \left(1.0 - \frac{y}{x}\right)\]
\[\left(x \cdot 1.0\right) \cdot \left(\frac{1}{2} \cdot \log \left(1.0 - \frac{y}{x}\right) + \left(\log \left(\sqrt{\sqrt{1.0 - \frac{y}{x}}}\right) + \frac{1}{2} \cdot \log \left(\sqrt{1.0 - \frac{y}{x}}\right)\right)\right)\]

Error

Bits error versus x

Bits error versus y

Target

Original45.1
Target45.1
Herbie45.1
\[x \cdot \log \left(1.0 - \frac{y}{x}\right)\]

Derivation

  1. Initial program 45.1

    \[\left(x \cdot 1.0\right) \cdot \log \left(1.0 - \frac{y}{x}\right)\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt45.1

    \[\leadsto \left(x \cdot 1.0\right) \cdot \log \color{blue}{\left(\sqrt{1.0 - \frac{y}{x}} \cdot \sqrt{1.0 - \frac{y}{x}}\right)}\]
  4. Applied log-prod45.1

    \[\leadsto \left(x \cdot 1.0\right) \cdot \color{blue}{\left(\log \left(\sqrt{1.0 - \frac{y}{x}}\right) + \log \left(\sqrt{1.0 - \frac{y}{x}}\right)\right)}\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt45.1

    \[\leadsto \left(x \cdot 1.0\right) \cdot \left(\log \left(\sqrt{1.0 - \frac{y}{x}}\right) + \log \left(\sqrt{\color{blue}{\sqrt{1.0 - \frac{y}{x}} \cdot \sqrt{1.0 - \frac{y}{x}}}}\right)\right)\]
  7. Applied sqrt-prod45.2

    \[\leadsto \left(x \cdot 1.0\right) \cdot \left(\log \left(\sqrt{1.0 - \frac{y}{x}}\right) + \log \color{blue}{\left(\sqrt{\sqrt{1.0 - \frac{y}{x}}} \cdot \sqrt{\sqrt{1.0 - \frac{y}{x}}}\right)}\right)\]
  8. Applied log-prod45.2

    \[\leadsto \left(x \cdot 1.0\right) \cdot \left(\log \left(\sqrt{1.0 - \frac{y}{x}}\right) + \color{blue}{\left(\log \left(\sqrt{\sqrt{1.0 - \frac{y}{x}}}\right) + \log \left(\sqrt{\sqrt{1.0 - \frac{y}{x}}}\right)\right)}\right)\]
  9. Using strategy rm
  10. Applied pow1/245.2

    \[\leadsto \left(x \cdot 1.0\right) \cdot \left(\log \left(\sqrt{1.0 - \frac{y}{x}}\right) + \left(\log \left(\sqrt{\sqrt{1.0 - \frac{y}{x}}}\right) + \log \color{blue}{\left({\left(\sqrt{1.0 - \frac{y}{x}}\right)}^{\frac{1}{2}}\right)}\right)\right)\]
  11. Applied log-pow45.2

    \[\leadsto \left(x \cdot 1.0\right) \cdot \left(\log \left(\sqrt{1.0 - \frac{y}{x}}\right) + \left(\log \left(\sqrt{\sqrt{1.0 - \frac{y}{x}}}\right) + \color{blue}{\frac{1}{2} \cdot \log \left(\sqrt{1.0 - \frac{y}{x}}\right)}\right)\right)\]
  12. Using strategy rm
  13. Applied pow1/245.2

    \[\leadsto \left(x \cdot 1.0\right) \cdot \left(\log \color{blue}{\left({\left(1.0 - \frac{y}{x}\right)}^{\frac{1}{2}}\right)} + \left(\log \left(\sqrt{\sqrt{1.0 - \frac{y}{x}}}\right) + \frac{1}{2} \cdot \log \left(\sqrt{1.0 - \frac{y}{x}}\right)\right)\right)\]
  14. Applied log-pow45.1

    \[\leadsto \left(x \cdot 1.0\right) \cdot \left(\color{blue}{\frac{1}{2} \cdot \log \left(1.0 - \frac{y}{x}\right)} + \left(\log \left(\sqrt{\sqrt{1.0 - \frac{y}{x}}}\right) + \frac{1}{2} \cdot \log \left(\sqrt{1.0 - \frac{y}{x}}\right)\right)\right)\]
  15. Removed slow pow expressions.

Runtime

Time bar (total: 2.4m)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit +o reduce:binary-search
(FPCore (x y)
  :name "Data.HyperLogLog.Type:size from hyperloglog-0.3.4, A"

  :herbie-target
  (* x (log (- 1.0 (/ y x))))

  (* (* x 1.0) (log (- 1.0 (/ y x)))))