Average Error: 9.6 → 0.6
Time: 8.0s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\sqrt[3]{{\left(\log y\right)}^{2}} \cdot \left(\sqrt[3]{\log y} \cdot x\right) + \left(\mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right) - t\right)\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\sqrt[3]{{\left(\log y\right)}^{2}} \cdot \left(\sqrt[3]{\log y} \cdot x\right) + \left(\mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right) - t\right)
double f(double x, double y, double z, double t) {
        double r407344 = x;
        double r407345 = y;
        double r407346 = log(r407345);
        double r407347 = r407344 * r407346;
        double r407348 = z;
        double r407349 = 1.0;
        double r407350 = r407349 - r407345;
        double r407351 = log(r407350);
        double r407352 = r407348 * r407351;
        double r407353 = r407347 + r407352;
        double r407354 = t;
        double r407355 = r407353 - r407354;
        return r407355;
}

double f(double x, double y, double z, double t) {
        double r407356 = y;
        double r407357 = log(r407356);
        double r407358 = 2.0;
        double r407359 = pow(r407357, r407358);
        double r407360 = cbrt(r407359);
        double r407361 = cbrt(r407357);
        double r407362 = x;
        double r407363 = r407361 * r407362;
        double r407364 = r407360 * r407363;
        double r407365 = z;
        double r407366 = 1.0;
        double r407367 = log(r407366);
        double r407368 = r407365 * r407356;
        double r407369 = 0.5;
        double r407370 = pow(r407356, r407358);
        double r407371 = r407365 * r407370;
        double r407372 = pow(r407366, r407358);
        double r407373 = r407371 / r407372;
        double r407374 = r407369 * r407373;
        double r407375 = fma(r407366, r407368, r407374);
        double r407376 = -r407375;
        double r407377 = fma(r407365, r407367, r407376);
        double r407378 = t;
        double r407379 = r407377 - r407378;
        double r407380 = r407364 + r407379;
        return r407380;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

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

    \[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
  2. Simplified9.6

    \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, z \cdot \log \left(1 - y\right) - t\right)}\]
  3. Taylor expanded around 0 0.3

    \[\leadsto \mathsf{fma}\left(\log y, x, \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)} - t\right)\]
  4. Simplified0.3

    \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)} - t\right)\]
  5. Using strategy rm
  6. Applied fma-udef0.3

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

    \[\leadsto \color{blue}{\left(\left(\sqrt[3]{\log y} \cdot \sqrt[3]{\log y}\right) \cdot \sqrt[3]{\log y}\right)} \cdot x + \left(\mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right) - t\right)\]
  9. Applied associate-*l*0.8

    \[\leadsto \color{blue}{\left(\sqrt[3]{\log y} \cdot \sqrt[3]{\log y}\right) \cdot \left(\sqrt[3]{\log y} \cdot x\right)} + \left(\mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right) - t\right)\]
  10. Using strategy rm
  11. Applied cbrt-unprod0.6

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

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

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

Reproduce

herbie shell --seed 2020036 +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))