Average Error: 0.1 → 0.1
Time: 45.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, \left(\mathsf{fma}\left(x, \log y, z\right) + t\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(y, i, \mathsf{fma}\left(\log c, b - 0.5, \left(\mathsf{fma}\left(x, \log y, z\right) + t\right) + a\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r6915775 = x;
        double r6915776 = y;
        double r6915777 = log(r6915776);
        double r6915778 = r6915775 * r6915777;
        double r6915779 = z;
        double r6915780 = r6915778 + r6915779;
        double r6915781 = t;
        double r6915782 = r6915780 + r6915781;
        double r6915783 = a;
        double r6915784 = r6915782 + r6915783;
        double r6915785 = b;
        double r6915786 = 0.5;
        double r6915787 = r6915785 - r6915786;
        double r6915788 = c;
        double r6915789 = log(r6915788);
        double r6915790 = r6915787 * r6915789;
        double r6915791 = r6915784 + r6915790;
        double r6915792 = i;
        double r6915793 = r6915776 * r6915792;
        double r6915794 = r6915791 + r6915793;
        return r6915794;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r6915795 = y;
        double r6915796 = i;
        double r6915797 = c;
        double r6915798 = log(r6915797);
        double r6915799 = b;
        double r6915800 = 0.5;
        double r6915801 = r6915799 - r6915800;
        double r6915802 = x;
        double r6915803 = log(r6915795);
        double r6915804 = z;
        double r6915805 = fma(r6915802, r6915803, r6915804);
        double r6915806 = t;
        double r6915807 = r6915805 + r6915806;
        double r6915808 = a;
        double r6915809 = r6915807 + r6915808;
        double r6915810 = fma(r6915798, r6915801, r6915809);
        double r6915811 = fma(r6915795, r6915796, r6915810);
        return r6915811;
}

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

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B"
  (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))