Average Error: 1.6 → 0.6
Time: 2.7s
Precision: binary64
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\left|\frac{x + 4}{y} - \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \left(z \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)\right|\]
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\left|\frac{x + 4}{y} - \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \left(z \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)\right|
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
(FPCore (x y z)
 :precision binary64
 (fabs
  (-
   (/ (+ x 4.0) y)
   (*
    (/ (* (cbrt x) (cbrt x)) (* (cbrt y) (cbrt y)))
    (* z (/ (cbrt x) (cbrt y)))))))
double code(double x, double y, double z) {
	return fabs(((x + 4.0) / y) - ((x / y) * z));
}
double code(double x, double y, double z) {
	return fabs(((x + 4.0) / y) - (((cbrt(x) * cbrt(x)) / (cbrt(y) * cbrt(y))) * (z * (cbrt(x) / cbrt(y)))));
}

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 add-cube-cbrt_binary641.9

    \[\leadsto \left|\frac{x + 4}{y} - \frac{x}{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}} \cdot z\right|\]
  4. Applied add-cube-cbrt_binary642.0

    \[\leadsto \left|\frac{x + 4}{y} - \frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}} \cdot z\right|\]
  5. Applied times-frac_binary642.0

    \[\leadsto \left|\frac{x + 4}{y} - \color{blue}{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)} \cdot z\right|\]
  6. Applied associate-*l*_binary640.6

    \[\leadsto \left|\frac{x + 4}{y} - \color{blue}{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{y} \cdot \sqrt[3]{y}} \cdot \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}} \cdot z\right)}\right|\]
  7. Simplified0.6

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

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

Reproduce

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