Average Error: 9.1 → 0.7
Time: 32.0s
Precision: 64
\[\left(x \cdot \log y + z \cdot \log \left(1.0 - y\right)\right) - t\]
\[\mathsf{fma}\left(\mathsf{fma}\left(\frac{y}{1.0} \cdot \frac{y}{1.0}, \frac{-1}{2}, \log 1.0 - y \cdot 1.0\right), z, {\left(\log y \cdot \log y\right)}^{\frac{1}{6}} \cdot \left(\left(\sqrt[3]{\log y} \cdot x\right) \cdot {\left(\log y \cdot \log y\right)}^{\frac{1}{6}}\right) - t\right)\]
\left(x \cdot \log y + z \cdot \log \left(1.0 - y\right)\right) - t
\mathsf{fma}\left(\mathsf{fma}\left(\frac{y}{1.0} \cdot \frac{y}{1.0}, \frac{-1}{2}, \log 1.0 - y \cdot 1.0\right), z, {\left(\log y \cdot \log y\right)}^{\frac{1}{6}} \cdot \left(\left(\sqrt[3]{\log y} \cdot x\right) \cdot {\left(\log y \cdot \log y\right)}^{\frac{1}{6}}\right) - t\right)
double f(double x, double y, double z, double t) {
        double r17481278 = x;
        double r17481279 = y;
        double r17481280 = log(r17481279);
        double r17481281 = r17481278 * r17481280;
        double r17481282 = z;
        double r17481283 = 1.0;
        double r17481284 = r17481283 - r17481279;
        double r17481285 = log(r17481284);
        double r17481286 = r17481282 * r17481285;
        double r17481287 = r17481281 + r17481286;
        double r17481288 = t;
        double r17481289 = r17481287 - r17481288;
        return r17481289;
}

double f(double x, double y, double z, double t) {
        double r17481290 = y;
        double r17481291 = 1.0;
        double r17481292 = r17481290 / r17481291;
        double r17481293 = r17481292 * r17481292;
        double r17481294 = -0.5;
        double r17481295 = log(r17481291);
        double r17481296 = r17481290 * r17481291;
        double r17481297 = r17481295 - r17481296;
        double r17481298 = fma(r17481293, r17481294, r17481297);
        double r17481299 = z;
        double r17481300 = log(r17481290);
        double r17481301 = r17481300 * r17481300;
        double r17481302 = 0.16666666666666666;
        double r17481303 = pow(r17481301, r17481302);
        double r17481304 = cbrt(r17481300);
        double r17481305 = x;
        double r17481306 = r17481304 * r17481305;
        double r17481307 = r17481306 * r17481303;
        double r17481308 = r17481303 * r17481307;
        double r17481309 = t;
        double r17481310 = r17481308 - r17481309;
        double r17481311 = fma(r17481298, r17481299, r17481310);
        return r17481311;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original9.1
Target0.3
Herbie0.7
\[\left(-z\right) \cdot \left(\left(0.5 \cdot \left(y \cdot y\right) + y\right) + \frac{\frac{1}{3}}{1.0 \cdot \left(1.0 \cdot 1.0\right)} \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) - \left(t - x \cdot \log y\right)\]

Derivation

  1. Initial program 9.1

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

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

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

    \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{y}{1.0} \cdot \frac{y}{1.0}, \frac{-1}{2}, \log 1.0 - 1.0 \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.0} \cdot \frac{y}{1.0}, \frac{-1}{2}, \log 1.0 - 1.0 \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.0} \cdot \frac{y}{1.0}, \frac{-1}{2}, \log 1.0 - 1.0 \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 pow1/362.2

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{y}{1.0} \cdot \frac{y}{1.0}, \frac{-1}{2}, \log 1.0 - 1.0 \cdot y\right), z, \left(\sqrt[3]{\log y} \cdot \color{blue}{{\left(\log y\right)}^{\frac{1}{3}}}\right) \cdot \left(\sqrt[3]{\log y} \cdot x\right) - t\right)\]
  10. Applied pow1/362.2

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

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{y}{1.0} \cdot \frac{y}{1.0}, \frac{-1}{2}, \log 1.0 - 1.0 \cdot y\right), z, \color{blue}{{\left(\log y \cdot \log y\right)}^{\frac{1}{3}}} \cdot \left(\sqrt[3]{\log y} \cdot x\right) - t\right)\]
  12. Using strategy rm
  13. Applied sqr-pow0.7

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

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

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

Reproduce

herbie shell --seed 2019162 +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) (* (/ 1/3 (* 1.0 (* 1.0 1.0))) (* y (* y y))))) (- t (* x (log y))))

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