Average Error: 2.7 → 0.2
Time: 12.6s
Precision: binary64
Cost: 19912
\[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
\[\begin{array}{l} \mathbf{if}\;e^{z} \leq 0:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;e^{z} \leq 1.0002:\\ \;\;\;\;x + \frac{-1}{\frac{-1.1283791670955126}{y} + \left(x + -1.1283791670955126 \cdot \frac{z}{y}\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{e^{z}}{0.8862269254527579}}\\ \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
(FPCore (x y z)
 :precision binary64
 (if (<= (exp z) 0.0)
   (+ x (/ -1.0 x))
   (if (<= (exp z) 1.0002)
     (+
      x
      (/
       -1.0
       (+ (/ -1.1283791670955126 y) (+ x (* -1.1283791670955126 (/ z y))))))
     (+ x (/ y (/ (exp z) 0.8862269254527579))))))
double code(double x, double y, double z) {
	return x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
}
double code(double x, double y, double z) {
	double tmp;
	if (exp(z) <= 0.0) {
		tmp = x + (-1.0 / x);
	} else if (exp(z) <= 1.0002) {
		tmp = x + (-1.0 / ((-1.1283791670955126 / y) + (x + (-1.1283791670955126 * (z / y)))));
	} else {
		tmp = x + (y / (exp(z) / 0.8862269254527579));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x + (y / ((1.1283791670955126d0 * exp(z)) - (x * y)))
end function
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (exp(z) <= 0.0d0) then
        tmp = x + ((-1.0d0) / x)
    else if (exp(z) <= 1.0002d0) then
        tmp = x + ((-1.0d0) / (((-1.1283791670955126d0) / y) + (x + ((-1.1283791670955126d0) * (z / y)))))
    else
        tmp = x + (y / (exp(z) / 0.8862269254527579d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	return x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
}
public static double code(double x, double y, double z) {
	double tmp;
	if (Math.exp(z) <= 0.0) {
		tmp = x + (-1.0 / x);
	} else if (Math.exp(z) <= 1.0002) {
		tmp = x + (-1.0 / ((-1.1283791670955126 / y) + (x + (-1.1283791670955126 * (z / y)))));
	} else {
		tmp = x + (y / (Math.exp(z) / 0.8862269254527579));
	}
	return tmp;
}
def code(x, y, z):
	return x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
def code(x, y, z):
	tmp = 0
	if math.exp(z) <= 0.0:
		tmp = x + (-1.0 / x)
	elif math.exp(z) <= 1.0002:
		tmp = x + (-1.0 / ((-1.1283791670955126 / y) + (x + (-1.1283791670955126 * (z / y)))))
	else:
		tmp = x + (y / (math.exp(z) / 0.8862269254527579))
	return tmp
function code(x, y, z)
	return Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y))))
end
function code(x, y, z)
	tmp = 0.0
	if (exp(z) <= 0.0)
		tmp = Float64(x + Float64(-1.0 / x));
	elseif (exp(z) <= 1.0002)
		tmp = Float64(x + Float64(-1.0 / Float64(Float64(-1.1283791670955126 / y) + Float64(x + Float64(-1.1283791670955126 * Float64(z / y))))));
	else
		tmp = Float64(x + Float64(y / Float64(exp(z) / 0.8862269254527579)));
	end
	return tmp
end
function tmp = code(x, y, z)
	tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (exp(z) <= 0.0)
		tmp = x + (-1.0 / x);
	elseif (exp(z) <= 1.0002)
		tmp = x + (-1.0 / ((-1.1283791670955126 / y) + (x + (-1.1283791670955126 * (z / y)))));
	else
		tmp = x + (y / (exp(z) / 0.8862269254527579));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := If[LessEqual[N[Exp[z], $MachinePrecision], 0.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Exp[z], $MachinePrecision], 1.0002], N[(x + N[(-1.0 / N[(N[(-1.1283791670955126 / y), $MachinePrecision] + N[(x + N[(-1.1283791670955126 * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[Exp[z], $MachinePrecision] / 0.8862269254527579), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\

\mathbf{elif}\;e^{z} \leq 1.0002:\\
\;\;\;\;x + \frac{-1}{\frac{-1.1283791670955126}{y} + \left(x + -1.1283791670955126 \cdot \frac{z}{y}\right)}\\

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


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original2.7
Target0.0
Herbie0.2
\[x + \frac{1}{\frac{1.1283791670955126}{y} \cdot e^{z} - x} \]

Derivation

  1. Split input into 3 regimes
  2. if (exp.f64 z) < 0.0

    1. Initial program 7.0

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Simplified0.0

      \[\leadsto \color{blue}{x + \frac{-1}{\mathsf{fma}\left(e^{z}, \frac{-1.1283791670955126}{y}, x\right)}} \]
      Proof
      (+.f64 x (/.f64 -1 (fma.f64 (exp.f64 z) (/.f64 -5641895835477563/5000000000000000 y) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (exp.f64 z) (/.f64 (Rewrite<= metadata-eval (neg.f64 5641895835477563/5000000000000000)) y) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (exp.f64 z) (Rewrite<= distribute-neg-frac_binary64 (neg.f64 (/.f64 5641895835477563/5000000000000000 y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (exp.f64 z) (neg.f64 (/.f64 5641895835477563/5000000000000000 y))) x)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (+.f64 (*.f64 (exp.f64 z) (Rewrite=> distribute-neg-frac_binary64 (/.f64 (neg.f64 5641895835477563/5000000000000000) y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (+.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 (exp.f64 z) (neg.f64 5641895835477563/5000000000000000)) y)) x))): 1 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (+.f64 (/.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 (exp.f64 z) 5641895835477563/5000000000000000))) y) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (+.f64 (/.f64 (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)))) y) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (Rewrite<= +-commutative_binary64 (+.f64 x (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (+.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 x 1)) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (+.f64 (*.f64 x (Rewrite<= metadata-eval (neg.f64 -1))) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (Rewrite<= fma-udef_binary64 (fma.f64 x (neg.f64 -1) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (Rewrite<= /-rgt-identity_binary64 (/.f64 x 1)) (neg.f64 -1) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (Rewrite<= metadata-eval (neg.f64 -1))) (neg.f64 -1) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (Rewrite=> metadata-eval 1) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (Rewrite<= *-inverses_binary64 (/.f64 y y)) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (/.f64 y y) (Rewrite<= *-lft-identity_binary64 (*.f64 1 (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (/.f64 y y) (*.f64 (Rewrite<= metadata-eval (/.f64 -1 -1)) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (/.f64 y y) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 -1 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)))) (*.f64 -1 y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (/.f64 y y) (/.f64 (*.f64 -1 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)))) (Rewrite<= neg-mul-1_binary64 (neg.f64 y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (/.f64 y y) (Rewrite<= associate-*r/_binary64 (*.f64 -1 (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) (neg.f64 y))))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (/.f64 y y) (Rewrite<= neg-mul-1_binary64 (neg.f64 (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) (neg.f64 y))))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 (/.f64 x (neg.f64 -1)) (/.f64 y y)) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) (neg.f64 y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (*.f64 (/.f64 x (Rewrite=> metadata-eval 1)) (/.f64 y y)) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) (neg.f64 y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (*.f64 (Rewrite=> /-rgt-identity_binary64 x) (/.f64 y y)) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) (neg.f64 y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 x y) y)) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) (neg.f64 y))))): 20 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (/.f64 (*.f64 x y) y) (/.f64 (Rewrite=> distribute-lft-neg-in_binary64 (*.f64 (neg.f64 5641895835477563/5000000000000000) (exp.f64 z))) (neg.f64 y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (/.f64 (*.f64 x y) y) (/.f64 (*.f64 (neg.f64 5641895835477563/5000000000000000) (exp.f64 z)) (Rewrite=> neg-mul-1_binary64 (*.f64 -1 y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (/.f64 (*.f64 x y) y) (Rewrite=> times-frac_binary64 (*.f64 (/.f64 (neg.f64 5641895835477563/5000000000000000) -1) (/.f64 (exp.f64 z) y)))))): 6 points increase in error, 4 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (/.f64 (*.f64 x y) y) (*.f64 (/.f64 (Rewrite=> metadata-eval -5641895835477563/5000000000000000) -1) (/.f64 (exp.f64 z) y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (/.f64 (*.f64 x y) y) (*.f64 (Rewrite=> metadata-eval 5641895835477563/5000000000000000) (/.f64 (exp.f64 z) y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (/.f64 (*.f64 x y) y) (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) y))))): 4 points increase in error, 6 points decrease in error
      (+.f64 x (/.f64 -1 (Rewrite<= div-sub_binary64 (/.f64 (-.f64 (*.f64 x y) (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))): 1 points increase in error, 1 points decrease in error
      (+.f64 x (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 -1 y) (-.f64 (*.f64 x y) (*.f64 5641895835477563/5000000000000000 (exp.f64 z)))))): 12 points increase in error, 11 points decrease in error
      (+.f64 x (/.f64 (*.f64 -1 y) (Rewrite=> sub-neg_binary64 (+.f64 (*.f64 x y) (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 (*.f64 -1 y) (Rewrite=> +-commutative_binary64 (+.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) (*.f64 x y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 (*.f64 -1 y) (+.f64 (Rewrite=> neg-sub0_binary64 (-.f64 0 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)))) (*.f64 x y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 (*.f64 -1 y) (Rewrite=> associate-+l-_binary64 (-.f64 0 (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 (*.f64 -1 y) (Rewrite=> sub0-neg_binary64 (neg.f64 (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 (*.f64 -1 y) (Rewrite=> neg-mul-1_binary64 (*.f64 -1 (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (Rewrite=> times-frac_binary64 (*.f64 (/.f64 -1 -1) (/.f64 y (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (*.f64 (Rewrite=> metadata-eval 1) (/.f64 y (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (Rewrite=> *-lft-identity_binary64 (/.f64 y (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y))))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in y around inf 0.0

      \[\leadsto x + \color{blue}{\frac{-1}{x}} \]

    if 0.0 < (exp.f64 z) < 1.0002

    1. Initial program 0.1

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Simplified0.1

      \[\leadsto \color{blue}{x + \frac{-1}{\mathsf{fma}\left(e^{z}, \frac{-1.1283791670955126}{y}, x\right)}} \]
      Proof
      (+.f64 x (/.f64 -1 (fma.f64 (exp.f64 z) (/.f64 -5641895835477563/5000000000000000 y) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (exp.f64 z) (/.f64 (Rewrite<= metadata-eval (neg.f64 5641895835477563/5000000000000000)) y) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (exp.f64 z) (Rewrite<= distribute-neg-frac_binary64 (neg.f64 (/.f64 5641895835477563/5000000000000000 y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (exp.f64 z) (neg.f64 (/.f64 5641895835477563/5000000000000000 y))) x)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (+.f64 (*.f64 (exp.f64 z) (Rewrite=> distribute-neg-frac_binary64 (/.f64 (neg.f64 5641895835477563/5000000000000000) y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (+.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 (exp.f64 z) (neg.f64 5641895835477563/5000000000000000)) y)) x))): 1 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (+.f64 (/.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 (exp.f64 z) 5641895835477563/5000000000000000))) y) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (+.f64 (/.f64 (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)))) y) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (Rewrite<= +-commutative_binary64 (+.f64 x (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (+.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 x 1)) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (+.f64 (*.f64 x (Rewrite<= metadata-eval (neg.f64 -1))) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (Rewrite<= fma-udef_binary64 (fma.f64 x (neg.f64 -1) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (Rewrite<= /-rgt-identity_binary64 (/.f64 x 1)) (neg.f64 -1) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (Rewrite<= metadata-eval (neg.f64 -1))) (neg.f64 -1) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (Rewrite=> metadata-eval 1) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (Rewrite<= *-inverses_binary64 (/.f64 y y)) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (/.f64 y y) (Rewrite<= *-lft-identity_binary64 (*.f64 1 (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (/.f64 y y) (*.f64 (Rewrite<= metadata-eval (/.f64 -1 -1)) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (/.f64 y y) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 -1 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)))) (*.f64 -1 y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (/.f64 y y) (/.f64 (*.f64 -1 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)))) (Rewrite<= neg-mul-1_binary64 (neg.f64 y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (/.f64 y y) (Rewrite<= associate-*r/_binary64 (*.f64 -1 (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) (neg.f64 y))))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (fma.f64 (/.f64 x (neg.f64 -1)) (/.f64 y y) (Rewrite<= neg-mul-1_binary64 (neg.f64 (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) (neg.f64 y))))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 (/.f64 x (neg.f64 -1)) (/.f64 y y)) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) (neg.f64 y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (*.f64 (/.f64 x (Rewrite=> metadata-eval 1)) (/.f64 y y)) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) (neg.f64 y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (*.f64 (Rewrite=> /-rgt-identity_binary64 x) (/.f64 y y)) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) (neg.f64 y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 x y) y)) (/.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) (neg.f64 y))))): 20 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (/.f64 (*.f64 x y) y) (/.f64 (Rewrite=> distribute-lft-neg-in_binary64 (*.f64 (neg.f64 5641895835477563/5000000000000000) (exp.f64 z))) (neg.f64 y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (/.f64 (*.f64 x y) y) (/.f64 (*.f64 (neg.f64 5641895835477563/5000000000000000) (exp.f64 z)) (Rewrite=> neg-mul-1_binary64 (*.f64 -1 y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (/.f64 (*.f64 x y) y) (Rewrite=> times-frac_binary64 (*.f64 (/.f64 (neg.f64 5641895835477563/5000000000000000) -1) (/.f64 (exp.f64 z) y)))))): 6 points increase in error, 4 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (/.f64 (*.f64 x y) y) (*.f64 (/.f64 (Rewrite=> metadata-eval -5641895835477563/5000000000000000) -1) (/.f64 (exp.f64 z) y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (/.f64 (*.f64 x y) y) (*.f64 (Rewrite=> metadata-eval 5641895835477563/5000000000000000) (/.f64 (exp.f64 z) y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 -1 (-.f64 (/.f64 (*.f64 x y) y) (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) y))))): 4 points increase in error, 6 points decrease in error
      (+.f64 x (/.f64 -1 (Rewrite<= div-sub_binary64 (/.f64 (-.f64 (*.f64 x y) (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) y)))): 1 points increase in error, 1 points decrease in error
      (+.f64 x (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 -1 y) (-.f64 (*.f64 x y) (*.f64 5641895835477563/5000000000000000 (exp.f64 z)))))): 12 points increase in error, 11 points decrease in error
      (+.f64 x (/.f64 (*.f64 -1 y) (Rewrite=> sub-neg_binary64 (+.f64 (*.f64 x y) (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 (*.f64 -1 y) (Rewrite=> +-commutative_binary64 (+.f64 (neg.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z))) (*.f64 x y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 (*.f64 -1 y) (+.f64 (Rewrite=> neg-sub0_binary64 (-.f64 0 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)))) (*.f64 x y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 (*.f64 -1 y) (Rewrite=> associate-+l-_binary64 (-.f64 0 (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 (*.f64 -1 y) (Rewrite=> sub0-neg_binary64 (neg.f64 (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (/.f64 (*.f64 -1 y) (Rewrite=> neg-mul-1_binary64 (*.f64 -1 (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (Rewrite=> times-frac_binary64 (*.f64 (/.f64 -1 -1) (/.f64 y (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (*.f64 (Rewrite=> metadata-eval 1) (/.f64 y (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (Rewrite=> *-lft-identity_binary64 (/.f64 y (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y))))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in z around 0 0.3

      \[\leadsto x + \frac{-1}{\color{blue}{\left(-1.1283791670955126 \cdot \frac{z}{y} + x\right) - 1.1283791670955126 \cdot \frac{1}{y}}} \]
    4. Taylor expanded in y around 0 0.3

      \[\leadsto x + \frac{-1}{\left(-1.1283791670955126 \cdot \frac{z}{y} + x\right) - \color{blue}{\frac{1.1283791670955126}{y}}} \]

    if 1.0002 < (exp.f64 z)

    1. Initial program 3.9

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Taylor expanded in y around 0 0.3

      \[\leadsto x + \color{blue}{0.8862269254527579 \cdot \frac{y}{e^{z}}} \]
    3. Simplified0.3

      \[\leadsto x + \color{blue}{\frac{y}{\frac{e^{z}}{0.8862269254527579}}} \]
      Proof
      (/.f64 y (/.f64 (exp.f64 z) 5000000000000000/5641895835477563)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y 5000000000000000/5641895835477563) (exp.f64 z))): 30 points increase in error, 46 points decrease in error
      (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 y (exp.f64 z)) 5000000000000000/5641895835477563)): 0 points increase in error, 2 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 5000000000000000/5641895835477563 (/.f64 y (exp.f64 z)))): 0 points increase in error, 0 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification0.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{z} \leq 0:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;e^{z} \leq 1.0002:\\ \;\;\;\;x + \frac{-1}{\frac{-1.1283791670955126}{y} + \left(x + -1.1283791670955126 \cdot \frac{z}{y}\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{e^{z}}{0.8862269254527579}}\\ \end{array} \]

Alternatives

Alternative 1
Error0.2
Cost19912
\[\begin{array}{l} \mathbf{if}\;e^{z} \leq 0:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;e^{z} \leq 1.0002:\\ \;\;\;\;x + \frac{-1}{\frac{-1.1283791670955126}{y} + \left(x + -1.1283791670955126 \cdot \frac{z}{y}\right)}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{0.8862269254527579}{e^{z}}\\ \end{array} \]
Alternative 2
Error0.0
Cost13376
\[x + \frac{-1}{\mathsf{fma}\left(e^{z}, \frac{-1.1283791670955126}{y}, x\right)} \]
Alternative 3
Error0.1
Cost13376
\[x + \frac{-1}{\mathsf{fma}\left(-1.1283791670955126, \frac{e^{z}}{y}, x\right)} \]
Alternative 4
Error0.6
Cost1224
\[\begin{array}{l} \mathbf{if}\;z \leq -124265923633919950:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 0.0003897377727374538:\\ \;\;\;\;x + \frac{-1}{\frac{-1.1283791670955126}{y} + \left(x + -1.1283791670955126 \cdot \frac{z}{y}\right)}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 5
Error9.0
Cost1104
\[\begin{array}{l} t_0 := x + \frac{-1}{x}\\ \mathbf{if}\;z \leq -5.695985711297918 \cdot 10^{-13}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 4.108049066329091 \cdot 10^{-172}:\\ \;\;\;\;x + \frac{y}{1.1283791670955126}\\ \mathbf{elif}\;z \leq 4.0857996764403705 \cdot 10^{-57}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 0.0003897377727374538:\\ \;\;\;\;x + y \cdot \frac{0.8862269254527579}{z + 1}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 6
Error0.4
Cost1096
\[\begin{array}{l} \mathbf{if}\;z \leq -501374388.91305363:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 0.0003897377727374538:\\ \;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot 1.1283791670955126\right) - x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 7
Error0.7
Cost968
\[\begin{array}{l} \mathbf{if}\;z \leq -124265923633919950:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 0.0003897377727374538:\\ \;\;\;\;x + \frac{-1}{x + \frac{-1}{\frac{y}{1.1283791670955126}}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 8
Error9.0
Cost848
\[\begin{array}{l} t_0 := x + \frac{-1}{x}\\ t_1 := x + \frac{y}{1.1283791670955126}\\ \mathbf{if}\;z \leq -5.695985711297918 \cdot 10^{-13}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 4.108049066329091 \cdot 10^{-172}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 4.0857996764403705 \cdot 10^{-57}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 0.0003897377727374538:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 9
Error0.5
Cost840
\[\begin{array}{l} \mathbf{if}\;z \leq -501374388.91305363:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 0.0003897377727374538:\\ \;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 10
Error0.7
Cost840
\[\begin{array}{l} \mathbf{if}\;z \leq -124265923633919950:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 0.0003897377727374538:\\ \;\;\;\;x + \frac{-1}{x + \frac{-1.1283791670955126}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 11
Error15.7
Cost584
\[\begin{array}{l} \mathbf{if}\;z \leq -5.695985711297918 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 0.0003897377727374538:\\ \;\;\;\;x + \frac{y}{1.1283791670955126}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 12
Error18.3
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -5.414545286083228 \cdot 10^{-157}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3.795116006769209 \cdot 10^{-204}:\\ \;\;\;\;y \cdot 0.8862269254527579\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 13
Error19.3
Cost64
\[x \]

Error

Reproduce

herbie shell --seed 2022308 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x)))

  (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))