Average Error: 0.1 → 0.1
Time: 46.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 r117872 = x;
        double r117873 = y;
        double r117874 = log(r117873);
        double r117875 = r117872 * r117874;
        double r117876 = z;
        double r117877 = r117875 + r117876;
        double r117878 = t;
        double r117879 = r117877 + r117878;
        double r117880 = a;
        double r117881 = r117879 + r117880;
        double r117882 = b;
        double r117883 = 0.5;
        double r117884 = r117882 - r117883;
        double r117885 = c;
        double r117886 = log(r117885);
        double r117887 = r117884 * r117886;
        double r117888 = r117881 + r117887;
        double r117889 = i;
        double r117890 = r117873 * r117889;
        double r117891 = r117888 + r117890;
        return r117891;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r117892 = y;
        double r117893 = i;
        double r117894 = c;
        double r117895 = log(r117894);
        double r117896 = b;
        double r117897 = 0.5;
        double r117898 = r117896 - r117897;
        double r117899 = a;
        double r117900 = x;
        double r117901 = log(r117892);
        double r117902 = z;
        double r117903 = fma(r117900, r117901, r117902);
        double r117904 = t;
        double r117905 = r117903 + r117904;
        double r117906 = r117899 + r117905;
        double r117907 = fma(r117895, r117898, r117906);
        double r117908 = fma(r117892, r117893, r117907);
        return r117908;
}

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