Average Error: 7.6 → 7.6
Time: 4.1s
Precision: 64
\[\frac{x \cdot y - z \cdot t}{a}\]
\[\frac{1 \cdot \left(x \cdot y - z \cdot t\right)}{a}\]
\frac{x \cdot y - z \cdot t}{a}
\frac{1 \cdot \left(x \cdot y - z \cdot t\right)}{a}
double f(double x, double y, double z, double t, double a) {
        double r1018128 = x;
        double r1018129 = y;
        double r1018130 = r1018128 * r1018129;
        double r1018131 = z;
        double r1018132 = t;
        double r1018133 = r1018131 * r1018132;
        double r1018134 = r1018130 - r1018133;
        double r1018135 = a;
        double r1018136 = r1018134 / r1018135;
        return r1018136;
}

double f(double x, double y, double z, double t, double a) {
        double r1018137 = 1.0;
        double r1018138 = x;
        double r1018139 = y;
        double r1018140 = r1018138 * r1018139;
        double r1018141 = z;
        double r1018142 = t;
        double r1018143 = r1018141 * r1018142;
        double r1018144 = r1018140 - r1018143;
        double r1018145 = r1018137 * r1018144;
        double r1018146 = a;
        double r1018147 = r1018145 / r1018146;
        return r1018147;
}

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.6
Target5.9
Herbie7.6
\[\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.6

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

    \[\leadsto \frac{\color{blue}{1 \cdot \left(x \cdot y - z \cdot t\right)}}{a}\]
  4. Final simplification7.6

    \[\leadsto \frac{1 \cdot \left(x \cdot y - z \cdot t\right)}{a}\]

Reproduce

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

  :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))