Average Error: 0.1 → 0.1
Time: 9.6s
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(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, t + z\right) + a\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(i, y, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, t + z\right) + a\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r81806 = x;
        double r81807 = y;
        double r81808 = log(r81807);
        double r81809 = r81806 * r81808;
        double r81810 = z;
        double r81811 = r81809 + r81810;
        double r81812 = t;
        double r81813 = r81811 + r81812;
        double r81814 = a;
        double r81815 = r81813 + r81814;
        double r81816 = b;
        double r81817 = 0.5;
        double r81818 = r81816 - r81817;
        double r81819 = c;
        double r81820 = log(r81819);
        double r81821 = r81818 * r81820;
        double r81822 = r81815 + r81821;
        double r81823 = i;
        double r81824 = r81807 * r81823;
        double r81825 = r81822 + r81824;
        return r81825;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r81826 = i;
        double r81827 = y;
        double r81828 = c;
        double r81829 = log(r81828);
        double r81830 = b;
        double r81831 = 0.5;
        double r81832 = r81830 - r81831;
        double r81833 = x;
        double r81834 = log(r81827);
        double r81835 = t;
        double r81836 = z;
        double r81837 = r81835 + r81836;
        double r81838 = fma(r81833, r81834, r81837);
        double r81839 = a;
        double r81840 = r81838 + r81839;
        double r81841 = fma(r81829, r81832, r81840);
        double r81842 = fma(r81826, r81827, r81841);
        return r81842;
}

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, \mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right)\right)}\]
  3. Using strategy rm
  4. Applied associate-+r+0.1

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

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

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

Reproduce

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