Average Error: 0.1 → 0.1
Time: 7.0s
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, 1 - \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right), x + y\right) - \log \left(\sqrt[3]{t}\right) \cdot z\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, 1 - \log \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right), x + y\right) - \log \left(\sqrt[3]{t}\right) \cdot z\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r384153 = x;
        double r384154 = y;
        double r384155 = r384153 + r384154;
        double r384156 = z;
        double r384157 = r384155 + r384156;
        double r384158 = t;
        double r384159 = log(r384158);
        double r384160 = r384156 * r384159;
        double r384161 = r384157 - r384160;
        double r384162 = a;
        double r384163 = 0.5;
        double r384164 = r384162 - r384163;
        double r384165 = b;
        double r384166 = r384164 * r384165;
        double r384167 = r384161 + r384166;
        return r384167;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r384168 = b;
        double r384169 = a;
        double r384170 = 0.5;
        double r384171 = r384169 - r384170;
        double r384172 = z;
        double r384173 = 1.0;
        double r384174 = t;
        double r384175 = cbrt(r384174);
        double r384176 = r384175 * r384175;
        double r384177 = log(r384176);
        double r384178 = r384173 - r384177;
        double r384179 = x;
        double r384180 = y;
        double r384181 = r384179 + r384180;
        double r384182 = fma(r384172, r384178, r384181);
        double r384183 = log(r384175);
        double r384184 = r384183 * r384172;
        double r384185 = r384182 - r384184;
        double r384186 = fma(r384168, r384171, r384185);
        return r384186;
}

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.4
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. Using strategy rm
  4. Applied add-cube-cbrt0.1

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

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

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

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

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

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

Reproduce

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