Average Error: 0.1 → 0.1
Time: 24.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(1 - \log t, z, y\right)\right) + x\]
\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(1 - \log t, z, y\right)\right) + x
double f(double x, double y, double z, double t, double a, double b) {
        double r529397 = x;
        double r529398 = y;
        double r529399 = r529397 + r529398;
        double r529400 = z;
        double r529401 = r529399 + r529400;
        double r529402 = t;
        double r529403 = log(r529402);
        double r529404 = r529400 * r529403;
        double r529405 = r529401 - r529404;
        double r529406 = a;
        double r529407 = 0.5;
        double r529408 = r529406 - r529407;
        double r529409 = b;
        double r529410 = r529408 * r529409;
        double r529411 = r529405 + r529410;
        return r529411;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r529412 = b;
        double r529413 = a;
        double r529414 = 0.5;
        double r529415 = r529413 - r529414;
        double r529416 = 1.0;
        double r529417 = t;
        double r529418 = log(r529417);
        double r529419 = r529416 - r529418;
        double r529420 = z;
        double r529421 = y;
        double r529422 = fma(r529419, r529420, r529421);
        double r529423 = fma(r529412, r529415, r529422);
        double r529424 = x;
        double r529425 = r529423 + r529424;
        return r529425;
}

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, \mathsf{fma}\left(1 - \log t, z, y\right)\right) + x}\]
  3. Final simplification0.1

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

Reproduce

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