Average Error: 1.5 → 0.9
Time: 2.7s
Precision: binary64
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\left|\frac{x + 4}{y} - \left(x \cdot \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt[3]{y} \cdot \sqrt[3]{y}}\right) \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{y}}\right|\]
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\left|\frac{x + 4}{y} - \left(x \cdot \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt[3]{y} \cdot \sqrt[3]{y}}\right) \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{y}}\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)
   (*
    (* x (/ (* (cbrt z) (cbrt z)) (* (cbrt y) (cbrt y))))
    (/ (cbrt z) (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) - ((x * ((cbrt(z) * cbrt(z)) / (cbrt(y) * cbrt(y)))) * (cbrt(z) / 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.5

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

    \[\leadsto \left|\frac{x + 4}{y} - \color{blue}{\left(x \cdot \frac{1}{y}\right)} \cdot z\right|\]
  4. Applied associate-*l*_binary643.5

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

    \[\leadsto \left|\frac{x + 4}{y} - x \cdot \color{blue}{\frac{z}{y}}\right|\]
  6. Using strategy rm
  7. Applied add-cube-cbrt_binary643.8

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

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

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

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

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

Reproduce

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