Average Error: 12.4 → 2.4
Time: 3.3s
Precision: binary64
\[\frac{x \cdot \left(y + z\right)}{z}\]
\[\begin{array}{l} \mathbf{if}\;y \leq -9.162031571097381 \cdot 10^{+136}:\\ \;\;\;\;x + \left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \frac{\sqrt[3]{y}}{z}\\ \mathbf{elif}\;y \leq 1.8848281515184507 \cdot 10^{+219}:\\ \;\;\;\;x + x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(x \cdot \sqrt[3]{y}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\\ \end{array}\]
\frac{x \cdot \left(y + z\right)}{z}
\begin{array}{l}
\mathbf{if}\;y \leq -9.162031571097381 \cdot 10^{+136}:\\
\;\;\;\;x + \left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \frac{\sqrt[3]{y}}{z}\\

\mathbf{elif}\;y \leq 1.8848281515184507 \cdot 10^{+219}:\\
\;\;\;\;x + x \cdot \frac{y}{z}\\

\mathbf{else}:\\
\;\;\;\;x + \left(\left(x \cdot \sqrt[3]{y}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\\

\end{array}
double code(double x, double y, double z) {
	return (((double) (x * ((double) (y + z)))) / z);
}
double code(double x, double y, double z) {
	double VAR;
	if ((y <= -9.162031571097381e+136)) {
		VAR = ((double) (x + ((double) (((double) (x * ((double) (((double) cbrt(y)) * ((double) cbrt(y)))))) * (((double) cbrt(y)) / z)))));
	} else {
		double VAR_1;
		if ((y <= 1.8848281515184507e+219)) {
			VAR_1 = ((double) (x + ((double) (x * (y / z)))));
		} else {
			VAR_1 = ((double) (x + ((double) (((double) (((double) (x * ((double) cbrt(y)))) * (((double) cbrt(y)) / ((double) (((double) cbrt(z)) * ((double) cbrt(z))))))) * (((double) cbrt(y)) / ((double) cbrt(z)))))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

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.4
Target2.8
Herbie2.4
\[\frac{x}{\frac{z}{y + z}}\]

Derivation

  1. Split input into 3 regimes
  2. if y < -9.16203157109738136e136

    1. Initial program Error: 12.7 bits

      \[\frac{x \cdot \left(y + z\right)}{z}\]
    2. SimplifiedError: 10.9 bits

      \[\leadsto \color{blue}{x + x \cdot \frac{y}{z}}\]
    3. Using strategy rm
    4. Applied *-un-lft-identityError: 10.9 bits

      \[\leadsto x + x \cdot \frac{y}{\color{blue}{1 \cdot z}}\]
    5. Applied add-cube-cbrtError: 11.5 bits

      \[\leadsto x + x \cdot \frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{1 \cdot z}\]
    6. Applied times-fracError: 11.5 bits

      \[\leadsto x + x \cdot \color{blue}{\left(\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \frac{\sqrt[3]{y}}{z}\right)}\]
    7. Applied associate-*r*Error: 8.3 bits

      \[\leadsto x + \color{blue}{\left(x \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1}\right) \cdot \frac{\sqrt[3]{y}}{z}}\]
    8. SimplifiedError: 8.3 bits

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

    if -9.16203157109738136e136 < y < 1.8848281515184507e219

    1. Initial program Error: 12.1 bits

      \[\frac{x \cdot \left(y + z\right)}{z}\]
    2. SimplifiedError: 1.6 bits

      \[\leadsto \color{blue}{x + x \cdot \frac{y}{z}}\]

    if 1.8848281515184507e219 < y

    1. Initial program Error: 16.8 bits

      \[\frac{x \cdot \left(y + z\right)}{z}\]
    2. SimplifiedError: 12.9 bits

      \[\leadsto \color{blue}{x + x \cdot \frac{y}{z}}\]
    3. Using strategy rm
    4. Applied add-cube-cbrtError: 13.6 bits

      \[\leadsto x + x \cdot \frac{y}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}\]
    5. Applied add-cube-cbrtError: 13.8 bits

      \[\leadsto x + x \cdot \frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}\]
    6. Applied times-fracError: 13.8 bits

      \[\leadsto x + x \cdot \color{blue}{\left(\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\right)}\]
    7. Applied associate-*r*Error: 4.7 bits

      \[\leadsto x + \color{blue}{\left(x \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}}\]
    8. SimplifiedError: 4.7 bits

      \[\leadsto x + \color{blue}{\left(x \cdot \left(\sqrt[3]{y} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right)\right)} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\]
    9. Using strategy rm
    10. Applied associate-*r*Error: 4.1 bits

      \[\leadsto x + \color{blue}{\left(\left(x \cdot \sqrt[3]{y}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right)} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplificationError: 2.4 bits

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.162031571097381 \cdot 10^{+136}:\\ \;\;\;\;x + \left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \frac{\sqrt[3]{y}}{z}\\ \mathbf{elif}\;y \leq 1.8848281515184507 \cdot 10^{+219}:\\ \;\;\;\;x + x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(x \cdot \sqrt[3]{y}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\\ \end{array}\]

Reproduce

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