Average Error: 0.1 → 0.1
Time: 11.4s
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, x \cdot \log y + \left(t + \left(z + a\right)\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, \mathsf{fma}\left(\log c, b - 0.5, x \cdot \log y + \left(t + \left(z + a\right)\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r84235 = x;
        double r84236 = y;
        double r84237 = log(r84236);
        double r84238 = r84235 * r84237;
        double r84239 = z;
        double r84240 = r84238 + r84239;
        double r84241 = t;
        double r84242 = r84240 + r84241;
        double r84243 = a;
        double r84244 = r84242 + r84243;
        double r84245 = b;
        double r84246 = 0.5;
        double r84247 = r84245 - r84246;
        double r84248 = c;
        double r84249 = log(r84248);
        double r84250 = r84247 * r84249;
        double r84251 = r84244 + r84250;
        double r84252 = i;
        double r84253 = r84236 * r84252;
        double r84254 = r84251 + r84253;
        return r84254;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r84255 = i;
        double r84256 = y;
        double r84257 = c;
        double r84258 = log(r84257);
        double r84259 = b;
        double r84260 = 0.5;
        double r84261 = r84259 - r84260;
        double r84262 = x;
        double r84263 = log(r84256);
        double r84264 = r84262 * r84263;
        double r84265 = t;
        double r84266 = z;
        double r84267 = a;
        double r84268 = r84266 + r84267;
        double r84269 = r84265 + r84268;
        double r84270 = r84264 + r84269;
        double r84271 = fma(r84258, r84261, r84270);
        double r84272 = fma(r84255, r84256, r84271);
        return r84272;
}

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 fma-udef0.1

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

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

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

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

Reproduce

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