Average Error: 8.0 → 8.0
Time: 16.3s
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 r514233 = x;
        double r514234 = y;
        double r514235 = r514233 * r514234;
        double r514236 = z;
        double r514237 = t;
        double r514238 = r514236 * r514237;
        double r514239 = r514235 - r514238;
        double r514240 = a;
        double r514241 = r514239 / r514240;
        return r514241;
}

double f(double x, double y, double z, double t, double a) {
        double r514242 = x;
        double r514243 = y;
        double r514244 = r514242 * r514243;
        double r514245 = z;
        double r514246 = t;
        double r514247 = r514245 * r514246;
        double r514248 = r514244 - r514247;
        double r514249 = a;
        double r514250 = r514248 / r514249;
        return r514250;
}

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