Average Error: 9.5 → 0.3
Time: 14.0s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\left(x \cdot \log y + z \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right) - t\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(x \cdot \log y + z \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right) - t
double f(double x, double y, double z, double t) {
        double r364634 = x;
        double r364635 = y;
        double r364636 = log(r364635);
        double r364637 = r364634 * r364636;
        double r364638 = z;
        double r364639 = 1.0;
        double r364640 = r364639 - r364635;
        double r364641 = log(r364640);
        double r364642 = r364638 * r364641;
        double r364643 = r364637 + r364642;
        double r364644 = t;
        double r364645 = r364643 - r364644;
        return r364645;
}

double f(double x, double y, double z, double t) {
        double r364646 = x;
        double r364647 = y;
        double r364648 = log(r364647);
        double r364649 = r364646 * r364648;
        double r364650 = z;
        double r364651 = 1.0;
        double r364652 = log(r364651);
        double r364653 = r364651 * r364647;
        double r364654 = 0.5;
        double r364655 = 2.0;
        double r364656 = pow(r364647, r364655);
        double r364657 = pow(r364651, r364655);
        double r364658 = r364656 / r364657;
        double r364659 = r364654 * r364658;
        double r364660 = r364653 + r364659;
        double r364661 = r364652 - r364660;
        double r364662 = r364650 * r364661;
        double r364663 = r364649 + r364662;
        double r364664 = t;
        double r364665 = r364663 - r364664;
        return r364665;
}

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.5
Target0.3
Herbie0.3
\[\left(-z\right) \cdot \left(\left(0.5 \cdot \left(y \cdot y\right) + y\right) + \frac{0.3333333333333333148296162562473909929395}{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.5

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

    \[\leadsto \left(x \cdot \log y + z \cdot \color{blue}{\left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)}\right) - t\]
  3. Final simplification0.3

    \[\leadsto \left(x \cdot \log y + z \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right) - t\]

Reproduce

herbie shell --seed 1978988140 
(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.333333333333333315 (* 1 (* 1 1))) (* y (* y y))))) (- t (* x (log y))))

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