Average Error: 7.9 → 7.9
Time: 16.6s
Precision: 64
\[\frac{x \cdot y - z \cdot t}{a}\]
\[\frac{x \cdot y - t \cdot z}{a}\]
\frac{x \cdot y - z \cdot t}{a}
\frac{x \cdot y - t \cdot z}{a}
double f(double x, double y, double z, double t, double a) {
        double r52754483 = x;
        double r52754484 = y;
        double r52754485 = r52754483 * r52754484;
        double r52754486 = z;
        double r52754487 = t;
        double r52754488 = r52754486 * r52754487;
        double r52754489 = r52754485 - r52754488;
        double r52754490 = a;
        double r52754491 = r52754489 / r52754490;
        return r52754491;
}

double f(double x, double y, double z, double t, double a) {
        double r52754492 = x;
        double r52754493 = y;
        double r52754494 = r52754492 * r52754493;
        double r52754495 = t;
        double r52754496 = z;
        double r52754497 = r52754495 * r52754496;
        double r52754498 = r52754494 - r52754497;
        double r52754499 = a;
        double r52754500 = r52754498 / r52754499;
        return r52754500;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original7.9
Target5.8
Herbie7.9
\[\begin{array}{l} \mathbf{if}\;z \lt -2.468684968699548224247694913169778644284 \cdot 10^{170}:\\ \;\;\;\;\frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\ \mathbf{elif}\;z \lt 6.309831121978371209578784129518242708809 \cdot 10^{-71}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\ \end{array}\]

Derivation

  1. Initial program 7.9

    \[\frac{x \cdot y - z \cdot t}{a}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity7.9

    \[\leadsto \frac{x \cdot y - z \cdot t}{\color{blue}{1 \cdot a}}\]
  4. Applied associate-/r*7.9

    \[\leadsto \color{blue}{\frac{\frac{x \cdot y - z \cdot t}{1}}{a}}\]
  5. Simplified7.9

    \[\leadsto \frac{\color{blue}{x \cdot y - t \cdot z}}{a}\]
  6. Final simplification7.9

    \[\leadsto \frac{x \cdot y - t \cdot z}{a}\]

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y z t a)
  :name "Data.Colour.Matrix:inverse from colour-2.3.3, B"

  :herbie-target
  (if (< z -2.468684968699548e+170) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z))))

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