Average Error: 0.1 → 0.1
Time: 40.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(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, a\right)\right) + \mathsf{fma}\left(i, y, z + t\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(\log y, x, a\right)\right) + \mathsf{fma}\left(i, y, z + t\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3364435 = x;
        double r3364436 = y;
        double r3364437 = log(r3364436);
        double r3364438 = r3364435 * r3364437;
        double r3364439 = z;
        double r3364440 = r3364438 + r3364439;
        double r3364441 = t;
        double r3364442 = r3364440 + r3364441;
        double r3364443 = a;
        double r3364444 = r3364442 + r3364443;
        double r3364445 = b;
        double r3364446 = 0.5;
        double r3364447 = r3364445 - r3364446;
        double r3364448 = c;
        double r3364449 = log(r3364448);
        double r3364450 = r3364447 * r3364449;
        double r3364451 = r3364444 + r3364450;
        double r3364452 = i;
        double r3364453 = r3364436 * r3364452;
        double r3364454 = r3364451 + r3364453;
        return r3364454;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3364455 = b;
        double r3364456 = 0.5;
        double r3364457 = r3364455 - r3364456;
        double r3364458 = c;
        double r3364459 = log(r3364458);
        double r3364460 = y;
        double r3364461 = log(r3364460);
        double r3364462 = x;
        double r3364463 = a;
        double r3364464 = fma(r3364461, r3364462, r3364463);
        double r3364465 = fma(r3364457, r3364459, r3364464);
        double r3364466 = i;
        double r3364467 = z;
        double r3364468 = t;
        double r3364469 = r3364467 + r3364468;
        double r3364470 = fma(r3364466, r3364460, r3364469);
        double r3364471 = r3364465 + r3364470;
        return r3364471;
}

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. Final simplification0.1

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

Reproduce

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