Average Error: 9.8 → 0.1
Time: 13.6s
Precision: binary64
Cost: 832
\[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}\]
\[\frac{x}{y} + \left(-2 + \frac{2 + \frac{2}{z}}{t}\right)\]
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\frac{x}{y} + \left(-2 + \frac{2 + \frac{2}{z}}{t}\right)
(FPCore (x y z t)
 :precision binary64
 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
(FPCore (x y z t)
 :precision binary64
 (+ (/ x y) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
	return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
double code(double x, double y, double z, double t) {
	return (x / y) + (-2.0 + ((2.0 + (2.0 / 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

Original9.8
Target0.1
Herbie0.1
\[\frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right)\]

Alternatives

Alternative 1
Error0.7
Cost1288
\[\begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -27694.13932792402 \lor \neg \left(\frac{x}{y} \leq 1.982247185123842\right):\\ \;\;\;\;\frac{x}{y} + \frac{2 + \frac{2}{z}}{t}\\ \mathbf{else}:\\ \;\;\;\;-2 + \left(\frac{2}{z \cdot t} + \frac{2}{t}\right)\\ \end{array}\]
Alternative 2
Error5.0
Cost1602
\[\begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -213270412459.23285:\\ \;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\ \mathbf{elif}\;\frac{x}{y} \leq 1.8113297382242166 \cdot 10^{+32}:\\ \;\;\;\;-2 + \left(\frac{2}{z \cdot t} + \frac{2}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\ \end{array}\]
Alternative 3
Error5.9
Cost904
\[\begin{array}{l} \mathbf{if}\;z \leq -1.916564809743049 \cdot 10^{-10} \lor \neg \left(z \leq 3.9837182419270496 \cdot 10^{-08}\right):\\ \;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\ \end{array}\]
Alternative 4
Error11.9
Cost776
\[\begin{array}{l} \mathbf{if}\;t \leq -866746623.8901827 \lor \neg \left(t \leq 1.79565891073365 \cdot 10^{-13}\right):\\ \;\;\;\;\frac{x}{y} + -2\\ \mathbf{else}:\\ \;\;\;\;\frac{2 + \frac{2}{z}}{t}\\ \end{array}\]
Alternative 5
Error26.7
Cost913
\[\begin{array}{l} \mathbf{if}\;t \leq -508697225.00452185 \lor \neg \left(t \leq -2.0577384380194943 \cdot 10^{-60} \lor \neg \left(t \leq -1.735123305415935 \cdot 10^{-175}\right) \land t \leq 1.5814037666306062 \cdot 10^{-13}\right):\\ \;\;\;\;\frac{x}{y} + -2\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \end{array}\]
Alternative 6
Error35.3
Cost904
\[\begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -5057382145.258428 \lor \neg \left(\frac{x}{y} \leq 6.636955697355784 \cdot 10^{+36}\right):\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{z \cdot t}\\ \end{array}\]
Alternative 7
Error42.5
Cost776
\[\begin{array}{l} \mathbf{if}\;\frac{x}{y} \leq -1.0143738727907385 \lor \neg \left(\frac{x}{y} \leq 6.660559650711322 \cdot 10^{+16}\right):\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array}\]
Alternative 8
Error59.5
Cost64
\[-1\]
Alternative 9
Error62.3
Cost64
\[1\]

Error

Derivation

  1. Initial program 9.8

    \[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}\]
  2. Simplified0.1

    \[\leadsto \color{blue}{\frac{x}{y} + \left(-2 + \frac{2 + \frac{2}{z}}{t}\right)}\]
  3. Simplified0.1

    \[\leadsto \color{blue}{\frac{x}{y} + \left(-2 + \frac{2 + \frac{2}{z}}{t}\right)}\]
  4. Final simplification0.1

    \[\leadsto \frac{x}{y} + \left(-2 + \frac{2 + \frac{2}{z}}{t}\right)\]

Reproduce

herbie shell --seed 2021044 
(FPCore (x y z t)
  :name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
  :precision binary64

  :herbie-target
  (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))

  (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))