Average Error: 5.9 → 1.7
Time: 9.9s
Precision: binary64
\[x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\]
\[\begin{array}{l} \mathbf{if}\;y \le 5.4287039226098703 \cdot 10^{42}:\\ \;\;\;\;x + \frac{e^{0}}{y}\\ \mathbf{elif}\;y \le 2.32301324944924577 \cdot 10^{120}:\\ \;\;\;\;x + \frac{1}{\sqrt[3]{{\left(\frac{y}{{\left(\frac{y}{z + y}\right)}^{y}}\right)}^{3}}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{y}{{\left(\frac{y}{z + y}\right)}^{y}}}\\ \end{array}\]
x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}
\begin{array}{l}
\mathbf{if}\;y \le 5.4287039226098703 \cdot 10^{42}:\\
\;\;\;\;x + \frac{e^{0}}{y}\\

\mathbf{elif}\;y \le 2.32301324944924577 \cdot 10^{120}:\\
\;\;\;\;x + \frac{1}{\sqrt[3]{{\left(\frac{y}{{\left(\frac{y}{z + y}\right)}^{y}}\right)}^{3}}}\\

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

\end{array}
double code(double x, double y, double z) {
	return ((double) (x + ((double) (((double) exp(((double) (y * ((double) log(((double) (y / ((double) (z + y)))))))))) / y))));
}
double code(double x, double y, double z) {
	double VAR;
	if ((y <= 5.42870392260987e+42)) {
		VAR = ((double) (x + ((double) (((double) exp(0.0)) / y))));
	} else {
		double VAR_1;
		if ((y <= 2.3230132494492458e+120)) {
			VAR_1 = ((double) (x + ((double) (1.0 / ((double) cbrt(((double) pow(((double) (y / ((double) pow(((double) (y / ((double) (z + y)))), y)))), 3.0))))))));
		} else {
			VAR_1 = ((double) (x + ((double) (1.0 / ((double) (y / ((double) pow(((double) (y / ((double) (z + y)))), y))))))));
		}
		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

Original5.9
Target0.9
Herbie1.7
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z + y} \lt 7.1154157598 \cdot 10^{-315}:\\ \;\;\;\;x + \frac{e^{\frac{-1}{z}}}{y}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{e^{\log \left({\left(\frac{y}{y + z}\right)}^{y}\right)}}{y}\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if y < 5.4287039226098703e42

    1. Initial program 7.3

      \[x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\]
    2. Taylor expanded around inf 1.5

      \[\leadsto x + \frac{e^{\color{blue}{\log 1 \cdot y}}}{y}\]
    3. Simplified1.5

      \[\leadsto x + \frac{e^{\color{blue}{0}}}{y}\]

    if 5.4287039226098703e42 < y < 2.32301324944924577e120

    1. Initial program 2.1

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

      \[\leadsto x + \color{blue}{\frac{1}{\frac{y}{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}}}\]
    4. Simplified2.1

      \[\leadsto x + \frac{1}{\color{blue}{\frac{y}{{\left(\frac{y}{z + y}\right)}^{y}}}}\]
    5. Using strategy rm
    6. Applied add-cbrt-cube2.1

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

      \[\leadsto x + \frac{1}{\frac{\color{blue}{\sqrt[3]{\left(y \cdot y\right) \cdot y}}}{\sqrt[3]{\left({\left(\frac{y}{z + y}\right)}^{y} \cdot {\left(\frac{y}{z + y}\right)}^{y}\right) \cdot {\left(\frac{y}{z + y}\right)}^{y}}}}\]
    8. Applied cbrt-undiv3.7

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

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

    if 2.32301324944924577e120 < y

    1. Initial program 1.6

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

      \[\leadsto x + \color{blue}{\frac{1}{\frac{y}{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}}}\]
    4. Simplified1.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le 5.4287039226098703 \cdot 10^{42}:\\ \;\;\;\;x + \frac{e^{0}}{y}\\ \mathbf{elif}\;y \le 2.32301324944924577 \cdot 10^{120}:\\ \;\;\;\;x + \frac{1}{\sqrt[3]{{\left(\frac{y}{{\left(\frac{y}{z + y}\right)}^{y}}\right)}^{3}}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{y}{{\left(\frac{y}{z + y}\right)}^{y}}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020164 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, G"
  :precision binary64

  :herbie-target
  (if (< (/ y (+ z y)) 7.1154157597908e-315) (+ x (/ (exp (/ -1.0 z)) y)) (+ x (/ (exp (log (pow (/ y (+ y z)) y))) y)))

  (+ x (/ (exp (* y (log (/ y (+ z y))))) y)))