Average Error: 0.1 → 0.1
Time: 1.6m
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(y, i, a\right) + \mathsf{fma}\left(\log y, x, z + t\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(b - 0.5, \log c, \mathsf{fma}\left(y, i, a\right) + \mathsf{fma}\left(\log y, x, z + t\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3937730 = x;
        double r3937731 = y;
        double r3937732 = log(r3937731);
        double r3937733 = r3937730 * r3937732;
        double r3937734 = z;
        double r3937735 = r3937733 + r3937734;
        double r3937736 = t;
        double r3937737 = r3937735 + r3937736;
        double r3937738 = a;
        double r3937739 = r3937737 + r3937738;
        double r3937740 = b;
        double r3937741 = 0.5;
        double r3937742 = r3937740 - r3937741;
        double r3937743 = c;
        double r3937744 = log(r3937743);
        double r3937745 = r3937742 * r3937744;
        double r3937746 = r3937739 + r3937745;
        double r3937747 = i;
        double r3937748 = r3937731 * r3937747;
        double r3937749 = r3937746 + r3937748;
        return r3937749;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3937750 = b;
        double r3937751 = 0.5;
        double r3937752 = r3937750 - r3937751;
        double r3937753 = c;
        double r3937754 = log(r3937753);
        double r3937755 = y;
        double r3937756 = i;
        double r3937757 = a;
        double r3937758 = fma(r3937755, r3937756, r3937757);
        double r3937759 = log(r3937755);
        double r3937760 = x;
        double r3937761 = z;
        double r3937762 = t;
        double r3937763 = r3937761 + r3937762;
        double r3937764 = fma(r3937759, r3937760, r3937763);
        double r3937765 = r3937758 + r3937764;
        double r3937766 = fma(r3937752, r3937754, r3937765);
        return r3937766;
}

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(b - 0.5, \log c, \left(\mathsf{fma}\left(x, \log y, z\right) + t\right) + \mathsf{fma}\left(y, i, a\right)\right)}\]
  3. Taylor expanded around 0 0.1

    \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{\left(x \cdot \log y + \left(t + z\right)\right)} + \mathsf{fma}\left(y, i, a\right)\right)\]
  4. Simplified0.1

    \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{\mathsf{fma}\left(\log y, x, z + t\right)} + \mathsf{fma}\left(y, i, a\right)\right)\]
  5. Final simplification0.1

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

Reproduce

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