Statistics.Distribution.Poisson.Internal:probability from math-functions-0.1.5.2

Percentage Accurate: 100.0% → 100.0%
Time: 8.3s
Alternatives: 15
Speedup: 1.0×

Specification

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

\\
e^{\left(x + y \cdot \log y\right) - z}
\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 15 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: 100.0% accurate, 1.0× speedup?

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

\\
e^{\left(x + y \cdot \log y\right) - z}
\end{array}

Alternative 1: 100.0% accurate, 1.0× speedup?

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

\\
e^{\left(x + y \cdot \log y\right) - z}
\end{array}
Derivation
  1. Initial program 100.0%

    \[e^{\left(x + y \cdot \log y\right) - z} \]
  2. Add Preprocessing
  3. Final simplification100.0%

    \[\leadsto e^{\left(x + y \cdot \log y\right) - z} \]
  4. Add Preprocessing

Alternative 2: 89.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \log y\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{-305} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+27}\right) \land t\_0 \leq 2 \cdot 10^{+51}:\\ \;\;\;\;e^{x - z}\\ \mathbf{else}:\\ \;\;\;\;e^{t\_0}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (log y))))
   (if (or (<= t_0 -5e-305) (and (not (<= t_0 2e+27)) (<= t_0 2e+51)))
     (exp (- x z))
     (exp t_0))))
double code(double x, double y, double z) {
	double t_0 = y * log(y);
	double tmp;
	if ((t_0 <= -5e-305) || (!(t_0 <= 2e+27) && (t_0 <= 2e+51))) {
		tmp = exp((x - z));
	} else {
		tmp = exp(t_0);
	}
	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 = y * log(y)
    if ((t_0 <= (-5d-305)) .or. (.not. (t_0 <= 2d+27)) .and. (t_0 <= 2d+51)) then
        tmp = exp((x - z))
    else
        tmp = exp(t_0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * Math.log(y);
	double tmp;
	if ((t_0 <= -5e-305) || (!(t_0 <= 2e+27) && (t_0 <= 2e+51))) {
		tmp = Math.exp((x - z));
	} else {
		tmp = Math.exp(t_0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * math.log(y)
	tmp = 0
	if (t_0 <= -5e-305) or (not (t_0 <= 2e+27) and (t_0 <= 2e+51)):
		tmp = math.exp((x - z))
	else:
		tmp = math.exp(t_0)
	return tmp
function code(x, y, z)
	t_0 = Float64(y * log(y))
	tmp = 0.0
	if ((t_0 <= -5e-305) || (!(t_0 <= 2e+27) && (t_0 <= 2e+51)))
		tmp = exp(Float64(x - z));
	else
		tmp = exp(t_0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * log(y);
	tmp = 0.0;
	if ((t_0 <= -5e-305) || (~((t_0 <= 2e+27)) && (t_0 <= 2e+51)))
		tmp = exp((x - z));
	else
		tmp = exp(t_0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -5e-305], And[N[Not[LessEqual[t$95$0, 2e+27]], $MachinePrecision], LessEqual[t$95$0, 2e+51]]], N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision], N[Exp[t$95$0], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \log y\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-305} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+27}\right) \land t\_0 \leq 2 \cdot 10^{+51}:\\
\;\;\;\;e^{x - z}\\

\mathbf{else}:\\
\;\;\;\;e^{t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y (log.f64 y)) < -4.99999999999999985e-305 or 2e27 < (*.f64 y (log.f64 y)) < 2e51

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 99.9%

      \[\leadsto e^{\color{blue}{x} - z} \]

    if -4.99999999999999985e-305 < (*.f64 y (log.f64 y)) < 2e27 or 2e51 < (*.f64 y (log.f64 y))

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 92.4%

      \[\leadsto e^{\color{blue}{y \cdot \log y - z}} \]
    4. Taylor expanded in y around inf 85.6%

      \[\leadsto e^{\color{blue}{-1 \cdot \left(y \cdot \log \left(\frac{1}{y}\right)\right)}} \]
    5. Step-by-step derivation
      1. mul-1-neg85.6%

        \[\leadsto e^{\color{blue}{-y \cdot \log \left(\frac{1}{y}\right)}} \]
      2. distribute-rgt-neg-in85.6%

        \[\leadsto e^{\color{blue}{y \cdot \left(-\log \left(\frac{1}{y}\right)\right)}} \]
      3. log-rec85.6%

        \[\leadsto e^{y \cdot \left(-\color{blue}{\left(-\log y\right)}\right)} \]
      4. remove-double-neg85.6%

        \[\leadsto e^{y \cdot \color{blue}{\log y}} \]
    6. Simplified85.6%

      \[\leadsto e^{\color{blue}{y \cdot \log y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \log y \leq -5 \cdot 10^{-305} \lor \neg \left(y \cdot \log y \leq 2 \cdot 10^{+27}\right) \land y \cdot \log y \leq 2 \cdot 10^{+51}:\\ \;\;\;\;e^{x - z}\\ \mathbf{else}:\\ \;\;\;\;e^{y \cdot \log y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 94.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \log y\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{-286}:\\ \;\;\;\;\frac{{y}^{y}}{e^{z - x}}\\ \mathbf{else}:\\ \;\;\;\;e^{t\_0 - z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (log y))))
   (if (<= t_0 -5e-286) (/ (pow y y) (exp (- z x))) (exp (- t_0 z)))))
double code(double x, double y, double z) {
	double t_0 = y * log(y);
	double tmp;
	if (t_0 <= -5e-286) {
		tmp = pow(y, y) / exp((z - x));
	} else {
		tmp = exp((t_0 - z));
	}
	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 = y * log(y)
    if (t_0 <= (-5d-286)) then
        tmp = (y ** y) / exp((z - x))
    else
        tmp = exp((t_0 - z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * Math.log(y);
	double tmp;
	if (t_0 <= -5e-286) {
		tmp = Math.pow(y, y) / Math.exp((z - x));
	} else {
		tmp = Math.exp((t_0 - z));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * math.log(y)
	tmp = 0
	if t_0 <= -5e-286:
		tmp = math.pow(y, y) / math.exp((z - x))
	else:
		tmp = math.exp((t_0 - z))
	return tmp
function code(x, y, z)
	t_0 = Float64(y * log(y))
	tmp = 0.0
	if (t_0 <= -5e-286)
		tmp = Float64((y ^ y) / exp(Float64(z - x)));
	else
		tmp = exp(Float64(t_0 - z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * log(y);
	tmp = 0.0;
	if (t_0 <= -5e-286)
		tmp = (y ^ y) / exp((z - x));
	else
		tmp = exp((t_0 - z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-286], N[(N[Power[y, y], $MachinePrecision] / N[Exp[N[(z - x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[N[(t$95$0 - z), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \log y\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-286}:\\
\;\;\;\;\frac{{y}^{y}}{e^{z - x}}\\

\mathbf{else}:\\
\;\;\;\;e^{t\_0 - z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y (log.f64 y)) < -5.00000000000000037e-286

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum87.2%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff87.2%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/87.2%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative87.2%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow87.2%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp100.0%

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

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing

    if -5.00000000000000037e-286 < (*.f64 y (log.f64 y))

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 91.0%

      \[\leadsto e^{\color{blue}{y \cdot \log y - z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.4%

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

Alternative 4: 93.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \log y\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{-286}:\\ \;\;\;\;e^{x - z}\\ \mathbf{else}:\\ \;\;\;\;e^{t\_0 - z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (log y))))
   (if (<= t_0 -5e-286) (exp (- x z)) (exp (- t_0 z)))))
double code(double x, double y, double z) {
	double t_0 = y * log(y);
	double tmp;
	if (t_0 <= -5e-286) {
		tmp = exp((x - z));
	} else {
		tmp = exp((t_0 - z));
	}
	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 = y * log(y)
    if (t_0 <= (-5d-286)) then
        tmp = exp((x - z))
    else
        tmp = exp((t_0 - z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y * Math.log(y);
	double tmp;
	if (t_0 <= -5e-286) {
		tmp = Math.exp((x - z));
	} else {
		tmp = Math.exp((t_0 - z));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * math.log(y)
	tmp = 0
	if t_0 <= -5e-286:
		tmp = math.exp((x - z))
	else:
		tmp = math.exp((t_0 - z))
	return tmp
function code(x, y, z)
	t_0 = Float64(y * log(y))
	tmp = 0.0
	if (t_0 <= -5e-286)
		tmp = exp(Float64(x - z));
	else
		tmp = exp(Float64(t_0 - z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * log(y);
	tmp = 0.0;
	if (t_0 <= -5e-286)
		tmp = exp((x - z));
	else
		tmp = exp((t_0 - z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-286], N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision], N[Exp[N[(t$95$0 - z), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \log y\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-286}:\\
\;\;\;\;e^{x - z}\\

\mathbf{else}:\\
\;\;\;\;e^{t\_0 - z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y (log.f64 y)) < -5.00000000000000037e-286

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 99.9%

      \[\leadsto e^{\color{blue}{x} - z} \]

    if -5.00000000000000037e-286 < (*.f64 y (log.f64 y))

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 91.0%

      \[\leadsto e^{\color{blue}{y \cdot \log y - z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \log y \leq -5 \cdot 10^{-286}:\\ \;\;\;\;e^{x - z}\\ \mathbf{else}:\\ \;\;\;\;e^{y \cdot \log y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.0% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.9 \cdot 10^{-8} \lor \neg \left(x \leq 5.1 \cdot 10^{-14}\right):\\ \;\;\;\;e^{x}\\ \mathbf{else}:\\ \;\;\;\;e^{-z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -1.9e-8) (not (<= x 5.1e-14))) (exp x) (exp (- z))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.9e-8) || !(x <= 5.1e-14)) {
		tmp = exp(x);
	} else {
		tmp = exp(-z);
	}
	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.9d-8)) .or. (.not. (x <= 5.1d-14))) then
        tmp = exp(x)
    else
        tmp = exp(-z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.9e-8) || !(x <= 5.1e-14)) {
		tmp = Math.exp(x);
	} else {
		tmp = Math.exp(-z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -1.9e-8) or not (x <= 5.1e-14):
		tmp = math.exp(x)
	else:
		tmp = math.exp(-z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -1.9e-8) || !(x <= 5.1e-14))
		tmp = exp(x);
	else
		tmp = exp(Float64(-z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((x <= -1.9e-8) || ~((x <= 5.1e-14)))
		tmp = exp(x);
	else
		tmp = exp(-z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.9e-8], N[Not[LessEqual[x, 5.1e-14]], $MachinePrecision]], N[Exp[x], $MachinePrecision], N[Exp[(-z)], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{-8} \lor \neg \left(x \leq 5.1 \cdot 10^{-14}\right):\\
\;\;\;\;e^{x}\\

\mathbf{else}:\\
\;\;\;\;e^{-z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.90000000000000014e-8 or 5.0999999999999997e-14 < x

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum64.6%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff58.5%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/58.5%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative58.5%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow58.5%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp76.2%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified76.2%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 84.9%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in z around 0 76.6%

      \[\leadsto \color{blue}{\frac{1}{e^{-x}}} \]
    7. Step-by-step derivation
      1. exp-neg76.6%

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{e^{x}}}} \]
      2. remove-double-div76.6%

        \[\leadsto \color{blue}{e^{x}} \]
    8. Simplified76.6%

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

    if -1.90000000000000014e-8 < x < 5.0999999999999997e-14

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 61.4%

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. neg-mul-161.4%

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified61.4%

      \[\leadsto e^{\color{blue}{-z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification69.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.9 \cdot 10^{-8} \lor \neg \left(x \leq 5.1 \cdot 10^{-14}\right):\\ \;\;\;\;e^{x}\\ \mathbf{else}:\\ \;\;\;\;e^{-z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 68.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+154}:\\
\;\;\;\;1 + z \cdot \left(z \cdot 0.5 + -1\right)\\

\mathbf{elif}\;z \leq 125000000:\\
\;\;\;\;e^{x}\\

\mathbf{else}:\\
\;\;\;\;0\\


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

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum79.3%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff79.3%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/79.3%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative79.3%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow79.3%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp100.0%

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

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 100.0%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in x around 0 100.0%

      \[\leadsto \color{blue}{\frac{1}{e^{z}}} \]
    7. Taylor expanded in z around 0 100.0%

      \[\leadsto \color{blue}{1 + z \cdot \left(0.5 \cdot z - 1\right)} \]

    if -1.8999999999999999e154 < z < 1.25e8

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum82.8%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff82.8%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/82.8%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative82.8%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow82.8%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp88.7%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified88.7%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 67.8%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in z around 0 59.4%

      \[\leadsto \color{blue}{\frac{1}{e^{-x}}} \]
    7. Step-by-step derivation
      1. exp-neg59.4%

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{e^{x}}}} \]
      2. remove-double-div59.4%

        \[\leadsto \color{blue}{e^{x}} \]
    8. Simplified59.4%

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

    if 1.25e8 < z

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum81.0%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff37.9%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/37.9%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative37.9%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow37.9%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp50.0%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified50.0%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 76.2%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in z around 0 36.4%

      \[\leadsto \color{blue}{\frac{1}{e^{-x}}} \]
    7. Applied egg-rr67.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+154}:\\ \;\;\;\;1 + z \cdot \left(z \cdot 0.5 + -1\right)\\ \mathbf{elif}\;z \leq 125000000:\\ \;\;\;\;e^{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 77.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.8 \cdot 10^{+64}:\\
\;\;\;\;e^{x - z}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{{z}^{6}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 8.80000000000000007e64

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 93.7%

      \[\leadsto e^{\color{blue}{x} - z} \]

    if 8.80000000000000007e64 < y

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum77.0%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff56.0%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/56.0%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative56.0%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow56.0%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp62.0%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified62.0%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 41.6%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in x around 0 29.0%

      \[\leadsto \color{blue}{\frac{1}{e^{z}}} \]
    7. Applied egg-rr50.5%

      \[\leadsto \color{blue}{{\left(\mathsf{expm1}\left(z\right)\right)}^{-6}} \]
    8. Taylor expanded in z around 0 51.2%

      \[\leadsto \color{blue}{\frac{1}{{z}^{6}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification77.1%

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

Alternative 8: 79.4% accurate, 2.0× speedup?

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

\\
e^{x - z}
\end{array}
Derivation
  1. Initial program 100.0%

    \[e^{\left(x + y \cdot \log y\right) - z} \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 73.4%

    \[\leadsto e^{\color{blue}{x} - z} \]
  4. Final simplification73.4%

    \[\leadsto e^{x - z} \]
  5. Add Preprocessing

Alternative 9: 41.5% accurate, 8.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{-30}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-269}:\\ \;\;\;\;1 - z\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-148}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;1 + x \cdot \left(1 + x \cdot 0.5\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -4e-30)
   0.0
   (if (<= x 9.5e-269)
     (- 1.0 z)
     (if (<= x 3.5e-148) 0.0 (+ 1.0 (* x (+ 1.0 (* x 0.5))))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -4e-30) {
		tmp = 0.0;
	} else if (x <= 9.5e-269) {
		tmp = 1.0 - z;
	} else if (x <= 3.5e-148) {
		tmp = 0.0;
	} else {
		tmp = 1.0 + (x * (1.0 + (x * 0.5)));
	}
	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 <= (-4d-30)) then
        tmp = 0.0d0
    else if (x <= 9.5d-269) then
        tmp = 1.0d0 - z
    else if (x <= 3.5d-148) then
        tmp = 0.0d0
    else
        tmp = 1.0d0 + (x * (1.0d0 + (x * 0.5d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -4e-30) {
		tmp = 0.0;
	} else if (x <= 9.5e-269) {
		tmp = 1.0 - z;
	} else if (x <= 3.5e-148) {
		tmp = 0.0;
	} else {
		tmp = 1.0 + (x * (1.0 + (x * 0.5)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -4e-30:
		tmp = 0.0
	elif x <= 9.5e-269:
		tmp = 1.0 - z
	elif x <= 3.5e-148:
		tmp = 0.0
	else:
		tmp = 1.0 + (x * (1.0 + (x * 0.5)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -4e-30)
		tmp = 0.0;
	elseif (x <= 9.5e-269)
		tmp = Float64(1.0 - z);
	elseif (x <= 3.5e-148)
		tmp = 0.0;
	else
		tmp = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * 0.5))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -4e-30)
		tmp = 0.0;
	elseif (x <= 9.5e-269)
		tmp = 1.0 - z;
	elseif (x <= 3.5e-148)
		tmp = 0.0;
	else
		tmp = 1.0 + (x * (1.0 + (x * 0.5)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -4e-30], 0.0, If[LessEqual[x, 9.5e-269], N[(1.0 - z), $MachinePrecision], If[LessEqual[x, 3.5e-148], 0.0, N[(1.0 + N[(x * N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-30}:\\
\;\;\;\;0\\

\mathbf{elif}\;x \leq 9.5 \cdot 10^{-269}:\\
\;\;\;\;1 - z\\

\mathbf{elif}\;x \leq 3.5 \cdot 10^{-148}:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot 0.5\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4e-30 or 9.5000000000000006e-269 < x < 3.5e-148

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum64.8%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff52.8%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/52.8%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative52.8%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow52.8%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp66.7%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified66.7%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 71.9%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in z around 0 48.6%

      \[\leadsto \color{blue}{\frac{1}{e^{-x}}} \]
    7. Applied egg-rr53.6%

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

    if -4e-30 < x < 9.5000000000000006e-269

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum100.0%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff90.5%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/90.5%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative90.5%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow90.5%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp90.5%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified90.5%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 66.0%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in x around 0 66.0%

      \[\leadsto \color{blue}{\frac{1}{e^{z}}} \]
    7. Taylor expanded in z around 0 29.0%

      \[\leadsto \color{blue}{1 + -1 \cdot z} \]
    8. Step-by-step derivation
      1. mul-1-neg29.0%

        \[\leadsto 1 + \color{blue}{\left(-z\right)} \]
      2. unsub-neg29.0%

        \[\leadsto \color{blue}{1 - z} \]
    9. Simplified29.0%

      \[\leadsto \color{blue}{1 - z} \]

    if 3.5e-148 < x

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum90.6%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff83.5%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/83.5%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative83.5%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow83.5%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp92.9%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified92.9%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 80.6%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in z around 0 73.1%

      \[\leadsto \color{blue}{\frac{1}{e^{-x}}} \]
    7. Taylor expanded in x around 0 50.8%

      \[\leadsto \color{blue}{1 + x \cdot \left(1 + 0.5 \cdot x\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification46.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{-30}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-269}:\\ \;\;\;\;1 - z\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-148}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;1 + x \cdot \left(1 + x \cdot 0.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 32.4% accurate, 9.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.05 \cdot 10^{-29}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-269} \lor \neg \left(x \leq 3.06 \cdot 10^{-148}\right) \land x \leq 4.35 \cdot 10^{-48}:\\ \;\;\;\;1 - z\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -2.05e-29)
   0.0
   (if (or (<= x 3.5e-269) (and (not (<= x 3.06e-148)) (<= x 4.35e-48)))
     (- 1.0 z)
     0.0)))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.05e-29) {
		tmp = 0.0;
	} else if ((x <= 3.5e-269) || (!(x <= 3.06e-148) && (x <= 4.35e-48))) {
		tmp = 1.0 - z;
	} else {
		tmp = 0.0;
	}
	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.05d-29)) then
        tmp = 0.0d0
    else if ((x <= 3.5d-269) .or. (.not. (x <= 3.06d-148)) .and. (x <= 4.35d-48)) then
        tmp = 1.0d0 - z
    else
        tmp = 0.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.05e-29) {
		tmp = 0.0;
	} else if ((x <= 3.5e-269) || (!(x <= 3.06e-148) && (x <= 4.35e-48))) {
		tmp = 1.0 - z;
	} else {
		tmp = 0.0;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -2.05e-29:
		tmp = 0.0
	elif (x <= 3.5e-269) or (not (x <= 3.06e-148) and (x <= 4.35e-48)):
		tmp = 1.0 - z
	else:
		tmp = 0.0
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -2.05e-29)
		tmp = 0.0;
	elseif ((x <= 3.5e-269) || (!(x <= 3.06e-148) && (x <= 4.35e-48)))
		tmp = Float64(1.0 - z);
	else
		tmp = 0.0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -2.05e-29)
		tmp = 0.0;
	elseif ((x <= 3.5e-269) || (~((x <= 3.06e-148)) && (x <= 4.35e-48)))
		tmp = 1.0 - z;
	else
		tmp = 0.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -2.05e-29], 0.0, If[Or[LessEqual[x, 3.5e-269], And[N[Not[LessEqual[x, 3.06e-148]], $MachinePrecision], LessEqual[x, 4.35e-48]]], N[(1.0 - z), $MachinePrecision], 0.0]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{-29}:\\
\;\;\;\;0\\

\mathbf{elif}\;x \leq 3.5 \cdot 10^{-269} \lor \neg \left(x \leq 3.06 \cdot 10^{-148}\right) \land x \leq 4.35 \cdot 10^{-48}:\\
\;\;\;\;1 - z\\

\mathbf{else}:\\
\;\;\;\;0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.0499999999999999e-29 or 3.50000000000000019e-269 < x < 3.0600000000000001e-148 or 4.3499999999999998e-48 < x

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum73.3%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff62.8%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/62.8%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative62.8%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow62.8%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp76.2%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified76.2%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 78.4%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in z around 0 60.9%

      \[\leadsto \color{blue}{\frac{1}{e^{-x}}} \]
    7. Applied egg-rr38.3%

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

    if -2.0499999999999999e-29 < x < 3.50000000000000019e-269 or 3.0600000000000001e-148 < x < 4.3499999999999998e-48

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum100.0%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff91.6%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/91.6%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative91.6%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow91.6%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp91.6%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified91.6%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 63.0%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in x around 0 63.0%

      \[\leadsto \color{blue}{\frac{1}{e^{z}}} \]
    7. Taylor expanded in z around 0 33.4%

      \[\leadsto \color{blue}{1 + -1 \cdot z} \]
    8. Step-by-step derivation
      1. mul-1-neg33.4%

        \[\leadsto 1 + \color{blue}{\left(-z\right)} \]
      2. unsub-neg33.4%

        \[\leadsto \color{blue}{1 - z} \]
    9. Simplified33.4%

      \[\leadsto \color{blue}{1 - z} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification36.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.05 \cdot 10^{-29}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-269} \lor \neg \left(x \leq 3.06 \cdot 10^{-148}\right) \land x \leq 4.35 \cdot 10^{-48}:\\ \;\;\;\;1 - z\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 52.8% accurate, 9.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -9.8 \cdot 10^{-19}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+42}:\\ \;\;\;\;1 + z \cdot \left(z \cdot 0.5 + -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x \cdot \left(1 + x \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -9.8e-19)
   0.0
   (if (<= x 9e+42)
     (+ 1.0 (* z (+ (* z 0.5) -1.0)))
     (+ 1.0 (* x (+ 1.0 (* x (+ 0.5 (* x 0.16666666666666666)))))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -9.8e-19) {
		tmp = 0.0;
	} else if (x <= 9e+42) {
		tmp = 1.0 + (z * ((z * 0.5) + -1.0));
	} else {
		tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))));
	}
	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 <= (-9.8d-19)) then
        tmp = 0.0d0
    else if (x <= 9d+42) then
        tmp = 1.0d0 + (z * ((z * 0.5d0) + (-1.0d0)))
    else
        tmp = 1.0d0 + (x * (1.0d0 + (x * (0.5d0 + (x * 0.16666666666666666d0)))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -9.8e-19) {
		tmp = 0.0;
	} else if (x <= 9e+42) {
		tmp = 1.0 + (z * ((z * 0.5) + -1.0));
	} else {
		tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -9.8e-19:
		tmp = 0.0
	elif x <= 9e+42:
		tmp = 1.0 + (z * ((z * 0.5) + -1.0))
	else:
		tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -9.8e-19)
		tmp = 0.0;
	elseif (x <= 9e+42)
		tmp = Float64(1.0 + Float64(z * Float64(Float64(z * 0.5) + -1.0)));
	else
		tmp = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * 0.16666666666666666))))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -9.8e-19)
		tmp = 0.0;
	elseif (x <= 9e+42)
		tmp = 1.0 + (z * ((z * 0.5) + -1.0));
	else
		tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -9.8e-19], 0.0, If[LessEqual[x, 9e+42], N[(1.0 + N[(z * N[(N[(z * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(1.0 + N[(x * N[(0.5 + N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.8 \cdot 10^{-19}:\\
\;\;\;\;0\\

\mathbf{elif}\;x \leq 9 \cdot 10^{+42}:\\
\;\;\;\;1 + z \cdot \left(z \cdot 0.5 + -1\right)\\

\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -9.79999999999999985e-19

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum48.6%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff41.9%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/41.9%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative41.9%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow41.9%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp62.2%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified62.2%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 80.0%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in z around 0 65.4%

      \[\leadsto \color{blue}{\frac{1}{e^{-x}}} \]
    7. Applied egg-rr66.8%

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

    if -9.79999999999999985e-19 < x < 9.00000000000000025e42

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum99.2%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff86.4%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/86.4%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative86.4%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow86.4%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp86.4%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified86.4%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 60.3%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in x around 0 58.8%

      \[\leadsto \color{blue}{\frac{1}{e^{z}}} \]
    7. Taylor expanded in z around 0 35.9%

      \[\leadsto \color{blue}{1 + z \cdot \left(0.5 \cdot z - 1\right)} \]

    if 9.00000000000000025e42 < x

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum86.0%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff80.0%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/80.0%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative80.0%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow80.0%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp96.0%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified96.0%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 98.0%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in z around 0 94.1%

      \[\leadsto \color{blue}{\frac{1}{e^{-x}}} \]
    7. Taylor expanded in x around 0 80.9%

      \[\leadsto \color{blue}{1 + x \cdot \left(1 + x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right)} \]
    8. Step-by-step derivation
      1. +-commutative80.9%

        \[\leadsto 1 + x \cdot \color{blue}{\left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right) + 1\right)} \]
      2. distribute-lft-in80.9%

        \[\leadsto 1 + \color{blue}{\left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + x \cdot 1\right)} \]
      3. *-rgt-identity80.9%

        \[\leadsto 1 + \left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + \color{blue}{x}\right) \]
      4. remove-double-neg80.9%

        \[\leadsto 1 + \left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + \color{blue}{\left(-\left(-x\right)\right)}\right) \]
      5. mul-1-neg80.9%

        \[\leadsto 1 + \left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + \left(-\color{blue}{-1 \cdot x}\right)\right) \]
      6. unsub-neg80.9%

        \[\leadsto 1 + \color{blue}{\left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) - -1 \cdot x\right)} \]
      7. unsub-neg80.9%

        \[\leadsto 1 + \color{blue}{\left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + \left(--1 \cdot x\right)\right)} \]
      8. mul-1-neg80.9%

        \[\leadsto 1 + \left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + \left(-\color{blue}{\left(-x\right)}\right)\right) \]
      9. remove-double-neg80.9%

        \[\leadsto 1 + \left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + \color{blue}{x}\right) \]
      10. *-rgt-identity80.9%

        \[\leadsto 1 + \left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + \color{blue}{x \cdot 1}\right) \]
      11. distribute-lft-in80.9%

        \[\leadsto 1 + \color{blue}{x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right) + 1\right)} \]
      12. +-commutative80.9%

        \[\leadsto 1 + x \cdot \color{blue}{\left(1 + x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right)} \]
      13. *-commutative80.9%

        \[\leadsto 1 + x \cdot \left(1 + x \cdot \left(0.5 + \color{blue}{x \cdot 0.16666666666666666}\right)\right) \]
    9. Simplified80.9%

      \[\leadsto \color{blue}{1 + x \cdot \left(1 + x \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification53.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.8 \cdot 10^{-19}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+42}:\\ \;\;\;\;1 + z \cdot \left(z \cdot 0.5 + -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x \cdot \left(1 + x \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 54.1% accurate, 9.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{-18}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+77}:\\ \;\;\;\;1 + z \cdot \left(z \cdot \left(0.5 + z \cdot -0.16666666666666666\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x \cdot \left(1 + x \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -2.25e-18)
   0.0
   (if (<= x 1.4e+77)
     (+ 1.0 (* z (+ (* z (+ 0.5 (* z -0.16666666666666666))) -1.0)))
     (+ 1.0 (* x (+ 1.0 (* x (+ 0.5 (* x 0.16666666666666666)))))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.25e-18) {
		tmp = 0.0;
	} else if (x <= 1.4e+77) {
		tmp = 1.0 + (z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0));
	} else {
		tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))));
	}
	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.25d-18)) then
        tmp = 0.0d0
    else if (x <= 1.4d+77) then
        tmp = 1.0d0 + (z * ((z * (0.5d0 + (z * (-0.16666666666666666d0)))) + (-1.0d0)))
    else
        tmp = 1.0d0 + (x * (1.0d0 + (x * (0.5d0 + (x * 0.16666666666666666d0)))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.25e-18) {
		tmp = 0.0;
	} else if (x <= 1.4e+77) {
		tmp = 1.0 + (z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0));
	} else {
		tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -2.25e-18:
		tmp = 0.0
	elif x <= 1.4e+77:
		tmp = 1.0 + (z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0))
	else:
		tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -2.25e-18)
		tmp = 0.0;
	elseif (x <= 1.4e+77)
		tmp = Float64(1.0 + Float64(z * Float64(Float64(z * Float64(0.5 + Float64(z * -0.16666666666666666))) + -1.0)));
	else
		tmp = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * 0.16666666666666666))))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -2.25e-18)
		tmp = 0.0;
	elseif (x <= 1.4e+77)
		tmp = 1.0 + (z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0));
	else
		tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -2.25e-18], 0.0, If[LessEqual[x, 1.4e+77], N[(1.0 + N[(z * N[(N[(z * N[(0.5 + N[(z * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(1.0 + N[(x * N[(0.5 + N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.25 \cdot 10^{-18}:\\
\;\;\;\;0\\

\mathbf{elif}\;x \leq 1.4 \cdot 10^{+77}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(0.5 + z \cdot -0.16666666666666666\right) + -1\right)\\

\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.24999999999999997e-18

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum48.6%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff41.9%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/41.9%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative41.9%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow41.9%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp62.2%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified62.2%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 80.0%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in z around 0 65.4%

      \[\leadsto \color{blue}{\frac{1}{e^{-x}}} \]
    7. Applied egg-rr66.8%

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

    if -2.24999999999999997e-18 < x < 1.4e77

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum99.3%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff86.8%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/86.8%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative86.8%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow86.8%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp86.8%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified86.8%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 61.7%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in x around 0 57.5%

      \[\leadsto \color{blue}{\frac{1}{e^{z}}} \]
    7. Taylor expanded in z around 0 35.2%

      \[\leadsto \color{blue}{1 + z \cdot \left(z \cdot \left(0.5 + -0.16666666666666666 \cdot z\right) - 1\right)} \]

    if 1.4e77 < x

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum84.4%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff77.8%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/77.8%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative77.8%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow77.8%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp95.6%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified95.6%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 97.8%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in z around 0 93.4%

      \[\leadsto \color{blue}{\frac{1}{e^{-x}}} \]
    7. Taylor expanded in x around 0 89.3%

      \[\leadsto \color{blue}{1 + x \cdot \left(1 + x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right)} \]
    8. Step-by-step derivation
      1. +-commutative89.3%

        \[\leadsto 1 + x \cdot \color{blue}{\left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right) + 1\right)} \]
      2. distribute-lft-in89.3%

        \[\leadsto 1 + \color{blue}{\left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + x \cdot 1\right)} \]
      3. *-rgt-identity89.3%

        \[\leadsto 1 + \left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + \color{blue}{x}\right) \]
      4. remove-double-neg89.3%

        \[\leadsto 1 + \left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + \color{blue}{\left(-\left(-x\right)\right)}\right) \]
      5. mul-1-neg89.3%

        \[\leadsto 1 + \left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + \left(-\color{blue}{-1 \cdot x}\right)\right) \]
      6. unsub-neg89.3%

        \[\leadsto 1 + \color{blue}{\left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) - -1 \cdot x\right)} \]
      7. unsub-neg89.3%

        \[\leadsto 1 + \color{blue}{\left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + \left(--1 \cdot x\right)\right)} \]
      8. mul-1-neg89.3%

        \[\leadsto 1 + \left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + \left(-\color{blue}{\left(-x\right)}\right)\right) \]
      9. remove-double-neg89.3%

        \[\leadsto 1 + \left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + \color{blue}{x}\right) \]
      10. *-rgt-identity89.3%

        \[\leadsto 1 + \left(x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right) + \color{blue}{x \cdot 1}\right) \]
      11. distribute-lft-in89.3%

        \[\leadsto 1 + \color{blue}{x \cdot \left(x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right) + 1\right)} \]
      12. +-commutative89.3%

        \[\leadsto 1 + x \cdot \color{blue}{\left(1 + x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right)} \]
      13. *-commutative89.3%

        \[\leadsto 1 + x \cdot \left(1 + x \cdot \left(0.5 + \color{blue}{x \cdot 0.16666666666666666}\right)\right) \]
    9. Simplified89.3%

      \[\leadsto \color{blue}{1 + x \cdot \left(1 + x \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification53.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{-18}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+77}:\\ \;\;\;\;1 + z \cdot \left(z \cdot \left(0.5 + z \cdot -0.16666666666666666\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x \cdot \left(1 + x \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 50.6% accurate, 10.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{-18}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+145}:\\ \;\;\;\;1 + z \cdot \left(z \cdot 0.5 + -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x \cdot \left(1 + x \cdot 0.5\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -2.25e-18)
   0.0
   (if (<= x 9e+145)
     (+ 1.0 (* z (+ (* z 0.5) -1.0)))
     (+ 1.0 (* x (+ 1.0 (* x 0.5)))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.25e-18) {
		tmp = 0.0;
	} else if (x <= 9e+145) {
		tmp = 1.0 + (z * ((z * 0.5) + -1.0));
	} else {
		tmp = 1.0 + (x * (1.0 + (x * 0.5)));
	}
	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.25d-18)) then
        tmp = 0.0d0
    else if (x <= 9d+145) then
        tmp = 1.0d0 + (z * ((z * 0.5d0) + (-1.0d0)))
    else
        tmp = 1.0d0 + (x * (1.0d0 + (x * 0.5d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.25e-18) {
		tmp = 0.0;
	} else if (x <= 9e+145) {
		tmp = 1.0 + (z * ((z * 0.5) + -1.0));
	} else {
		tmp = 1.0 + (x * (1.0 + (x * 0.5)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -2.25e-18:
		tmp = 0.0
	elif x <= 9e+145:
		tmp = 1.0 + (z * ((z * 0.5) + -1.0))
	else:
		tmp = 1.0 + (x * (1.0 + (x * 0.5)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -2.25e-18)
		tmp = 0.0;
	elseif (x <= 9e+145)
		tmp = Float64(1.0 + Float64(z * Float64(Float64(z * 0.5) + -1.0)));
	else
		tmp = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * 0.5))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -2.25e-18)
		tmp = 0.0;
	elseif (x <= 9e+145)
		tmp = 1.0 + (z * ((z * 0.5) + -1.0));
	else
		tmp = 1.0 + (x * (1.0 + (x * 0.5)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -2.25e-18], 0.0, If[LessEqual[x, 9e+145], N[(1.0 + N[(z * N[(N[(z * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.25 \cdot 10^{-18}:\\
\;\;\;\;0\\

\mathbf{elif}\;x \leq 9 \cdot 10^{+145}:\\
\;\;\;\;1 + z \cdot \left(z \cdot 0.5 + -1\right)\\

\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot 0.5\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.24999999999999997e-18

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum48.6%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff41.9%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/41.9%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative41.9%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow41.9%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp62.2%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified62.2%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 80.0%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in z around 0 65.4%

      \[\leadsto \color{blue}{\frac{1}{e^{-x}}} \]
    7. Applied egg-rr66.8%

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

    if -2.24999999999999997e-18 < x < 8.9999999999999996e145

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum97.3%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff85.2%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/85.2%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative85.2%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow85.2%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp86.6%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified86.6%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 64.2%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in x around 0 56.3%

      \[\leadsto \color{blue}{\frac{1}{e^{z}}} \]
    7. Taylor expanded in z around 0 34.2%

      \[\leadsto \color{blue}{1 + z \cdot \left(0.5 \cdot z - 1\right)} \]

    if 8.9999999999999996e145 < x

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum87.9%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff81.8%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/81.8%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative81.8%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow81.8%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp100.0%

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

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 100.0%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in z around 0 97.0%

      \[\leadsto \color{blue}{\frac{1}{e^{-x}}} \]
    7. Taylor expanded in x around 0 94.3%

      \[\leadsto \color{blue}{1 + x \cdot \left(1 + 0.5 \cdot x\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification51.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{-18}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+145}:\\ \;\;\;\;1 + z \cdot \left(z \cdot 0.5 + -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x \cdot \left(1 + x \cdot 0.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 32.1% accurate, 18.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -22:\\ \;\;\;\;0\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-236}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -22.0) 0.0 (if (<= z 2.9e-236) 1.0 0.0)))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -22.0) {
		tmp = 0.0;
	} else if (z <= 2.9e-236) {
		tmp = 1.0;
	} else {
		tmp = 0.0;
	}
	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 <= (-22.0d0)) then
        tmp = 0.0d0
    else if (z <= 2.9d-236) then
        tmp = 1.0d0
    else
        tmp = 0.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -22.0) {
		tmp = 0.0;
	} else if (z <= 2.9e-236) {
		tmp = 1.0;
	} else {
		tmp = 0.0;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -22.0:
		tmp = 0.0
	elif z <= 2.9e-236:
		tmp = 1.0
	else:
		tmp = 0.0
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -22.0)
		tmp = 0.0;
	elseif (z <= 2.9e-236)
		tmp = 1.0;
	else
		tmp = 0.0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -22.0)
		tmp = 0.0;
	elseif (z <= 2.9e-236)
		tmp = 1.0;
	else
		tmp = 0.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -22.0], 0.0, If[LessEqual[z, 2.9e-236], 1.0, 0.0]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -22:\\
\;\;\;\;0\\

\mathbf{elif}\;z \leq 2.9 \cdot 10^{-236}:\\
\;\;\;\;1\\

\mathbf{else}:\\
\;\;\;\;0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -22 or 2.9e-236 < z

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum78.6%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff63.7%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/63.7%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative63.7%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow63.7%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp77.4%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified77.4%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 77.9%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in z around 0 46.7%

      \[\leadsto \color{blue}{\frac{1}{e^{-x}}} \]
    7. Applied egg-rr35.1%

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

    if -22 < z < 2.9e-236

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
      2. +-commutative100.0%

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
      3. exp-sum88.6%

        \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
      4. exp-diff88.6%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
      5. associate-/r/88.6%

        \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
      6. *-commutative88.6%

        \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
      7. exp-to-pow88.6%

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
      8. div-exp88.6%

        \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
    3. Simplified88.6%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 64.7%

      \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
    6. Taylor expanded in x around 0 31.7%

      \[\leadsto \color{blue}{\frac{1}{e^{z}}} \]
    7. Taylor expanded in z around 0 27.8%

      \[\leadsto \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification32.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -22:\\ \;\;\;\;0\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-236}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 30.2% accurate, 207.0× speedup?

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

\\
0
\end{array}
Derivation
  1. Initial program 100.0%

    \[e^{\left(x + y \cdot \log y\right) - z} \]
  2. Step-by-step derivation
    1. associate--l+100.0%

      \[\leadsto e^{\color{blue}{x + \left(y \cdot \log y - z\right)}} \]
    2. +-commutative100.0%

      \[\leadsto e^{\color{blue}{\left(y \cdot \log y - z\right) + x}} \]
    3. exp-sum82.0%

      \[\leadsto \color{blue}{e^{y \cdot \log y - z} \cdot e^{x}} \]
    4. exp-diff72.3%

      \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{e^{z}}} \cdot e^{x} \]
    5. associate-/r/72.3%

      \[\leadsto \color{blue}{\frac{e^{y \cdot \log y}}{\frac{e^{z}}{e^{x}}}} \]
    6. *-commutative72.3%

      \[\leadsto \frac{e^{\color{blue}{\log y \cdot y}}}{\frac{e^{z}}{e^{x}}} \]
    7. exp-to-pow72.3%

      \[\leadsto \frac{\color{blue}{{y}^{y}}}{\frac{e^{z}}{e^{x}}} \]
    8. div-exp81.2%

      \[\leadsto \frac{{y}^{y}}{\color{blue}{e^{z - x}}} \]
  3. Simplified81.2%

    \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z - x}}} \]
  4. Add Preprocessing
  5. Taylor expanded in y around 0 73.4%

    \[\leadsto \color{blue}{\frac{1}{e^{z - x}}} \]
  6. Taylor expanded in z around 0 51.6%

    \[\leadsto \color{blue}{\frac{1}{e^{-x}}} \]
  7. Applied egg-rr29.9%

    \[\leadsto \color{blue}{0} \]
  8. Final simplification29.9%

    \[\leadsto 0 \]
  9. Add Preprocessing

Developer target: 100.0% accurate, 1.0× speedup?

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

\\
e^{\left(x - z\right) + \log y \cdot y}
\end{array}

Reproduce

?
herbie shell --seed 2024082 
(FPCore (x y z)
  :name "Statistics.Distribution.Poisson.Internal:probability from math-functions-0.1.5.2"
  :precision binary64

  :alt
  (exp (+ (- x z) (* (log y) y)))

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