Average Error: 12.2 → 1.1
Time: 2.7s
Precision: binary64
\[\frac{x \cdot \left(y + z\right)}{z} \]
\[\begin{array}{l} t_0 := \sqrt[3]{y + z}\\ \left(x \cdot \frac{t_0 \cdot t_0}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{t_0}{\sqrt[3]{z}} \end{array} \]
\frac{x \cdot \left(y + z\right)}{z}
\begin{array}{l}
t_0 := \sqrt[3]{y + z}\\
\left(x \cdot \frac{t_0 \cdot t_0}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{t_0}{\sqrt[3]{z}}
\end{array}
(FPCore (x y z) :precision binary64 (/ (* x (+ y z)) z))
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (cbrt (+ y z))))
   (* (* x (/ (* t_0 t_0) (* (cbrt z) (cbrt z)))) (/ t_0 (cbrt z)))))
double code(double x, double y, double z) {
	return (x * (y + z)) / z;
}
double code(double x, double y, double z) {
	double t_0 = cbrt(y + z);
	return (x * ((t_0 * t_0) / (cbrt(z) * cbrt(z)))) * (t_0 / cbrt(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

Target

Original12.2
Target3.1
Herbie1.1
\[\frac{x}{\frac{z}{y + z}} \]

Derivation

  1. Initial program 12.2

    \[\frac{x \cdot \left(y + z\right)}{z} \]
  2. Using strategy rm
  3. Applied *-un-lft-identity_binary6412.2

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

    \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y + z}{z}} \]
  5. Simplified3.5

    \[\leadsto \color{blue}{x} \cdot \frac{y + z}{z} \]
  6. Using strategy rm
  7. Applied add-cube-cbrt_binary644.7

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

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

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

    \[\leadsto \color{blue}{\left(x \cdot \frac{\sqrt[3]{y + z} \cdot \sqrt[3]{y + z}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{y + z}}{\sqrt[3]{z}}} \]
  11. Final simplification1.1

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

Reproduce

herbie shell --seed 2021207 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
  :precision binary64

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

  (/ (* x (+ y z)) z))