Average Error: 0.1 → 0.1
Time: 13.2s
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, z\right) + \left(t + a\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(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r94858 = x;
        double r94859 = y;
        double r94860 = log(r94859);
        double r94861 = r94858 * r94860;
        double r94862 = z;
        double r94863 = r94861 + r94862;
        double r94864 = t;
        double r94865 = r94863 + r94864;
        double r94866 = a;
        double r94867 = r94865 + r94866;
        double r94868 = b;
        double r94869 = 0.5;
        double r94870 = r94868 - r94869;
        double r94871 = c;
        double r94872 = log(r94871);
        double r94873 = r94870 * r94872;
        double r94874 = r94867 + r94873;
        double r94875 = i;
        double r94876 = r94859 * r94875;
        double r94877 = r94874 + r94876;
        return r94877;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r94878 = i;
        double r94879 = y;
        double r94880 = c;
        double r94881 = log(r94880);
        double r94882 = b;
        double r94883 = 0.5;
        double r94884 = r94882 - r94883;
        double r94885 = x;
        double r94886 = log(r94879);
        double r94887 = z;
        double r94888 = fma(r94885, r94886, r94887);
        double r94889 = t;
        double r94890 = a;
        double r94891 = r94889 + r94890;
        double r94892 = r94888 + r94891;
        double r94893 = fma(r94881, r94884, r94892);
        double r94894 = fma(r94878, r94879, r94893);
        return r94894;
}

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. Final simplification0.1

    \[\leadsto \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)\]

Reproduce

herbie shell --seed 2020035 +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)))