Average Error: 0.1 → 0.1
Time: 18.0s
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(y, i, \mathsf{fma}\left(\log c, b - 0.5, a + \left(\mathsf{fma}\left(x, \log y, z\right) + t\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(y, i, \mathsf{fma}\left(\log c, b - 0.5, a + \left(\mathsf{fma}\left(x, \log y, z\right) + t\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r101171 = x;
        double r101172 = y;
        double r101173 = log(r101172);
        double r101174 = r101171 * r101173;
        double r101175 = z;
        double r101176 = r101174 + r101175;
        double r101177 = t;
        double r101178 = r101176 + r101177;
        double r101179 = a;
        double r101180 = r101178 + r101179;
        double r101181 = b;
        double r101182 = 0.5;
        double r101183 = r101181 - r101182;
        double r101184 = c;
        double r101185 = log(r101184);
        double r101186 = r101183 * r101185;
        double r101187 = r101180 + r101186;
        double r101188 = i;
        double r101189 = r101172 * r101188;
        double r101190 = r101187 + r101189;
        return r101190;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r101191 = y;
        double r101192 = i;
        double r101193 = c;
        double r101194 = log(r101193);
        double r101195 = b;
        double r101196 = 0.5;
        double r101197 = r101195 - r101196;
        double r101198 = a;
        double r101199 = x;
        double r101200 = log(r101191);
        double r101201 = z;
        double r101202 = fma(r101199, r101200, r101201);
        double r101203 = t;
        double r101204 = r101202 + r101203;
        double r101205 = r101198 + r101204;
        double r101206 = fma(r101194, r101197, r101205);
        double r101207 = fma(r101191, r101192, r101206);
        return r101207;
}

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(y, i, \mathsf{fma}\left(\log c, b - 0.5, a + \left(\mathsf{fma}\left(x, \log y, z\right) + t\right)\right)\right)}\]
  3. Final simplification0.1

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

Reproduce

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