Average Error: 7.5 → 7.5
Time: 18.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 r37176640 = x;
        double r37176641 = y;
        double r37176642 = r37176640 * r37176641;
        double r37176643 = z;
        double r37176644 = t;
        double r37176645 = r37176643 * r37176644;
        double r37176646 = r37176642 - r37176645;
        double r37176647 = a;
        double r37176648 = r37176646 / r37176647;
        return r37176648;
}

double f(double x, double y, double z, double t, double a) {
        double r37176649 = x;
        double r37176650 = y;
        double r37176651 = r37176649 * r37176650;
        double r37176652 = z;
        double r37176653 = t;
        double r37176654 = r37176652 * r37176653;
        double r37176655 = r37176651 - r37176654;
        double r37176656 = a;
        double r37176657 = r37176655 / r37176656;
        return r37176657;
}

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.468684968699548 \cdot 10^{+170}:\\ \;\;\;\;\frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\ \mathbf{elif}\;z \lt 6.309831121978371 \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 2019165 
(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))