Average Error: 9.9 → 0.2
Time: 4.1s
Precision: binary64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\left(x \cdot \log y + \left(\left(\left(y \cdot y\right) \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right) \cdot z - y \cdot z\right)\right) - t\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(x \cdot \log y + \left(\left(\left(y \cdot y\right) \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right) \cdot z - y \cdot z\right)\right) - t
(FPCore (x y z t)
 :precision binary64
 (- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))
(FPCore (x y z t)
 :precision binary64
 (-
  (+
   (* x (log y))
   (- (* (* (* y y) (- (* y -0.3333333333333333) 0.5)) z) (* y z)))
  t))
double code(double x, double y, double z, double t) {
	return ((x * log(y)) + (z * log(1.0 - y))) - t;
}
double code(double x, double y, double z, double t) {
	return ((x * log(y)) + ((((y * y) * ((y * -0.3333333333333333) - 0.5)) * z) - (y * z))) - t;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original9.9
Target0.2
Herbie0.2
\[\left(-z\right) \cdot \left(\left(0.5 \cdot \left(y \cdot y\right) + y\right) + \frac{0.3333333333333333}{1 \cdot \left(1 \cdot 1\right)} \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) - \left(t - x \cdot \log y\right)\]

Derivation

  1. Initial program 9.9

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

    \[\leadsto \left(x \cdot \log y + z \cdot \color{blue}{\left(-\left(0.3333333333333333 \cdot {y}^{3} + \left(0.5 \cdot {y}^{2} + y\right)\right)\right)}\right) - t\]
  3. Simplified0.2

    \[\leadsto \left(x \cdot \log y + z \cdot \color{blue}{\left(\left(y \cdot y\right) \cdot \left(y \cdot -0.3333333333333333 - 0.5\right) - y\right)}\right) - t\]
  4. Using strategy rm
  5. Applied sub-neg_binary640.2

    \[\leadsto \left(x \cdot \log y + z \cdot \color{blue}{\left(\left(y \cdot y\right) \cdot \left(y \cdot -0.3333333333333333 - 0.5\right) + \left(-y\right)\right)}\right) - t\]
  6. Applied distribute-rgt-in_binary640.2

    \[\leadsto \left(x \cdot \log y + \color{blue}{\left(\left(\left(y \cdot y\right) \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right) \cdot z + \left(-y\right) \cdot z\right)}\right) - t\]
  7. Simplified0.2

    \[\leadsto \left(x \cdot \log y + \left(\left(\left(y \cdot y\right) \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right) \cdot z + \color{blue}{z \cdot \left(-y\right)}\right)\right) - t\]
  8. Final simplification0.2

    \[\leadsto \left(x \cdot \log y + \left(\left(\left(y \cdot y\right) \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right) \cdot z - y \cdot z\right)\right) - t\]

Reproduce

herbie shell --seed 2020232 
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B"
  :precision binary64

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

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