Average Error: 0.1 → 0.1
Time: 12.3s
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, 1 \cdot \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\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, 1 \cdot \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r85989 = x;
        double r85990 = y;
        double r85991 = log(r85990);
        double r85992 = r85989 * r85991;
        double r85993 = z;
        double r85994 = r85992 + r85993;
        double r85995 = t;
        double r85996 = r85994 + r85995;
        double r85997 = a;
        double r85998 = r85996 + r85997;
        double r85999 = b;
        double r86000 = 0.5;
        double r86001 = r85999 - r86000;
        double r86002 = c;
        double r86003 = log(r86002);
        double r86004 = r86001 * r86003;
        double r86005 = r85998 + r86004;
        double r86006 = i;
        double r86007 = r85990 * r86006;
        double r86008 = r86005 + r86007;
        return r86008;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r86009 = i;
        double r86010 = y;
        double r86011 = 1.0;
        double r86012 = c;
        double r86013 = log(r86012);
        double r86014 = b;
        double r86015 = 0.5;
        double r86016 = r86014 - r86015;
        double r86017 = x;
        double r86018 = log(r86010);
        double r86019 = z;
        double r86020 = fma(r86017, r86018, r86019);
        double r86021 = t;
        double r86022 = a;
        double r86023 = r86021 + r86022;
        double r86024 = r86020 + r86023;
        double r86025 = fma(r86013, r86016, r86024);
        double r86026 = r86011 * r86025;
        double r86027 = fma(r86009, r86010, r86026);
        return r86027;
}

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 *-un-lft-identity0.1

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

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

Reproduce

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