Average Error: 6.4 → 0.5
Time: 4.1s
Precision: binary64
\[x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\]
\[\begin{array}{l} \mathbf{if}\;y \leq 3631925.0693738717:\\ \;\;\;\;x + \frac{e^{y \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)\right)} \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{y \cdot e^{z}}\\ \end{array}\]
x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}
\begin{array}{l}
\mathbf{if}\;y \leq 3631925.0693738717:\\
\;\;\;\;x + \frac{e^{y \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)\right)} \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}}{y}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y \cdot e^{z}}\\

\end{array}
(FPCore (x y z)
 :precision binary64
 (+ x (/ (exp (* y (log (/ y (+ z y))))) y)))
(FPCore (x y z)
 :precision binary64
 (if (<= y 3631925.0693738717)
   (+
    x
    (/
     (*
      (exp (* y (* 2.0 (log (/ (cbrt y) (cbrt (+ y z)))))))
      (pow (/ (cbrt y) (cbrt (+ y z))) y))
     y))
   (+ x (/ 1.0 (* y (exp z))))))
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 <= 3631925.0693738717) {
		tmp = x + ((exp(y * (2.0 * log(cbrt(y) / cbrt(y + z)))) * pow((cbrt(y) / cbrt(y + z)), y)) / y);
	} else {
		tmp = x + (1.0 / (y * exp(z)));
	}
	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

Original6.4
Target1.0
Herbie0.5
\[\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 < 3631925.06937387167

    1. Initial program 8.2

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

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

      \[\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-cbrt_binary648.2

      \[\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-frac_binary648.2

      \[\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-down_binary642.3

      \[\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. Using strategy rm
    9. Applied add-exp-log_binary6443.1

      \[\leadsto x + \frac{{\left(\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{y + z} \cdot \color{blue}{e^{\log \left(\sqrt[3]{y + z}\right)}}}\right)}^{y} \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}}{y}\]
    10. Applied add-exp-log_binary6443.1

      \[\leadsto x + \frac{{\left(\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\color{blue}{e^{\log \left(\sqrt[3]{y + z}\right)}} \cdot e^{\log \left(\sqrt[3]{y + z}\right)}}\right)}^{y} \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}}{y}\]
    11. Applied prod-exp_binary6443.1

      \[\leadsto x + \frac{{\left(\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\color{blue}{e^{\log \left(\sqrt[3]{y + z}\right) + \log \left(\sqrt[3]{y + z}\right)}}}\right)}^{y} \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}}{y}\]
    12. Applied add-exp-log_binary6443.1

      \[\leadsto x + \frac{{\left(\frac{\sqrt[3]{y} \cdot \color{blue}{e^{\log \left(\sqrt[3]{y}\right)}}}{e^{\log \left(\sqrt[3]{y + z}\right) + \log \left(\sqrt[3]{y + z}\right)}}\right)}^{y} \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}}{y}\]
    13. Applied add-exp-log_binary6443.1

      \[\leadsto x + \frac{{\left(\frac{\color{blue}{e^{\log \left(\sqrt[3]{y}\right)}} \cdot e^{\log \left(\sqrt[3]{y}\right)}}{e^{\log \left(\sqrt[3]{y + z}\right) + \log \left(\sqrt[3]{y + z}\right)}}\right)}^{y} \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}}{y}\]
    14. Applied prod-exp_binary6443.1

      \[\leadsto x + \frac{{\left(\frac{\color{blue}{e^{\log \left(\sqrt[3]{y}\right) + \log \left(\sqrt[3]{y}\right)}}}{e^{\log \left(\sqrt[3]{y + z}\right) + \log \left(\sqrt[3]{y + z}\right)}}\right)}^{y} \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}}{y}\]
    15. Applied div-exp_binary6443.1

      \[\leadsto x + \frac{{\color{blue}{\left(e^{\left(\log \left(\sqrt[3]{y}\right) + \log \left(\sqrt[3]{y}\right)\right) - \left(\log \left(\sqrt[3]{y + z}\right) + \log \left(\sqrt[3]{y + z}\right)\right)}\right)}}^{y} \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}}{y}\]
    16. Applied pow-exp_binary6442.4

      \[\leadsto x + \frac{\color{blue}{e^{\left(\left(\log \left(\sqrt[3]{y}\right) + \log \left(\sqrt[3]{y}\right)\right) - \left(\log \left(\sqrt[3]{y + z}\right) + \log \left(\sqrt[3]{y + z}\right)\right)\right) \cdot y}} \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}}{y}\]
    17. Simplified0.8

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

    if 3631925.06937387167 < y

    1. Initial program 1.7

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

      \[\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}\]
    4. Using strategy rm
    5. Applied clear-num_binary640.0

      \[\leadsto x + \color{blue}{\frac{1}{\frac{y}{e^{-z}}}}\]
    6. Simplified0.0

      \[\leadsto x + \frac{1}{\color{blue}{y \cdot e^{z}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3631925.0693738717:\\ \;\;\;\;x + \frac{e^{y \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)\right)} \cdot {\left(\frac{\sqrt[3]{y}}{\sqrt[3]{y + z}}\right)}^{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{y \cdot e^{z}}\\ \end{array}\]

Reproduce

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