Average Error: 1.6 → 1.6
Time: 3.8s
Precision: binary64
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\left|\left(x + 4\right) \cdot \frac{1}{y} - \frac{x}{y} \cdot z\right|\]
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\left|\left(x + 4\right) \cdot \frac{1}{y} - \frac{x}{y} \cdot z\right|
double code(double x, double y, double z) {
	return ((double) fabs(((double) (((double) (((double) (x + 4.0)) / y)) - ((double) (((double) (x / y)) * z))))));
}
double code(double x, double y, double z) {
	return ((double) fabs(((double) (((double) (((double) (x + 4.0)) * ((double) (1.0 / y)))) - ((double) (((double) (x / y)) * z))))));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 1.6

    \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
  2. Using strategy rm
  3. Applied div-inv1.6

    \[\leadsto \left|\color{blue}{\left(x + 4\right) \cdot \frac{1}{y}} - \frac{x}{y} \cdot z\right|\]
  4. Final simplification1.6

    \[\leadsto \left|\left(x + 4\right) \cdot \frac{1}{y} - \frac{x}{y} \cdot z\right|\]

Reproduce

herbie shell --seed 2020147 
(FPCore (x y z)
  :name "fabs fraction 1"
  :precision binary64
  (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))