Average Error: 3.2 → 0.3
Time: 1.5s
Precision: binary64
\[\left(\left(x \cdot y\right) \cdot z + x \cdot y\right) - \frac{z \cdot y}{x}\]
\[\begin{array}{l} \mathbf{if}\;\left(\left(x \cdot y\right) \cdot z + x \cdot y\right) - \frac{z \cdot y}{x} \le -1.134502737044711 \cdot 10^{-103} \lor \neg \left(\left(\left(x \cdot y\right) \cdot z + x \cdot y\right) - \frac{z \cdot y}{x} \le 1.2758900792983024 \cdot 10^{41}\right):\\ \;\;\;\;\left(\left(x \cdot y\right) \cdot z + x \cdot y\right) - \frac{z \cdot y}{x}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot z + \left(x - \frac{z}{x}\right)\right)\\ \end{array}\]
\left(\left(x \cdot y\right) \cdot z + x \cdot y\right) - \frac{z \cdot y}{x}
\begin{array}{l}
\mathbf{if}\;\left(\left(x \cdot y\right) \cdot z + x \cdot y\right) - \frac{z \cdot y}{x} \le -1.134502737044711 \cdot 10^{-103} \lor \neg \left(\left(\left(x \cdot y\right) \cdot z + x \cdot y\right) - \frac{z \cdot y}{x} \le 1.2758900792983024 \cdot 10^{41}\right):\\
\;\;\;\;\left(\left(x \cdot y\right) \cdot z + x \cdot y\right) - \frac{z \cdot y}{x}\\

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

\end{array}
double code(double x, double y, double z) {
	return ((double) (((double) (((double) (((double) (x * y)) * z)) + ((double) (x * y)))) - ((double) (((double) (z * y)) / x))));
}
double code(double x, double y, double z) {
	double VAR;
	if (((((double) (((double) (((double) (((double) (x * y)) * z)) + ((double) (x * y)))) - ((double) (((double) (z * y)) / x)))) <= -1.1345027370447107e-103) || !(((double) (((double) (((double) (((double) (x * y)) * z)) + ((double) (x * y)))) - ((double) (((double) (z * y)) / x)))) <= 1.2758900792983024e+41))) {
		VAR = ((double) (((double) (((double) (((double) (x * y)) * z)) + ((double) (x * y)))) - ((double) (((double) (z * y)) / x))));
	} else {
		VAR = ((double) (y * ((double) (((double) (x * z)) + ((double) (x - ((double) (z / x))))))));
	}
	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

Derivation

  1. Split input into 2 regimes
  2. if (- (+ (* (* x y) z) (* x y)) (/ (* z y) x)) < -1.134502737044711e-103 or 1.2758900792983024e41 < (- (+ (* (* x y) z) (* x y)) (/ (* z y) x))

    1. Initial program 0.2

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

    if -1.134502737044711e-103 < (- (+ (* (* x y) z) (* x y)) (/ (* z y) x)) < 1.2758900792983024e41

    1. Initial program 10.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(x \cdot y\right) \cdot z + x \cdot y\right) - \frac{z \cdot y}{x} \le -1.134502737044711 \cdot 10^{-103} \lor \neg \left(\left(\left(x \cdot y\right) \cdot z + x \cdot y\right) - \frac{z \cdot y}{x} \le 1.2758900792983024 \cdot 10^{41}\right):\\ \;\;\;\;\left(\left(x \cdot y\right) \cdot z + x \cdot y\right) - \frac{z \cdot y}{x}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot z + \left(x - \frac{z}{x}\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020153 
(FPCore (x y z)
  :name "(- (+ (* (* x y) z) (* x y)) (/ (* z y) x))"
  :precision binary64
  (- (+ (* (* x y) z) (* x y)) (/ (* z y) x)))