Average Error: 0.1 → 0.1
Time: 39.7s
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\]
\[\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z + t\right)\right) + \mathsf{fma}\left(\log y, x, a\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
\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z + t\right)\right) + \mathsf{fma}\left(\log y, x, a\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3437382 = x;
        double r3437383 = y;
        double r3437384 = log(r3437383);
        double r3437385 = r3437382 * r3437384;
        double r3437386 = z;
        double r3437387 = r3437385 + r3437386;
        double r3437388 = t;
        double r3437389 = r3437387 + r3437388;
        double r3437390 = a;
        double r3437391 = r3437389 + r3437390;
        double r3437392 = b;
        double r3437393 = 0.5;
        double r3437394 = r3437392 - r3437393;
        double r3437395 = c;
        double r3437396 = log(r3437395);
        double r3437397 = r3437394 * r3437396;
        double r3437398 = r3437391 + r3437397;
        double r3437399 = i;
        double r3437400 = r3437383 * r3437399;
        double r3437401 = r3437398 + r3437400;
        return r3437401;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3437402 = b;
        double r3437403 = 0.5;
        double r3437404 = r3437402 - r3437403;
        double r3437405 = c;
        double r3437406 = log(r3437405);
        double r3437407 = i;
        double r3437408 = y;
        double r3437409 = z;
        double r3437410 = t;
        double r3437411 = r3437409 + r3437410;
        double r3437412 = fma(r3437407, r3437408, r3437411);
        double r3437413 = fma(r3437404, r3437406, r3437412);
        double r3437414 = log(r3437408);
        double r3437415 = x;
        double r3437416 = a;
        double r3437417 = fma(r3437414, r3437415, r3437416);
        double r3437418 = r3437413 + r3437417;
        return r3437418;
}

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

    \[\leadsto \mathsf{fma}\left(i, y, t + z\right) + \color{blue}{\left(\left(b - 0.5\right) \cdot \log c + \mathsf{fma}\left(\log y, x, a\right)\right)}\]
  5. Applied associate-+r+0.1

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

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

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

Reproduce

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