Average Error: 0.1 → 0.1
Time: 24.1s
Precision: 64
\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\]
\[\left(\mathsf{fma}\left(b, a - 0.5, z\right) - z \cdot \log t\right) + \left(y + x\right)\]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\left(\mathsf{fma}\left(b, a - 0.5, z\right) - z \cdot \log t\right) + \left(y + x\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r20094430 = x;
        double r20094431 = y;
        double r20094432 = r20094430 + r20094431;
        double r20094433 = z;
        double r20094434 = r20094432 + r20094433;
        double r20094435 = t;
        double r20094436 = log(r20094435);
        double r20094437 = r20094433 * r20094436;
        double r20094438 = r20094434 - r20094437;
        double r20094439 = a;
        double r20094440 = 0.5;
        double r20094441 = r20094439 - r20094440;
        double r20094442 = b;
        double r20094443 = r20094441 * r20094442;
        double r20094444 = r20094438 + r20094443;
        return r20094444;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r20094445 = b;
        double r20094446 = a;
        double r20094447 = 0.5;
        double r20094448 = r20094446 - r20094447;
        double r20094449 = z;
        double r20094450 = fma(r20094445, r20094448, r20094449);
        double r20094451 = t;
        double r20094452 = log(r20094451);
        double r20094453 = r20094449 * r20094452;
        double r20094454 = r20094450 - r20094453;
        double r20094455 = y;
        double r20094456 = x;
        double r20094457 = r20094455 + r20094456;
        double r20094458 = r20094454 + r20094457;
        return r20094458;
}

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. Using strategy rm
  3. Applied associate--l+0.1

    \[\leadsto \color{blue}{\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b\]
  4. Applied associate-+l+0.1

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

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

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

Reproduce

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

  :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)))