Average Error: 13.1 → 2.2
Time: 3.3s
Precision: binary64
\[\frac{x \cdot \left(y + z\right)}{z}\]
\[\begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y + z\right)}{z} \le 1.69309411293973363 \cdot 10^{-270}:\\ \;\;\;\;x + \frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{y}{\sqrt[3]{z}}\\ \mathbf{elif}\;\frac{x \cdot \left(y + z\right)}{z} \le 1.82587901953215762 \cdot 10^{299}:\\ \;\;\;\;\frac{x \cdot \left(y + z\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot \frac{y}{z}\\ \end{array}\]
\frac{x \cdot \left(y + z\right)}{z}
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y + z\right)}{z} \le 1.69309411293973363 \cdot 10^{-270}:\\
\;\;\;\;x + \frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{y}{\sqrt[3]{z}}\\

\mathbf{elif}\;\frac{x \cdot \left(y + z\right)}{z} \le 1.82587901953215762 \cdot 10^{299}:\\
\;\;\;\;\frac{x \cdot \left(y + z\right)}{z}\\

\mathbf{else}:\\
\;\;\;\;x + x \cdot \frac{y}{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 (((((double) (x * ((double) (y + z)))) / z) <= 1.6930941129397336e-270)) {
		VAR = ((double) (x + ((double) ((x / ((double) (((double) cbrt(z)) * ((double) cbrt(z))))) * (y / ((double) cbrt(z)))))));
	} else {
		double VAR_1;
		if (((((double) (x * ((double) (y + z)))) / z) <= 1.8258790195321576e+299)) {
			VAR_1 = (((double) (x * ((double) (y + z)))) / z);
		} else {
			VAR_1 = ((double) (x + ((double) (x * (y / 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

Original13.1
Target3.3
Herbie2.2
\[\frac{x}{\frac{z}{y + z}}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (* x (+ y z)) z) < 1.69309411293973363e-270

    1. Initial program 14.6

      \[\frac{x \cdot \left(y + z\right)}{z}\]
    2. Simplified3.2

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

      \[\leadsto x + x \cdot \frac{y}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}\]
    5. Applied *-un-lft-identity3.6

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

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

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

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

    if 1.69309411293973363e-270 < (/ (* x (+ y z)) z) < 1.82587901953215762e299

    1. Initial program 0.4

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

    if 1.82587901953215762e299 < (/ (* x (+ y z)) z)

    1. Initial program 60.6

      \[\frac{x \cdot \left(y + z\right)}{z}\]
    2. Simplified0.8

      \[\leadsto \color{blue}{x + x \cdot \frac{y}{z}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification2.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y + z\right)}{z} \le 1.69309411293973363 \cdot 10^{-270}:\\ \;\;\;\;x + \frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{y}{\sqrt[3]{z}}\\ \mathbf{elif}\;\frac{x \cdot \left(y + z\right)}{z} \le 1.82587901953215762 \cdot 10^{299}:\\ \;\;\;\;\frac{x \cdot \left(y + z\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot \frac{y}{z}\\ \end{array}\]

Reproduce

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