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

Percentage Accurate: 100.0% → 100.0%
Time: 9.1s
Alternatives: 16
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 16 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. Add Preprocessing

Alternative 2: 94.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+42} \lor \neg \left(x \leq 750\right):\\
\;\;\;\;e^{x - z}\\

\mathbf{else}:\\
\;\;\;\;e^{y \cdot \log y - z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.4499999999999999e42 or 750 < x

    1. Initial program 100.0%

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

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

    if -1.4499999999999999e42 < x < 750

    1. Initial program 100.0%

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

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

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

Alternative 3: 87.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.6 \cdot 10^{+39} \lor \neg \left(x \leq 450\right):\\
\;\;\;\;e^{x - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.60000000000000003e39 or 450 < x

    1. Initial program 100.0%

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

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

    if -5.60000000000000003e39 < x < 450

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{y \cdot \log y - z}} \]
    4. Step-by-step derivation
      1. exp-diff89.6%

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

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

        \[\leadsto \frac{\color{blue}{{y}^{y}}}{e^{z}} \]
    5. Simplified89.6%

      \[\leadsto \color{blue}{\frac{{y}^{y}}{e^{z}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.6 \cdot 10^{+39} \lor \neg \left(x \leq 450\right):\\ \;\;\;\;e^{x - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{{y}^{y}}{e^{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 73.8% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+54}:\\
\;\;\;\;0\\

\mathbf{elif}\;x \leq 700:\\
\;\;\;\;{y}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.1999999999999999e54

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified43.8%

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

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

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

        \[\leadsto \color{blue}{1 - z} \]
    8. Simplified3.0%

      \[\leadsto \color{blue}{1 - z} \]
    9. Taylor expanded in z around inf 3.6%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    10. Step-by-step derivation
      1. neg-mul-13.6%

        \[\leadsto \color{blue}{-z} \]
    11. Simplified3.6%

      \[\leadsto \color{blue}{-z} \]
    12. Step-by-step derivation
      1. add-log-exp52.3%

        \[\leadsto \color{blue}{\log \left(e^{-z}\right)} \]
      2. exp-neg52.3%

        \[\leadsto \log \color{blue}{\left(\frac{1}{e^{z}}\right)} \]
      3. add-sqr-sqrt52.3%

        \[\leadsto \log \left(\frac{1}{\color{blue}{\sqrt{e^{z}} \cdot \sqrt{e^{z}}}}\right) \]
      4. associate-/r*52.3%

        \[\leadsto \log \color{blue}{\left(\frac{\frac{1}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right)} \]
      5. metadata-eval52.3%

        \[\leadsto \log \left(\frac{\frac{\color{blue}{\sqrt{1}}}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      6. sqrt-div52.3%

        \[\leadsto \log \left(\frac{\color{blue}{\sqrt{\frac{1}{e^{z}}}}}{\sqrt{e^{z}}}\right) \]
      7. exp-neg52.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      8. pow152.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{-z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      9. pow152.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      10. add-sqr-sqrt37.7%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}}}{\sqrt{e^{z}}}\right) \]
      11. sqrt-unprod51.8%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}}}{\sqrt{e^{z}}}\right) \]
      12. sqr-neg51.8%

        \[\leadsto \log \left(\frac{\sqrt{e^{\sqrt{\color{blue}{z \cdot z}}}}}{\sqrt{e^{z}}}\right) \]
      13. sqrt-unprod14.1%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}}}{\sqrt{e^{z}}}\right) \]
      14. add-sqr-sqrt42.2%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{z}}}}{\sqrt{e^{z}}}\right) \]
      15. pow142.2%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      16. pow142.2%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      17. log-div42.2%

        \[\leadsto \color{blue}{\log \left(\sqrt{e^{z}}\right) - \log \left(\sqrt{e^{z}}\right)} \]
    13. Applied egg-rr84.6%

      \[\leadsto \color{blue}{0.5 \cdot z - 0.5 \cdot z} \]
    14. Step-by-step derivation
      1. +-inverses84.6%

        \[\leadsto \color{blue}{0} \]
    15. Simplified84.6%

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

    if -6.1999999999999999e54 < x < 700

    1. Initial program 100.0%

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

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

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

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

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

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

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

      \[\leadsto {y}^{y} \cdot \color{blue}{e^{x}} \]
    6. Taylor expanded in x around 0 71.8%

      \[\leadsto \color{blue}{{y}^{y}} \]

    if 700 < x

    1. Initial program 100.0%

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

      \[\leadsto e^{\color{blue}{x}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 72.9% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -710:\\
\;\;\;\;e^{-z}\\

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+79}:\\
\;\;\;\;e^{x}\\

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


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

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified89.9%

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

    if -710 < z < 3.5999999999999999e79

    1. Initial program 100.0%

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

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

    if 3.5999999999999999e79 < z

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified80.8%

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

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

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

        \[\leadsto \color{blue}{1 - z} \]
    8. Simplified1.7%

      \[\leadsto \color{blue}{1 - z} \]
    9. Taylor expanded in z around inf 1.7%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    10. Step-by-step derivation
      1. neg-mul-11.7%

        \[\leadsto \color{blue}{-z} \]
    11. Simplified1.7%

      \[\leadsto \color{blue}{-z} \]
    12. Step-by-step derivation
      1. add-log-exp1.3%

        \[\leadsto \color{blue}{\log \left(e^{-z}\right)} \]
      2. exp-neg1.3%

        \[\leadsto \log \color{blue}{\left(\frac{1}{e^{z}}\right)} \]
      3. add-sqr-sqrt1.3%

        \[\leadsto \log \left(\frac{1}{\color{blue}{\sqrt{e^{z}} \cdot \sqrt{e^{z}}}}\right) \]
      4. associate-/r*1.3%

        \[\leadsto \log \color{blue}{\left(\frac{\frac{1}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right)} \]
      5. metadata-eval1.3%

        \[\leadsto \log \left(\frac{\frac{\color{blue}{\sqrt{1}}}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      6. sqrt-div1.3%

        \[\leadsto \log \left(\frac{\color{blue}{\sqrt{\frac{1}{e^{z}}}}}{\sqrt{e^{z}}}\right) \]
      7. exp-neg1.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      8. pow11.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{-z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      9. pow11.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      10. add-sqr-sqrt0.0%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}}}{\sqrt{e^{z}}}\right) \]
      11. sqrt-unprod0.0%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}}}{\sqrt{e^{z}}}\right) \]
      12. sqr-neg0.0%

        \[\leadsto \log \left(\frac{\sqrt{e^{\sqrt{\color{blue}{z \cdot z}}}}}{\sqrt{e^{z}}}\right) \]
      13. sqrt-unprod0.0%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}}}{\sqrt{e^{z}}}\right) \]
      14. add-sqr-sqrt0.0%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{z}}}}{\sqrt{e^{z}}}\right) \]
      15. pow10.0%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      16. pow10.0%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      17. log-div0.0%

        \[\leadsto \color{blue}{\log \left(\sqrt{e^{z}}\right) - \log \left(\sqrt{e^{z}}\right)} \]
    13. Applied egg-rr80.8%

      \[\leadsto \color{blue}{0.5 \cdot z - 0.5 \cdot z} \]
    14. Step-by-step derivation
      1. +-inverses80.8%

        \[\leadsto \color{blue}{0} \]
    15. Simplified80.8%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 6: 69.3% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+112}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+79}:\\
\;\;\;\;e^{x}\\

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


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

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto \color{blue}{1 + z \cdot \left(z \cdot \left(0.5 + -0.16666666666666666 \cdot z\right) - 1\right)} \]
    7. Taylor expanded in z around inf 91.4%

      \[\leadsto 1 + z \cdot \left(z \cdot \color{blue}{\left(-0.16666666666666666 \cdot z\right)} - 1\right) \]
    8. Step-by-step derivation
      1. *-commutative91.4%

        \[\leadsto 1 + z \cdot \left(z \cdot \color{blue}{\left(z \cdot -0.16666666666666666\right)} - 1\right) \]
    9. Simplified91.4%

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

    if -4.5999999999999999e112 < z < 3.5999999999999999e79

    1. Initial program 100.0%

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

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

    if 3.5999999999999999e79 < z

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified80.8%

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

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

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

        \[\leadsto \color{blue}{1 - z} \]
    8. Simplified1.7%

      \[\leadsto \color{blue}{1 - z} \]
    9. Taylor expanded in z around inf 1.7%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    10. Step-by-step derivation
      1. neg-mul-11.7%

        \[\leadsto \color{blue}{-z} \]
    11. Simplified1.7%

      \[\leadsto \color{blue}{-z} \]
    12. Step-by-step derivation
      1. add-log-exp1.3%

        \[\leadsto \color{blue}{\log \left(e^{-z}\right)} \]
      2. exp-neg1.3%

        \[\leadsto \log \color{blue}{\left(\frac{1}{e^{z}}\right)} \]
      3. add-sqr-sqrt1.3%

        \[\leadsto \log \left(\frac{1}{\color{blue}{\sqrt{e^{z}} \cdot \sqrt{e^{z}}}}\right) \]
      4. associate-/r*1.3%

        \[\leadsto \log \color{blue}{\left(\frac{\frac{1}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right)} \]
      5. metadata-eval1.3%

        \[\leadsto \log \left(\frac{\frac{\color{blue}{\sqrt{1}}}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      6. sqrt-div1.3%

        \[\leadsto \log \left(\frac{\color{blue}{\sqrt{\frac{1}{e^{z}}}}}{\sqrt{e^{z}}}\right) \]
      7. exp-neg1.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      8. pow11.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{-z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      9. pow11.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      10. add-sqr-sqrt0.0%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}}}{\sqrt{e^{z}}}\right) \]
      11. sqrt-unprod0.0%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}}}{\sqrt{e^{z}}}\right) \]
      12. sqr-neg0.0%

        \[\leadsto \log \left(\frac{\sqrt{e^{\sqrt{\color{blue}{z \cdot z}}}}}{\sqrt{e^{z}}}\right) \]
      13. sqrt-unprod0.0%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}}}{\sqrt{e^{z}}}\right) \]
      14. add-sqr-sqrt0.0%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{z}}}}{\sqrt{e^{z}}}\right) \]
      15. pow10.0%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      16. pow10.0%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      17. log-div0.0%

        \[\leadsto \color{blue}{\log \left(\sqrt{e^{z}}\right) - \log \left(\sqrt{e^{z}}\right)} \]
    13. Applied egg-rr80.8%

      \[\leadsto \color{blue}{0.5 \cdot z - 0.5 \cdot z} \]
    14. Step-by-step derivation
      1. +-inverses80.8%

        \[\leadsto \color{blue}{0} \]
    15. Simplified80.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{+112}:\\ \;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+79}:\\ \;\;\;\;e^{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 90.7% accurate, 1.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;{y}^{y}\\


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

    1. Initial program 100.0%

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

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

    if 3.8e20 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

      \[\leadsto {y}^{y} \cdot \color{blue}{e^{x}} \]
    6. Taylor expanded in x around 0 78.0%

      \[\leadsto \color{blue}{{y}^{y}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 53.2% accurate, 9.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+54}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{+59}:\\ \;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666 + 0.5\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.3e+54)
   0.0
   (if (<= x 1.2e+59)
     (+ 1.0 (* z (+ (* z (+ (* z -0.16666666666666666) 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 <= -2.3e+54) {
		tmp = 0.0;
	} else if (x <= 1.2e+59) {
		tmp = 1.0 + (z * ((z * ((z * -0.16666666666666666) + 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 <= (-2.3d+54)) then
        tmp = 0.0d0
    else if (x <= 1.2d+59) then
        tmp = 1.0d0 + (z * ((z * ((z * (-0.16666666666666666d0)) + 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 <= -2.3e+54) {
		tmp = 0.0;
	} else if (x <= 1.2e+59) {
		tmp = 1.0 + (z * ((z * ((z * -0.16666666666666666) + 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 <= -2.3e+54:
		tmp = 0.0
	elif x <= 1.2e+59:
		tmp = 1.0 + (z * ((z * ((z * -0.16666666666666666) + 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 <= -2.3e+54)
		tmp = 0.0;
	elseif (x <= 1.2e+59)
		tmp = Float64(1.0 + Float64(z * Float64(Float64(z * Float64(Float64(z * -0.16666666666666666) + 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 <= -2.3e+54)
		tmp = 0.0;
	elseif (x <= 1.2e+59)
		tmp = 1.0 + (z * ((z * ((z * -0.16666666666666666) + 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, -2.3e+54], 0.0, If[LessEqual[x, 1.2e+59], N[(1.0 + N[(z * N[(N[(z * N[(N[(z * -0.16666666666666666), $MachinePrecision] + 0.5), $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.3 \cdot 10^{+54}:\\
\;\;\;\;0\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{+59}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666 + 0.5\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.29999999999999994e54

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified43.8%

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

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

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

        \[\leadsto \color{blue}{1 - z} \]
    8. Simplified3.0%

      \[\leadsto \color{blue}{1 - z} \]
    9. Taylor expanded in z around inf 3.6%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    10. Step-by-step derivation
      1. neg-mul-13.6%

        \[\leadsto \color{blue}{-z} \]
    11. Simplified3.6%

      \[\leadsto \color{blue}{-z} \]
    12. Step-by-step derivation
      1. add-log-exp52.3%

        \[\leadsto \color{blue}{\log \left(e^{-z}\right)} \]
      2. exp-neg52.3%

        \[\leadsto \log \color{blue}{\left(\frac{1}{e^{z}}\right)} \]
      3. add-sqr-sqrt52.3%

        \[\leadsto \log \left(\frac{1}{\color{blue}{\sqrt{e^{z}} \cdot \sqrt{e^{z}}}}\right) \]
      4. associate-/r*52.3%

        \[\leadsto \log \color{blue}{\left(\frac{\frac{1}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right)} \]
      5. metadata-eval52.3%

        \[\leadsto \log \left(\frac{\frac{\color{blue}{\sqrt{1}}}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      6. sqrt-div52.3%

        \[\leadsto \log \left(\frac{\color{blue}{\sqrt{\frac{1}{e^{z}}}}}{\sqrt{e^{z}}}\right) \]
      7. exp-neg52.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      8. pow152.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{-z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      9. pow152.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      10. add-sqr-sqrt37.7%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}}}{\sqrt{e^{z}}}\right) \]
      11. sqrt-unprod51.8%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}}}{\sqrt{e^{z}}}\right) \]
      12. sqr-neg51.8%

        \[\leadsto \log \left(\frac{\sqrt{e^{\sqrt{\color{blue}{z \cdot z}}}}}{\sqrt{e^{z}}}\right) \]
      13. sqrt-unprod14.1%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}}}{\sqrt{e^{z}}}\right) \]
      14. add-sqr-sqrt42.2%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{z}}}}{\sqrt{e^{z}}}\right) \]
      15. pow142.2%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      16. pow142.2%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      17. log-div42.2%

        \[\leadsto \color{blue}{\log \left(\sqrt{e^{z}}\right) - \log \left(\sqrt{e^{z}}\right)} \]
    13. Applied egg-rr84.6%

      \[\leadsto \color{blue}{0.5 \cdot z - 0.5 \cdot z} \]
    14. Step-by-step derivation
      1. +-inverses84.6%

        \[\leadsto \color{blue}{0} \]
    15. Simplified84.6%

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

    if -2.29999999999999994e54 < x < 1.2000000000000001e59

    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.6%

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

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

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

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

    if 1.2000000000000001e59 < x

    1. Initial program 100.0%

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

      \[\leadsto e^{\color{blue}{x}} \]
    4. Taylor expanded in x around 0 87.7%

      \[\leadsto \color{blue}{1 + x \cdot \left(1 + x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right)} \]
    5. Step-by-step derivation
      1. *-commutative87.7%

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

      \[\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 simplification59.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+54}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{+59}:\\ \;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666 + 0.5\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 9: 53.1% accurate, 9.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+54}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{+58}:\\ \;\;\;\;1 + z \cdot \left(z \cdot \left(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.3e+54)
   0.0
   (if (<= x 4.5e+58)
     (+ 1.0 (* z (+ (* z (* 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.3e+54) {
		tmp = 0.0;
	} else if (x <= 4.5e+58) {
		tmp = 1.0 + (z * ((z * (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.3d+54)) then
        tmp = 0.0d0
    else if (x <= 4.5d+58) then
        tmp = 1.0d0 + (z * ((z * (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.3e+54) {
		tmp = 0.0;
	} else if (x <= 4.5e+58) {
		tmp = 1.0 + (z * ((z * (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.3e+54:
		tmp = 0.0
	elif x <= 4.5e+58:
		tmp = 1.0 + (z * ((z * (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.3e+54)
		tmp = 0.0;
	elseif (x <= 4.5e+58)
		tmp = Float64(1.0 + Float64(z * Float64(Float64(z * 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.3e+54)
		tmp = 0.0;
	elseif (x <= 4.5e+58)
		tmp = 1.0 + (z * ((z * (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.3e+54], 0.0, If[LessEqual[x, 4.5e+58], N[(1.0 + N[(z * N[(N[(z * N[(z * -0.16666666666666666), $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.3 \cdot 10^{+54}:\\
\;\;\;\;0\\

\mathbf{elif}\;x \leq 4.5 \cdot 10^{+58}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(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.29999999999999994e54

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified43.8%

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

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

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

        \[\leadsto \color{blue}{1 - z} \]
    8. Simplified3.0%

      \[\leadsto \color{blue}{1 - z} \]
    9. Taylor expanded in z around inf 3.6%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    10. Step-by-step derivation
      1. neg-mul-13.6%

        \[\leadsto \color{blue}{-z} \]
    11. Simplified3.6%

      \[\leadsto \color{blue}{-z} \]
    12. Step-by-step derivation
      1. add-log-exp52.3%

        \[\leadsto \color{blue}{\log \left(e^{-z}\right)} \]
      2. exp-neg52.3%

        \[\leadsto \log \color{blue}{\left(\frac{1}{e^{z}}\right)} \]
      3. add-sqr-sqrt52.3%

        \[\leadsto \log \left(\frac{1}{\color{blue}{\sqrt{e^{z}} \cdot \sqrt{e^{z}}}}\right) \]
      4. associate-/r*52.3%

        \[\leadsto \log \color{blue}{\left(\frac{\frac{1}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right)} \]
      5. metadata-eval52.3%

        \[\leadsto \log \left(\frac{\frac{\color{blue}{\sqrt{1}}}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      6. sqrt-div52.3%

        \[\leadsto \log \left(\frac{\color{blue}{\sqrt{\frac{1}{e^{z}}}}}{\sqrt{e^{z}}}\right) \]
      7. exp-neg52.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      8. pow152.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{-z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      9. pow152.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      10. add-sqr-sqrt37.7%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}}}{\sqrt{e^{z}}}\right) \]
      11. sqrt-unprod51.8%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}}}{\sqrt{e^{z}}}\right) \]
      12. sqr-neg51.8%

        \[\leadsto \log \left(\frac{\sqrt{e^{\sqrt{\color{blue}{z \cdot z}}}}}{\sqrt{e^{z}}}\right) \]
      13. sqrt-unprod14.1%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}}}{\sqrt{e^{z}}}\right) \]
      14. add-sqr-sqrt42.2%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{z}}}}{\sqrt{e^{z}}}\right) \]
      15. pow142.2%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      16. pow142.2%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      17. log-div42.2%

        \[\leadsto \color{blue}{\log \left(\sqrt{e^{z}}\right) - \log \left(\sqrt{e^{z}}\right)} \]
    13. Applied egg-rr84.6%

      \[\leadsto \color{blue}{0.5 \cdot z - 0.5 \cdot z} \]
    14. Step-by-step derivation
      1. +-inverses84.6%

        \[\leadsto \color{blue}{0} \]
    15. Simplified84.6%

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

    if -2.29999999999999994e54 < x < 4.4999999999999998e58

    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.6%

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

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

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

      \[\leadsto \color{blue}{1 + z \cdot \left(z \cdot \left(0.5 + -0.16666666666666666 \cdot z\right) - 1\right)} \]
    7. Taylor expanded in z around inf 41.6%

      \[\leadsto 1 + z \cdot \left(z \cdot \color{blue}{\left(-0.16666666666666666 \cdot z\right)} - 1\right) \]
    8. Step-by-step derivation
      1. *-commutative41.6%

        \[\leadsto 1 + z \cdot \left(z \cdot \color{blue}{\left(z \cdot -0.16666666666666666\right)} - 1\right) \]
    9. Simplified41.6%

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

    if 4.4999999999999998e58 < x

    1. Initial program 100.0%

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

      \[\leadsto e^{\color{blue}{x}} \]
    4. Taylor expanded in x around 0 87.7%

      \[\leadsto \color{blue}{1 + x \cdot \left(1 + x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right)} \]
    5. Step-by-step derivation
      1. *-commutative87.7%

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

      \[\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 simplification59.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+54}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{+58}:\\ \;\;\;\;1 + z \cdot \left(z \cdot \left(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 10: 49.6% accurate, 9.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+54}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{+59}:\\ \;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -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.3e+54)
   0.0
   (if (<= x 1.2e+59)
     (+ 1.0 (* z (+ (* z (* z -0.16666666666666666)) -1.0)))
     (+ 1.0 (* x (+ 1.0 (* x 0.5)))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.3e+54) {
		tmp = 0.0;
	} else if (x <= 1.2e+59) {
		tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -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.3d+54)) then
        tmp = 0.0d0
    else if (x <= 1.2d+59) then
        tmp = 1.0d0 + (z * ((z * (z * (-0.16666666666666666d0))) + (-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.3e+54) {
		tmp = 0.0;
	} else if (x <= 1.2e+59) {
		tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
	} else {
		tmp = 1.0 + (x * (1.0 + (x * 0.5)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -2.3e+54:
		tmp = 0.0
	elif x <= 1.2e+59:
		tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -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.3e+54)
		tmp = 0.0;
	elseif (x <= 1.2e+59)
		tmp = Float64(1.0 + Float64(z * Float64(Float64(z * Float64(z * -0.16666666666666666)) + -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.3e+54)
		tmp = 0.0;
	elseif (x <= 1.2e+59)
		tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -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.3e+54], 0.0, If[LessEqual[x, 1.2e+59], N[(1.0 + N[(z * N[(N[(z * N[(z * -0.16666666666666666), $MachinePrecision]), $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.3 \cdot 10^{+54}:\\
\;\;\;\;0\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{+59}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -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.29999999999999994e54

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified43.8%

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

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

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

        \[\leadsto \color{blue}{1 - z} \]
    8. Simplified3.0%

      \[\leadsto \color{blue}{1 - z} \]
    9. Taylor expanded in z around inf 3.6%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    10. Step-by-step derivation
      1. neg-mul-13.6%

        \[\leadsto \color{blue}{-z} \]
    11. Simplified3.6%

      \[\leadsto \color{blue}{-z} \]
    12. Step-by-step derivation
      1. add-log-exp52.3%

        \[\leadsto \color{blue}{\log \left(e^{-z}\right)} \]
      2. exp-neg52.3%

        \[\leadsto \log \color{blue}{\left(\frac{1}{e^{z}}\right)} \]
      3. add-sqr-sqrt52.3%

        \[\leadsto \log \left(\frac{1}{\color{blue}{\sqrt{e^{z}} \cdot \sqrt{e^{z}}}}\right) \]
      4. associate-/r*52.3%

        \[\leadsto \log \color{blue}{\left(\frac{\frac{1}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right)} \]
      5. metadata-eval52.3%

        \[\leadsto \log \left(\frac{\frac{\color{blue}{\sqrt{1}}}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      6. sqrt-div52.3%

        \[\leadsto \log \left(\frac{\color{blue}{\sqrt{\frac{1}{e^{z}}}}}{\sqrt{e^{z}}}\right) \]
      7. exp-neg52.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      8. pow152.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{-z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      9. pow152.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      10. add-sqr-sqrt37.7%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}}}{\sqrt{e^{z}}}\right) \]
      11. sqrt-unprod51.8%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}}}{\sqrt{e^{z}}}\right) \]
      12. sqr-neg51.8%

        \[\leadsto \log \left(\frac{\sqrt{e^{\sqrt{\color{blue}{z \cdot z}}}}}{\sqrt{e^{z}}}\right) \]
      13. sqrt-unprod14.1%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}}}{\sqrt{e^{z}}}\right) \]
      14. add-sqr-sqrt42.2%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{z}}}}{\sqrt{e^{z}}}\right) \]
      15. pow142.2%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      16. pow142.2%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      17. log-div42.2%

        \[\leadsto \color{blue}{\log \left(\sqrt{e^{z}}\right) - \log \left(\sqrt{e^{z}}\right)} \]
    13. Applied egg-rr84.6%

      \[\leadsto \color{blue}{0.5 \cdot z - 0.5 \cdot z} \]
    14. Step-by-step derivation
      1. +-inverses84.6%

        \[\leadsto \color{blue}{0} \]
    15. Simplified84.6%

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

    if -2.29999999999999994e54 < x < 1.2000000000000001e59

    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.6%

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

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

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

      \[\leadsto \color{blue}{1 + z \cdot \left(z \cdot \left(0.5 + -0.16666666666666666 \cdot z\right) - 1\right)} \]
    7. Taylor expanded in z around inf 41.6%

      \[\leadsto 1 + z \cdot \left(z \cdot \color{blue}{\left(-0.16666666666666666 \cdot z\right)} - 1\right) \]
    8. Step-by-step derivation
      1. *-commutative41.6%

        \[\leadsto 1 + z \cdot \left(z \cdot \color{blue}{\left(z \cdot -0.16666666666666666\right)} - 1\right) \]
    9. Simplified41.6%

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

    if 1.2000000000000001e59 < x

    1. Initial program 100.0%

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

      \[\leadsto e^{\color{blue}{x}} \]
    4. Taylor expanded in x around 0 71.1%

      \[\leadsto \color{blue}{1 + x \cdot \left(1 + 0.5 \cdot x\right)} \]
    5. Step-by-step derivation
      1. *-commutative71.1%

        \[\leadsto 1 + x \cdot \left(1 + \color{blue}{x \cdot 0.5}\right) \]
    6. Simplified71.1%

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

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

Alternative 11: 49.1% accurate, 10.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{+41}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 1.45 \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.2e+41)
   0.0
   (if (<= x 1.45e+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.2e+41) {
		tmp = 0.0;
	} else if (x <= 1.45e+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.2d+41)) then
        tmp = 0.0d0
    else if (x <= 1.45d+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.2e+41) {
		tmp = 0.0;
	} else if (x <= 1.45e+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.2e+41:
		tmp = 0.0
	elif x <= 1.45e+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.2e+41)
		tmp = 0.0;
	elseif (x <= 1.45e+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.2e+41)
		tmp = 0.0;
	elseif (x <= 1.45e+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.2e+41], 0.0, If[LessEqual[x, 1.45e+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.2 \cdot 10^{+41}:\\
\;\;\;\;0\\

\mathbf{elif}\;x \leq 1.45 \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.1999999999999999e41

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified44.0%

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

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

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

        \[\leadsto \color{blue}{1 - z} \]
    8. Simplified3.0%

      \[\leadsto \color{blue}{1 - z} \]
    9. Taylor expanded in z around inf 3.7%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    10. Step-by-step derivation
      1. neg-mul-13.7%

        \[\leadsto \color{blue}{-z} \]
    11. Simplified3.7%

      \[\leadsto \color{blue}{-z} \]
    12. Step-by-step derivation
      1. add-log-exp53.8%

        \[\leadsto \color{blue}{\log \left(e^{-z}\right)} \]
      2. exp-neg53.8%

        \[\leadsto \log \color{blue}{\left(\frac{1}{e^{z}}\right)} \]
      3. add-sqr-sqrt53.8%

        \[\leadsto \log \left(\frac{1}{\color{blue}{\sqrt{e^{z}} \cdot \sqrt{e^{z}}}}\right) \]
      4. associate-/r*53.8%

        \[\leadsto \log \color{blue}{\left(\frac{\frac{1}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right)} \]
      5. metadata-eval53.8%

        \[\leadsto \log \left(\frac{\frac{\color{blue}{\sqrt{1}}}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      6. sqrt-div53.8%

        \[\leadsto \log \left(\frac{\color{blue}{\sqrt{\frac{1}{e^{z}}}}}{\sqrt{e^{z}}}\right) \]
      7. exp-neg53.8%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      8. pow153.8%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{-z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      9. pow153.8%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      10. add-sqr-sqrt38.1%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}}}{\sqrt{e^{z}}}\right) \]
      11. sqrt-unprod53.3%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}}}{\sqrt{e^{z}}}\right) \]
      12. sqr-neg53.3%

        \[\leadsto \log \left(\frac{\sqrt{e^{\sqrt{\color{blue}{z \cdot z}}}}}{\sqrt{e^{z}}}\right) \]
      13. sqrt-unprod15.2%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}}}{\sqrt{e^{z}}}\right) \]
      14. add-sqr-sqrt42.5%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{z}}}}{\sqrt{e^{z}}}\right) \]
      15. pow142.5%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      16. pow142.5%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      17. log-div42.5%

        \[\leadsto \color{blue}{\log \left(\sqrt{e^{z}}\right) - \log \left(\sqrt{e^{z}}\right)} \]
    13. Applied egg-rr83.6%

      \[\leadsto \color{blue}{0.5 \cdot z - 0.5 \cdot z} \]
    14. Step-by-step derivation
      1. +-inverses83.6%

        \[\leadsto \color{blue}{0} \]
    15. Simplified83.6%

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

    if -2.1999999999999999e41 < x < 1.45e145

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified60.8%

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

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

    if 1.45e145 < x

    1. Initial program 100.0%

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

      \[\leadsto e^{\color{blue}{x}} \]
    4. Taylor expanded in x around 0 90.8%

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

        \[\leadsto 1 + x \cdot \left(1 + \color{blue}{x \cdot 0.5}\right) \]
    6. Simplified90.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{+41}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 1.45 \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 12: 49.0% accurate, 10.9× speedup?

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

\mathbf{elif}\;x \leq 9.5 \cdot 10^{+145}:\\
\;\;\;\;1 + z \cdot \left(z \cdot 0.5\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.80000000000000001e39

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified44.0%

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

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

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

        \[\leadsto \color{blue}{1 - z} \]
    8. Simplified3.0%

      \[\leadsto \color{blue}{1 - z} \]
    9. Taylor expanded in z around inf 3.7%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    10. Step-by-step derivation
      1. neg-mul-13.7%

        \[\leadsto \color{blue}{-z} \]
    11. Simplified3.7%

      \[\leadsto \color{blue}{-z} \]
    12. Step-by-step derivation
      1. add-log-exp53.8%

        \[\leadsto \color{blue}{\log \left(e^{-z}\right)} \]
      2. exp-neg53.8%

        \[\leadsto \log \color{blue}{\left(\frac{1}{e^{z}}\right)} \]
      3. add-sqr-sqrt53.8%

        \[\leadsto \log \left(\frac{1}{\color{blue}{\sqrt{e^{z}} \cdot \sqrt{e^{z}}}}\right) \]
      4. associate-/r*53.8%

        \[\leadsto \log \color{blue}{\left(\frac{\frac{1}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right)} \]
      5. metadata-eval53.8%

        \[\leadsto \log \left(\frac{\frac{\color{blue}{\sqrt{1}}}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      6. sqrt-div53.8%

        \[\leadsto \log \left(\frac{\color{blue}{\sqrt{\frac{1}{e^{z}}}}}{\sqrt{e^{z}}}\right) \]
      7. exp-neg53.8%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      8. pow153.8%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{-z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      9. pow153.8%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      10. add-sqr-sqrt38.1%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}}}{\sqrt{e^{z}}}\right) \]
      11. sqrt-unprod53.3%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}}}{\sqrt{e^{z}}}\right) \]
      12. sqr-neg53.3%

        \[\leadsto \log \left(\frac{\sqrt{e^{\sqrt{\color{blue}{z \cdot z}}}}}{\sqrt{e^{z}}}\right) \]
      13. sqrt-unprod15.2%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}}}{\sqrt{e^{z}}}\right) \]
      14. add-sqr-sqrt42.5%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{z}}}}{\sqrt{e^{z}}}\right) \]
      15. pow142.5%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      16. pow142.5%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      17. log-div42.5%

        \[\leadsto \color{blue}{\log \left(\sqrt{e^{z}}\right) - \log \left(\sqrt{e^{z}}\right)} \]
    13. Applied egg-rr83.6%

      \[\leadsto \color{blue}{0.5 \cdot z - 0.5 \cdot z} \]
    14. Step-by-step derivation
      1. +-inverses83.6%

        \[\leadsto \color{blue}{0} \]
    15. Simplified83.6%

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

    if -2.80000000000000001e39 < x < 9.49999999999999948e145

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified60.8%

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

      \[\leadsto \color{blue}{1 + z \cdot \left(0.5 \cdot z - 1\right)} \]
    7. Taylor expanded in z around inf 36.5%

      \[\leadsto 1 + z \cdot \color{blue}{\left(0.5 \cdot z\right)} \]
    8. Step-by-step derivation
      1. *-commutative36.5%

        \[\leadsto 1 + z \cdot \color{blue}{\left(z \cdot 0.5\right)} \]
    9. Simplified36.5%

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

    if 9.49999999999999948e145 < x

    1. Initial program 100.0%

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

      \[\leadsto e^{\color{blue}{x}} \]
    4. Taylor expanded in x around 0 90.8%

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

        \[\leadsto 1 + x \cdot \left(1 + \color{blue}{x \cdot 0.5}\right) \]
    6. Simplified90.8%

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

Alternative 13: 40.1% accurate, 17.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+41}:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.7999999999999999e41

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified44.0%

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

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

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

        \[\leadsto \color{blue}{1 - z} \]
    8. Simplified3.0%

      \[\leadsto \color{blue}{1 - z} \]
    9. Taylor expanded in z around inf 3.7%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    10. Step-by-step derivation
      1. neg-mul-13.7%

        \[\leadsto \color{blue}{-z} \]
    11. Simplified3.7%

      \[\leadsto \color{blue}{-z} \]
    12. Step-by-step derivation
      1. add-log-exp53.8%

        \[\leadsto \color{blue}{\log \left(e^{-z}\right)} \]
      2. exp-neg53.8%

        \[\leadsto \log \color{blue}{\left(\frac{1}{e^{z}}\right)} \]
      3. add-sqr-sqrt53.8%

        \[\leadsto \log \left(\frac{1}{\color{blue}{\sqrt{e^{z}} \cdot \sqrt{e^{z}}}}\right) \]
      4. associate-/r*53.8%

        \[\leadsto \log \color{blue}{\left(\frac{\frac{1}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right)} \]
      5. metadata-eval53.8%

        \[\leadsto \log \left(\frac{\frac{\color{blue}{\sqrt{1}}}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      6. sqrt-div53.8%

        \[\leadsto \log \left(\frac{\color{blue}{\sqrt{\frac{1}{e^{z}}}}}{\sqrt{e^{z}}}\right) \]
      7. exp-neg53.8%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      8. pow153.8%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{-z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      9. pow153.8%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      10. add-sqr-sqrt38.1%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}}}{\sqrt{e^{z}}}\right) \]
      11. sqrt-unprod53.3%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}}}{\sqrt{e^{z}}}\right) \]
      12. sqr-neg53.3%

        \[\leadsto \log \left(\frac{\sqrt{e^{\sqrt{\color{blue}{z \cdot z}}}}}{\sqrt{e^{z}}}\right) \]
      13. sqrt-unprod15.2%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}}}{\sqrt{e^{z}}}\right) \]
      14. add-sqr-sqrt42.5%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{z}}}}{\sqrt{e^{z}}}\right) \]
      15. pow142.5%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      16. pow142.5%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      17. log-div42.5%

        \[\leadsto \color{blue}{\log \left(\sqrt{e^{z}}\right) - \log \left(\sqrt{e^{z}}\right)} \]
    13. Applied egg-rr83.6%

      \[\leadsto \color{blue}{0.5 \cdot z - 0.5 \cdot z} \]
    14. Step-by-step derivation
      1. +-inverses83.6%

        \[\leadsto \color{blue}{0} \]
    15. Simplified83.6%

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

    if -2.7999999999999999e41 < x

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified54.2%

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

      \[\leadsto \color{blue}{1 + z \cdot \left(0.5 \cdot z - 1\right)} \]
    7. Taylor expanded in z around inf 32.3%

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

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

      \[\leadsto 1 + z \cdot \color{blue}{\left(z \cdot 0.5\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 14: 30.9% accurate, 18.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.46 \cdot 10^{+24}:\\
\;\;\;\;0\\

\mathbf{elif}\;x \leq 5 \cdot 10^{-61}:\\
\;\;\;\;1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.46000000000000013e24 or 4.9999999999999999e-61 < x

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified40.6%

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

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

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

        \[\leadsto \color{blue}{1 - z} \]
    8. Simplified4.7%

      \[\leadsto \color{blue}{1 - z} \]
    9. Taylor expanded in z around inf 3.1%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    10. Step-by-step derivation
      1. neg-mul-13.1%

        \[\leadsto \color{blue}{-z} \]
    11. Simplified3.1%

      \[\leadsto \color{blue}{-z} \]
    12. Step-by-step derivation
      1. add-log-exp37.1%

        \[\leadsto \color{blue}{\log \left(e^{-z}\right)} \]
      2. exp-neg37.1%

        \[\leadsto \log \color{blue}{\left(\frac{1}{e^{z}}\right)} \]
      3. add-sqr-sqrt37.1%

        \[\leadsto \log \left(\frac{1}{\color{blue}{\sqrt{e^{z}} \cdot \sqrt{e^{z}}}}\right) \]
      4. associate-/r*37.1%

        \[\leadsto \log \color{blue}{\left(\frac{\frac{1}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right)} \]
      5. metadata-eval37.1%

        \[\leadsto \log \left(\frac{\frac{\color{blue}{\sqrt{1}}}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      6. sqrt-div37.1%

        \[\leadsto \log \left(\frac{\color{blue}{\sqrt{\frac{1}{e^{z}}}}}{\sqrt{e^{z}}}\right) \]
      7. exp-neg37.1%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      8. pow137.1%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{-z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      9. pow137.1%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      10. add-sqr-sqrt29.2%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}}}{\sqrt{e^{z}}}\right) \]
      11. sqrt-unprod36.7%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}}}{\sqrt{e^{z}}}\right) \]
      12. sqr-neg36.7%

        \[\leadsto \log \left(\frac{\sqrt{e^{\sqrt{\color{blue}{z \cdot z}}}}}{\sqrt{e^{z}}}\right) \]
      13. sqrt-unprod7.5%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}}}{\sqrt{e^{z}}}\right) \]
      14. add-sqr-sqrt21.8%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{z}}}}{\sqrt{e^{z}}}\right) \]
      15. pow121.8%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      16. pow121.8%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      17. log-div21.8%

        \[\leadsto \color{blue}{\log \left(\sqrt{e^{z}}\right) - \log \left(\sqrt{e^{z}}\right)} \]
    13. Applied egg-rr48.6%

      \[\leadsto \color{blue}{0.5 \cdot z - 0.5 \cdot z} \]
    14. Step-by-step derivation
      1. +-inverses48.6%

        \[\leadsto \color{blue}{0} \]
    15. Simplified48.6%

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

    if -1.46000000000000013e24 < x < 4.9999999999999999e-61

    1. Initial program 100.0%

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

      \[\leadsto e^{\color{blue}{x}} \]
    4. Taylor expanded in x around 0 23.0%

      \[\leadsto \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 30.6% accurate, 25.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0057:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -0.0057000000000000002

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 - z} \]
    8. Simplified3.1%

      \[\leadsto \color{blue}{1 - z} \]
    9. Taylor expanded in z around inf 3.6%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    10. Step-by-step derivation
      1. neg-mul-13.6%

        \[\leadsto \color{blue}{-z} \]
    11. Simplified3.6%

      \[\leadsto \color{blue}{-z} \]
    12. Step-by-step derivation
      1. add-log-exp54.5%

        \[\leadsto \color{blue}{\log \left(e^{-z}\right)} \]
      2. exp-neg54.5%

        \[\leadsto \log \color{blue}{\left(\frac{1}{e^{z}}\right)} \]
      3. add-sqr-sqrt54.5%

        \[\leadsto \log \left(\frac{1}{\color{blue}{\sqrt{e^{z}} \cdot \sqrt{e^{z}}}}\right) \]
      4. associate-/r*54.5%

        \[\leadsto \log \color{blue}{\left(\frac{\frac{1}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right)} \]
      5. metadata-eval54.5%

        \[\leadsto \log \left(\frac{\frac{\color{blue}{\sqrt{1}}}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      6. sqrt-div54.5%

        \[\leadsto \log \left(\frac{\color{blue}{\sqrt{\frac{1}{e^{z}}}}}{\sqrt{e^{z}}}\right) \]
      7. exp-neg54.5%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      8. pow154.5%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{-z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      9. pow154.5%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
      10. add-sqr-sqrt41.2%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}}}{\sqrt{e^{z}}}\right) \]
      11. sqrt-unprod54.1%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}}}{\sqrt{e^{z}}}\right) \]
      12. sqr-neg54.1%

        \[\leadsto \log \left(\frac{\sqrt{e^{\sqrt{\color{blue}{z \cdot z}}}}}{\sqrt{e^{z}}}\right) \]
      13. sqrt-unprod12.9%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}}}{\sqrt{e^{z}}}\right) \]
      14. add-sqr-sqrt37.3%

        \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{z}}}}{\sqrt{e^{z}}}\right) \]
      15. pow137.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
      16. pow137.3%

        \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{z}}}}{\sqrt{e^{z}}}\right) \]
      17. log-div37.3%

        \[\leadsto \color{blue}{\log \left(\sqrt{e^{z}}\right) - \log \left(\sqrt{e^{z}}\right)} \]
    13. Applied egg-rr73.5%

      \[\leadsto \color{blue}{0.5 \cdot z - 0.5 \cdot z} \]
    14. Step-by-step derivation
      1. +-inverses73.5%

        \[\leadsto \color{blue}{0} \]
    15. Simplified73.5%

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

    if -0.0057000000000000002 < x

    1. Initial program 100.0%

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

      \[\leadsto e^{\color{blue}{x}} \]
    4. Taylor expanded in x around 0 18.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.0057:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 29.5% 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. Add Preprocessing
  3. Taylor expanded in z around inf 51.6%

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

      \[\leadsto e^{\color{blue}{-z}} \]
  5. Simplified51.6%

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

    \[\leadsto \color{blue}{1 + -1 \cdot z} \]
  7. Step-by-step derivation
    1. mul-1-neg13.5%

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

      \[\leadsto \color{blue}{1 - z} \]
  8. Simplified13.5%

    \[\leadsto \color{blue}{1 - z} \]
  9. Taylor expanded in z around inf 3.2%

    \[\leadsto \color{blue}{-1 \cdot z} \]
  10. Step-by-step derivation
    1. neg-mul-13.2%

      \[\leadsto \color{blue}{-z} \]
  11. Simplified3.2%

    \[\leadsto \color{blue}{-z} \]
  12. Step-by-step derivation
    1. add-log-exp35.9%

      \[\leadsto \color{blue}{\log \left(e^{-z}\right)} \]
    2. exp-neg35.9%

      \[\leadsto \log \color{blue}{\left(\frac{1}{e^{z}}\right)} \]
    3. add-sqr-sqrt35.9%

      \[\leadsto \log \left(\frac{1}{\color{blue}{\sqrt{e^{z}} \cdot \sqrt{e^{z}}}}\right) \]
    4. associate-/r*35.9%

      \[\leadsto \log \color{blue}{\left(\frac{\frac{1}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right)} \]
    5. metadata-eval35.9%

      \[\leadsto \log \left(\frac{\frac{\color{blue}{\sqrt{1}}}{\sqrt{e^{z}}}}{\sqrt{e^{z}}}\right) \]
    6. sqrt-div35.9%

      \[\leadsto \log \left(\frac{\color{blue}{\sqrt{\frac{1}{e^{z}}}}}{\sqrt{e^{z}}}\right) \]
    7. exp-neg35.9%

      \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
    8. pow135.9%

      \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{-z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
    9. pow135.9%

      \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{-z}}}}{\sqrt{e^{z}}}\right) \]
    10. add-sqr-sqrt31.4%

      \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}}}{\sqrt{e^{z}}}\right) \]
    11. sqrt-unprod35.7%

      \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}}}{\sqrt{e^{z}}}\right) \]
    12. sqr-neg35.7%

      \[\leadsto \log \left(\frac{\sqrt{e^{\sqrt{\color{blue}{z \cdot z}}}}}{\sqrt{e^{z}}}\right) \]
    13. sqrt-unprod4.3%

      \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}}}{\sqrt{e^{z}}}\right) \]
    14. add-sqr-sqrt12.1%

      \[\leadsto \log \left(\frac{\sqrt{e^{\color{blue}{z}}}}{\sqrt{e^{z}}}\right) \]
    15. pow112.1%

      \[\leadsto \log \left(\frac{\sqrt{\color{blue}{{\left(e^{z}\right)}^{1}}}}{\sqrt{e^{z}}}\right) \]
    16. pow112.1%

      \[\leadsto \log \left(\frac{\sqrt{\color{blue}{e^{z}}}}{\sqrt{e^{z}}}\right) \]
    17. log-div12.1%

      \[\leadsto \color{blue}{\log \left(\sqrt{e^{z}}\right) - \log \left(\sqrt{e^{z}}\right)} \]
  13. Applied egg-rr30.6%

    \[\leadsto \color{blue}{0.5 \cdot z - 0.5 \cdot z} \]
  14. Step-by-step derivation
    1. +-inverses30.6%

      \[\leadsto \color{blue}{0} \]
  15. Simplified30.6%

    \[\leadsto \color{blue}{0} \]
  16. Add Preprocessing

Developer Target 1: 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 2024141 
(FPCore (x y z)
  :name "Statistics.Distribution.Poisson.Internal:probability from math-functions-0.1.5.2"
  :precision binary64

  :alt
  (! :herbie-platform default (exp (+ (- x z) (* (log y) y))))

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