Average Error: 0.1 → 0.1
Time: 12.9s
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\]
\[i \cdot y + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, t + z\right) + 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
i \cdot y + \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, t + z\right) + a\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r94447 = x;
        double r94448 = y;
        double r94449 = log(r94448);
        double r94450 = r94447 * r94449;
        double r94451 = z;
        double r94452 = r94450 + r94451;
        double r94453 = t;
        double r94454 = r94452 + r94453;
        double r94455 = a;
        double r94456 = r94454 + r94455;
        double r94457 = b;
        double r94458 = 0.5;
        double r94459 = r94457 - r94458;
        double r94460 = c;
        double r94461 = log(r94460);
        double r94462 = r94459 * r94461;
        double r94463 = r94456 + r94462;
        double r94464 = i;
        double r94465 = r94448 * r94464;
        double r94466 = r94463 + r94465;
        return r94466;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r94467 = i;
        double r94468 = y;
        double r94469 = r94467 * r94468;
        double r94470 = c;
        double r94471 = log(r94470);
        double r94472 = b;
        double r94473 = 0.5;
        double r94474 = r94472 - r94473;
        double r94475 = x;
        double r94476 = log(r94468);
        double r94477 = t;
        double r94478 = z;
        double r94479 = r94477 + r94478;
        double r94480 = fma(r94475, r94476, r94479);
        double r94481 = a;
        double r94482 = r94480 + r94481;
        double r94483 = fma(r94471, r94474, r94482);
        double r94484 = r94469 + r94483;
        return r94484;
}

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

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

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

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

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

Reproduce

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