Average Error: 9.8 → 0.4
Time: 13.9s
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({\left(\frac{1}{{y}^{\frac{2}{3}}}\right)}^{\frac{-1}{3}} \cdot {\left(\frac{1}{\sqrt[3]{y}}\right)}^{\frac{-1}{3}}\right), z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\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({\left(\frac{1}{{y}^{\frac{2}{3}}}\right)}^{\frac{-1}{3}} \cdot {\left(\frac{1}{\sqrt[3]{y}}\right)}^{\frac{-1}{3}}\right), z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right)\right) - t
double f(double x, double y, double z, double t) {
        double r397704 = x;
        double r397705 = y;
        double r397706 = log(r397705);
        double r397707 = r397704 * r397706;
        double r397708 = z;
        double r397709 = 1.0;
        double r397710 = r397709 - r397705;
        double r397711 = log(r397710);
        double r397712 = r397708 * r397711;
        double r397713 = r397707 + r397712;
        double r397714 = t;
        double r397715 = r397713 - r397714;
        return r397715;
}

double f(double x, double y, double z, double t) {
        double r397716 = x;
        double r397717 = y;
        double r397718 = cbrt(r397717);
        double r397719 = r397718 * r397718;
        double r397720 = log(r397719);
        double r397721 = r397716 * r397720;
        double r397722 = 1.0;
        double r397723 = 0.6666666666666666;
        double r397724 = pow(r397717, r397723);
        double r397725 = r397722 / r397724;
        double r397726 = -0.3333333333333333;
        double r397727 = pow(r397725, r397726);
        double r397728 = r397722 / r397718;
        double r397729 = pow(r397728, r397726);
        double r397730 = r397727 * r397729;
        double r397731 = log(r397730);
        double r397732 = z;
        double r397733 = 1.0;
        double r397734 = log(r397733);
        double r397735 = 0.5;
        double r397736 = 2.0;
        double r397737 = pow(r397717, r397736);
        double r397738 = pow(r397733, r397736);
        double r397739 = r397737 / r397738;
        double r397740 = r397735 * r397739;
        double r397741 = fma(r397733, r397717, r397740);
        double r397742 = r397734 - r397741;
        double r397743 = r397732 * r397742;
        double r397744 = fma(r397716, r397731, r397743);
        double r397745 = r397721 + r397744;
        double r397746 = t;
        double r397747 = r397745 - r397746;
        return r397747;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original9.8
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.8

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

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

    \[\leadsto \left(x \cdot \log \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} + z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\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)} + z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\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)} + z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\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) + z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\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), z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right)}\right) - t\]
  10. Taylor expanded around inf 0.4

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

    \[\leadsto \left(x \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \mathsf{fma}\left(x, \log \left({\left(\frac{1}{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}\right)}^{\frac{-1}{3}}\right), z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right)\right) - t\]
  13. Applied add-cube-cbrt0.4

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

    \[\leadsto \left(x \cdot \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + \mathsf{fma}\left(x, \log \left({\color{blue}{\left(\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \frac{\sqrt[3]{1}}{\sqrt[3]{y}}\right)}}^{\frac{-1}{3}}\right), z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right)\right) - t\]
  15. Applied unpow-prod-down0.4

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

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

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

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

Reproduce

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