Average Error: 0.1 → 0.1
Time: 15.5s
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 r100497 = x;
        double r100498 = y;
        double r100499 = log(r100498);
        double r100500 = r100497 * r100499;
        double r100501 = z;
        double r100502 = r100500 + r100501;
        double r100503 = t;
        double r100504 = r100502 + r100503;
        double r100505 = a;
        double r100506 = r100504 + r100505;
        double r100507 = b;
        double r100508 = 0.5;
        double r100509 = r100507 - r100508;
        double r100510 = c;
        double r100511 = log(r100510);
        double r100512 = r100509 * r100511;
        double r100513 = r100506 + r100512;
        double r100514 = i;
        double r100515 = r100498 * r100514;
        double r100516 = r100513 + r100515;
        return r100516;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r100517 = i;
        double r100518 = y;
        double r100519 = c;
        double r100520 = log(r100519);
        double r100521 = b;
        double r100522 = 0.5;
        double r100523 = r100521 - r100522;
        double r100524 = x;
        double r100525 = log(r100518);
        double r100526 = t;
        double r100527 = z;
        double r100528 = r100526 + r100527;
        double r100529 = fma(r100524, r100525, r100528);
        double r100530 = a;
        double r100531 = r100529 + r100530;
        double r100532 = fma(r100520, r100523, r100531);
        double r100533 = fma(r100517, r100518, r100532);
        return r100533;
}

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