Average Error: 7.9 → 7.9
Time: 47.1s
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 r37808130 = x;
        double r37808131 = y;
        double r37808132 = r37808130 * r37808131;
        double r37808133 = z;
        double r37808134 = t;
        double r37808135 = r37808133 * r37808134;
        double r37808136 = r37808132 - r37808135;
        double r37808137 = a;
        double r37808138 = r37808136 / r37808137;
        return r37808138;
}

double f(double x, double y, double z, double t, double a) {
        double r37808139 = x;
        double r37808140 = y;
        double r37808141 = r37808139 * r37808140;
        double r37808142 = z;
        double r37808143 = t;
        double r37808144 = r37808142 * r37808143;
        double r37808145 = r37808141 - r37808144;
        double r37808146 = a;
        double r37808147 = r37808145 / r37808146;
        return r37808147;
}

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.9
Target6.2
Herbie7.9
\[\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.9

    \[\frac{x \cdot y - z \cdot t}{a}\]
  2. Final simplification7.9

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

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(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))