Average Error: 9.6 → 0.6
Time: 58.3s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\mathsf{fma}\left(\mathsf{fma}\left(\frac{y}{1} \cdot \frac{y}{1}, \frac{-1}{2}, \log 1 - y \cdot 1\right), z, \left(x \cdot \sqrt[3]{\log y}\right) \cdot \sqrt[3]{\log y \cdot \log y} - t\right)\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\mathsf{fma}\left(\mathsf{fma}\left(\frac{y}{1} \cdot \frac{y}{1}, \frac{-1}{2}, \log 1 - y \cdot 1\right), z, \left(x \cdot \sqrt[3]{\log y}\right) \cdot \sqrt[3]{\log y \cdot \log y} - t\right)
double f(double x, double y, double z, double t) {
        double r18538584 = x;
        double r18538585 = y;
        double r18538586 = log(r18538585);
        double r18538587 = r18538584 * r18538586;
        double r18538588 = z;
        double r18538589 = 1.0;
        double r18538590 = r18538589 - r18538585;
        double r18538591 = log(r18538590);
        double r18538592 = r18538588 * r18538591;
        double r18538593 = r18538587 + r18538592;
        double r18538594 = t;
        double r18538595 = r18538593 - r18538594;
        return r18538595;
}

double f(double x, double y, double z, double t) {
        double r18538596 = y;
        double r18538597 = 1.0;
        double r18538598 = r18538596 / r18538597;
        double r18538599 = r18538598 * r18538598;
        double r18538600 = -0.5;
        double r18538601 = log(r18538597);
        double r18538602 = r18538596 * r18538597;
        double r18538603 = r18538601 - r18538602;
        double r18538604 = fma(r18538599, r18538600, r18538603);
        double r18538605 = z;
        double r18538606 = x;
        double r18538607 = log(r18538596);
        double r18538608 = cbrt(r18538607);
        double r18538609 = r18538606 * r18538608;
        double r18538610 = r18538607 * r18538607;
        double r18538611 = cbrt(r18538610);
        double r18538612 = r18538609 * r18538611;
        double r18538613 = t;
        double r18538614 = r18538612 - r18538613;
        double r18538615 = fma(r18538604, r18538605, r18538614);
        return r18538615;
}

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.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. Simplified9.6

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(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))