Average Error: 5.8 → 0.1
Time: 4.9s
Precision: 64
\[x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\]
\[\begin{array}{l} \mathbf{if}\;y \le -9.3841128803965788:\\ \;\;\;\;x + \sqrt{e^{-1 \cdot z}} \cdot \frac{\sqrt{e^{-1 \cdot z}}}{y}\\ \mathbf{elif}\;y \le -4.1758005976406368 \cdot 10^{-97}:\\ \;\;\;\;x + {\left(\frac{1}{\sqrt[3]{z + y} \cdot \sqrt[3]{z + y}}\right)}^{y} \cdot \frac{{\left(\frac{y}{\sqrt[3]{z + y}}\right)}^{y}}{y}\\ \mathbf{elif}\;y \le 0.13331480702107812:\\ \;\;\;\;x + \frac{e^{0}}{y}\\ \mathbf{else}:\\ \;\;\;\;x + \sqrt{e^{-1 \cdot z}} \cdot \frac{\sqrt{e^{-1 \cdot z}}}{y}\\ \end{array}\]
x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}
\begin{array}{l}
\mathbf{if}\;y \le -9.3841128803965788:\\
\;\;\;\;x + \sqrt{e^{-1 \cdot z}} \cdot \frac{\sqrt{e^{-1 \cdot z}}}{y}\\

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

\mathbf{elif}\;y \le 0.13331480702107812:\\
\;\;\;\;x + \frac{e^{0}}{y}\\

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

\end{array}
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 VAR;
	if ((y <= -9.384112880396579)) {
		VAR = (x + (sqrt(exp((-1.0 * z))) * (sqrt(exp((-1.0 * z))) / y)));
	} else {
		double VAR_1;
		if ((y <= -4.175800597640637e-97)) {
			VAR_1 = (x + (pow((1.0 / (cbrt((z + y)) * cbrt((z + y)))), y) * (pow((y / cbrt((z + y))), y) / y)));
		} else {
			double VAR_2;
			if ((y <= 0.13331480702107812)) {
				VAR_2 = (x + (exp(0.0) / y));
			} else {
				VAR_2 = (x + (sqrt(exp((-1.0 * z))) * (sqrt(exp((-1.0 * z))) / y)));
			}
			VAR_1 = VAR_2;
		}
		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.8
Target0.9
Herbie0.1
\[\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 < -9.384112880396579 or 0.13331480702107812 < y

    1. Initial program 1.8

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

      \[\leadsto \color{blue}{x + \frac{e^{-1 \cdot z}}{y}}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity0.0

      \[\leadsto x + \frac{e^{-1 \cdot z}}{\color{blue}{1 \cdot y}}\]
    5. Applied add-sqr-sqrt0.0

      \[\leadsto x + \frac{\color{blue}{\sqrt{e^{-1 \cdot z}} \cdot \sqrt{e^{-1 \cdot z}}}}{1 \cdot y}\]
    6. Applied times-frac0.0

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

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

    if -9.384112880396579 < y < -4.175800597640637e-97

    1. Initial program 2.4

      \[x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity2.4

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

      \[\leadsto x + \frac{e^{y \cdot \log \left(\frac{y}{\color{blue}{\left(\sqrt[3]{z + y} \cdot \sqrt[3]{z + y}\right) \cdot \sqrt[3]{z + y}}}\right)}}{1 \cdot y}\]
    5. Applied *-un-lft-identity2.4

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

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

      \[\leadsto x + \frac{e^{y \cdot \color{blue}{\left(\log \left(\frac{1}{\sqrt[3]{z + y} \cdot \sqrt[3]{z + y}}\right) + \log \left(\frac{y}{\sqrt[3]{z + y}}\right)\right)}}}{1 \cdot y}\]
    8. Applied distribute-lft-in0.0

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

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

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

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

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

    if -4.175800597640637e-97 < y < 0.13331480702107812

    1. Initial program 11.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -9.3841128803965788:\\ \;\;\;\;x + \sqrt{e^{-1 \cdot z}} \cdot \frac{\sqrt{e^{-1 \cdot z}}}{y}\\ \mathbf{elif}\;y \le -4.1758005976406368 \cdot 10^{-97}:\\ \;\;\;\;x + {\left(\frac{1}{\sqrt[3]{z + y} \cdot \sqrt[3]{z + y}}\right)}^{y} \cdot \frac{{\left(\frac{y}{\sqrt[3]{z + y}}\right)}^{y}}{y}\\ \mathbf{elif}\;y \le 0.13331480702107812:\\ \;\;\;\;x + \frac{e^{0}}{y}\\ \mathbf{else}:\\ \;\;\;\;x + \sqrt{e^{-1 \cdot z}} \cdot \frac{\sqrt{e^{-1 \cdot z}}}{y}\\ \end{array}\]

Reproduce

herbie shell --seed 2020106 
(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 z)) y)) (+ x (/ (exp (log (pow (/ y (+ y z)) y))) y)))

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