Average Error: 5.6 → 0.0
Time: 7.4s
Precision: binary64
\[x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\]
\[\begin{array}{l} \mathbf{if}\;y \leq -18.08893616273098 \lor \neg \left(y \leq 0.5977659477328693\right):\\ \;\;\;\;x + \frac{e^{-z}}{y}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\left({\left(\frac{1}{\sqrt[3]{y + z} \cdot \sqrt[3]{y + z}}\right)}^{y} \cdot {\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)}^{y}\right) \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 \leq -18.08893616273098 \lor \neg \left(y \leq 0.5977659477328693\right):\\
\;\;\;\;x + \frac{e^{-z}}{y}\\

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

\end{array}
(FPCore (x y z)
 :precision binary64
 (+ x (/ (exp (* y (log (/ y (+ z y))))) y)))
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -18.08893616273098) (not (<= y 0.5977659477328693)))
   (+ x (/ (exp (- z)) y))
   (+
    x
    (/
     (*
      (*
       (pow (/ 1.0 (* (cbrt (+ y z)) (cbrt (+ y z)))) y)
       (pow (* (cbrt y) (cbrt y)) y))
      (pow (/ (cbrt y) (cbrt (+ y z))) y))
     y))))
double code(double x, double y, double z) {
	return x + (exp(y * log(y / (z + y))) / y);
}
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -18.08893616273098) || !(y <= 0.5977659477328693)) {
		tmp = x + (exp(-z) / y);
	} else {
		tmp = x + (((pow((1.0 / (cbrt(y + z) * cbrt(y + z))), y) * pow((cbrt(y) * cbrt(y)), y)) * pow((cbrt(y) / cbrt(y + z)), y)) / y);
	}
	return tmp;
}

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.6
Target1.1
Herbie0.0
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z + y} < 7.1154157597908 \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 < -18.088936162730981 or 0.597765947732869285 < y

    1. Initial program 2.0

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

      \[\leadsto \color{blue}{x + \frac{{\left(\frac{y}{y + z}\right)}^{y}}{y}}\]
    3. Taylor expanded around inf 0.0

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

    if -18.088936162730981 < y < 0.597765947732869285

    1. Initial program 9.8

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

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

      \[\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 *-un-lft-identity_binary64_44589.8

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

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

      \[\leadsto x + \frac{\color{blue}{{\left(\frac{1}{\sqrt[3]{y + z} \cdot \sqrt[3]{y + z}}\right)}^{y} \cdot {\left(\frac{y}{\sqrt[3]{y + z}}\right)}^{y}}}{y}\]
    8. Using strategy rm
    9. Applied *-un-lft-identity_binary64_44582.8

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

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

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

      \[\leadsto x + \frac{{\left(\frac{1}{\sqrt[3]{y + z} \cdot \sqrt[3]{y + z}}\right)}^{y} \cdot \color{blue}{\left({\left(\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1}\right)}^{y} \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}\right)}}{y}\]
    13. Applied associate-*r*_binary64_44000.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -18.08893616273098 \lor \neg \left(y \leq 0.5977659477328693\right):\\ \;\;\;\;x + \frac{e^{-z}}{y}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\left({\left(\frac{1}{\sqrt[3]{y + z} \cdot \sqrt[3]{y + z}}\right)}^{y} \cdot {\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)}^{y}\right) \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}}{y}\\ \end{array}\]

Reproduce

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