Average Error: 0.1 → 0.1
Time: 6.5m
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(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, a\right)\right) + \mathsf{fma}\left(i, y, z + t\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(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, a\right)\right) + \mathsf{fma}\left(i, y, z + t\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r1275847 = x;
        double r1275848 = y;
        double r1275849 = log(r1275848);
        double r1275850 = r1275847 * r1275849;
        double r1275851 = z;
        double r1275852 = r1275850 + r1275851;
        double r1275853 = t;
        double r1275854 = r1275852 + r1275853;
        double r1275855 = a;
        double r1275856 = r1275854 + r1275855;
        double r1275857 = b;
        double r1275858 = 0.5;
        double r1275859 = r1275857 - r1275858;
        double r1275860 = c;
        double r1275861 = log(r1275860);
        double r1275862 = r1275859 * r1275861;
        double r1275863 = r1275856 + r1275862;
        double r1275864 = i;
        double r1275865 = r1275848 * r1275864;
        double r1275866 = r1275863 + r1275865;
        return r1275866;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r1275867 = b;
        double r1275868 = 0.5;
        double r1275869 = r1275867 - r1275868;
        double r1275870 = c;
        double r1275871 = log(r1275870);
        double r1275872 = y;
        double r1275873 = log(r1275872);
        double r1275874 = x;
        double r1275875 = a;
        double r1275876 = fma(r1275873, r1275874, r1275875);
        double r1275877 = fma(r1275869, r1275871, r1275876);
        double r1275878 = i;
        double r1275879 = z;
        double r1275880 = t;
        double r1275881 = r1275879 + r1275880;
        double r1275882 = fma(r1275878, r1275872, r1275881);
        double r1275883 = r1275877 + r1275882;
        return r1275883;
}

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

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

Reproduce

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