Average Error: 12.1 → 3.1
Time: 1.9s
Precision: 64
\[\frac{x \cdot \left(y + z\right)}{z}\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.7672276150092905 \cdot 10^{236}:\\ \;\;\;\;\frac{1 \cdot \left(x \cdot \left(y + z\right)\right)}{z}\\ \mathbf{elif}\;y \le 1.76861279965385967 \cdot 10^{95}:\\ \;\;\;\;\frac{x}{\frac{z}{y + z}}\\ \mathbf{elif}\;y \le 4.8253144849401574 \cdot 10^{212}:\\ \;\;\;\;\frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{y + z}{\sqrt[3]{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot \left(y + z\right)}}\\ \end{array}\]
\frac{x \cdot \left(y + z\right)}{z}
\begin{array}{l}
\mathbf{if}\;y \le -1.7672276150092905 \cdot 10^{236}:\\
\;\;\;\;\frac{1 \cdot \left(x \cdot \left(y + z\right)\right)}{z}\\

\mathbf{elif}\;y \le 1.76861279965385967 \cdot 10^{95}:\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\

\mathbf{elif}\;y \le 4.8253144849401574 \cdot 10^{212}:\\
\;\;\;\;\frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{y + z}{\sqrt[3]{z}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{z}{x \cdot \left(y + z\right)}}\\

\end{array}
double code(double x, double y, double z) {
	return ((x * (y + z)) / z);
}
double code(double x, double y, double z) {
	double temp;
	if ((y <= -1.7672276150092905e+236)) {
		temp = ((1.0 * (x * (y + z))) / z);
	} else {
		double temp_1;
		if ((y <= 1.7686127996538597e+95)) {
			temp_1 = (x / (z / (y + z)));
		} else {
			double temp_2;
			if ((y <= 4.825314484940157e+212)) {
				temp_2 = ((x / (cbrt(z) * cbrt(z))) * ((y + z) / cbrt(z)));
			} else {
				temp_2 = (1.0 / (z / (x * (y + z))));
			}
			temp_1 = temp_2;
		}
		temp = temp_1;
	}
	return temp;
}

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.1
Target3.2
Herbie3.1
\[\frac{x}{\frac{z}{y + z}}\]

Derivation

  1. Split input into 4 regimes
  2. if y < -1.7672276150092905e+236

    1. Initial program 13.5

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

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

    if -1.7672276150092905e+236 < y < 1.7686127996538597e+95

    1. Initial program 12.1

      \[\frac{x \cdot \left(y + z\right)}{z}\]
    2. Using strategy rm
    3. Applied associate-/l*1.4

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

    if 1.7686127996538597e+95 < y < 4.825314484940157e+212

    1. Initial program 10.0

      \[\frac{x \cdot \left(y + z\right)}{z}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt11.0

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

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

    if 4.825314484940157e+212 < y

    1. Initial program 13.3

      \[\frac{x \cdot \left(y + z\right)}{z}\]
    2. Using strategy rm
    3. Applied clear-num13.3

      \[\leadsto \color{blue}{\frac{1}{\frac{z}{x \cdot \left(y + z\right)}}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification3.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -1.7672276150092905 \cdot 10^{236}:\\ \;\;\;\;\frac{1 \cdot \left(x \cdot \left(y + z\right)\right)}{z}\\ \mathbf{elif}\;y \le 1.76861279965385967 \cdot 10^{95}:\\ \;\;\;\;\frac{x}{\frac{z}{y + z}}\\ \mathbf{elif}\;y \le 4.8253144849401574 \cdot 10^{212}:\\ \;\;\;\;\frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{y + z}{\sqrt[3]{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot \left(y + z\right)}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020058 +o rules:numerics
(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))