Average Error: 7.5 → 7.5
Time: 3.6s
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 r1002169 = x;
        double r1002170 = y;
        double r1002171 = r1002169 * r1002170;
        double r1002172 = z;
        double r1002173 = t;
        double r1002174 = r1002172 * r1002173;
        double r1002175 = r1002171 - r1002174;
        double r1002176 = a;
        double r1002177 = r1002175 / r1002176;
        return r1002177;
}

double f(double x, double y, double z, double t, double a) {
        double r1002178 = x;
        double r1002179 = y;
        double r1002180 = r1002178 * r1002179;
        double r1002181 = z;
        double r1002182 = t;
        double r1002183 = r1002181 * r1002182;
        double r1002184 = r1002180 - r1002183;
        double r1002185 = a;
        double r1002186 = r1002184 / r1002185;
        return r1002186;
}

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.5
Target6.0
Herbie7.5
\[\begin{array}{l} \mathbf{if}\;z \lt -2.46868496869954822 \cdot 10^{170}:\\ \;\;\;\;\frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\ \mathbf{elif}\;z \lt 6.30983112197837121 \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.5

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

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

Reproduce

herbie shell --seed 2020060 +o rules:numerics
(FPCore (x y z t a)
  :name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
  :precision binary64

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