Average Error: 0.1 → 0.1
Time: 32.0s
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 r72844 = x;
        double r72845 = y;
        double r72846 = log(r72845);
        double r72847 = r72844 * r72846;
        double r72848 = z;
        double r72849 = r72847 + r72848;
        double r72850 = t;
        double r72851 = r72849 + r72850;
        double r72852 = a;
        double r72853 = r72851 + r72852;
        double r72854 = b;
        double r72855 = 0.5;
        double r72856 = r72854 - r72855;
        double r72857 = c;
        double r72858 = log(r72857);
        double r72859 = r72856 * r72858;
        double r72860 = r72853 + r72859;
        double r72861 = i;
        double r72862 = r72845 * r72861;
        double r72863 = r72860 + r72862;
        return r72863;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r72864 = y;
        double r72865 = i;
        double r72866 = c;
        double r72867 = log(r72866);
        double r72868 = b;
        double r72869 = 0.5;
        double r72870 = r72868 - r72869;
        double r72871 = a;
        double r72872 = x;
        double r72873 = log(r72864);
        double r72874 = z;
        double r72875 = fma(r72872, r72873, r72874);
        double r72876 = t;
        double r72877 = r72875 + r72876;
        double r72878 = r72871 + r72877;
        double r72879 = fma(r72867, r72870, r72878);
        double r72880 = fma(r72864, r72865, r72879);
        return r72880;
}

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