Average Error: 3.0 → 3.0
Time: 15.1s
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 r501173 = x;
        double r501174 = y;
        double r501175 = z;
        double r501176 = t;
        double r501177 = r501175 * r501176;
        double r501178 = r501174 - r501177;
        double r501179 = r501173 / r501178;
        return r501179;
}

double f(double x, double y, double z, double t) {
        double r501180 = x;
        double r501181 = y;
        double r501182 = z;
        double r501183 = t;
        double r501184 = r501182 * r501183;
        double r501185 = r501181 - r501184;
        double r501186 = r501180 / r501185;
        return r501186;
}

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

Original3.0
Target1.7
Herbie3.0
\[\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 3.0

    \[\frac{x}{y - z \cdot t}\]
  2. Final simplification3.0

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

Reproduce

herbie shell --seed 2019303 +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))))