Average Error: 0.0 → 0.0
Time: 7.6s
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, b \cdot \left(\left(y + t\right) - 2\right) + \mathsf{fma}\left(1 - y, z, x\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, b \cdot \left(\left(y + t\right) - 2\right) + \mathsf{fma}\left(1 - y, z, x\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r23407 = x;
        double r23408 = y;
        double r23409 = 1.0;
        double r23410 = r23408 - r23409;
        double r23411 = z;
        double r23412 = r23410 * r23411;
        double r23413 = r23407 - r23412;
        double r23414 = t;
        double r23415 = r23414 - r23409;
        double r23416 = a;
        double r23417 = r23415 * r23416;
        double r23418 = r23413 - r23417;
        double r23419 = r23408 + r23414;
        double r23420 = 2.0;
        double r23421 = r23419 - r23420;
        double r23422 = b;
        double r23423 = r23421 * r23422;
        double r23424 = r23418 + r23423;
        return r23424;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r23425 = 1.0;
        double r23426 = t;
        double r23427 = r23425 - r23426;
        double r23428 = a;
        double r23429 = b;
        double r23430 = y;
        double r23431 = r23430 + r23426;
        double r23432 = 2.0;
        double r23433 = r23431 - r23432;
        double r23434 = r23429 * r23433;
        double r23435 = r23425 - r23430;
        double r23436 = z;
        double r23437 = x;
        double r23438 = fma(r23435, r23436, r23437);
        double r23439 = r23434 + r23438;
        double r23440 = fma(r23427, r23428, r23439);
        return r23440;
}

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. Using strategy rm
  4. Applied fma-udef0.0

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

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

Reproduce

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