Average Error: 6.4 → 3.5
Time: 5.1s
Precision: binary64
\[x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.08993977949814151 \cdot 10^{27}:\\ \;\;\;\;x + \frac{{\left({\left(\frac{y}{y + z}\right)}^{\left(\sqrt{y}\right)}\right)}^{\left(\sqrt{y}\right)}}{y}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{{\left(\sqrt[3]{y} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{y + z} \cdot \sqrt[3]{y + z}}\right)}^{y} \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}}{y}\\ \end{array}\]
x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}
\begin{array}{l}
\mathbf{if}\;y \le -1.08993977949814151 \cdot 10^{27}:\\
\;\;\;\;x + \frac{{\left({\left(\frac{y}{y + z}\right)}^{\left(\sqrt{y}\right)}\right)}^{\left(\sqrt{y}\right)}}{y}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{{\left(\sqrt[3]{y} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{y + z} \cdot \sqrt[3]{y + z}}\right)}^{y} \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}}{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 <= -1.0899397794981415e+27)) {
		VAR = ((double) (x + ((double) (((double) pow(((double) pow(((double) (y / ((double) (y + z)))), ((double) sqrt(y)))), ((double) sqrt(y)))) / y))));
	} else {
		VAR = ((double) (x + ((double) (((double) (((double) pow(((double) (((double) cbrt(y)) * ((double) (((double) cbrt(y)) / ((double) (((double) cbrt(((double) (y + z)))) * ((double) cbrt(((double) (y + z)))))))))), y)) * ((double) pow(((double) (((double) cbrt(y)) / ((double) cbrt(((double) (y + z)))))), y)))) / y))));
	}
	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

Original6.4
Target1.1
Herbie3.5
\[\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 2 regimes
  2. if y < -1.08993977949814151e27

    1. Initial program 2.5

      \[x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\]
    2. Simplified2.5

      \[\leadsto \color{blue}{x + \frac{{\left(\frac{y}{y + z}\right)}^{y}}{y}}\]
    3. Using strategy rm
    4. Applied add-sqr-sqrt3.4

      \[\leadsto x + \frac{{\left(\frac{y}{y + z}\right)}^{\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}}}{y}\]
    5. Applied pow-unpow3.4

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

    if -1.08993977949814151e27 < y

    1. Initial program 7.5

      \[x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\]
    2. Simplified7.5

      \[\leadsto \color{blue}{x + \frac{{\left(\frac{y}{y + z}\right)}^{y}}{y}}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt14.9

      \[\leadsto x + \frac{{\left(\frac{y}{\color{blue}{\left(\sqrt[3]{y + z} \cdot \sqrt[3]{y + z}\right) \cdot \sqrt[3]{y + z}}}\right)}^{y}}{y}\]
    5. Applied add-cube-cbrt7.5

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

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

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

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

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

Reproduce

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