Average Error: 0.0 → 0.0
Time: 5.9s
Precision: 64
\[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b\]
\[\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(b, \left(y + t\right) - 2, \mathsf{fma}\left(1 - y, z, x\right)\right)\right)\]
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(b, \left(y + t\right) - 2, \mathsf{fma}\left(1 - y, z, x\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r18875 = x;
        double r18876 = y;
        double r18877 = 1.0;
        double r18878 = r18876 - r18877;
        double r18879 = z;
        double r18880 = r18878 * r18879;
        double r18881 = r18875 - r18880;
        double r18882 = t;
        double r18883 = r18882 - r18877;
        double r18884 = a;
        double r18885 = r18883 * r18884;
        double r18886 = r18881 - r18885;
        double r18887 = r18876 + r18882;
        double r18888 = 2.0;
        double r18889 = r18887 - r18888;
        double r18890 = b;
        double r18891 = r18889 * r18890;
        double r18892 = r18886 + r18891;
        return r18892;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r18893 = 1.0;
        double r18894 = t;
        double r18895 = r18893 - r18894;
        double r18896 = a;
        double r18897 = b;
        double r18898 = y;
        double r18899 = r18898 + r18894;
        double r18900 = 2.0;
        double r18901 = r18899 - r18900;
        double r18902 = r18893 - r18898;
        double r18903 = z;
        double r18904 = x;
        double r18905 = fma(r18902, r18903, r18904);
        double r18906 = fma(r18897, r18901, r18905);
        double r18907 = fma(r18895, r18896, r18906);
        return r18907;
}

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

Derivation

  1. Initial program 0.0

    \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(b, \left(y + t\right) - 2, \mathsf{fma}\left(1 - y, z, x\right)\right)\right)}\]
  3. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(b, \left(y + t\right) - 2, \mathsf{fma}\left(1 - y, z, x\right)\right)\right)\]

Reproduce

herbie shell --seed 2020042 +o rules:numerics
(FPCore (x y z t a b)
  :name "Statistics.Distribution.Beta:$centropy from math-functions-0.1.5.2"
  :precision binary64
  (+ (- (- x (* (- y 1) z)) (* (- t 1) a)) (* (- (+ y t) 2) b)))