Average Error: 2.7 → 2.7
Time: 9.2s
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 r421104 = x;
        double r421105 = y;
        double r421106 = z;
        double r421107 = t;
        double r421108 = r421106 * r421107;
        double r421109 = r421105 - r421108;
        double r421110 = r421104 / r421109;
        return r421110;
}

double f(double x, double y, double z, double t) {
        double r421111 = x;
        double r421112 = y;
        double r421113 = z;
        double r421114 = t;
        double r421115 = r421113 * r421114;
        double r421116 = r421112 - r421115;
        double r421117 = r421111 / r421116;
        return r421117;
}

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.6
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 2019212 +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))))