Average Error: 0.1 → 0.1
Time: 15.7s
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 r100296 = x;
        double r100297 = y;
        double r100298 = log(r100297);
        double r100299 = r100296 * r100298;
        double r100300 = z;
        double r100301 = r100299 + r100300;
        double r100302 = t;
        double r100303 = r100301 + r100302;
        double r100304 = a;
        double r100305 = r100303 + r100304;
        double r100306 = b;
        double r100307 = 0.5;
        double r100308 = r100306 - r100307;
        double r100309 = c;
        double r100310 = log(r100309);
        double r100311 = r100308 * r100310;
        double r100312 = r100305 + r100311;
        double r100313 = i;
        double r100314 = r100297 * r100313;
        double r100315 = r100312 + r100314;
        return r100315;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r100316 = i;
        double r100317 = y;
        double r100318 = c;
        double r100319 = log(r100318);
        double r100320 = b;
        double r100321 = 0.5;
        double r100322 = r100320 - r100321;
        double r100323 = x;
        double r100324 = log(r100317);
        double r100325 = t;
        double r100326 = z;
        double r100327 = r100325 + r100326;
        double r100328 = fma(r100323, r100324, r100327);
        double r100329 = a;
        double r100330 = r100328 + r100329;
        double r100331 = fma(r100319, r100322, r100330);
        double r100332 = fma(r100316, r100317, r100331);
        return r100332;
}

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 2019353 +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)))