Average Error: 0.1 → 0.1
Time: 16.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(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 r100792 = x;
        double r100793 = y;
        double r100794 = log(r100793);
        double r100795 = r100792 * r100794;
        double r100796 = z;
        double r100797 = r100795 + r100796;
        double r100798 = t;
        double r100799 = r100797 + r100798;
        double r100800 = a;
        double r100801 = r100799 + r100800;
        double r100802 = b;
        double r100803 = 0.5;
        double r100804 = r100802 - r100803;
        double r100805 = c;
        double r100806 = log(r100805);
        double r100807 = r100804 * r100806;
        double r100808 = r100801 + r100807;
        double r100809 = i;
        double r100810 = r100793 * r100809;
        double r100811 = r100808 + r100810;
        return r100811;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r100812 = i;
        double r100813 = y;
        double r100814 = c;
        double r100815 = log(r100814);
        double r100816 = b;
        double r100817 = 0.5;
        double r100818 = r100816 - r100817;
        double r100819 = x;
        double r100820 = log(r100813);
        double r100821 = t;
        double r100822 = z;
        double r100823 = r100821 + r100822;
        double r100824 = fma(r100819, r100820, r100823);
        double r100825 = a;
        double r100826 = r100824 + r100825;
        double r100827 = fma(r100815, r100818, r100826);
        double r100828 = fma(r100812, r100813, r100827);
        return r100828;
}

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 2019353 +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)))