Average Error: 9.0 → 0.1
Time: 9.3s
Precision: binary64
\[\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z} \]
\[-2 + \left(\frac{2 + \frac{2}{z}}{t} + \frac{x}{y}\right) \]
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
-2 + \left(\frac{2 + \frac{2}{z}}{t} + \frac{x}{y}\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
 (+ -2.0 (+ (/ (+ 2.0 (/ 2.0 z)) t) (/ x y))))
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 -2.0 + (((2.0 + (2.0 / z)) / t) + (x / y));
}

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.0
Target0.1
Herbie0.1
\[\frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right) \]

Derivation

  1. Initial program 9.0

    \[\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. Applied *-un-lft-identity_binary640.1

    \[\leadsto \frac{x}{y} + \color{blue}{1 \cdot \left(-2 - \frac{-2 + \frac{-2}{z}}{t}\right)} \]
  4. Applied *-un-lft-identity_binary640.1

    \[\leadsto \color{blue}{1 \cdot \frac{x}{y}} + 1 \cdot \left(-2 - \frac{-2 + \frac{-2}{z}}{t}\right) \]
  5. Applied distribute-lft-out_binary640.1

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

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

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

Reproduce

herbie shell --seed 2022068 
(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))))