Average Error: 27.0 → 5.1
Time: 1.6m
Precision: 64
Internal Precision: 1408
\[\left(x \cdot \log y + z \cdot \log \left(1.0 - y\right)\right) - t\]
\[\left(x \cdot \log y + z \cdot \left(\log 1.0 - \left(\frac{1}{2} \cdot \frac{{y}^{2}}{{1.0}^{2}} + 1.0 \cdot y\right)\right)\right) - t\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original27.0
Target14.5
Herbie5.1
\[\left(-z\right) \cdot \left(\left(0.5 \cdot \left(y \cdot y\right) + y\right) + \frac{\frac{1}{3}}{1.0 \cdot \left(1.0 \cdot 1.0\right)} \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) - \left(t - x \cdot \log y\right)\]

Derivation

  1. Initial program 27.0

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

    \[\leadsto \left(x \cdot \log y + z \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. Removed slow pow expressions.

Runtime

Time bar (total: 1.6m)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B"

  :herbie-target
  (- (* (- z) (+ (+ (* 0.5 (* y y)) y) (* (/ 1/3 (* 1.0 (* 1.0 1.0))) (* y (* y y))))) (- t (* x (log y))))

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