Average Error: 7.4 → 7.4
Time: 8.6s
Precision: 64
\[\frac{x \cdot y - z \cdot t}{a}\]
\[\frac{x \cdot y - t \cdot z}{a}\]
\frac{x \cdot y - z \cdot t}{a}
\frac{x \cdot y - t \cdot z}{a}
double f(double x, double y, double z, double t, double a) {
        double r705558 = x;
        double r705559 = y;
        double r705560 = r705558 * r705559;
        double r705561 = z;
        double r705562 = t;
        double r705563 = r705561 * r705562;
        double r705564 = r705560 - r705563;
        double r705565 = a;
        double r705566 = r705564 / r705565;
        return r705566;
}

double f(double x, double y, double z, double t, double a) {
        double r705567 = x;
        double r705568 = y;
        double r705569 = r705567 * r705568;
        double r705570 = t;
        double r705571 = z;
        double r705572 = r705570 * r705571;
        double r705573 = r705569 - r705572;
        double r705574 = a;
        double r705575 = r705573 / r705574;
        return r705575;
}

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

    \[\frac{x \cdot y - z \cdot t}{a}\]
  2. Taylor expanded around 0 7.4

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

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

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

Reproduce

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