Average Error: 9.5 → 0.3
Time: 20.4s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t\]
\[\left(\mathsf{fma}\left(2 \cdot \log \left(\sqrt[3]{y}\right), x, \log \left({\left(\frac{1}{y}\right)}^{\frac{-1}{3}}\right) \cdot x\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\]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(\mathsf{fma}\left(2 \cdot \log \left(\sqrt[3]{y}\right), x, \log \left({\left(\frac{1}{y}\right)}^{\frac{-1}{3}}\right) \cdot x\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
double f(double x, double y, double z, double t) {
        double r313692 = x;
        double r313693 = y;
        double r313694 = log(r313693);
        double r313695 = r313692 * r313694;
        double r313696 = z;
        double r313697 = 1.0;
        double r313698 = r313697 - r313693;
        double r313699 = log(r313698);
        double r313700 = r313696 * r313699;
        double r313701 = r313695 + r313700;
        double r313702 = t;
        double r313703 = r313701 - r313702;
        return r313703;
}

double f(double x, double y, double z, double t) {
        double r313704 = 2.0;
        double r313705 = y;
        double r313706 = cbrt(r313705);
        double r313707 = log(r313706);
        double r313708 = r313704 * r313707;
        double r313709 = x;
        double r313710 = 1.0;
        double r313711 = r313710 / r313705;
        double r313712 = -0.3333333333333333;
        double r313713 = pow(r313711, r313712);
        double r313714 = log(r313713);
        double r313715 = r313714 * r313709;
        double r313716 = fma(r313708, r313709, r313715);
        double r313717 = z;
        double r313718 = 1.0;
        double r313719 = log(r313718);
        double r313720 = r313718 * r313705;
        double r313721 = r313719 - r313720;
        double r313722 = r313717 * r313721;
        double r313723 = 0.5;
        double r313724 = pow(r313705, r313704);
        double r313725 = r313717 * r313724;
        double r313726 = pow(r313718, r313704);
        double r313727 = r313725 / r313726;
        double r313728 = r313723 * r313727;
        double r313729 = r313722 - r313728;
        double r313730 = r313716 + r313729;
        double r313731 = t;
        double r313732 = r313730 - r313731;
        return r313732;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

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 + \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. Simplified0.4

    \[\leadsto \left(\left(\color{blue}{\left(2 \cdot \log \left(\sqrt[3]{y}\right)\right) \cdot x} + 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\]
  9. Simplified0.4

    \[\leadsto \left(\left(\left(2 \cdot \log \left(\sqrt[3]{y}\right)\right) \cdot x + \color{blue}{\log \left(\sqrt[3]{y}\right) \cdot x}\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\]
  10. Using strategy rm
  11. Applied fma-def0.3

    \[\leadsto \left(\color{blue}{\mathsf{fma}\left(2 \cdot \log \left(\sqrt[3]{y}\right), x, \log \left(\sqrt[3]{y}\right) \cdot x\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\]
  12. Taylor expanded around inf 0.3

    \[\leadsto \left(\mathsf{fma}\left(2 \cdot \log \left(\sqrt[3]{y}\right), x, \log \color{blue}{\left({\left(\frac{1}{y}\right)}^{\frac{-1}{3}}\right)} \cdot x\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\]
  13. Final simplification0.3

    \[\leadsto \left(\mathsf{fma}\left(2 \cdot \log \left(\sqrt[3]{y}\right), x, \log \left({\left(\frac{1}{y}\right)}^{\frac{-1}{3}}\right) \cdot x\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\]

Reproduce

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