Average Error: 0.1 → 0.1
Time: 5.8s
Precision: 64
\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\]
\[\mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, \left(1 - 2 \cdot \log \left(\sqrt[3]{t}\right)\right) - \log \left(\sqrt[3]{t}\right), x + y\right)\right)\]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, \left(1 - 2 \cdot \log \left(\sqrt[3]{t}\right)\right) - \log \left(\sqrt[3]{t}\right), x + y\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r373959 = x;
        double r373960 = y;
        double r373961 = r373959 + r373960;
        double r373962 = z;
        double r373963 = r373961 + r373962;
        double r373964 = t;
        double r373965 = log(r373964);
        double r373966 = r373962 * r373965;
        double r373967 = r373963 - r373966;
        double r373968 = a;
        double r373969 = 0.5;
        double r373970 = r373968 - r373969;
        double r373971 = b;
        double r373972 = r373970 * r373971;
        double r373973 = r373967 + r373972;
        return r373973;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r373974 = b;
        double r373975 = a;
        double r373976 = 0.5;
        double r373977 = r373975 - r373976;
        double r373978 = z;
        double r373979 = 1.0;
        double r373980 = 2.0;
        double r373981 = t;
        double r373982 = cbrt(r373981);
        double r373983 = log(r373982);
        double r373984 = r373980 * r373983;
        double r373985 = r373979 - r373984;
        double r373986 = r373985 - r373983;
        double r373987 = x;
        double r373988 = y;
        double r373989 = r373987 + r373988;
        double r373990 = fma(r373978, r373986, r373989);
        double r373991 = fma(r373974, r373977, r373990);
        return r373991;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Target

Original0.1
Target0.3
Herbie0.1
\[\left(\left(x + y\right) + \frac{\left(1 - {\left(\log t\right)}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b\]

Derivation

  1. Initial program 0.1

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\]
  2. Simplified0.1

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

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

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

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, 1 - \log \color{blue}{\left(\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}\right)}, x + y\right)\right)\]
  7. Applied log-prod0.1

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, 1 - \color{blue}{\left(\log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) + \log \left(\sqrt[3]{t}\right)\right)}, x + y\right)\right)\]
  8. Applied associate--r+0.1

    \[\leadsto \mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, \color{blue}{\left(1 - \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right)\right) - \log \left(\sqrt[3]{t}\right)}, x + y\right)\right)\]
  9. Simplified0.1

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

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

Reproduce

herbie shell --seed 2020056 +o rules:numerics
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 0.5) b))

  (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))