Average Error: 0.0 → 0.0
Time: 4.7s
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 - y, z, b \cdot y + \mathsf{fma}\left(b, t - 2, x - \left(t - 1\right) \cdot a\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 - y, z, b \cdot y + \mathsf{fma}\left(b, t - 2, x - \left(t - 1\right) \cdot a\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r32288 = x;
        double r32289 = y;
        double r32290 = 1.0;
        double r32291 = r32289 - r32290;
        double r32292 = z;
        double r32293 = r32291 * r32292;
        double r32294 = r32288 - r32293;
        double r32295 = t;
        double r32296 = r32295 - r32290;
        double r32297 = a;
        double r32298 = r32296 * r32297;
        double r32299 = r32294 - r32298;
        double r32300 = r32289 + r32295;
        double r32301 = 2.0;
        double r32302 = r32300 - r32301;
        double r32303 = b;
        double r32304 = r32302 * r32303;
        double r32305 = r32299 + r32304;
        return r32305;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r32306 = 1.0;
        double r32307 = y;
        double r32308 = r32306 - r32307;
        double r32309 = z;
        double r32310 = b;
        double r32311 = r32310 * r32307;
        double r32312 = t;
        double r32313 = 2.0;
        double r32314 = r32312 - r32313;
        double r32315 = x;
        double r32316 = r32312 - r32306;
        double r32317 = a;
        double r32318 = r32316 * r32317;
        double r32319 = r32315 - r32318;
        double r32320 = fma(r32310, r32314, r32319);
        double r32321 = r32311 + r32320;
        double r32322 = fma(r32308, r32309, r32321);
        return r32322;
}

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 - y, z, \mathsf{fma}\left(b, \left(y + t\right) - 2, x\right) - \left(t - 1\right) \cdot a\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.0

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

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

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

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

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

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

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

Reproduce

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