Average Error: 0.1 → 0.1
Time: 24.7s
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, x + y\right) + \left(1 - \log t\right) \cdot z\]
\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, x + y\right) + \left(1 - \log t\right) \cdot z
double f(double x, double y, double z, double t, double a, double b) {
        double r17212400 = x;
        double r17212401 = y;
        double r17212402 = r17212400 + r17212401;
        double r17212403 = z;
        double r17212404 = r17212402 + r17212403;
        double r17212405 = t;
        double r17212406 = log(r17212405);
        double r17212407 = r17212403 * r17212406;
        double r17212408 = r17212404 - r17212407;
        double r17212409 = a;
        double r17212410 = 0.5;
        double r17212411 = r17212409 - r17212410;
        double r17212412 = b;
        double r17212413 = r17212411 * r17212412;
        double r17212414 = r17212408 + r17212413;
        return r17212414;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r17212415 = b;
        double r17212416 = a;
        double r17212417 = 0.5;
        double r17212418 = r17212416 - r17212417;
        double r17212419 = x;
        double r17212420 = y;
        double r17212421 = r17212419 + r17212420;
        double r17212422 = fma(r17212415, r17212418, r17212421);
        double r17212423 = 1.0;
        double r17212424 = t;
        double r17212425 = log(r17212424);
        double r17212426 = r17212423 - r17212425;
        double r17212427 = z;
        double r17212428 = r17212426 * r17212427;
        double r17212429 = r17212422 + r17212428;
        return r17212429;
}

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(z, 1 - \log t, \mathsf{fma}\left(b, a - 0.5, y + x\right)\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.1

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

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

Reproduce

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