Average Error: 0.1 → 0.1
Time: 36.6s
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 r3521533 = x;
        double r3521534 = y;
        double r3521535 = log(r3521534);
        double r3521536 = r3521533 * r3521535;
        double r3521537 = z;
        double r3521538 = r3521536 + r3521537;
        double r3521539 = t;
        double r3521540 = r3521538 + r3521539;
        double r3521541 = a;
        double r3521542 = r3521540 + r3521541;
        double r3521543 = b;
        double r3521544 = 0.5;
        double r3521545 = r3521543 - r3521544;
        double r3521546 = c;
        double r3521547 = log(r3521546);
        double r3521548 = r3521545 * r3521547;
        double r3521549 = r3521542 + r3521548;
        double r3521550 = i;
        double r3521551 = r3521534 * r3521550;
        double r3521552 = r3521549 + r3521551;
        return r3521552;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3521553 = b;
        double r3521554 = 0.5;
        double r3521555 = r3521553 - r3521554;
        double r3521556 = c;
        double r3521557 = log(r3521556);
        double r3521558 = i;
        double r3521559 = y;
        double r3521560 = z;
        double r3521561 = t;
        double r3521562 = r3521560 + r3521561;
        double r3521563 = fma(r3521558, r3521559, r3521562);
        double r3521564 = fma(r3521555, r3521557, r3521563);
        double r3521565 = log(r3521559);
        double r3521566 = x;
        double r3521567 = a;
        double r3521568 = fma(r3521565, r3521566, r3521567);
        double r3521569 = r3521564 + r3521568;
        return r3521569;
}

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 2019171 +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)))