Average Error: 6.4 → 0.6
Time: 9.0s
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{{\left({\left(\frac{y}{y + z}\right)}^{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)}\right)}^{\log \left(e^{\sqrt[3]{y}}\right)}}{y}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{e^{-z}}{y}\\ \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{{\left({\left(\frac{y}{y + z}\right)}^{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)}\right)}^{\log \left(e^{\sqrt[3]{y}}\right)}}{y}\\

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

\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
    (/ (pow (pow (/ y (+ y z)) (* (cbrt y) (cbrt y))) (log (exp (cbrt y)))) y))
   (+ x (/ (exp (- z)) 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 <= 3631925.0693738717) {
		tmp = x + (pow(pow((y / (y + z)), (cbrt(y) * cbrt(y))), log(exp(cbrt(y)))) / y);
	} else {
		tmp = x + (exp(-z) / 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

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

    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_binary64_37558.2

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

      \[\leadsto x + \frac{\color{blue}{{\left({\left(\frac{y}{y + z}\right)}^{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)}\right)}^{\left(\sqrt[3]{y}\right)}}}{y}\]
    6. Using strategy rm
    7. Applied add-log-exp_binary64_37490.8

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

    if 3631940 < 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}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3631925.0693738717:\\ \;\;\;\;x + \frac{{\left({\left(\frac{y}{y + z}\right)}^{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)}\right)}^{\log \left(e^{\sqrt[3]{y}}\right)}}{y}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{e^{-z}}{y}\\ \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)))