Average Error: 0.1 → 0.5
Time: 1.2m
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(\sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)}, \sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)}, t\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, 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(\sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)}, \sqrt[3]{\mathsf{fma}\left(\log y, x, z\right)}, t\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, a\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3133892 = x;
        double r3133893 = y;
        double r3133894 = log(r3133893);
        double r3133895 = r3133892 * r3133894;
        double r3133896 = z;
        double r3133897 = r3133895 + r3133896;
        double r3133898 = t;
        double r3133899 = r3133897 + r3133898;
        double r3133900 = a;
        double r3133901 = r3133899 + r3133900;
        double r3133902 = b;
        double r3133903 = 0.5;
        double r3133904 = r3133902 - r3133903;
        double r3133905 = c;
        double r3133906 = log(r3133905);
        double r3133907 = r3133904 * r3133906;
        double r3133908 = r3133901 + r3133907;
        double r3133909 = i;
        double r3133910 = r3133893 * r3133909;
        double r3133911 = r3133908 + r3133910;
        return r3133911;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3133912 = y;
        double r3133913 = log(r3133912);
        double r3133914 = x;
        double r3133915 = z;
        double r3133916 = fma(r3133913, r3133914, r3133915);
        double r3133917 = cbrt(r3133916);
        double r3133918 = r3133917 * r3133917;
        double r3133919 = t;
        double r3133920 = fma(r3133918, r3133917, r3133919);
        double r3133921 = b;
        double r3133922 = 0.5;
        double r3133923 = r3133921 - r3133922;
        double r3133924 = c;
        double r3133925 = log(r3133924);
        double r3133926 = i;
        double r3133927 = a;
        double r3133928 = fma(r3133912, r3133926, r3133927);
        double r3133929 = fma(r3133923, r3133925, r3133928);
        double r3133930 = r3133920 + r3133929;
        return r3133930;
}

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

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

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

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

Reproduce

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