Average Error: 7.3 → 7.3
Time: 57.7s
Precision: 64
\[\frac{x \cdot y - z \cdot t}{a}\]
\[\frac{y \cdot x - z \cdot t}{a}\]
\frac{x \cdot y - z \cdot t}{a}
\frac{y \cdot x - z \cdot t}{a}
double f(double x, double y, double z, double t, double a) {
        double r37837415 = x;
        double r37837416 = y;
        double r37837417 = r37837415 * r37837416;
        double r37837418 = z;
        double r37837419 = t;
        double r37837420 = r37837418 * r37837419;
        double r37837421 = r37837417 - r37837420;
        double r37837422 = a;
        double r37837423 = r37837421 / r37837422;
        return r37837423;
}

double f(double x, double y, double z, double t, double a) {
        double r37837424 = y;
        double r37837425 = x;
        double r37837426 = r37837424 * r37837425;
        double r37837427 = z;
        double r37837428 = t;
        double r37837429 = r37837427 * r37837428;
        double r37837430 = r37837426 - r37837429;
        double r37837431 = a;
        double r37837432 = r37837430 / r37837431;
        return r37837432;
}

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. Taylor expanded around inf 7.3

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

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

Reproduce

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