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

Percentage Accurate: 100.0% → 100.0%
Time: 10.0s
Alternatives: 17
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 17 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.3% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999998e-303 < (*.f64 y (log.f64 y))

    1. Initial program 100.0%

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

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

Alternative 3: 89.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq 4 \cdot 10^{+119}:\\
\;\;\;\;e^{y \cdot \log y - z}\\

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


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

    1. Initial program 100.0%

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

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

    if -2.49999999999999988e157 < x < 3.99999999999999978e119

    1. Initial program 100.0%

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

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

    if 3.99999999999999978e119 < 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 91.3%

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

      \[\leadsto \color{blue}{1 + x \cdot \left(1 + x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right)} \]
    5. Taylor expanded in x around inf 91.3%

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

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

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

Alternative 4: 81.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+130} \lor \neg \left(x \leq 1.7 \cdot 10^{+99}\right):\\
\;\;\;\;e^{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.5000000000000009e130 or 1.69999999999999992e99 < 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 85.1%

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

    if -9.5000000000000009e130 < x < 1.69999999999999992e99

    1. Initial program 100.0%

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

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

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

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

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

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

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

Alternative 5: 82.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-7} \lor \neg \left(z \leq 6 \cdot 10^{+111}\right):\\
\;\;\;\;e^{-z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.7999999999999995e-7 or 6e111 < 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 83.2%

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

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

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

    if -5.7999999999999995e-7 < z < 6e111

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
    4. Step-by-step derivation
      1. +-commutative93.1%

        \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
      2. exp-sum80.8%

        \[\leadsto \color{blue}{e^{y \cdot \log y} \cdot e^{x}} \]
      3. *-commutative80.8%

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

        \[\leadsto \color{blue}{{y}^{y}} \cdot e^{x} \]
    5. Simplified80.8%

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

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

Alternative 6: 73.1% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{+83} \lor \neg \left(x \leq 90\right):\\ \;\;\;\;e^{x}\\ \mathbf{else}:\\ \;\;\;\;e^{-z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -1.3e+83) (not (<= x 90.0))) (exp x) (exp (- z))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.3e+83) || !(x <= 90.0)) {
		tmp = exp(x);
	} else {
		tmp = exp(-z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((x <= (-1.3d+83)) .or. (.not. (x <= 90.0d0))) then
        tmp = exp(x)
    else
        tmp = exp(-z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.3e+83) || !(x <= 90.0)) {
		tmp = Math.exp(x);
	} else {
		tmp = Math.exp(-z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -1.3e+83) or not (x <= 90.0):
		tmp = math.exp(x)
	else:
		tmp = math.exp(-z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -1.3e+83) || !(x <= 90.0))
		tmp = exp(x);
	else
		tmp = exp(Float64(-z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((x <= -1.3e+83) || ~((x <= 90.0)))
		tmp = exp(x);
	else
		tmp = exp(-z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.3e+83], N[Not[LessEqual[x, 90.0]], $MachinePrecision]], N[Exp[x], $MachinePrecision], N[Exp[(-z)], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+83} \lor \neg \left(x \leq 90\right):\\
\;\;\;\;e^{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3000000000000001e83 or 90 < 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 79.6%

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

    if -1.3000000000000001e83 < x < 90

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified66.7%

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

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

Alternative 7: 72.4% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.25 \cdot 10^{-139}:\\
\;\;\;\;e^{-z}\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{-13}:\\
\;\;\;\;e^{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.25000000000000008e-139

    1. Initial program 100.0%

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

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

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

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

    if 1.25000000000000008e-139 < y < 3.5000000000000002e-13

    1. Initial program 100.0%

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

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

    if 3.5000000000000002e-13 < y

    1. Initial program 100.0%

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

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

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

Alternative 8: 62.5% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

      \[\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 87.2%

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

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

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

    if -2.54999999999999996e105 < z

    1. Initial program 100.0%

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

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

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

Alternative 9: 42.5% accurate, 9.0× speedup?

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

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

      \[\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 80.7%

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

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

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

    if -6.79999999999999984e80 < z < 3.2999999999999999e85

    1. Initial program 100.0%

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

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

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

    if 3.2999999999999999e85 < 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 76.2%

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

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

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt0.0%

        \[\leadsto e^{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      2. sqrt-unprod25.3%

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

        \[\leadsto e^{\sqrt{\color{blue}{z \cdot z}}} \]
      4. sqrt-unprod25.3%

        \[\leadsto e^{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      5. add-sqr-sqrt25.3%

        \[\leadsto e^{\color{blue}{z}} \]
      6. expm1-log1p-u25.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(e^{z}\right)\right)} \]
      7. expm1-undefine25.3%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(e^{z}\right)} - 1} \]
    7. Applied egg-rr25.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(e^{z}\right)} - 1} \]
    8. Step-by-step derivation
      1. log1p-undefine25.3%

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

        \[\leadsto \color{blue}{\left(1 + e^{z}\right)} - 1 \]
      3. associate-+r-25.3%

        \[\leadsto \color{blue}{1 + \left(e^{z} - 1\right)} \]
      4. expm1-undefine25.3%

        \[\leadsto 1 + \color{blue}{\mathsf{expm1}\left(z\right)} \]
      5. rem-exp-log25.3%

        \[\leadsto \color{blue}{e^{\log \left(1 + \mathsf{expm1}\left(z\right)\right)}} \]
      6. log1p-define25.3%

        \[\leadsto e^{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(z\right)\right)}} \]
      7. log1p-expm125.3%

        \[\leadsto e^{\color{blue}{z}} \]
    9. Simplified25.3%

      \[\leadsto \color{blue}{e^{z}} \]
    10. Taylor expanded in z around 0 22.1%

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

        \[\leadsto 1 + z \cdot \left(1 + z \cdot \left(0.5 + \color{blue}{z \cdot 0.16666666666666666}\right)\right) \]
    12. Simplified22.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{+80}:\\ \;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+85}:\\ \;\;\;\;1 + x \cdot \left(1 + x \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 + z \cdot \left(1 + z \cdot \left(0.5 + z \cdot 0.16666666666666666\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 41.7% accurate, 9.0× speedup?

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

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

      \[\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 80.7%

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

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

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

    if -6.59999999999999982e80 < z < 8.5000000000000003e163

    1. Initial program 100.0%

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

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

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

    if 8.5000000000000003e163 < 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 83.1%

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified83.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{+80}:\\ \;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+163}:\\ \;\;\;\;1 + x \cdot \left(1 + x \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 + z \cdot \left(z \cdot 0.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 41.6% accurate, 9.8× speedup?

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

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

\mathbf{elif}\;z \leq 7.5 \cdot 10^{+163}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\\

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


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

    1. Initial program 100.0%

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

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

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

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

      \[\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 80.7%

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

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

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

    if -4.30000000000000004e80 < z < 7.50000000000000001e163

    1. Initial program 100.0%

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

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

      \[\leadsto \color{blue}{1 + x \cdot \left(1 + x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right)} \]
    5. Taylor expanded in x around inf 36.8%

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

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

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

    if 7.50000000000000001e163 < 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 83.1%

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified83.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{+80}:\\ \;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+163}:\\ \;\;\;\;1 + x \cdot \left(1 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 + z \cdot \left(z \cdot 0.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 39.2% accurate, 12.9× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

    if 1.45e52 < 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 82.0%

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

      \[\leadsto \color{blue}{1 + x \cdot \left(1 + x \cdot \left(0.5 + 0.16666666666666666 \cdot x\right)\right)} \]
    5. Taylor expanded in x around inf 71.2%

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

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

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

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

Alternative 13: 36.8% accurate, 14.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.6 \cdot 10^{+134}:\\ \;\;\;\;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 1.6e+134)
   (+ 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 <= 1.6e+134) {
		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 <= 1.6d+134) 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 <= 1.6e+134) {
		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 <= 1.6e+134:
		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 <= 1.6e+134)
		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 <= 1.6e+134)
		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, 1.6e+134], 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 1.6 \cdot 10^{+134}:\\
\;\;\;\;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 2 regimes
  2. if x < 1.6e134

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified58.1%

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

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

    if 1.6e134 < 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}} \]
    4. Taylor expanded in x around 0 85.6%

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

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

Alternative 14: 36.6% accurate, 14.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.6 \cdot 10^{+134}:\\ \;\;\;\;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 1.6e+134) (+ 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 <= 1.6e+134) {
		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 <= 1.6d+134) 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 <= 1.6e+134) {
		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 <= 1.6e+134:
		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 <= 1.6e+134)
		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 <= 1.6e+134)
		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, 1.6e+134], 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 1.6 \cdot 10^{+134}:\\
\;\;\;\;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 2 regimes
  2. if x < 1.6e134

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified58.1%

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

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

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

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

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

    if 1.6e134 < 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}} \]
    4. Taylor expanded in x around 0 85.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.6 \cdot 10^{+134}:\\ \;\;\;\;1 + z \cdot \left(z \cdot 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x \cdot \left(1 + x \cdot 0.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 28.2% accurate, 29.6× speedup?

\[\begin{array}{l} \\ 1 + z \cdot \left(z \cdot 0.5\right) \end{array} \]
(FPCore (x y z) :precision binary64 (+ 1.0 (* z (* z 0.5))))
double code(double x, double y, double z) {
	return 1.0 + (z * (z * 0.5));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = 1.0d0 + (z * (z * 0.5d0))
end function
public static double code(double x, double y, double z) {
	return 1.0 + (z * (z * 0.5));
}
def code(x, y, z):
	return 1.0 + (z * (z * 0.5))
function code(x, y, z)
	return Float64(1.0 + Float64(z * Float64(z * 0.5)))
end
function tmp = code(x, y, z)
	tmp = 1.0 + (z * (z * 0.5));
end
code[x_, y_, z_] := N[(1.0 + N[(z * N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
1 + z \cdot \left(z \cdot 0.5\right)
\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 54.4%

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

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

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

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

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

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

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

Alternative 16: 14.1% accurate, 69.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{1 + x} \]
  5. Final simplification13.0%

    \[\leadsto x + 1 \]
  6. Add Preprocessing

Alternative 17: 14.0% accurate, 207.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  5. 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 2024132 
(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)))