Average Error: 0.1 → 0.1
Time: 28.3s
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(x, \log y, \mathsf{fma}\left(i, y, t\right) + \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + a\]
\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(x, \log y, \mathsf{fma}\left(i, y, t\right) + \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + a
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r84799 = x;
        double r84800 = y;
        double r84801 = log(r84800);
        double r84802 = r84799 * r84801;
        double r84803 = z;
        double r84804 = r84802 + r84803;
        double r84805 = t;
        double r84806 = r84804 + r84805;
        double r84807 = a;
        double r84808 = r84806 + r84807;
        double r84809 = b;
        double r84810 = 0.5;
        double r84811 = r84809 - r84810;
        double r84812 = c;
        double r84813 = log(r84812);
        double r84814 = r84811 * r84813;
        double r84815 = r84808 + r84814;
        double r84816 = i;
        double r84817 = r84800 * r84816;
        double r84818 = r84815 + r84817;
        return r84818;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r84819 = x;
        double r84820 = y;
        double r84821 = log(r84820);
        double r84822 = i;
        double r84823 = t;
        double r84824 = fma(r84822, r84820, r84823);
        double r84825 = c;
        double r84826 = log(r84825);
        double r84827 = b;
        double r84828 = 0.5;
        double r84829 = r84827 - r84828;
        double r84830 = z;
        double r84831 = fma(r84826, r84829, r84830);
        double r84832 = r84824 + r84831;
        double r84833 = fma(r84819, r84821, r84832);
        double r84834 = a;
        double r84835 = r84833 + r84834;
        return r84835;
}

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. Using strategy rm
  4. Applied fma-udef0.1

    \[\leadsto \mathsf{fma}\left(i, y, t + z\right) + \color{blue}{\left(\left(b - 0.5\right) \cdot \log c + \mathsf{fma}\left(\log y, x, a\right)\right)}\]
  5. Applied associate-+r+0.1

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z + t\right)\right)} + \mathsf{fma}\left(\log y, x, a\right)\]
  7. Using strategy rm
  8. Applied fma-udef0.1

    \[\leadsto \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z + t\right)\right) + \color{blue}{\left(\log y \cdot x + a\right)}\]
  9. Applied associate-+r+0.1

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

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

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

Reproduce

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