Average Error: 9.6 → 0.4
Time: 22.0s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\left(\log \left(\sqrt{y}\right) \cdot x + \left(\log \left(\sqrt{y}\right) \cdot x + \left(\left(\log 1 - y \cdot 1\right) \cdot z - \left(\left(z \cdot 0.5\right) \cdot y\right) \cdot y\right)\right)\right) - t\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(\log \left(\sqrt{y}\right) \cdot x + \left(\log \left(\sqrt{y}\right) \cdot x + \left(\left(\log 1 - y \cdot 1\right) \cdot z - \left(\left(z \cdot 0.5\right) \cdot y\right) \cdot y\right)\right)\right) - t
double f(double x, double y, double z, double t) {
        double r8916988 = x;
        double r8916989 = y;
        double r8916990 = log(r8916989);
        double r8916991 = r8916988 * r8916990;
        double r8916992 = z;
        double r8916993 = 1.0;
        double r8916994 = r8916993 - r8916989;
        double r8916995 = log(r8916994);
        double r8916996 = r8916992 * r8916995;
        double r8916997 = r8916991 + r8916996;
        double r8916998 = t;
        double r8916999 = r8916997 - r8916998;
        return r8916999;
}

double f(double x, double y, double z, double t) {
        double r8917000 = y;
        double r8917001 = sqrt(r8917000);
        double r8917002 = log(r8917001);
        double r8917003 = x;
        double r8917004 = r8917002 * r8917003;
        double r8917005 = 1.0;
        double r8917006 = log(r8917005);
        double r8917007 = r8917000 * r8917005;
        double r8917008 = r8917006 - r8917007;
        double r8917009 = z;
        double r8917010 = r8917008 * r8917009;
        double r8917011 = 0.5;
        double r8917012 = r8917009 * r8917011;
        double r8917013 = r8917012 * r8917000;
        double r8917014 = r8917013 * r8917000;
        double r8917015 = r8917010 - r8917014;
        double r8917016 = r8917004 + r8917015;
        double r8917017 = r8917004 + r8917016;
        double r8917018 = t;
        double r8917019 = r8917017 - r8917018;
        return r8917019;
}

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.6
Target0.3
Herbie0.4
\[\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.6

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

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

    \[\leadsto \left(x \cdot \log y + \color{blue}{\left(z \cdot \left(\log 1 - y \cdot 1\right) - \frac{z \cdot \frac{1}{2}}{\frac{1}{y} \cdot \frac{1}{y}}\right)}\right) - t\]
  4. Using strategy rm
  5. Applied add-sqr-sqrt0.4

    \[\leadsto \left(x \cdot \log \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} + \left(z \cdot \left(\log 1 - y \cdot 1\right) - \frac{z \cdot \frac{1}{2}}{\frac{1}{y} \cdot \frac{1}{y}}\right)\right) - t\]
  6. Applied log-prod0.4

    \[\leadsto \left(x \cdot \color{blue}{\left(\log \left(\sqrt{y}\right) + \log \left(\sqrt{y}\right)\right)} + \left(z \cdot \left(\log 1 - y \cdot 1\right) - \frac{z \cdot \frac{1}{2}}{\frac{1}{y} \cdot \frac{1}{y}}\right)\right) - t\]
  7. Applied distribute-rgt-in0.4

    \[\leadsto \left(\color{blue}{\left(\log \left(\sqrt{y}\right) \cdot x + \log \left(\sqrt{y}\right) \cdot x\right)} + \left(z \cdot \left(\log 1 - y \cdot 1\right) - \frac{z \cdot \frac{1}{2}}{\frac{1}{y} \cdot \frac{1}{y}}\right)\right) - t\]
  8. Applied associate-+l+0.4

    \[\leadsto \color{blue}{\left(\log \left(\sqrt{y}\right) \cdot x + \left(\log \left(\sqrt{y}\right) \cdot x + \left(z \cdot \left(\log 1 - y \cdot 1\right) - \frac{z \cdot \frac{1}{2}}{\frac{1}{y} \cdot \frac{1}{y}}\right)\right)\right)} - t\]
  9. Taylor expanded around 0 0.4

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

    \[\leadsto \left(\log \left(\sqrt{y}\right) \cdot x + \left(\log \left(\sqrt{y}\right) \cdot x + \left(z \cdot \left(\log 1 - y \cdot 1\right) - \color{blue}{\left(\left(0.5 \cdot z\right) \cdot y\right) \cdot y}\right)\right)\right) - t\]
  11. Final simplification0.4

    \[\leadsto \left(\log \left(\sqrt{y}\right) \cdot x + \left(\log \left(\sqrt{y}\right) \cdot x + \left(\left(\log 1 - y \cdot 1\right) \cdot z - \left(\left(z \cdot 0.5\right) \cdot y\right) \cdot y\right)\right)\right) - t\]

Reproduce

herbie shell --seed 2019179 
(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) (* (/ 0.3333333333333333 (* 1.0 (* 1.0 1.0))) (* y (* y y))))) (- t (* x (log y))))

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