Average Error: 7.3 → 7.3
Time: 13.0s
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 r536203 = x;
        double r536204 = y;
        double r536205 = r536203 * r536204;
        double r536206 = z;
        double r536207 = t;
        double r536208 = r536206 * r536207;
        double r536209 = r536205 - r536208;
        double r536210 = a;
        double r536211 = r536209 / r536210;
        return r536211;
}

double f(double x, double y, double z, double t, double a) {
        double r536212 = x;
        double r536213 = y;
        double r536214 = r536212 * r536213;
        double r536215 = z;
        double r536216 = t;
        double r536217 = r536215 * r536216;
        double r536218 = r536214 - r536217;
        double r536219 = a;
        double r536220 = r536218 / r536219;
        return r536220;
}

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

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

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

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

Reproduce

herbie shell --seed 2019298 
(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))