Average Error: 2.9 → 2.9
Time: 2.5s
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 r799640 = x;
        double r799641 = y;
        double r799642 = z;
        double r799643 = t;
        double r799644 = r799642 * r799643;
        double r799645 = r799641 - r799644;
        double r799646 = r799640 / r799645;
        return r799646;
}

double f(double x, double y, double z, double t) {
        double r799647 = x;
        double r799648 = y;
        double r799649 = z;
        double r799650 = t;
        double r799651 = r799649 * r799650;
        double r799652 = r799648 - r799651;
        double r799653 = r799647 / r799652;
        return r799653;
}

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.9
Target1.7
Herbie2.9
\[\begin{array}{l} \mathbf{if}\;x \lt -1.618195973607049 \cdot 10^{50}:\\ \;\;\;\;\frac{1}{\frac{y}{x} - \frac{z}{x} \cdot t}\\ \mathbf{elif}\;x \lt 2.13783064348764444 \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.9

    \[\frac{x}{y - z \cdot t}\]
  2. Using strategy rm
  3. Applied clear-num3.4

    \[\leadsto \color{blue}{\frac{1}{\frac{y - z \cdot t}{x}}}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity3.4

    \[\leadsto \frac{1}{\frac{y - z \cdot t}{\color{blue}{1 \cdot x}}}\]
  6. Applied *-un-lft-identity3.4

    \[\leadsto \frac{1}{\frac{\color{blue}{1 \cdot \left(y - z \cdot t\right)}}{1 \cdot x}}\]
  7. Applied times-frac3.4

    \[\leadsto \frac{1}{\color{blue}{\frac{1}{1} \cdot \frac{y - z \cdot t}{x}}}\]
  8. Applied add-cube-cbrt3.4

    \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\frac{1}{1} \cdot \frac{y - z \cdot t}{x}}\]
  9. Applied times-frac3.4

    \[\leadsto \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\frac{1}{1}} \cdot \frac{\sqrt[3]{1}}{\frac{y - z \cdot t}{x}}}\]
  10. Simplified3.4

    \[\leadsto \color{blue}{1} \cdot \frac{\sqrt[3]{1}}{\frac{y - z \cdot t}{x}}\]
  11. Simplified2.9

    \[\leadsto 1 \cdot \color{blue}{\frac{x}{y - z \cdot t}}\]
  12. Final simplification2.9

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

Reproduce

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

  :herbie-target
  (if (< x -1.618195973607049e+50) (/ 1 (- (/ y x) (* (/ z x) t))) (if (< x 2.1378306434876444e+131) (/ x (- y (* z t))) (/ 1 (- (/ y x) (* (/ z x) t)))))

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