Average Error: 0.1 → 0.1
Time: 19.0s
Precision: 64
\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\]
\[x + \mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, 1 - \log t, y\right)\right)\]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
x + \mathsf{fma}\left(b, a - 0.5, \mathsf{fma}\left(z, 1 - \log t, y\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r383342 = x;
        double r383343 = y;
        double r383344 = r383342 + r383343;
        double r383345 = z;
        double r383346 = r383344 + r383345;
        double r383347 = t;
        double r383348 = log(r383347);
        double r383349 = r383345 * r383348;
        double r383350 = r383346 - r383349;
        double r383351 = a;
        double r383352 = 0.5;
        double r383353 = r383351 - r383352;
        double r383354 = b;
        double r383355 = r383353 * r383354;
        double r383356 = r383350 + r383355;
        return r383356;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r383357 = x;
        double r383358 = b;
        double r383359 = a;
        double r383360 = 0.5;
        double r383361 = r383359 - r383360;
        double r383362 = z;
        double r383363 = 1.0;
        double r383364 = t;
        double r383365 = log(r383364);
        double r383366 = r383363 - r383365;
        double r383367 = y;
        double r383368 = fma(r383362, r383366, r383367);
        double r383369 = fma(r383358, r383361, r383368);
        double r383370 = r383357 + r383369;
        return r383370;
}

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. 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}{\mathsf{fma}\left(b, a - 0.5, z - z \cdot \log t\right)}\]
  6. Using strategy rm
  7. Applied associate-+l+0.1

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

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

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

Reproduce

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