Average Error: 0.0 → 0.0
Time: 4.2s
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, x - \left(y - 1\right) \cdot z, -a \cdot \left(t - 1\right)\right) + \mathsf{fma}\left(b, \left(y + t\right) - 2, \mathsf{fma}\left(-a, t - 1, a \cdot \left(t - 1\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, x - \left(y - 1\right) \cdot z, -a \cdot \left(t - 1\right)\right) + \mathsf{fma}\left(b, \left(y + t\right) - 2, \mathsf{fma}\left(-a, t - 1, a \cdot \left(t - 1\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r29852 = x;
        double r29853 = y;
        double r29854 = 1.0;
        double r29855 = r29853 - r29854;
        double r29856 = z;
        double r29857 = r29855 * r29856;
        double r29858 = r29852 - r29857;
        double r29859 = t;
        double r29860 = r29859 - r29854;
        double r29861 = a;
        double r29862 = r29860 * r29861;
        double r29863 = r29858 - r29862;
        double r29864 = r29853 + r29859;
        double r29865 = 2.0;
        double r29866 = r29864 - r29865;
        double r29867 = b;
        double r29868 = r29866 * r29867;
        double r29869 = r29863 + r29868;
        return r29869;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r29870 = 1.0;
        double r29871 = x;
        double r29872 = y;
        double r29873 = 1.0;
        double r29874 = r29872 - r29873;
        double r29875 = z;
        double r29876 = r29874 * r29875;
        double r29877 = r29871 - r29876;
        double r29878 = a;
        double r29879 = t;
        double r29880 = r29879 - r29873;
        double r29881 = r29878 * r29880;
        double r29882 = -r29881;
        double r29883 = fma(r29870, r29877, r29882);
        double r29884 = b;
        double r29885 = r29872 + r29879;
        double r29886 = 2.0;
        double r29887 = r29885 - r29886;
        double r29888 = -r29878;
        double r29889 = fma(r29888, r29880, r29881);
        double r29890 = fma(r29884, r29887, r29889);
        double r29891 = r29883 + r29890;
        return r29891;
}

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. Using strategy rm
  3. Applied *-un-lft-identity0.0

    \[\leadsto \left(\color{blue}{1 \cdot \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\]
  4. Applied prod-diff0.0

    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(1, x - \left(y - 1\right) \cdot z, -a \cdot \left(t - 1\right)\right) + \mathsf{fma}\left(-a, t - 1, a \cdot \left(t - 1\right)\right)\right)} + \left(\left(y + t\right) - 2\right) \cdot b\]
  5. Applied associate-+l+0.0

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

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

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

Reproduce

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