Average Error: 0.1 → 0.1
Time: 23.1s
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 r66539 = x;
        double r66540 = y;
        double r66541 = log(r66540);
        double r66542 = r66539 * r66541;
        double r66543 = z;
        double r66544 = r66542 + r66543;
        double r66545 = t;
        double r66546 = r66544 + r66545;
        double r66547 = a;
        double r66548 = r66546 + r66547;
        double r66549 = b;
        double r66550 = 0.5;
        double r66551 = r66549 - r66550;
        double r66552 = c;
        double r66553 = log(r66552);
        double r66554 = r66551 * r66553;
        double r66555 = r66548 + r66554;
        double r66556 = i;
        double r66557 = r66540 * r66556;
        double r66558 = r66555 + r66557;
        return r66558;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r66559 = y;
        double r66560 = i;
        double r66561 = c;
        double r66562 = log(r66561);
        double r66563 = b;
        double r66564 = 0.5;
        double r66565 = r66563 - r66564;
        double r66566 = a;
        double r66567 = x;
        double r66568 = log(r66559);
        double r66569 = z;
        double r66570 = fma(r66567, r66568, r66569);
        double r66571 = t;
        double r66572 = r66570 + r66571;
        double r66573 = r66566 + r66572;
        double r66574 = fma(r66562, r66565, r66573);
        double r66575 = fma(r66559, r66560, r66574);
        return r66575;
}

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