Average Error: 21.8 → 0.3
Time: 2.8m
Precision: 64
Internal Precision: 1152
\[\left(\left(x - 1.0\right) \cdot \log y + \left(z - 1.0\right) \cdot \log \left(1.0 - y\right)\right) - t\]
\[\left(\left(x - 1.0\right) \cdot \log y + \left(\sqrt[3]{z - 1.0} \cdot \sqrt[3]{z - 1.0}\right) \cdot \left(\sqrt[3]{z - 1.0} \cdot \left(\log 1.0 - \left(\frac{1}{2} \cdot \frac{{y}^{2}}{{1.0}^{2}} + 1.0 \cdot y\right)\right)\right)\right) - t\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original21.8
Target21.8
Herbie0.3
\[\left(\left(x - 1.0\right) \cdot \log y + \left(z - 1.0\right) \cdot \log \left(1.0 - y\right)\right) - t\]

Derivation

  1. Initial program 21.8

    \[\left(\left(x - 1.0\right) \cdot \log y + \left(z - 1.0\right) \cdot \log \left(1.0 - y\right)\right) - t\]
  2. Taylor expanded around 0 0.1

    \[\leadsto \left(\left(x - 1.0\right) \cdot \log y + \left(z - 1.0\right) \cdot \color{blue}{\left(\log 1.0 - \left(\frac{1}{2} \cdot \frac{{y}^{2}}{{1.0}^{2}} + 1.0 \cdot y\right)\right)}\right) - t\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.3

    \[\leadsto \left(\left(x - 1.0\right) \cdot \log y + \color{blue}{\left(\left(\sqrt[3]{z - 1.0} \cdot \sqrt[3]{z - 1.0}\right) \cdot \sqrt[3]{z - 1.0}\right)} \cdot \left(\log 1.0 - \left(\frac{1}{2} \cdot \frac{{y}^{2}}{{1.0}^{2}} + 1.0 \cdot y\right)\right)\right) - t\]
  5. Applied associate-*l*0.3

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

Runtime

Time bar (total: 2.8m)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit +o reduce:binary-search
(FPCore (x y z t)
  :name "Statistics.Distribution.Beta:$cdensity from math-functions-0.1.5.2"

  :herbie-target
  (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t)

  (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))