Average Error: 0.1 → 0.1
Time: 36.8s
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(y, i, \left(\mathsf{fma}\left(\log y, x, t + a\right) + z\right) + \log c \cdot \left(b - 0.5\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
\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log y, x, t + a\right) + z\right) + \log c \cdot \left(b - 0.5\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3527405 = x;
        double r3527406 = y;
        double r3527407 = log(r3527406);
        double r3527408 = r3527405 * r3527407;
        double r3527409 = z;
        double r3527410 = r3527408 + r3527409;
        double r3527411 = t;
        double r3527412 = r3527410 + r3527411;
        double r3527413 = a;
        double r3527414 = r3527412 + r3527413;
        double r3527415 = b;
        double r3527416 = 0.5;
        double r3527417 = r3527415 - r3527416;
        double r3527418 = c;
        double r3527419 = log(r3527418);
        double r3527420 = r3527417 * r3527419;
        double r3527421 = r3527414 + r3527420;
        double r3527422 = i;
        double r3527423 = r3527406 * r3527422;
        double r3527424 = r3527421 + r3527423;
        return r3527424;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3527425 = y;
        double r3527426 = i;
        double r3527427 = log(r3527425);
        double r3527428 = x;
        double r3527429 = t;
        double r3527430 = a;
        double r3527431 = r3527429 + r3527430;
        double r3527432 = fma(r3527427, r3527428, r3527431);
        double r3527433 = z;
        double r3527434 = r3527432 + r3527433;
        double r3527435 = c;
        double r3527436 = log(r3527435);
        double r3527437 = b;
        double r3527438 = 0.5;
        double r3527439 = r3527437 - r3527438;
        double r3527440 = r3527436 * r3527439;
        double r3527441 = r3527434 + r3527440;
        double r3527442 = fma(r3527425, r3527426, r3527441);
        return r3527442;
}

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

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

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

Reproduce

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