Average Error: 0.1 → 0.1
Time: 36.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 r102659 = x;
        double r102660 = y;
        double r102661 = log(r102660);
        double r102662 = r102659 * r102661;
        double r102663 = z;
        double r102664 = r102662 + r102663;
        double r102665 = t;
        double r102666 = r102664 + r102665;
        double r102667 = a;
        double r102668 = r102666 + r102667;
        double r102669 = b;
        double r102670 = 0.5;
        double r102671 = r102669 - r102670;
        double r102672 = c;
        double r102673 = log(r102672);
        double r102674 = r102671 * r102673;
        double r102675 = r102668 + r102674;
        double r102676 = i;
        double r102677 = r102660 * r102676;
        double r102678 = r102675 + r102677;
        return r102678;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r102679 = y;
        double r102680 = i;
        double r102681 = c;
        double r102682 = log(r102681);
        double r102683 = b;
        double r102684 = 0.5;
        double r102685 = r102683 - r102684;
        double r102686 = a;
        double r102687 = x;
        double r102688 = log(r102679);
        double r102689 = z;
        double r102690 = fma(r102687, r102688, r102689);
        double r102691 = t;
        double r102692 = r102690 + r102691;
        double r102693 = r102686 + r102692;
        double r102694 = fma(r102682, r102685, r102693);
        double r102695 = fma(r102679, r102680, r102694);
        return r102695;
}

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