Average Error: 0.1 → 0.1
Time: 23.0s
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(y, i, \mathsf{fma}\left(\log c, b - 0.5, a + \left(\mathsf{fma}\left(x, \log y, z\right) + t\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(y, i, \mathsf{fma}\left(\log c, b - 0.5, a + \left(\mathsf{fma}\left(x, \log y, z\right) + t\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r90845 = x;
        double r90846 = y;
        double r90847 = log(r90846);
        double r90848 = r90845 * r90847;
        double r90849 = z;
        double r90850 = r90848 + r90849;
        double r90851 = t;
        double r90852 = r90850 + r90851;
        double r90853 = a;
        double r90854 = r90852 + r90853;
        double r90855 = b;
        double r90856 = 0.5;
        double r90857 = r90855 - r90856;
        double r90858 = c;
        double r90859 = log(r90858);
        double r90860 = r90857 * r90859;
        double r90861 = r90854 + r90860;
        double r90862 = i;
        double r90863 = r90846 * r90862;
        double r90864 = r90861 + r90863;
        return r90864;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r90865 = y;
        double r90866 = i;
        double r90867 = c;
        double r90868 = log(r90867);
        double r90869 = b;
        double r90870 = 0.5;
        double r90871 = r90869 - r90870;
        double r90872 = a;
        double r90873 = x;
        double r90874 = log(r90865);
        double r90875 = z;
        double r90876 = fma(r90873, r90874, r90875);
        double r90877 = t;
        double r90878 = r90876 + r90877;
        double r90879 = r90872 + r90878;
        double r90880 = fma(r90868, r90871, r90879);
        double r90881 = fma(r90865, r90866, r90880);
        return r90881;
}

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. Final simplification0.1

    \[\leadsto \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)\]

Reproduce

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