Average Error: 2.7 → 2.7
Time: 5.7s
Precision: binary64
Cost: 448
\[\frac{x}{y - z \cdot t}\]
\[\frac{x}{y - z \cdot t}\]
\frac{x}{y - z \cdot t}
\frac{x}{y - z \cdot t}
(FPCore (x y z t) :precision binary64 (/ x (- y (* z t))))
(FPCore (x y z t) :precision binary64 (/ x (- y (* z t))))
double code(double x, double y, double z, double t) {
	return x / (y - (z * t));
}
double code(double x, double y, double z, double t) {
	return x / (y - (z * t));
}

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 < -1.618195973607049 \cdot 10^{+50}:\\ \;\;\;\;\frac{1}{\frac{y}{x} - \frac{z}{x} \cdot t}\\ \mathbf{elif}\;x < 2.1378306434876444 \cdot 10^{+131}:\\ \;\;\;\;\frac{x}{y - z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{y}{x} - \frac{z}{x} \cdot t}\\ \end{array}\]

Alternatives

Alternative 1
Error15.1
Cost1282
\[\begin{array}{l} \mathbf{if}\;z \cdot t \leq -1.62447374728391 \cdot 10^{-24}:\\ \;\;\;\;x \cdot \frac{-1}{z \cdot t}\\ \mathbf{elif}\;z \cdot t \leq 1.4522560965360581 \cdot 10^{-83}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{z \cdot t}\\ \end{array}\]
Alternative 2
Error15.0
Cost968
\[\begin{array}{l} \mathbf{if}\;z \cdot t \leq -4.5559904301870297 \cdot 10^{-26} \lor \neg \left(z \cdot t \leq 2.5842276180443638 \cdot 10^{-82}\right):\\ \;\;\;\;\frac{-x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array}\]
Alternative 3
Error27.5
Cost834
\[\begin{array}{l} \mathbf{if}\;z \leq -4.0085636767269985 \cdot 10^{+99}:\\ \;\;\;\;0\\ \mathbf{elif}\;z \leq 5.4912767238400986 \cdot 10^{+157}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}\]
Alternative 4
Error46.1
Cost64
\[0\]
Alternative 5
Error61.7
Cost64
\[1\]

Error

Derivation

  1. Initial program 2.7

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

    \[\leadsto \color{blue}{\frac{x}{y - z \cdot t}}\]
  3. Final simplification2.7

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

Reproduce

herbie shell --seed 2021044 
(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.0 (- (/ y x) (* (/ z x) t))) (if (< x 2.1378306434876444e+131) (/ x (- y (* z t))) (/ 1.0 (- (/ y x) (* (/ z x) t)))))

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