Average Error: 23.8 → 23.8
Time: 25.0s
Precision: 64
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
\[\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\left(b - y\right) \cdot z + y}\]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\left(b - y\right) \cdot z + y}
double f(double x, double y, double z, double t, double a, double b) {
        double r488575 = x;
        double r488576 = y;
        double r488577 = r488575 * r488576;
        double r488578 = z;
        double r488579 = t;
        double r488580 = a;
        double r488581 = r488579 - r488580;
        double r488582 = r488578 * r488581;
        double r488583 = r488577 + r488582;
        double r488584 = b;
        double r488585 = r488584 - r488576;
        double r488586 = r488578 * r488585;
        double r488587 = r488576 + r488586;
        double r488588 = r488583 / r488587;
        return r488588;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r488589 = x;
        double r488590 = y;
        double r488591 = z;
        double r488592 = t;
        double r488593 = a;
        double r488594 = r488592 - r488593;
        double r488595 = r488591 * r488594;
        double r488596 = fma(r488589, r488590, r488595);
        double r488597 = b;
        double r488598 = r488597 - r488590;
        double r488599 = r488598 * r488591;
        double r488600 = r488599 + r488590;
        double r488601 = r488596 / r488600;
        return r488601;
}

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

Target

Original23.8
Target18.4
Herbie23.8
\[\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}\]

Derivation

  1. Initial program 23.8

    \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
  2. Simplified23.8

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}}\]
  3. Using strategy rm
  4. Applied fma-udef23.8

    \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\color{blue}{z \cdot \left(b - y\right) + y}}\]
  5. Simplified23.8

    \[\leadsto \frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\color{blue}{\left(b - y\right) \cdot z} + y}\]
  6. Final simplification23.8

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

Reproduce

herbie shell --seed 2019322 +o rules:numerics
(FPCore (x y z t a b)
  :name "Development.Shake.Progress:decay from shake-0.15.5"
  :precision binary64

  :herbie-target
  (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))

  (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))