Average Error: 8.0 → 8.0
Time: 5.5s
Precision: 64
\[\frac{x \cdot y - z \cdot t}{a}\]
\[\frac{x \cdot y - z \cdot t}{a}\]
\frac{x \cdot y - z \cdot t}{a}
\frac{x \cdot y - z \cdot t}{a}
double f(double x, double y, double z, double t, double a) {
        double r693128 = x;
        double r693129 = y;
        double r693130 = r693128 * r693129;
        double r693131 = z;
        double r693132 = t;
        double r693133 = r693131 * r693132;
        double r693134 = r693130 - r693133;
        double r693135 = a;
        double r693136 = r693134 / r693135;
        return r693136;
}

double f(double x, double y, double z, double t, double a) {
        double r693137 = x;
        double r693138 = y;
        double r693139 = r693137 * r693138;
        double r693140 = z;
        double r693141 = t;
        double r693142 = r693140 * r693141;
        double r693143 = r693139 - r693142;
        double r693144 = a;
        double r693145 = r693143 / r693144;
        return r693145;
}

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

Original8.0
Target6.2
Herbie8.0
\[\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 8.0

    \[\frac{x \cdot y - z \cdot t}{a}\]
  2. Using strategy rm
  3. Applied div-inv8.1

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

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

Reproduce

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

  :herbie-target
  (if (< z -2.46868496869954822e170) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6.30983112197837121e-71) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z))))

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