Average Error: 0.1 → 0.1
Time: 10.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(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, t + z\right) + a\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(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, t + z\right) + a\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r60990 = x;
        double r60991 = y;
        double r60992 = log(r60991);
        double r60993 = r60990 * r60992;
        double r60994 = z;
        double r60995 = r60993 + r60994;
        double r60996 = t;
        double r60997 = r60995 + r60996;
        double r60998 = a;
        double r60999 = r60997 + r60998;
        double r61000 = b;
        double r61001 = 0.5;
        double r61002 = r61000 - r61001;
        double r61003 = c;
        double r61004 = log(r61003);
        double r61005 = r61002 * r61004;
        double r61006 = r60999 + r61005;
        double r61007 = i;
        double r61008 = r60991 * r61007;
        double r61009 = r61006 + r61008;
        return r61009;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r61010 = i;
        double r61011 = y;
        double r61012 = c;
        double r61013 = log(r61012);
        double r61014 = b;
        double r61015 = 0.5;
        double r61016 = r61014 - r61015;
        double r61017 = x;
        double r61018 = log(r61011);
        double r61019 = t;
        double r61020 = z;
        double r61021 = r61019 + r61020;
        double r61022 = fma(r61017, r61018, r61021);
        double r61023 = a;
        double r61024 = r61022 + r61023;
        double r61025 = fma(r61013, r61016, r61024);
        double r61026 = fma(r61010, r61011, r61025);
        return r61026;
}

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

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

Reproduce

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