Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A

Percentage Accurate: 95.6% → 99.7%
Time: 9.8s
Alternatives: 13
Speedup: 5.8×

Specification

?
\[\begin{array}{l} \\ x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
double code(double x, double y, double z) {
	return x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
}
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
public static double code(double x, double y, double z) {
	return x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
}
def code(x, y, z):
	return x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
function code(x, y, z)
	return Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y))))
end
function tmp = code(x, y, z)
	tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
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]
\begin{array}{l}

\\
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 13 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 95.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
double code(double x, double y, double z) {
	return x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
}
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
public static double code(double x, double y, double z) {
	return x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
}
def code(x, y, z):
	return x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
function code(x, y, z)
	return Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y))))
end
function tmp = code(x, y, z)
	tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
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]
\begin{array}{l}

\\
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\end{array}

Alternative 1: 99.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{z} \leq 0:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;e^{z} \leq 1.01:\\ \;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot 1.1283791670955126\right) - x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{e^{z}} \cdot -0.8862269254527579\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (exp z) 0.0)
   (+ x (/ -1.0 x))
   (if (<= (exp z) 1.01)
     (+ x (/ y (- (+ 1.1283791670955126 (* z 1.1283791670955126)) (* x y))))
     (- x (* (/ y (exp z)) -0.8862269254527579)))))
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.01) {
		tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * 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
    real(8) :: tmp
    if (exp(z) <= 0.0d0) then
        tmp = x + ((-1.0d0) / x)
    else if (exp(z) <= 1.01d0) then
        tmp = x + (y / ((1.1283791670955126d0 + (z * 1.1283791670955126d0)) - (x * 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) {
	double tmp;
	if (Math.exp(z) <= 0.0) {
		tmp = x + (-1.0 / x);
	} else if (Math.exp(z) <= 1.01) {
		tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y)));
	} else {
		tmp = x - ((y / Math.exp(z)) * -0.8862269254527579);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if math.exp(z) <= 0.0:
		tmp = x + (-1.0 / x)
	elif math.exp(z) <= 1.01:
		tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y)))
	else:
		tmp = x - ((y / math.exp(z)) * -0.8862269254527579)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (exp(z) <= 0.0)
		tmp = Float64(x + Float64(-1.0 / x));
	elseif (exp(z) <= 1.01)
		tmp = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 + Float64(z * 1.1283791670955126)) - Float64(x * y))));
	else
		tmp = Float64(x - Float64(Float64(y / exp(z)) * -0.8862269254527579));
	end
	return tmp
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.01)
		tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y)));
	else
		tmp = x - ((y / exp(z)) * -0.8862269254527579);
	end
	tmp_2 = tmp;
end
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.01], N[(x + N[(y / N[(N[(1.1283791670955126 + N[(z * 1.1283791670955126), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / N[Exp[z], $MachinePrecision]), $MachinePrecision] * -0.8862269254527579), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (exp.f64 z) < 0.0

    1. Initial program 83.9%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 100.0%

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

    if 0.0 < (exp.f64 z) < 1.01000000000000001

    1. Initial program 99.8%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 99.8%

      \[\leadsto x + \frac{y}{\color{blue}{\left(1.1283791670955126 + 1.1283791670955126 \cdot z\right)} - x \cdot y} \]
    4. Step-by-step derivation
      1. *-commutative99.8%

        \[\leadsto x + \frac{y}{\left(1.1283791670955126 + \color{blue}{z \cdot 1.1283791670955126}\right) - x \cdot y} \]
    5. Simplified99.8%

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

    if 1.01000000000000001 < (exp.f64 z)

    1. Initial program 96.8%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Step-by-step derivation
      1. remove-double-neg96.8%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. neg-sub096.8%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      3. associate-+l-96.8%

        \[\leadsto \color{blue}{0 - \left(\left(-x\right) - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      4. add096.8%

        \[\leadsto 0 - \left(\color{blue}{\left(\left(-x\right) + 0\right)} - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      5. associate--l+96.8%

        \[\leadsto 0 - \color{blue}{\left(\left(-x\right) + \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)\right)} \]
      6. associate--r+96.8%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right) - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      7. neg-sub096.8%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      8. remove-double-neg96.8%

        \[\leadsto \color{blue}{x} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      9. neg-sub096.8%

        \[\leadsto x - \color{blue}{\left(-\frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      10. distribute-neg-frac296.8%

        \[\leadsto x - \color{blue}{\frac{y}{-\left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      11. neg-sub096.8%

        \[\leadsto x - \frac{y}{\color{blue}{0 - \left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      12. associate--r-96.8%

        \[\leadsto x - \frac{y}{\color{blue}{\left(0 - 1.1283791670955126 \cdot e^{z}\right) + x \cdot y}} \]
      13. neg-sub096.8%

        \[\leadsto x - \frac{y}{\color{blue}{\left(-1.1283791670955126 \cdot e^{z}\right)} + x \cdot y} \]
      14. +-commutative96.8%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y + \left(-1.1283791670955126 \cdot e^{z}\right)}} \]
      15. sub-neg96.8%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y - 1.1283791670955126 \cdot e^{z}}} \]
      16. fma-neg100.0%

        \[\leadsto x - \frac{y}{\color{blue}{\mathsf{fma}\left(x, y, -1.1283791670955126 \cdot e^{z}\right)}} \]
      17. *-commutative100.0%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, -\color{blue}{e^{z} \cdot 1.1283791670955126}\right)} \]
      18. distribute-rgt-neg-in100.0%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, \color{blue}{e^{z} \cdot \left(-1.1283791670955126\right)}\right)} \]
      19. metadata-eval100.0%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot \color{blue}{-1.1283791670955126}\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 100.0%

      \[\leadsto x - \color{blue}{-0.8862269254527579 \cdot \frac{y}{e^{z}}} \]
    6. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto x - \color{blue}{\frac{y}{e^{z}} \cdot -0.8862269254527579} \]
    7. Simplified100.0%

      \[\leadsto x - \color{blue}{\frac{y}{e^{z}} \cdot -0.8862269254527579} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.9%

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

Alternative 2: 99.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{z} \leq 0:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (exp z) 0.0)
   (+ x (/ -1.0 x))
   (- x (/ y (fma x y (* (exp z) -1.1283791670955126))))))
double code(double x, double y, double z) {
	double tmp;
	if (exp(z) <= 0.0) {
		tmp = x + (-1.0 / x);
	} else {
		tmp = x - (y / fma(x, y, (exp(z) * -1.1283791670955126)));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (exp(z) <= 0.0)
		tmp = Float64(x + Float64(-1.0 / x));
	else
		tmp = Float64(x - Float64(y / fma(x, y, Float64(exp(z) * -1.1283791670955126))));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[N[Exp[z], $MachinePrecision], 0.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(x * y + N[(N[Exp[z], $MachinePrecision] * -1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (exp.f64 z) < 0.0

    1. Initial program 83.9%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 100.0%

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

    if 0.0 < (exp.f64 z)

    1. Initial program 98.8%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Step-by-step derivation
      1. remove-double-neg98.8%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. neg-sub098.8%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      3. associate-+l-98.8%

        \[\leadsto \color{blue}{0 - \left(\left(-x\right) - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      4. add098.8%

        \[\leadsto 0 - \left(\color{blue}{\left(\left(-x\right) + 0\right)} - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      5. associate--l+98.8%

        \[\leadsto 0 - \color{blue}{\left(\left(-x\right) + \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)\right)} \]
      6. associate--r+98.8%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right) - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      7. neg-sub098.8%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      8. remove-double-neg98.8%

        \[\leadsto \color{blue}{x} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      9. neg-sub098.8%

        \[\leadsto x - \color{blue}{\left(-\frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      10. distribute-neg-frac298.8%

        \[\leadsto x - \color{blue}{\frac{y}{-\left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      11. neg-sub098.8%

        \[\leadsto x - \frac{y}{\color{blue}{0 - \left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      12. associate--r-98.8%

        \[\leadsto x - \frac{y}{\color{blue}{\left(0 - 1.1283791670955126 \cdot e^{z}\right) + x \cdot y}} \]
      13. neg-sub098.8%

        \[\leadsto x - \frac{y}{\color{blue}{\left(-1.1283791670955126 \cdot e^{z}\right)} + x \cdot y} \]
      14. +-commutative98.8%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y + \left(-1.1283791670955126 \cdot e^{z}\right)}} \]
      15. sub-neg98.8%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y - 1.1283791670955126 \cdot e^{z}}} \]
      16. fma-neg99.9%

        \[\leadsto x - \frac{y}{\color{blue}{\mathsf{fma}\left(x, y, -1.1283791670955126 \cdot e^{z}\right)}} \]
      17. *-commutative99.9%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, -\color{blue}{e^{z} \cdot 1.1283791670955126}\right)} \]
      18. distribute-rgt-neg-in99.9%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, \color{blue}{e^{z} \cdot \left(-1.1283791670955126\right)}\right)} \]
      19. metadata-eval99.9%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot \color{blue}{-1.1283791670955126}\right)} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}} \]
    4. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification99.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{z} \leq 0:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 99.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{z} \leq 0:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;e^{z} \leq 10000:\\ \;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot 1.1283791670955126\right) - x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (exp z) 0.0)
   (+ x (/ -1.0 x))
   (if (<= (exp z) 10000.0)
     (+ x (/ y (- (+ 1.1283791670955126 (* z 1.1283791670955126)) (* x y))))
     x)))
double code(double x, double y, double z) {
	double tmp;
	if (exp(z) <= 0.0) {
		tmp = x + (-1.0 / x);
	} else if (exp(z) <= 10000.0) {
		tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y)));
	} else {
		tmp = x;
	}
	return tmp;
}
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) <= 10000.0d0) then
        tmp = x + (y / ((1.1283791670955126d0 + (z * 1.1283791670955126d0)) - (x * y)))
    else
        tmp = x
    end if
    code = tmp
end function
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) <= 10000.0) {
		tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y)));
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if math.exp(z) <= 0.0:
		tmp = x + (-1.0 / x)
	elif math.exp(z) <= 10000.0:
		tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y)))
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (exp(z) <= 0.0)
		tmp = Float64(x + Float64(-1.0 / x));
	elseif (exp(z) <= 10000.0)
		tmp = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 + Float64(z * 1.1283791670955126)) - Float64(x * y))));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (exp(z) <= 0.0)
		tmp = x + (-1.0 / x);
	elseif (exp(z) <= 10000.0)
		tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y)));
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
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], 10000.0], N[(x + N[(y / N[(N[(1.1283791670955126 + N[(z * 1.1283791670955126), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\

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

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (exp.f64 z) < 0.0

    1. Initial program 83.9%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 100.0%

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

    if 0.0 < (exp.f64 z) < 1e4

    1. Initial program 99.8%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 98.7%

      \[\leadsto x + \frac{y}{\color{blue}{\left(1.1283791670955126 + 1.1283791670955126 \cdot z\right)} - x \cdot y} \]
    4. Step-by-step derivation
      1. *-commutative98.7%

        \[\leadsto x + \frac{y}{\left(1.1283791670955126 + \color{blue}{z \cdot 1.1283791670955126}\right) - x \cdot y} \]
    5. Simplified98.7%

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

    if 1e4 < (exp.f64 z)

    1. Initial program 96.7%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 100.0%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.3%

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

Alternative 4: 98.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{z} \leq 0:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (exp z) 0.0)
   (+ x (/ -1.0 x))
   (+ x (/ y (- (* (exp z) 1.1283791670955126) (* x y))))))
double code(double x, double y, double z) {
	double tmp;
	if (exp(z) <= 0.0) {
		tmp = x + (-1.0 / x);
	} else {
		tmp = x + (y / ((exp(z) * 1.1283791670955126) - (x * y)));
	}
	return tmp;
}
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
        tmp = x + (y / ((exp(z) * 1.1283791670955126d0) - (x * y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (Math.exp(z) <= 0.0) {
		tmp = x + (-1.0 / x);
	} else {
		tmp = x + (y / ((Math.exp(z) * 1.1283791670955126) - (x * y)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if math.exp(z) <= 0.0:
		tmp = x + (-1.0 / x)
	else:
		tmp = x + (y / ((math.exp(z) * 1.1283791670955126) - (x * y)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (exp(z) <= 0.0)
		tmp = Float64(x + Float64(-1.0 / x));
	else
		tmp = Float64(x + Float64(y / Float64(Float64(exp(z) * 1.1283791670955126) - Float64(x * y))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (exp(z) <= 0.0)
		tmp = x + (-1.0 / x);
	else
		tmp = x + (y / ((exp(z) * 1.1283791670955126) - (x * y)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[N[Exp[z], $MachinePrecision], 0.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (exp.f64 z) < 0.0

    1. Initial program 83.9%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 100.0%

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

    if 0.0 < (exp.f64 z)

    1. Initial program 98.8%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification99.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{z} \leq 0:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 71.0% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{-5}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -4 \cdot 10^{-62}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{elif}\;x \leq -2.9 \cdot 10^{-187}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -8.6 \cdot 10^{-300}:\\ \;\;\;\;y \cdot 0.8862269254527579\\ \mathbf{elif}\;x \leq 3.35 \cdot 10^{-305}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{elif}\;x \leq 1.76 \cdot 10^{-214}:\\ \;\;\;\;y \cdot 0.8862269254527579\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{-28}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -1.25e-5)
   x
   (if (<= x -4e-62)
     (/ -1.0 x)
     (if (<= x -2.9e-187)
       x
       (if (<= x -8.6e-300)
         (* y 0.8862269254527579)
         (if (<= x 3.35e-305)
           (/ -1.0 x)
           (if (<= x 1.76e-214)
             (* y 0.8862269254527579)
             (if (<= x 1.35e-28) (/ -1.0 x) x))))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.25e-5) {
		tmp = x;
	} else if (x <= -4e-62) {
		tmp = -1.0 / x;
	} else if (x <= -2.9e-187) {
		tmp = x;
	} else if (x <= -8.6e-300) {
		tmp = y * 0.8862269254527579;
	} else if (x <= 3.35e-305) {
		tmp = -1.0 / x;
	} else if (x <= 1.76e-214) {
		tmp = y * 0.8862269254527579;
	} else if (x <= 1.35e-28) {
		tmp = -1.0 / x;
	} else {
		tmp = x;
	}
	return tmp;
}
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 (x <= (-1.25d-5)) then
        tmp = x
    else if (x <= (-4d-62)) then
        tmp = (-1.0d0) / x
    else if (x <= (-2.9d-187)) then
        tmp = x
    else if (x <= (-8.6d-300)) then
        tmp = y * 0.8862269254527579d0
    else if (x <= 3.35d-305) then
        tmp = (-1.0d0) / x
    else if (x <= 1.76d-214) then
        tmp = y * 0.8862269254527579d0
    else if (x <= 1.35d-28) then
        tmp = (-1.0d0) / x
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.25e-5) {
		tmp = x;
	} else if (x <= -4e-62) {
		tmp = -1.0 / x;
	} else if (x <= -2.9e-187) {
		tmp = x;
	} else if (x <= -8.6e-300) {
		tmp = y * 0.8862269254527579;
	} else if (x <= 3.35e-305) {
		tmp = -1.0 / x;
	} else if (x <= 1.76e-214) {
		tmp = y * 0.8862269254527579;
	} else if (x <= 1.35e-28) {
		tmp = -1.0 / x;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -1.25e-5:
		tmp = x
	elif x <= -4e-62:
		tmp = -1.0 / x
	elif x <= -2.9e-187:
		tmp = x
	elif x <= -8.6e-300:
		tmp = y * 0.8862269254527579
	elif x <= 3.35e-305:
		tmp = -1.0 / x
	elif x <= 1.76e-214:
		tmp = y * 0.8862269254527579
	elif x <= 1.35e-28:
		tmp = -1.0 / x
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -1.25e-5)
		tmp = x;
	elseif (x <= -4e-62)
		tmp = Float64(-1.0 / x);
	elseif (x <= -2.9e-187)
		tmp = x;
	elseif (x <= -8.6e-300)
		tmp = Float64(y * 0.8862269254527579);
	elseif (x <= 3.35e-305)
		tmp = Float64(-1.0 / x);
	elseif (x <= 1.76e-214)
		tmp = Float64(y * 0.8862269254527579);
	elseif (x <= 1.35e-28)
		tmp = Float64(-1.0 / x);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -1.25e-5)
		tmp = x;
	elseif (x <= -4e-62)
		tmp = -1.0 / x;
	elseif (x <= -2.9e-187)
		tmp = x;
	elseif (x <= -8.6e-300)
		tmp = y * 0.8862269254527579;
	elseif (x <= 3.35e-305)
		tmp = -1.0 / x;
	elseif (x <= 1.76e-214)
		tmp = y * 0.8862269254527579;
	elseif (x <= 1.35e-28)
		tmp = -1.0 / x;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -1.25e-5], x, If[LessEqual[x, -4e-62], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, -2.9e-187], x, If[LessEqual[x, -8.6e-300], N[(y * 0.8862269254527579), $MachinePrecision], If[LessEqual[x, 3.35e-305], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 1.76e-214], N[(y * 0.8862269254527579), $MachinePrecision], If[LessEqual[x, 1.35e-28], N[(-1.0 / x), $MachinePrecision], x]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-5}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq -4 \cdot 10^{-62}:\\
\;\;\;\;\frac{-1}{x}\\

\mathbf{elif}\;x \leq -2.9 \cdot 10^{-187}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq -8.6 \cdot 10^{-300}:\\
\;\;\;\;y \cdot 0.8862269254527579\\

\mathbf{elif}\;x \leq 3.35 \cdot 10^{-305}:\\
\;\;\;\;\frac{-1}{x}\\

\mathbf{elif}\;x \leq 1.76 \cdot 10^{-214}:\\
\;\;\;\;y \cdot 0.8862269254527579\\

\mathbf{elif}\;x \leq 1.35 \cdot 10^{-28}:\\
\;\;\;\;\frac{-1}{x}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.25000000000000006e-5 or -4.0000000000000002e-62 < x < -2.89999999999999988e-187 or 1.3499999999999999e-28 < x

    1. Initial program 98.5%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 90.3%

      \[\leadsto \color{blue}{x} \]

    if -1.25000000000000006e-5 < x < -4.0000000000000002e-62 or -8.6000000000000001e-300 < x < 3.3500000000000002e-305 or 1.75999999999999997e-214 < x < 1.3499999999999999e-28

    1. Initial program 92.6%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 56.2%

      \[\leadsto \color{blue}{x - \frac{1}{x}} \]
    4. Taylor expanded in x around 0 55.8%

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

    if -2.89999999999999988e-187 < x < -8.6000000000000001e-300 or 3.3500000000000002e-305 < x < 1.75999999999999997e-214

    1. Initial program 91.6%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Step-by-step derivation
      1. remove-double-neg91.6%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. neg-sub091.6%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      3. associate-+l-91.6%

        \[\leadsto \color{blue}{0 - \left(\left(-x\right) - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      4. add091.6%

        \[\leadsto 0 - \left(\color{blue}{\left(\left(-x\right) + 0\right)} - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      5. associate--l+91.6%

        \[\leadsto 0 - \color{blue}{\left(\left(-x\right) + \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)\right)} \]
      6. associate--r+91.6%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right) - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      7. neg-sub091.6%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      8. remove-double-neg91.6%

        \[\leadsto \color{blue}{x} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      9. neg-sub091.6%

        \[\leadsto x - \color{blue}{\left(-\frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      10. distribute-neg-frac291.6%

        \[\leadsto x - \color{blue}{\frac{y}{-\left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      11. neg-sub091.3%

        \[\leadsto x - \frac{y}{\color{blue}{0 - \left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      12. associate--r-91.3%

        \[\leadsto x - \frac{y}{\color{blue}{\left(0 - 1.1283791670955126 \cdot e^{z}\right) + x \cdot y}} \]
      13. neg-sub091.8%

        \[\leadsto x - \frac{y}{\color{blue}{\left(-1.1283791670955126 \cdot e^{z}\right)} + x \cdot y} \]
      14. +-commutative91.8%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y + \left(-1.1283791670955126 \cdot e^{z}\right)}} \]
      15. sub-neg91.8%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y - 1.1283791670955126 \cdot e^{z}}} \]
      16. fma-neg91.8%

        \[\leadsto x - \frac{y}{\color{blue}{\mathsf{fma}\left(x, y, -1.1283791670955126 \cdot e^{z}\right)}} \]
      17. *-commutative91.8%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, -\color{blue}{e^{z} \cdot 1.1283791670955126}\right)} \]
      18. distribute-rgt-neg-in91.8%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, \color{blue}{e^{z} \cdot \left(-1.1283791670955126\right)}\right)} \]
      19. metadata-eval91.8%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot \color{blue}{-1.1283791670955126}\right)} \]
    3. Simplified91.8%

      \[\leadsto \color{blue}{x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 64.5%

      \[\leadsto x - \color{blue}{\frac{y}{x \cdot y - 1.1283791670955126}} \]
    6. Taylor expanded in x around 0 55.8%

      \[\leadsto \color{blue}{0.8862269254527579 \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{-5}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -4 \cdot 10^{-62}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{elif}\;x \leq -2.9 \cdot 10^{-187}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -8.6 \cdot 10^{-300}:\\ \;\;\;\;y \cdot 0.8862269254527579\\ \mathbf{elif}\;x \leq 3.35 \cdot 10^{-305}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{elif}\;x \leq 1.76 \cdot 10^{-214}:\\ \;\;\;\;y \cdot 0.8862269254527579\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{-28}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 71.2% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{-5}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -7 \cdot 10^{-63}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{elif}\;x \leq -1.7 \cdot 10^{-186}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-300}:\\ \;\;\;\;y \cdot 0.8862269254527579\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-308}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{-214}:\\ \;\;\;\;\frac{y}{1.1283791670955126}\\ \mathbf{elif}\;x \leq 10^{-27}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -2.5e-5)
   x
   (if (<= x -7e-63)
     (/ -1.0 x)
     (if (<= x -1.7e-186)
       x
       (if (<= x -7.6e-300)
         (* y 0.8862269254527579)
         (if (<= x 2.4e-308)
           (/ -1.0 x)
           (if (<= x 3.1e-214)
             (/ y 1.1283791670955126)
             (if (<= x 1e-27) (/ -1.0 x) x))))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.5e-5) {
		tmp = x;
	} else if (x <= -7e-63) {
		tmp = -1.0 / x;
	} else if (x <= -1.7e-186) {
		tmp = x;
	} else if (x <= -7.6e-300) {
		tmp = y * 0.8862269254527579;
	} else if (x <= 2.4e-308) {
		tmp = -1.0 / x;
	} else if (x <= 3.1e-214) {
		tmp = y / 1.1283791670955126;
	} else if (x <= 1e-27) {
		tmp = -1.0 / x;
	} else {
		tmp = x;
	}
	return tmp;
}
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 (x <= (-2.5d-5)) then
        tmp = x
    else if (x <= (-7d-63)) then
        tmp = (-1.0d0) / x
    else if (x <= (-1.7d-186)) then
        tmp = x
    else if (x <= (-7.6d-300)) then
        tmp = y * 0.8862269254527579d0
    else if (x <= 2.4d-308) then
        tmp = (-1.0d0) / x
    else if (x <= 3.1d-214) then
        tmp = y / 1.1283791670955126d0
    else if (x <= 1d-27) then
        tmp = (-1.0d0) / x
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.5e-5) {
		tmp = x;
	} else if (x <= -7e-63) {
		tmp = -1.0 / x;
	} else if (x <= -1.7e-186) {
		tmp = x;
	} else if (x <= -7.6e-300) {
		tmp = y * 0.8862269254527579;
	} else if (x <= 2.4e-308) {
		tmp = -1.0 / x;
	} else if (x <= 3.1e-214) {
		tmp = y / 1.1283791670955126;
	} else if (x <= 1e-27) {
		tmp = -1.0 / x;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -2.5e-5:
		tmp = x
	elif x <= -7e-63:
		tmp = -1.0 / x
	elif x <= -1.7e-186:
		tmp = x
	elif x <= -7.6e-300:
		tmp = y * 0.8862269254527579
	elif x <= 2.4e-308:
		tmp = -1.0 / x
	elif x <= 3.1e-214:
		tmp = y / 1.1283791670955126
	elif x <= 1e-27:
		tmp = -1.0 / x
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -2.5e-5)
		tmp = x;
	elseif (x <= -7e-63)
		tmp = Float64(-1.0 / x);
	elseif (x <= -1.7e-186)
		tmp = x;
	elseif (x <= -7.6e-300)
		tmp = Float64(y * 0.8862269254527579);
	elseif (x <= 2.4e-308)
		tmp = Float64(-1.0 / x);
	elseif (x <= 3.1e-214)
		tmp = Float64(y / 1.1283791670955126);
	elseif (x <= 1e-27)
		tmp = Float64(-1.0 / x);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -2.5e-5)
		tmp = x;
	elseif (x <= -7e-63)
		tmp = -1.0 / x;
	elseif (x <= -1.7e-186)
		tmp = x;
	elseif (x <= -7.6e-300)
		tmp = y * 0.8862269254527579;
	elseif (x <= 2.4e-308)
		tmp = -1.0 / x;
	elseif (x <= 3.1e-214)
		tmp = y / 1.1283791670955126;
	elseif (x <= 1e-27)
		tmp = -1.0 / x;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -2.5e-5], x, If[LessEqual[x, -7e-63], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, -1.7e-186], x, If[LessEqual[x, -7.6e-300], N[(y * 0.8862269254527579), $MachinePrecision], If[LessEqual[x, 2.4e-308], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 3.1e-214], N[(y / 1.1283791670955126), $MachinePrecision], If[LessEqual[x, 1e-27], N[(-1.0 / x), $MachinePrecision], x]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{-5}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq -7 \cdot 10^{-63}:\\
\;\;\;\;\frac{-1}{x}\\

\mathbf{elif}\;x \leq -1.7 \cdot 10^{-186}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq -7.6 \cdot 10^{-300}:\\
\;\;\;\;y \cdot 0.8862269254527579\\

\mathbf{elif}\;x \leq 2.4 \cdot 10^{-308}:\\
\;\;\;\;\frac{-1}{x}\\

\mathbf{elif}\;x \leq 3.1 \cdot 10^{-214}:\\
\;\;\;\;\frac{y}{1.1283791670955126}\\

\mathbf{elif}\;x \leq 10^{-27}:\\
\;\;\;\;\frac{-1}{x}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.50000000000000012e-5 or -7.00000000000000006e-63 < x < -1.7e-186 or 1e-27 < x

    1. Initial program 98.5%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 90.3%

      \[\leadsto \color{blue}{x} \]

    if -2.50000000000000012e-5 < x < -7.00000000000000006e-63 or -7.60000000000000026e-300 < x < 2.40000000000000008e-308 or 3.10000000000000004e-214 < x < 1e-27

    1. Initial program 92.6%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 56.2%

      \[\leadsto \color{blue}{x - \frac{1}{x}} \]
    4. Taylor expanded in x around 0 55.8%

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

    if -1.7e-186 < x < -7.60000000000000026e-300

    1. Initial program 91.7%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Step-by-step derivation
      1. remove-double-neg91.7%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. neg-sub091.7%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      3. associate-+l-91.7%

        \[\leadsto \color{blue}{0 - \left(\left(-x\right) - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      4. add091.7%

        \[\leadsto 0 - \left(\color{blue}{\left(\left(-x\right) + 0\right)} - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      5. associate--l+91.7%

        \[\leadsto 0 - \color{blue}{\left(\left(-x\right) + \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)\right)} \]
      6. associate--r+91.7%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right) - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      7. neg-sub091.7%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      8. remove-double-neg91.7%

        \[\leadsto \color{blue}{x} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      9. neg-sub091.7%

        \[\leadsto x - \color{blue}{\left(-\frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      10. distribute-neg-frac291.7%

        \[\leadsto x - \color{blue}{\frac{y}{-\left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      11. neg-sub091.7%

        \[\leadsto x - \frac{y}{\color{blue}{0 - \left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      12. associate--r-91.7%

        \[\leadsto x - \frac{y}{\color{blue}{\left(0 - 1.1283791670955126 \cdot e^{z}\right) + x \cdot y}} \]
      13. neg-sub092.0%

        \[\leadsto x - \frac{y}{\color{blue}{\left(-1.1283791670955126 \cdot e^{z}\right)} + x \cdot y} \]
      14. +-commutative92.0%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y + \left(-1.1283791670955126 \cdot e^{z}\right)}} \]
      15. sub-neg92.0%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y - 1.1283791670955126 \cdot e^{z}}} \]
      16. fma-neg92.0%

        \[\leadsto x - \frac{y}{\color{blue}{\mathsf{fma}\left(x, y, -1.1283791670955126 \cdot e^{z}\right)}} \]
      17. *-commutative92.0%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, -\color{blue}{e^{z} \cdot 1.1283791670955126}\right)} \]
      18. distribute-rgt-neg-in92.0%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, \color{blue}{e^{z} \cdot \left(-1.1283791670955126\right)}\right)} \]
      19. metadata-eval92.0%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot \color{blue}{-1.1283791670955126}\right)} \]
    3. Simplified92.0%

      \[\leadsto \color{blue}{x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 55.5%

      \[\leadsto x - \color{blue}{\frac{y}{x \cdot y - 1.1283791670955126}} \]
    6. Taylor expanded in x around 0 48.5%

      \[\leadsto \color{blue}{0.8862269254527579 \cdot y} \]

    if 2.40000000000000008e-308 < x < 3.10000000000000004e-214

    1. Initial program 91.5%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Step-by-step derivation
      1. remove-double-neg91.5%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. neg-sub091.5%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      3. associate-+l-91.5%

        \[\leadsto \color{blue}{0 - \left(\left(-x\right) - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      4. add091.5%

        \[\leadsto 0 - \left(\color{blue}{\left(\left(-x\right) + 0\right)} - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      5. associate--l+91.5%

        \[\leadsto 0 - \color{blue}{\left(\left(-x\right) + \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)\right)} \]
      6. associate--r+91.5%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right) - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      7. neg-sub091.5%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      8. remove-double-neg91.5%

        \[\leadsto \color{blue}{x} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      9. neg-sub091.5%

        \[\leadsto x - \color{blue}{\left(-\frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      10. distribute-neg-frac291.5%

        \[\leadsto x - \color{blue}{\frac{y}{-\left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      11. neg-sub090.8%

        \[\leadsto x - \frac{y}{\color{blue}{0 - \left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      12. associate--r-90.8%

        \[\leadsto x - \frac{y}{\color{blue}{\left(0 - 1.1283791670955126 \cdot e^{z}\right) + x \cdot y}} \]
      13. neg-sub091.5%

        \[\leadsto x - \frac{y}{\color{blue}{\left(-1.1283791670955126 \cdot e^{z}\right)} + x \cdot y} \]
      14. +-commutative91.5%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y + \left(-1.1283791670955126 \cdot e^{z}\right)}} \]
      15. sub-neg91.5%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y - 1.1283791670955126 \cdot e^{z}}} \]
      16. fma-neg91.5%

        \[\leadsto x - \frac{y}{\color{blue}{\mathsf{fma}\left(x, y, -1.1283791670955126 \cdot e^{z}\right)}} \]
      17. *-commutative91.5%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, -\color{blue}{e^{z} \cdot 1.1283791670955126}\right)} \]
      18. distribute-rgt-neg-in91.5%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, \color{blue}{e^{z} \cdot \left(-1.1283791670955126\right)}\right)} \]
      19. metadata-eval91.5%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot \color{blue}{-1.1283791670955126}\right)} \]
    3. Simplified91.5%

      \[\leadsto \color{blue}{x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 74.7%

      \[\leadsto x - \color{blue}{\frac{y}{x \cdot y - 1.1283791670955126}} \]
    6. Taylor expanded in x around 0 64.2%

      \[\leadsto \color{blue}{0.8862269254527579 \cdot y} \]
    7. Step-by-step derivation
      1. *-commutative64.2%

        \[\leadsto \color{blue}{y \cdot 0.8862269254527579} \]
      2. metadata-eval64.2%

        \[\leadsto y \cdot \color{blue}{\left(--0.8862269254527579\right)} \]
      3. distribute-rgt-neg-in64.2%

        \[\leadsto \color{blue}{-y \cdot -0.8862269254527579} \]
      4. metadata-eval64.6%

        \[\leadsto -y \cdot \color{blue}{\frac{1}{-1.1283791670955126}} \]
      5. div-inv64.7%

        \[\leadsto -\color{blue}{\frac{y}{-1.1283791670955126}} \]
      6. distribute-neg-frac264.7%

        \[\leadsto \color{blue}{\frac{y}{--1.1283791670955126}} \]
      7. metadata-eval64.7%

        \[\leadsto \frac{y}{\color{blue}{1.1283791670955126}} \]
    8. Applied egg-rr64.7%

      \[\leadsto \color{blue}{\frac{y}{1.1283791670955126}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification74.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{-5}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -7 \cdot 10^{-63}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{elif}\;x \leq -1.7 \cdot 10^{-186}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-300}:\\ \;\;\;\;y \cdot 0.8862269254527579\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-308}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{-214}:\\ \;\;\;\;\frac{y}{1.1283791670955126}\\ \mathbf{elif}\;x \leq 10^{-27}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 85.1% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \frac{-1}{x}\\ t_1 := x - \frac{y}{-1.1283791670955126}\\ \mathbf{if}\;z \leq -5 \cdot 10^{-10}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-203}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-246}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-135}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-32}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ x (/ -1.0 x))) (t_1 (- x (/ y -1.1283791670955126))))
   (if (<= z -5e-10)
     t_0
     (if (<= z -1.6e-203)
       t_1
       (if (<= z -9e-246)
         t_0
         (if (<= z 6e-135) t_1 (if (<= z 8e-32) t_0 x)))))))
double code(double x, double y, double z) {
	double t_0 = x + (-1.0 / x);
	double t_1 = x - (y / -1.1283791670955126);
	double tmp;
	if (z <= -5e-10) {
		tmp = t_0;
	} else if (z <= -1.6e-203) {
		tmp = t_1;
	} else if (z <= -9e-246) {
		tmp = t_0;
	} else if (z <= 6e-135) {
		tmp = t_1;
	} else if (z <= 8e-32) {
		tmp = t_0;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x + ((-1.0d0) / x)
    t_1 = x - (y / (-1.1283791670955126d0))
    if (z <= (-5d-10)) then
        tmp = t_0
    else if (z <= (-1.6d-203)) then
        tmp = t_1
    else if (z <= (-9d-246)) then
        tmp = t_0
    else if (z <= 6d-135) then
        tmp = t_1
    else if (z <= 8d-32) then
        tmp = t_0
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x + (-1.0 / x);
	double t_1 = x - (y / -1.1283791670955126);
	double tmp;
	if (z <= -5e-10) {
		tmp = t_0;
	} else if (z <= -1.6e-203) {
		tmp = t_1;
	} else if (z <= -9e-246) {
		tmp = t_0;
	} else if (z <= 6e-135) {
		tmp = t_1;
	} else if (z <= 8e-32) {
		tmp = t_0;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x + (-1.0 / x)
	t_1 = x - (y / -1.1283791670955126)
	tmp = 0
	if z <= -5e-10:
		tmp = t_0
	elif z <= -1.6e-203:
		tmp = t_1
	elif z <= -9e-246:
		tmp = t_0
	elif z <= 6e-135:
		tmp = t_1
	elif z <= 8e-32:
		tmp = t_0
	else:
		tmp = x
	return tmp
function code(x, y, z)
	t_0 = Float64(x + Float64(-1.0 / x))
	t_1 = Float64(x - Float64(y / -1.1283791670955126))
	tmp = 0.0
	if (z <= -5e-10)
		tmp = t_0;
	elseif (z <= -1.6e-203)
		tmp = t_1;
	elseif (z <= -9e-246)
		tmp = t_0;
	elseif (z <= 6e-135)
		tmp = t_1;
	elseif (z <= 8e-32)
		tmp = t_0;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x + (-1.0 / x);
	t_1 = x - (y / -1.1283791670955126);
	tmp = 0.0;
	if (z <= -5e-10)
		tmp = t_0;
	elseif (z <= -1.6e-203)
		tmp = t_1;
	elseif (z <= -9e-246)
		tmp = t_0;
	elseif (z <= 6e-135)
		tmp = t_1;
	elseif (z <= 8e-32)
		tmp = t_0;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x - N[(y / -1.1283791670955126), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e-10], t$95$0, If[LessEqual[z, -1.6e-203], t$95$1, If[LessEqual[z, -9e-246], t$95$0, If[LessEqual[z, 6e-135], t$95$1, If[LessEqual[z, 8e-32], t$95$0, x]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x + \frac{-1}{x}\\
t_1 := x - \frac{y}{-1.1283791670955126}\\
\mathbf{if}\;z \leq -5 \cdot 10^{-10}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -1.6 \cdot 10^{-203}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -9 \cdot 10^{-246}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 6 \cdot 10^{-135}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 8 \cdot 10^{-32}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.00000000000000031e-10 or -1.6e-203 < z < -8.99999999999999998e-246 or 6.00000000000000024e-135 < z < 8.00000000000000045e-32

    1. Initial program 89.8%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 93.7%

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

    if -5.00000000000000031e-10 < z < -1.6e-203 or -8.99999999999999998e-246 < z < 6.00000000000000024e-135

    1. Initial program 99.8%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Step-by-step derivation
      1. remove-double-neg99.8%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. neg-sub099.8%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      3. associate-+l-99.8%

        \[\leadsto \color{blue}{0 - \left(\left(-x\right) - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      4. add099.8%

        \[\leadsto 0 - \left(\color{blue}{\left(\left(-x\right) + 0\right)} - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      5. associate--l+99.8%

        \[\leadsto 0 - \color{blue}{\left(\left(-x\right) + \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)\right)} \]
      6. associate--r+99.8%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right) - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      7. neg-sub099.8%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      8. remove-double-neg99.8%

        \[\leadsto \color{blue}{x} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      9. neg-sub099.8%

        \[\leadsto x - \color{blue}{\left(-\frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      10. distribute-neg-frac299.8%

        \[\leadsto x - \color{blue}{\frac{y}{-\left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      11. neg-sub099.8%

        \[\leadsto x - \frac{y}{\color{blue}{0 - \left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      12. associate--r-99.8%

        \[\leadsto x - \frac{y}{\color{blue}{\left(0 - 1.1283791670955126 \cdot e^{z}\right) + x \cdot y}} \]
      13. neg-sub099.8%

        \[\leadsto x - \frac{y}{\color{blue}{\left(-1.1283791670955126 \cdot e^{z}\right)} + x \cdot y} \]
      14. +-commutative99.8%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y + \left(-1.1283791670955126 \cdot e^{z}\right)}} \]
      15. sub-neg99.8%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y - 1.1283791670955126 \cdot e^{z}}} \]
      16. fma-neg99.8%

        \[\leadsto x - \frac{y}{\color{blue}{\mathsf{fma}\left(x, y, -1.1283791670955126 \cdot e^{z}\right)}} \]
      17. *-commutative99.8%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, -\color{blue}{e^{z} \cdot 1.1283791670955126}\right)} \]
      18. distribute-rgt-neg-in99.8%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, \color{blue}{e^{z} \cdot \left(-1.1283791670955126\right)}\right)} \]
      19. metadata-eval99.8%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot \color{blue}{-1.1283791670955126}\right)} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.5%

      \[\leadsto x - \color{blue}{\frac{y}{x \cdot y - 1.1283791670955126}} \]
    6. Taylor expanded in x around 0 76.4%

      \[\leadsto x - \frac{y}{\color{blue}{-1.1283791670955126}} \]

    if 8.00000000000000045e-32 < z

    1. Initial program 97.2%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 94.5%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-10}:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-203}:\\ \;\;\;\;x - \frac{y}{-1.1283791670955126}\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-246}:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-135}:\\ \;\;\;\;x - \frac{y}{-1.1283791670955126}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-32}:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 85.1% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \frac{-1}{x}\\ \mathbf{if}\;z \leq -5.8 \cdot 10^{-12}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-203}:\\ \;\;\;\;x + \frac{y}{1.1283791670955126 + z \cdot 1.1283791670955126}\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{-246}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-134}:\\ \;\;\;\;x - \frac{y}{-1.1283791670955126}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-32}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ x (/ -1.0 x))))
   (if (<= z -5.8e-12)
     t_0
     (if (<= z -1.95e-203)
       (+ x (/ y (+ 1.1283791670955126 (* z 1.1283791670955126))))
       (if (<= z -3.7e-246)
         t_0
         (if (<= z 6.5e-134)
           (- x (/ y -1.1283791670955126))
           (if (<= z 8.8e-32) t_0 x)))))))
double code(double x, double y, double z) {
	double t_0 = x + (-1.0 / x);
	double tmp;
	if (z <= -5.8e-12) {
		tmp = t_0;
	} else if (z <= -1.95e-203) {
		tmp = x + (y / (1.1283791670955126 + (z * 1.1283791670955126)));
	} else if (z <= -3.7e-246) {
		tmp = t_0;
	} else if (z <= 6.5e-134) {
		tmp = x - (y / -1.1283791670955126);
	} else if (z <= 8.8e-32) {
		tmp = t_0;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x + ((-1.0d0) / x)
    if (z <= (-5.8d-12)) then
        tmp = t_0
    else if (z <= (-1.95d-203)) then
        tmp = x + (y / (1.1283791670955126d0 + (z * 1.1283791670955126d0)))
    else if (z <= (-3.7d-246)) then
        tmp = t_0
    else if (z <= 6.5d-134) then
        tmp = x - (y / (-1.1283791670955126d0))
    else if (z <= 8.8d-32) then
        tmp = t_0
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x + (-1.0 / x);
	double tmp;
	if (z <= -5.8e-12) {
		tmp = t_0;
	} else if (z <= -1.95e-203) {
		tmp = x + (y / (1.1283791670955126 + (z * 1.1283791670955126)));
	} else if (z <= -3.7e-246) {
		tmp = t_0;
	} else if (z <= 6.5e-134) {
		tmp = x - (y / -1.1283791670955126);
	} else if (z <= 8.8e-32) {
		tmp = t_0;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x + (-1.0 / x)
	tmp = 0
	if z <= -5.8e-12:
		tmp = t_0
	elif z <= -1.95e-203:
		tmp = x + (y / (1.1283791670955126 + (z * 1.1283791670955126)))
	elif z <= -3.7e-246:
		tmp = t_0
	elif z <= 6.5e-134:
		tmp = x - (y / -1.1283791670955126)
	elif z <= 8.8e-32:
		tmp = t_0
	else:
		tmp = x
	return tmp
function code(x, y, z)
	t_0 = Float64(x + Float64(-1.0 / x))
	tmp = 0.0
	if (z <= -5.8e-12)
		tmp = t_0;
	elseif (z <= -1.95e-203)
		tmp = Float64(x + Float64(y / Float64(1.1283791670955126 + Float64(z * 1.1283791670955126))));
	elseif (z <= -3.7e-246)
		tmp = t_0;
	elseif (z <= 6.5e-134)
		tmp = Float64(x - Float64(y / -1.1283791670955126));
	elseif (z <= 8.8e-32)
		tmp = t_0;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x + (-1.0 / x);
	tmp = 0.0;
	if (z <= -5.8e-12)
		tmp = t_0;
	elseif (z <= -1.95e-203)
		tmp = x + (y / (1.1283791670955126 + (z * 1.1283791670955126)));
	elseif (z <= -3.7e-246)
		tmp = t_0;
	elseif (z <= 6.5e-134)
		tmp = x - (y / -1.1283791670955126);
	elseif (z <= 8.8e-32)
		tmp = t_0;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.8e-12], t$95$0, If[LessEqual[z, -1.95e-203], N[(x + N[(y / N[(1.1283791670955126 + N[(z * 1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.7e-246], t$95$0, If[LessEqual[z, 6.5e-134], N[(x - N[(y / -1.1283791670955126), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e-32], t$95$0, x]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x + \frac{-1}{x}\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{-12}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -1.95 \cdot 10^{-203}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 + z \cdot 1.1283791670955126}\\

\mathbf{elif}\;z \leq -3.7 \cdot 10^{-246}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 6.5 \cdot 10^{-134}:\\
\;\;\;\;x - \frac{y}{-1.1283791670955126}\\

\mathbf{elif}\;z \leq 8.8 \cdot 10^{-32}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.8000000000000003e-12 or -1.95e-203 < z < -3.7e-246 or 6.4999999999999998e-134 < z < 8.7999999999999999e-32

    1. Initial program 89.8%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 93.7%

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

    if -5.8000000000000003e-12 < z < -1.95e-203

    1. Initial program 99.7%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 99.7%

      \[\leadsto x + \frac{y}{\color{blue}{\left(1.1283791670955126 + 1.1283791670955126 \cdot z\right)} - x \cdot y} \]
    4. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto x + \frac{y}{\left(1.1283791670955126 + \color{blue}{z \cdot 1.1283791670955126}\right) - x \cdot y} \]
    5. Simplified99.7%

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

      \[\leadsto x + \color{blue}{\frac{y}{1.1283791670955126 + 1.1283791670955126 \cdot z}} \]

    if -3.7e-246 < z < 6.4999999999999998e-134

    1. Initial program 99.9%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Step-by-step derivation
      1. remove-double-neg99.9%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. neg-sub099.9%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      3. associate-+l-99.9%

        \[\leadsto \color{blue}{0 - \left(\left(-x\right) - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      4. add099.9%

        \[\leadsto 0 - \left(\color{blue}{\left(\left(-x\right) + 0\right)} - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      5. associate--l+99.9%

        \[\leadsto 0 - \color{blue}{\left(\left(-x\right) + \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)\right)} \]
      6. associate--r+99.9%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right) - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      7. neg-sub099.9%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      8. remove-double-neg99.9%

        \[\leadsto \color{blue}{x} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      9. neg-sub099.9%

        \[\leadsto x - \color{blue}{\left(-\frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      10. distribute-neg-frac299.9%

        \[\leadsto x - \color{blue}{\frac{y}{-\left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      11. neg-sub099.9%

        \[\leadsto x - \frac{y}{\color{blue}{0 - \left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      12. associate--r-99.9%

        \[\leadsto x - \frac{y}{\color{blue}{\left(0 - 1.1283791670955126 \cdot e^{z}\right) + x \cdot y}} \]
      13. neg-sub099.9%

        \[\leadsto x - \frac{y}{\color{blue}{\left(-1.1283791670955126 \cdot e^{z}\right)} + x \cdot y} \]
      14. +-commutative99.9%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y + \left(-1.1283791670955126 \cdot e^{z}\right)}} \]
      15. sub-neg99.9%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y - 1.1283791670955126 \cdot e^{z}}} \]
      16. fma-neg99.9%

        \[\leadsto x - \frac{y}{\color{blue}{\mathsf{fma}\left(x, y, -1.1283791670955126 \cdot e^{z}\right)}} \]
      17. *-commutative99.9%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, -\color{blue}{e^{z} \cdot 1.1283791670955126}\right)} \]
      18. distribute-rgt-neg-in99.9%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, \color{blue}{e^{z} \cdot \left(-1.1283791670955126\right)}\right)} \]
      19. metadata-eval99.9%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot \color{blue}{-1.1283791670955126}\right)} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.9%

      \[\leadsto x - \color{blue}{\frac{y}{x \cdot y - 1.1283791670955126}} \]
    6. Taylor expanded in x around 0 73.7%

      \[\leadsto x - \frac{y}{\color{blue}{-1.1283791670955126}} \]

    if 8.7999999999999999e-32 < z

    1. Initial program 97.2%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 94.5%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification87.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{-12}:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-203}:\\ \;\;\;\;x + \frac{y}{1.1283791670955126 + z \cdot 1.1283791670955126}\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{-246}:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-134}:\\ \;\;\;\;x - \frac{y}{-1.1283791670955126}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-32}:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 85.2% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \frac{-1}{x}\\ \mathbf{if}\;z \leq -2.85 \cdot 10^{-7}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-204}:\\ \;\;\;\;x + -0.8862269254527579 \cdot \left(z \cdot y - y\right)\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-247}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{-133}:\\ \;\;\;\;x - \frac{y}{-1.1283791670955126}\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{-31}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ x (/ -1.0 x))))
   (if (<= z -2.85e-7)
     t_0
     (if (<= z -6e-204)
       (+ x (* -0.8862269254527579 (- (* z y) y)))
       (if (<= z -1.8e-247)
         t_0
         (if (<= z 2.4e-133)
           (- x (/ y -1.1283791670955126))
           (if (<= z 2.35e-31) t_0 x)))))))
double code(double x, double y, double z) {
	double t_0 = x + (-1.0 / x);
	double tmp;
	if (z <= -2.85e-7) {
		tmp = t_0;
	} else if (z <= -6e-204) {
		tmp = x + (-0.8862269254527579 * ((z * y) - y));
	} else if (z <= -1.8e-247) {
		tmp = t_0;
	} else if (z <= 2.4e-133) {
		tmp = x - (y / -1.1283791670955126);
	} else if (z <= 2.35e-31) {
		tmp = t_0;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x + ((-1.0d0) / x)
    if (z <= (-2.85d-7)) then
        tmp = t_0
    else if (z <= (-6d-204)) then
        tmp = x + ((-0.8862269254527579d0) * ((z * y) - y))
    else if (z <= (-1.8d-247)) then
        tmp = t_0
    else if (z <= 2.4d-133) then
        tmp = x - (y / (-1.1283791670955126d0))
    else if (z <= 2.35d-31) then
        tmp = t_0
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x + (-1.0 / x);
	double tmp;
	if (z <= -2.85e-7) {
		tmp = t_0;
	} else if (z <= -6e-204) {
		tmp = x + (-0.8862269254527579 * ((z * y) - y));
	} else if (z <= -1.8e-247) {
		tmp = t_0;
	} else if (z <= 2.4e-133) {
		tmp = x - (y / -1.1283791670955126);
	} else if (z <= 2.35e-31) {
		tmp = t_0;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x + (-1.0 / x)
	tmp = 0
	if z <= -2.85e-7:
		tmp = t_0
	elif z <= -6e-204:
		tmp = x + (-0.8862269254527579 * ((z * y) - y))
	elif z <= -1.8e-247:
		tmp = t_0
	elif z <= 2.4e-133:
		tmp = x - (y / -1.1283791670955126)
	elif z <= 2.35e-31:
		tmp = t_0
	else:
		tmp = x
	return tmp
function code(x, y, z)
	t_0 = Float64(x + Float64(-1.0 / x))
	tmp = 0.0
	if (z <= -2.85e-7)
		tmp = t_0;
	elseif (z <= -6e-204)
		tmp = Float64(x + Float64(-0.8862269254527579 * Float64(Float64(z * y) - y)));
	elseif (z <= -1.8e-247)
		tmp = t_0;
	elseif (z <= 2.4e-133)
		tmp = Float64(x - Float64(y / -1.1283791670955126));
	elseif (z <= 2.35e-31)
		tmp = t_0;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x + (-1.0 / x);
	tmp = 0.0;
	if (z <= -2.85e-7)
		tmp = t_0;
	elseif (z <= -6e-204)
		tmp = x + (-0.8862269254527579 * ((z * y) - y));
	elseif (z <= -1.8e-247)
		tmp = t_0;
	elseif (z <= 2.4e-133)
		tmp = x - (y / -1.1283791670955126);
	elseif (z <= 2.35e-31)
		tmp = t_0;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.85e-7], t$95$0, If[LessEqual[z, -6e-204], N[(x + N[(-0.8862269254527579 * N[(N[(z * y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.8e-247], t$95$0, If[LessEqual[z, 2.4e-133], N[(x - N[(y / -1.1283791670955126), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.35e-31], t$95$0, x]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x + \frac{-1}{x}\\
\mathbf{if}\;z \leq -2.85 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -6 \cdot 10^{-204}:\\
\;\;\;\;x + -0.8862269254527579 \cdot \left(z \cdot y - y\right)\\

\mathbf{elif}\;z \leq -1.8 \cdot 10^{-247}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 2.4 \cdot 10^{-133}:\\
\;\;\;\;x - \frac{y}{-1.1283791670955126}\\

\mathbf{elif}\;z \leq 2.35 \cdot 10^{-31}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.8500000000000002e-7 or -5.9999999999999997e-204 < z < -1.7999999999999998e-247 or 2.4e-133 < z < 2.34999999999999993e-31

    1. Initial program 89.8%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 93.7%

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

    if -2.8500000000000002e-7 < z < -5.9999999999999997e-204

    1. Initial program 99.7%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Step-by-step derivation
      1. remove-double-neg99.7%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. neg-sub099.7%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      3. associate-+l-99.7%

        \[\leadsto \color{blue}{0 - \left(\left(-x\right) - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      4. add099.7%

        \[\leadsto 0 - \left(\color{blue}{\left(\left(-x\right) + 0\right)} - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      5. associate--l+99.7%

        \[\leadsto 0 - \color{blue}{\left(\left(-x\right) + \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)\right)} \]
      6. associate--r+99.7%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right) - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      7. neg-sub099.7%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      8. remove-double-neg99.7%

        \[\leadsto \color{blue}{x} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      9. neg-sub099.7%

        \[\leadsto x - \color{blue}{\left(-\frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      10. distribute-neg-frac299.7%

        \[\leadsto x - \color{blue}{\frac{y}{-\left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      11. neg-sub099.7%

        \[\leadsto x - \frac{y}{\color{blue}{0 - \left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      12. associate--r-99.7%

        \[\leadsto x - \frac{y}{\color{blue}{\left(0 - 1.1283791670955126 \cdot e^{z}\right) + x \cdot y}} \]
      13. neg-sub099.7%

        \[\leadsto x - \frac{y}{\color{blue}{\left(-1.1283791670955126 \cdot e^{z}\right)} + x \cdot y} \]
      14. +-commutative99.7%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y + \left(-1.1283791670955126 \cdot e^{z}\right)}} \]
      15. sub-neg99.7%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y - 1.1283791670955126 \cdot e^{z}}} \]
      16. fma-neg99.7%

        \[\leadsto x - \frac{y}{\color{blue}{\mathsf{fma}\left(x, y, -1.1283791670955126 \cdot e^{z}\right)}} \]
      17. *-commutative99.7%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, -\color{blue}{e^{z} \cdot 1.1283791670955126}\right)} \]
      18. distribute-rgt-neg-in99.7%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, \color{blue}{e^{z} \cdot \left(-1.1283791670955126\right)}\right)} \]
      19. metadata-eval99.7%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot \color{blue}{-1.1283791670955126}\right)} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 81.4%

      \[\leadsto x - \color{blue}{-0.8862269254527579 \cdot \frac{y}{e^{z}}} \]
    6. Step-by-step derivation
      1. *-commutative81.4%

        \[\leadsto x - \color{blue}{\frac{y}{e^{z}} \cdot -0.8862269254527579} \]
    7. Simplified81.4%

      \[\leadsto x - \color{blue}{\frac{y}{e^{z}} \cdot -0.8862269254527579} \]
    8. Taylor expanded in z around 0 81.4%

      \[\leadsto x - \color{blue}{\left(y + -1 \cdot \left(y \cdot z\right)\right)} \cdot -0.8862269254527579 \]
    9. Step-by-step derivation
      1. mul-1-neg81.4%

        \[\leadsto x - \left(y + \color{blue}{\left(-y \cdot z\right)}\right) \cdot -0.8862269254527579 \]
      2. unsub-neg81.4%

        \[\leadsto x - \color{blue}{\left(y - y \cdot z\right)} \cdot -0.8862269254527579 \]
    10. Simplified81.4%

      \[\leadsto x - \color{blue}{\left(y - y \cdot z\right)} \cdot -0.8862269254527579 \]

    if -1.7999999999999998e-247 < z < 2.4e-133

    1. Initial program 99.9%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Step-by-step derivation
      1. remove-double-neg99.9%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. neg-sub099.9%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      3. associate-+l-99.9%

        \[\leadsto \color{blue}{0 - \left(\left(-x\right) - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      4. add099.9%

        \[\leadsto 0 - \left(\color{blue}{\left(\left(-x\right) + 0\right)} - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      5. associate--l+99.9%

        \[\leadsto 0 - \color{blue}{\left(\left(-x\right) + \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)\right)} \]
      6. associate--r+99.9%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right) - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      7. neg-sub099.9%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      8. remove-double-neg99.9%

        \[\leadsto \color{blue}{x} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      9. neg-sub099.9%

        \[\leadsto x - \color{blue}{\left(-\frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      10. distribute-neg-frac299.9%

        \[\leadsto x - \color{blue}{\frac{y}{-\left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      11. neg-sub099.9%

        \[\leadsto x - \frac{y}{\color{blue}{0 - \left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      12. associate--r-99.9%

        \[\leadsto x - \frac{y}{\color{blue}{\left(0 - 1.1283791670955126 \cdot e^{z}\right) + x \cdot y}} \]
      13. neg-sub099.9%

        \[\leadsto x - \frac{y}{\color{blue}{\left(-1.1283791670955126 \cdot e^{z}\right)} + x \cdot y} \]
      14. +-commutative99.9%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y + \left(-1.1283791670955126 \cdot e^{z}\right)}} \]
      15. sub-neg99.9%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y - 1.1283791670955126 \cdot e^{z}}} \]
      16. fma-neg99.9%

        \[\leadsto x - \frac{y}{\color{blue}{\mathsf{fma}\left(x, y, -1.1283791670955126 \cdot e^{z}\right)}} \]
      17. *-commutative99.9%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, -\color{blue}{e^{z} \cdot 1.1283791670955126}\right)} \]
      18. distribute-rgt-neg-in99.9%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, \color{blue}{e^{z} \cdot \left(-1.1283791670955126\right)}\right)} \]
      19. metadata-eval99.9%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot \color{blue}{-1.1283791670955126}\right)} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.9%

      \[\leadsto x - \color{blue}{\frac{y}{x \cdot y - 1.1283791670955126}} \]
    6. Taylor expanded in x around 0 73.7%

      \[\leadsto x - \frac{y}{\color{blue}{-1.1283791670955126}} \]

    if 2.34999999999999993e-31 < z

    1. Initial program 97.2%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 94.5%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification87.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.85 \cdot 10^{-7}:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-204}:\\ \;\;\;\;x + -0.8862269254527579 \cdot \left(z \cdot y - y\right)\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-247}:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{-133}:\\ \;\;\;\;x - \frac{y}{-1.1283791670955126}\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{-31}:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 80.2% accurate, 5.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \frac{-1}{x}\\ \mathbf{if}\;z \leq 6.2 \cdot 10^{-279}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-256}:\\ \;\;\;\;y \cdot 0.8862269254527579\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-30}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ x (/ -1.0 x))))
   (if (<= z 6.2e-279)
     t_0
     (if (<= z 3e-256) (* y 0.8862269254527579) (if (<= z 2.75e-30) t_0 x)))))
double code(double x, double y, double z) {
	double t_0 = x + (-1.0 / x);
	double tmp;
	if (z <= 6.2e-279) {
		tmp = t_0;
	} else if (z <= 3e-256) {
		tmp = y * 0.8862269254527579;
	} else if (z <= 2.75e-30) {
		tmp = t_0;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x + ((-1.0d0) / x)
    if (z <= 6.2d-279) then
        tmp = t_0
    else if (z <= 3d-256) then
        tmp = y * 0.8862269254527579d0
    else if (z <= 2.75d-30) then
        tmp = t_0
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x + (-1.0 / x);
	double tmp;
	if (z <= 6.2e-279) {
		tmp = t_0;
	} else if (z <= 3e-256) {
		tmp = y * 0.8862269254527579;
	} else if (z <= 2.75e-30) {
		tmp = t_0;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x + (-1.0 / x)
	tmp = 0
	if z <= 6.2e-279:
		tmp = t_0
	elif z <= 3e-256:
		tmp = y * 0.8862269254527579
	elif z <= 2.75e-30:
		tmp = t_0
	else:
		tmp = x
	return tmp
function code(x, y, z)
	t_0 = Float64(x + Float64(-1.0 / x))
	tmp = 0.0
	if (z <= 6.2e-279)
		tmp = t_0;
	elseif (z <= 3e-256)
		tmp = Float64(y * 0.8862269254527579);
	elseif (z <= 2.75e-30)
		tmp = t_0;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x + (-1.0 / x);
	tmp = 0.0;
	if (z <= 6.2e-279)
		tmp = t_0;
	elseif (z <= 3e-256)
		tmp = y * 0.8862269254527579;
	elseif (z <= 2.75e-30)
		tmp = t_0;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 6.2e-279], t$95$0, If[LessEqual[z, 3e-256], N[(y * 0.8862269254527579), $MachinePrecision], If[LessEqual[z, 2.75e-30], t$95$0, x]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x + \frac{-1}{x}\\
\mathbf{if}\;z \leq 6.2 \cdot 10^{-279}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 3 \cdot 10^{-256}:\\
\;\;\;\;y \cdot 0.8862269254527579\\

\mathbf{elif}\;z \leq 2.75 \cdot 10^{-30}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < 6.1999999999999998e-279 or 2.9999999999999998e-256 < z < 2.74999999999999988e-30

    1. Initial program 94.8%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 73.5%

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

    if 6.1999999999999998e-279 < z < 2.9999999999999998e-256

    1. Initial program 99.7%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Step-by-step derivation
      1. remove-double-neg99.7%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. neg-sub099.7%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      3. associate-+l-99.7%

        \[\leadsto \color{blue}{0 - \left(\left(-x\right) - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      4. add099.7%

        \[\leadsto 0 - \left(\color{blue}{\left(\left(-x\right) + 0\right)} - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      5. associate--l+99.7%

        \[\leadsto 0 - \color{blue}{\left(\left(-x\right) + \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)\right)} \]
      6. associate--r+99.7%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right) - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      7. neg-sub099.7%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      8. remove-double-neg99.7%

        \[\leadsto \color{blue}{x} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      9. neg-sub099.7%

        \[\leadsto x - \color{blue}{\left(-\frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      10. distribute-neg-frac299.7%

        \[\leadsto x - \color{blue}{\frac{y}{-\left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      11. neg-sub099.7%

        \[\leadsto x - \frac{y}{\color{blue}{0 - \left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      12. associate--r-99.7%

        \[\leadsto x - \frac{y}{\color{blue}{\left(0 - 1.1283791670955126 \cdot e^{z}\right) + x \cdot y}} \]
      13. neg-sub099.7%

        \[\leadsto x - \frac{y}{\color{blue}{\left(-1.1283791670955126 \cdot e^{z}\right)} + x \cdot y} \]
      14. +-commutative99.7%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y + \left(-1.1283791670955126 \cdot e^{z}\right)}} \]
      15. sub-neg99.7%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y - 1.1283791670955126 \cdot e^{z}}} \]
      16. fma-neg99.7%

        \[\leadsto x - \frac{y}{\color{blue}{\mathsf{fma}\left(x, y, -1.1283791670955126 \cdot e^{z}\right)}} \]
      17. *-commutative99.7%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, -\color{blue}{e^{z} \cdot 1.1283791670955126}\right)} \]
      18. distribute-rgt-neg-in99.7%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, \color{blue}{e^{z} \cdot \left(-1.1283791670955126\right)}\right)} \]
      19. metadata-eval99.7%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot \color{blue}{-1.1283791670955126}\right)} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.7%

      \[\leadsto x - \color{blue}{\frac{y}{x \cdot y - 1.1283791670955126}} \]
    6. Taylor expanded in x around 0 99.7%

      \[\leadsto \color{blue}{0.8862269254527579 \cdot y} \]

    if 2.74999999999999988e-30 < z

    1. Initial program 97.2%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 94.5%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification79.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 6.2 \cdot 10^{-279}:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-256}:\\ \;\;\;\;y \cdot 0.8862269254527579\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-30}:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 99.6% accurate, 5.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -150:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 215:\\ \;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -150.0)
   (+ x (/ -1.0 x))
   (if (<= z 215.0) (+ x (/ y (- 1.1283791670955126 (* x y)))) x)))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -150.0) {
		tmp = x + (-1.0 / x);
	} else if (z <= 215.0) {
		tmp = x + (y / (1.1283791670955126 - (x * y)));
	} else {
		tmp = x;
	}
	return tmp;
}
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 (z <= (-150.0d0)) then
        tmp = x + ((-1.0d0) / x)
    else if (z <= 215.0d0) then
        tmp = x + (y / (1.1283791670955126d0 - (x * y)))
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -150.0) {
		tmp = x + (-1.0 / x);
	} else if (z <= 215.0) {
		tmp = x + (y / (1.1283791670955126 - (x * y)));
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -150.0:
		tmp = x + (-1.0 / x)
	elif z <= 215.0:
		tmp = x + (y / (1.1283791670955126 - (x * y)))
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -150.0)
		tmp = Float64(x + Float64(-1.0 / x));
	elseif (z <= 215.0)
		tmp = Float64(x + Float64(y / Float64(1.1283791670955126 - Float64(x * y))));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -150.0)
		tmp = x + (-1.0 / x);
	elseif (z <= 215.0)
		tmp = x + (y / (1.1283791670955126 - (x * y)));
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -150.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 215.0], N[(x + N[(y / N[(1.1283791670955126 - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -150:\\
\;\;\;\;x + \frac{-1}{x}\\

\mathbf{elif}\;z \leq 215:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -150

    1. Initial program 83.9%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 100.0%

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

    if -150 < z < 215

    1. Initial program 99.8%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Step-by-step derivation
      1. remove-double-neg99.8%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. neg-sub099.8%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      3. associate-+l-99.8%

        \[\leadsto \color{blue}{0 - \left(\left(-x\right) - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      4. add099.8%

        \[\leadsto 0 - \left(\color{blue}{\left(\left(-x\right) + 0\right)} - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      5. associate--l+99.8%

        \[\leadsto 0 - \color{blue}{\left(\left(-x\right) + \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)\right)} \]
      6. associate--r+99.8%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right) - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      7. neg-sub099.8%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      8. remove-double-neg99.8%

        \[\leadsto \color{blue}{x} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      9. neg-sub099.8%

        \[\leadsto x - \color{blue}{\left(-\frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      10. distribute-neg-frac299.8%

        \[\leadsto x - \color{blue}{\frac{y}{-\left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      11. neg-sub099.8%

        \[\leadsto x - \frac{y}{\color{blue}{0 - \left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      12. associate--r-99.8%

        \[\leadsto x - \frac{y}{\color{blue}{\left(0 - 1.1283791670955126 \cdot e^{z}\right) + x \cdot y}} \]
      13. neg-sub099.8%

        \[\leadsto x - \frac{y}{\color{blue}{\left(-1.1283791670955126 \cdot e^{z}\right)} + x \cdot y} \]
      14. +-commutative99.8%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y + \left(-1.1283791670955126 \cdot e^{z}\right)}} \]
      15. sub-neg99.8%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y - 1.1283791670955126 \cdot e^{z}}} \]
      16. fma-neg99.8%

        \[\leadsto x - \frac{y}{\color{blue}{\mathsf{fma}\left(x, y, -1.1283791670955126 \cdot e^{z}\right)}} \]
      17. *-commutative99.8%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, -\color{blue}{e^{z} \cdot 1.1283791670955126}\right)} \]
      18. distribute-rgt-neg-in99.8%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, \color{blue}{e^{z} \cdot \left(-1.1283791670955126\right)}\right)} \]
      19. metadata-eval99.8%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot \color{blue}{-1.1283791670955126}\right)} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 98.2%

      \[\leadsto x - \color{blue}{\frac{y}{x \cdot y - 1.1283791670955126}} \]

    if 215 < z

    1. Initial program 96.7%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 100.0%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -150:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 215:\\ \;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 70.9% accurate, 8.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.6 \cdot 10^{-187}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.45 \cdot 10^{-213}:\\ \;\;\;\;y \cdot 0.8862269254527579\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -4.6e-187) x (if (<= x 2.45e-213) (* y 0.8862269254527579) x)))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -4.6e-187) {
		tmp = x;
	} else if (x <= 2.45e-213) {
		tmp = y * 0.8862269254527579;
	} else {
		tmp = x;
	}
	return tmp;
}
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 (x <= (-4.6d-187)) then
        tmp = x
    else if (x <= 2.45d-213) then
        tmp = y * 0.8862269254527579d0
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -4.6e-187) {
		tmp = x;
	} else if (x <= 2.45e-213) {
		tmp = y * 0.8862269254527579;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -4.6e-187:
		tmp = x
	elif x <= 2.45e-213:
		tmp = y * 0.8862269254527579
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -4.6e-187)
		tmp = x;
	elseif (x <= 2.45e-213)
		tmp = Float64(y * 0.8862269254527579);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -4.6e-187)
		tmp = x;
	elseif (x <= 2.45e-213)
		tmp = y * 0.8862269254527579;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -4.6e-187], x, If[LessEqual[x, 2.45e-213], N[(y * 0.8862269254527579), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{-187}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 2.45 \cdot 10^{-213}:\\
\;\;\;\;y \cdot 0.8862269254527579\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.59999999999999996e-187 or 2.4499999999999999e-213 < x

    1. Initial program 97.6%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 71.8%

      \[\leadsto \color{blue}{x} \]

    if -4.59999999999999996e-187 < x < 2.4499999999999999e-213

    1. Initial program 88.2%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Step-by-step derivation
      1. remove-double-neg88.2%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. neg-sub088.2%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right)} + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      3. associate-+l-88.2%

        \[\leadsto \color{blue}{0 - \left(\left(-x\right) - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      4. add088.2%

        \[\leadsto 0 - \left(\color{blue}{\left(\left(-x\right) + 0\right)} - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      5. associate--l+88.2%

        \[\leadsto 0 - \color{blue}{\left(\left(-x\right) + \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)\right)} \]
      6. associate--r+88.2%

        \[\leadsto \color{blue}{\left(0 - \left(-x\right)\right) - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      7. neg-sub088.2%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right)} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      8. remove-double-neg88.2%

        \[\leadsto \color{blue}{x} - \left(0 - \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right) \]
      9. neg-sub088.2%

        \[\leadsto x - \color{blue}{\left(-\frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\right)} \]
      10. distribute-neg-frac288.2%

        \[\leadsto x - \color{blue}{\frac{y}{-\left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      11. neg-sub087.5%

        \[\leadsto x - \frac{y}{\color{blue}{0 - \left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}} \]
      12. associate--r-87.5%

        \[\leadsto x - \frac{y}{\color{blue}{\left(0 - 1.1283791670955126 \cdot e^{z}\right) + x \cdot y}} \]
      13. neg-sub088.5%

        \[\leadsto x - \frac{y}{\color{blue}{\left(-1.1283791670955126 \cdot e^{z}\right)} + x \cdot y} \]
      14. +-commutative88.5%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y + \left(-1.1283791670955126 \cdot e^{z}\right)}} \]
      15. sub-neg88.5%

        \[\leadsto x - \frac{y}{\color{blue}{x \cdot y - 1.1283791670955126 \cdot e^{z}}} \]
      16. fma-neg88.5%

        \[\leadsto x - \frac{y}{\color{blue}{\mathsf{fma}\left(x, y, -1.1283791670955126 \cdot e^{z}\right)}} \]
      17. *-commutative88.5%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, -\color{blue}{e^{z} \cdot 1.1283791670955126}\right)} \]
      18. distribute-rgt-neg-in88.5%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, \color{blue}{e^{z} \cdot \left(-1.1283791670955126\right)}\right)} \]
      19. metadata-eval88.5%

        \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot \color{blue}{-1.1283791670955126}\right)} \]
    3. Simplified88.5%

      \[\leadsto \color{blue}{x - \frac{y}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 58.0%

      \[\leadsto x - \color{blue}{\frac{y}{x \cdot y - 1.1283791670955126}} \]
    6. Taylor expanded in x around 0 49.1%

      \[\leadsto \color{blue}{0.8862269254527579 \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.6 \cdot 10^{-187}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.45 \cdot 10^{-213}:\\ \;\;\;\;y \cdot 0.8862269254527579\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 68.4% accurate, 111.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
	return x;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x
end function
public static double code(double x, double y, double z) {
	return x;
}
def code(x, y, z):
	return x
function code(x, y, z)
	return x
end
function tmp = code(x, y, z)
	tmp = x;
end
code[x_, y_, z_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 95.5%

    \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 60.4%

    \[\leadsto \color{blue}{x} \]
  4. Final simplification60.4%

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{1}{\frac{1.1283791670955126}{y} \cdot e^{z} - x} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x))))
double code(double x, double y, double z) {
	return x + (1.0 / (((1.1283791670955126 / y) * exp(z)) - x));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x + (1.0d0 / (((1.1283791670955126d0 / y) * exp(z)) - x))
end function
public static double code(double x, double y, double z) {
	return x + (1.0 / (((1.1283791670955126 / y) * Math.exp(z)) - x));
}
def code(x, y, z):
	return x + (1.0 / (((1.1283791670955126 / y) * math.exp(z)) - x))
function code(x, y, z)
	return Float64(x + Float64(1.0 / Float64(Float64(Float64(1.1283791670955126 / y) * exp(z)) - x)))
end
function tmp = code(x, y, z)
	tmp = x + (1.0 / (((1.1283791670955126 / y) * exp(z)) - x));
end
code[x_, y_, z_] := N[(x + N[(1.0 / N[(N[(N[(1.1283791670955126 / y), $MachinePrecision] * N[Exp[z], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{1}{\frac{1.1283791670955126}{y} \cdot e^{z} - x}
\end{array}

Reproduce

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

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

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