Average Error: 9.2 → 0.4
Time: 16.6s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\left(x \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \mathsf{fma}\left(x, \log \left(\sqrt[3]{y}\right), \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)\right) - t\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(x \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \mathsf{fma}\left(x, \log \left(\sqrt[3]{y}\right), \mathsf{fma}\left(z, \log 1 - 1 \cdot y, \frac{z \cdot {y}^{2}}{{1}^{2}} \cdot \frac{-1}{2}\right)\right)\right) - t
double f(double x, double y, double z, double t) {
        double r468418 = x;
        double r468419 = y;
        double r468420 = log(r468419);
        double r468421 = r468418 * r468420;
        double r468422 = z;
        double r468423 = 1.0;
        double r468424 = r468423 - r468419;
        double r468425 = log(r468424);
        double r468426 = r468422 * r468425;
        double r468427 = r468421 + r468426;
        double r468428 = t;
        double r468429 = r468427 - r468428;
        return r468429;
}

double f(double x, double y, double z, double t) {
        double r468430 = x;
        double r468431 = y;
        double r468432 = cbrt(r468431);
        double r468433 = r468432 * r468432;
        double r468434 = log(r468433);
        double r468435 = r468430 * r468434;
        double r468436 = log(r468432);
        double r468437 = z;
        double r468438 = 1.0;
        double r468439 = log(r468438);
        double r468440 = r468438 * r468431;
        double r468441 = r468439 - r468440;
        double r468442 = 2.0;
        double r468443 = pow(r468431, r468442);
        double r468444 = r468437 * r468443;
        double r468445 = pow(r468438, r468442);
        double r468446 = r468444 / r468445;
        double r468447 = -0.5;
        double r468448 = r468446 * r468447;
        double r468449 = fma(r468437, r468441, r468448);
        double r468450 = fma(r468430, r468436, r468449);
        double r468451 = r468435 + r468450;
        double r468452 = t;
        double r468453 = r468451 - r468452;
        return r468453;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

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

    \[\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 + \color{blue}{\left(z \cdot \log 1 - \left(1 \cdot \left(z \cdot y\right) + \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)}\right) - t\]
  3. Simplified0.3

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020042 +o rules:numerics
(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 (* 1 1))) (* y (* y y))))) (- t (* x (log y))))

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