Average Error: 0.1 → 0.1
Time: 39.5s
Precision: 64
\[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\]
\[\left(t + \mathsf{fma}\left(\log y, x, z\right)\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, a\right)\right)\]
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\left(t + \mathsf{fma}\left(\log y, x, z\right)\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, a\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r2284517 = x;
        double r2284518 = y;
        double r2284519 = log(r2284518);
        double r2284520 = r2284517 * r2284519;
        double r2284521 = z;
        double r2284522 = r2284520 + r2284521;
        double r2284523 = t;
        double r2284524 = r2284522 + r2284523;
        double r2284525 = a;
        double r2284526 = r2284524 + r2284525;
        double r2284527 = b;
        double r2284528 = 0.5;
        double r2284529 = r2284527 - r2284528;
        double r2284530 = c;
        double r2284531 = log(r2284530);
        double r2284532 = r2284529 * r2284531;
        double r2284533 = r2284526 + r2284532;
        double r2284534 = i;
        double r2284535 = r2284518 * r2284534;
        double r2284536 = r2284533 + r2284535;
        return r2284536;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r2284537 = t;
        double r2284538 = y;
        double r2284539 = log(r2284538);
        double r2284540 = x;
        double r2284541 = z;
        double r2284542 = fma(r2284539, r2284540, r2284541);
        double r2284543 = r2284537 + r2284542;
        double r2284544 = b;
        double r2284545 = 0.5;
        double r2284546 = r2284544 - r2284545;
        double r2284547 = c;
        double r2284548 = log(r2284547);
        double r2284549 = i;
        double r2284550 = a;
        double r2284551 = fma(r2284538, r2284549, r2284550);
        double r2284552 = fma(r2284546, r2284548, r2284551);
        double r2284553 = r2284543 + r2284552;
        return r2284553;
}

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

Bits error versus c

Bits error versus i

Derivation

  1. Initial program 0.1

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\]
  2. Simplified0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, a\right)\right) + \left(\mathsf{fma}\left(\log y, x, z\right) + t\right)}\]
  3. Using strategy rm
  4. Applied +-commutative0.1

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

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

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B"
  (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))