Average Error: 2.7 → 2.7
Time: 17.4s
Precision: 64
\[\frac{x}{y - z \cdot t}\]
\[\frac{x}{y - z \cdot t}\]
\frac{x}{y - z \cdot t}
\frac{x}{y - z \cdot t}
double f(double x, double y, double z, double t) {
        double r1194690 = x;
        double r1194691 = y;
        double r1194692 = z;
        double r1194693 = t;
        double r1194694 = r1194692 * r1194693;
        double r1194695 = r1194691 - r1194694;
        double r1194696 = r1194690 / r1194695;
        return r1194696;
}

double f(double x, double y, double z, double t) {
        double r1194697 = x;
        double r1194698 = y;
        double r1194699 = z;
        double r1194700 = t;
        double r1194701 = r1194699 * r1194700;
        double r1194702 = r1194698 - r1194701;
        double r1194703 = r1194697 / r1194702;
        return r1194703;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original2.7
Target1.8
Herbie2.7
\[\begin{array}{l} \mathbf{if}\;x \lt -1.618195973607048970493874632750554853795 \cdot 10^{50}:\\ \;\;\;\;\frac{1}{\frac{y}{x} - \frac{z}{x} \cdot t}\\ \mathbf{elif}\;x \lt 2.137830643487644440407921345820165445823 \cdot 10^{131}:\\ \;\;\;\;\frac{x}{y - z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{y}{x} - \frac{z}{x} \cdot t}\\ \end{array}\]

Derivation

  1. Initial program 2.7

    \[\frac{x}{y - z \cdot t}\]
  2. Final simplification2.7

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

Reproduce

herbie shell --seed 2019306 +o rules:numerics
(FPCore (x y z t)
  :name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, B"
  :precision binary64

  :herbie-target
  (if (< x -1.618195973607049e50) (/ 1 (- (/ y x) (* (/ z x) t))) (if (< x 2.13783064348764444e131) (/ x (- y (* z t))) (/ 1 (- (/ y x) (* (/ z x) t)))))

  (/ x (- y (* z t))))