Average Error: 21.7 → 0.1
Time: 1.2m
Precision: 64
Internal precision: 128
\[\left(\left(x - 1.0\right) \cdot \log y + \left(z - 1.0\right) \cdot \log \left(1.0 - y\right)\right) - t\]
\[\left(\log y \cdot \left(x - 1.0\right) + \left(\left(y \cdot 0.5\right) \cdot y - t\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot 0.5 + 1.0\right)\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original21.7
Comparison21.7
Herbie0.1
\[ \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.7

    \[\left(\left(x - 1.0\right) \cdot \log y + \left(z - 1.0\right) \cdot \log \left(1.0 - y\right)\right) - t\]
  2. Applied taylor 0.3

    \[\leadsto \left(\left(x - 1.0\right) \cdot \log y + \left(z - 1.0\right) \cdot \left(\log 1.0 - \left(0.5 \cdot {y}^2 + 1.0 \cdot y\right)\right)\right) - t\]
  3. Taylor expanded around 0 0.3

    \[\leadsto \left(\left(x - 1.0\right) \cdot \log y + \left(z - 1.0\right) \cdot \color{blue}{\left(\log 1.0 - \left(0.5 \cdot {y}^2 + 1.0 \cdot y\right)\right)}\right) - t\]
  4. Applied simplify 0.3

    \[\leadsto \color{blue}{\left(\log 1.0 - y \cdot \left(1.0 + 0.5 \cdot y\right)\right) \cdot \left(z - 1.0\right) + \left(\left(x - 1.0\right) \cdot \log y - t\right)}\]
  5. Applied taylor 0.1

    \[\leadsto \left(0.5 \cdot {y}^2 - \left(1.0 \cdot \left(z \cdot y\right) + 0.5 \cdot \left(z \cdot {y}^2\right)\right)\right) + \left(\left(x - 1.0\right) \cdot \log y - t\right)\]
  6. Taylor expanded around inf 0.1

    \[\leadsto \color{blue}{\left(0.5 \cdot {y}^2 - \left(1.0 \cdot \left(z \cdot y\right) + 0.5 \cdot \left(z \cdot {y}^2\right)\right)\right)} + \left(\left(x - 1.0\right) \cdot \log y - t\right)\]
  7. Applied simplify 0.1

    \[\leadsto \color{blue}{\left(\log y \cdot \left(x - 1.0\right) + \left(\left(y \cdot 0.5\right) \cdot y - t\right)\right) - \left(y \cdot z\right) \cdot \left(y \cdot 0.5 + 1.0\right)}\]
  8. Removed slow pow expressions

Runtime

Time bar (total: 1.2m) Debug log

Please include this information when filing a bug report:

herbie --seed '#(2876237615 1275424508 1540912907 1437231540 1552071733 68395076)'
(FPCore (x y z t)
  :name "Statistics.Distribution.Beta:$cdensity from math-functions-0.1.5.2"

  :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))