Average Error: 2.7 → 1.2
Time: 3.5s
Precision: binary64
\[x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\]
\[\begin{array}{l} \mathbf{if}\;e^{z} \le 0.0:\\ \;\;\;\;x - \frac{1}{x}\\ \mathbf{elif}\;e^{z} \le 1.0000001699700771:\\ \;\;\;\;x + \frac{y}{\left(1.12837916709551256 \cdot z + \left(0.564189583547756279 \cdot {z}^{2} + 1.12837916709551256\right)\right) - x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x + \sqrt[3]{{\left(\frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\right)}^{3}}\\ \end{array}\]
x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}
\begin{array}{l}
\mathbf{if}\;e^{z} \le 0.0:\\
\;\;\;\;x - \frac{1}{x}\\

\mathbf{elif}\;e^{z} \le 1.0000001699700771:\\
\;\;\;\;x + \frac{y}{\left(1.12837916709551256 \cdot z + \left(0.564189583547756279 \cdot {z}^{2} + 1.12837916709551256\right)\right) - x \cdot y}\\

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

\end{array}
double code(double x, double y, double z) {
	return ((double) (x + ((double) (y / ((double) (((double) (1.1283791670955126 * ((double) exp(z)))) - ((double) (x * y))))))));
}
double code(double x, double y, double z) {
	double VAR;
	if ((((double) exp(z)) <= 0.0)) {
		VAR = ((double) (x - ((double) (1.0 / x))));
	} else {
		double VAR_1;
		if ((((double) exp(z)) <= 1.0000001699700771)) {
			VAR_1 = ((double) (x + ((double) (y / ((double) (((double) (((double) (1.1283791670955126 * z)) + ((double) (((double) (0.5641895835477563 * ((double) pow(z, 2.0)))) + 1.1283791670955126)))) - ((double) (x * y))))))));
		} else {
			VAR_1 = ((double) (x + ((double) cbrt(((double) pow(((double) (y / ((double) (((double) (1.1283791670955126 * ((double) exp(z)))) - ((double) (x * y)))))), 3.0))))));
		}
		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

Original2.7
Target0.1
Herbie1.2
\[x + \frac{1}{\frac{1.12837916709551256}{y} \cdot e^{z} - x}\]

Derivation

  1. Split input into 3 regimes
  2. if (exp z) < 0.0

    1. Initial program 7.2

      \[x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\]
    2. Taylor expanded around inf 0.0

      \[\leadsto \color{blue}{x - \frac{1}{x}}\]

    if 0.0 < (exp z) < 1.0000001699700771

    1. Initial program 0.0

      \[x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\]
    2. Taylor expanded around 0 0.2

      \[\leadsto x + \frac{y}{\color{blue}{\left(1.12837916709551256 \cdot z + \left(0.564189583547756279 \cdot {z}^{2} + 1.12837916709551256\right)\right)} - x \cdot y}\]

    if 1.0000001699700771 < (exp z)

    1. Initial program 3.8

      \[x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\]
    2. Using strategy rm
    3. Applied add-cbrt-cube4.0

      \[\leadsto x + \frac{y}{\color{blue}{\sqrt[3]{\left(\left(1.12837916709551256 \cdot e^{z} - x \cdot y\right) \cdot \left(1.12837916709551256 \cdot e^{z} - x \cdot y\right)\right) \cdot \left(1.12837916709551256 \cdot e^{z} - x \cdot y\right)}}}\]
    4. Applied add-cbrt-cube21.1

      \[\leadsto x + \frac{\color{blue}{\sqrt[3]{\left(y \cdot y\right) \cdot y}}}{\sqrt[3]{\left(\left(1.12837916709551256 \cdot e^{z} - x \cdot y\right) \cdot \left(1.12837916709551256 \cdot e^{z} - x \cdot y\right)\right) \cdot \left(1.12837916709551256 \cdot e^{z} - x \cdot y\right)}}\]
    5. Applied cbrt-undiv21.1

      \[\leadsto x + \color{blue}{\sqrt[3]{\frac{\left(y \cdot y\right) \cdot y}{\left(\left(1.12837916709551256 \cdot e^{z} - x \cdot y\right) \cdot \left(1.12837916709551256 \cdot e^{z} - x \cdot y\right)\right) \cdot \left(1.12837916709551256 \cdot e^{z} - x \cdot y\right)}}}\]
    6. Simplified4.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{z} \le 0.0:\\ \;\;\;\;x - \frac{1}{x}\\ \mathbf{elif}\;e^{z} \le 1.0000001699700771:\\ \;\;\;\;x + \frac{y}{\left(1.12837916709551256 \cdot z + \left(0.564189583547756279 \cdot {z}^{2} + 1.12837916709551256\right)\right) - x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x + \sqrt[3]{{\left(\frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\right)}^{3}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020177 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x)))

  (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))