Average Error: 0.1 → 0.1
Time: 27.9s
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\]
\[y \cdot i + \mathsf{fma}\left(\log c, b - 0.5, a + \left(\mathsf{fma}\left(x, \log y, z\right) + 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
y \cdot i + \mathsf{fma}\left(\log c, b - 0.5, a + \left(\mathsf{fma}\left(x, \log y, z\right) + t\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r98824 = x;
        double r98825 = y;
        double r98826 = log(r98825);
        double r98827 = r98824 * r98826;
        double r98828 = z;
        double r98829 = r98827 + r98828;
        double r98830 = t;
        double r98831 = r98829 + r98830;
        double r98832 = a;
        double r98833 = r98831 + r98832;
        double r98834 = b;
        double r98835 = 0.5;
        double r98836 = r98834 - r98835;
        double r98837 = c;
        double r98838 = log(r98837);
        double r98839 = r98836 * r98838;
        double r98840 = r98833 + r98839;
        double r98841 = i;
        double r98842 = r98825 * r98841;
        double r98843 = r98840 + r98842;
        return r98843;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r98844 = y;
        double r98845 = i;
        double r98846 = r98844 * r98845;
        double r98847 = c;
        double r98848 = log(r98847);
        double r98849 = b;
        double r98850 = 0.5;
        double r98851 = r98849 - r98850;
        double r98852 = a;
        double r98853 = x;
        double r98854 = log(r98844);
        double r98855 = z;
        double r98856 = fma(r98853, r98854, r98855);
        double r98857 = t;
        double r98858 = r98856 + r98857;
        double r98859 = r98852 + r98858;
        double r98860 = fma(r98848, r98851, r98859);
        double r98861 = r98846 + r98860;
        return r98861;
}

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

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

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

Reproduce

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