Average Error: 0.1 → 0.1
Time: 11.1s
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, x \cdot \log \left(\sqrt{y}\right) + \mathsf{fma}\left(\log \left(\sqrt{y}\right), x, t + \left(z + a\right)\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(i, y, \mathsf{fma}\left(\log c, b - 0.5, x \cdot \log \left(\sqrt{y}\right) + \mathsf{fma}\left(\log \left(\sqrt{y}\right), x, t + \left(z + a\right)\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r61938 = x;
        double r61939 = y;
        double r61940 = log(r61939);
        double r61941 = r61938 * r61940;
        double r61942 = z;
        double r61943 = r61941 + r61942;
        double r61944 = t;
        double r61945 = r61943 + r61944;
        double r61946 = a;
        double r61947 = r61945 + r61946;
        double r61948 = b;
        double r61949 = 0.5;
        double r61950 = r61948 - r61949;
        double r61951 = c;
        double r61952 = log(r61951);
        double r61953 = r61950 * r61952;
        double r61954 = r61947 + r61953;
        double r61955 = i;
        double r61956 = r61939 * r61955;
        double r61957 = r61954 + r61956;
        return r61957;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r61958 = i;
        double r61959 = y;
        double r61960 = c;
        double r61961 = log(r61960);
        double r61962 = b;
        double r61963 = 0.5;
        double r61964 = r61962 - r61963;
        double r61965 = x;
        double r61966 = sqrt(r61959);
        double r61967 = log(r61966);
        double r61968 = r61965 * r61967;
        double r61969 = t;
        double r61970 = z;
        double r61971 = a;
        double r61972 = r61970 + r61971;
        double r61973 = r61969 + r61972;
        double r61974 = fma(r61967, r61965, r61973);
        double r61975 = r61968 + r61974;
        double r61976 = fma(r61961, r61964, r61975);
        double r61977 = fma(r61958, r61959, r61976);
        return r61977;
}

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 fma-udef0.1

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

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

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

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

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

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

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

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

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

Reproduce

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