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

Percentage Accurate: 100.0% → 100.0%
Time: 8.1s
Alternatives: 6
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 6 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(\log y \cdot y + x\right) - z} \end{array} \]
(FPCore (x y z) :precision binary64 (exp (- (+ (* (log y) y) x) z)))
double code(double x, double y, double z) {
	return exp((((log(y) * y) + x) - z));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = exp((((log(y) * y) + x) - z))
end function
public static double code(double x, double y, double z) {
	return Math.exp((((Math.log(y) * y) + x) - z));
}
def code(x, y, z):
	return math.exp((((math.log(y) * y) + x) - z))
function code(x, y, z)
	return exp(Float64(Float64(Float64(log(y) * y) + x) - z))
end
function tmp = code(x, y, z)
	tmp = exp((((log(y) * y) + x) - z));
end
code[x_, y_, z_] := N[Exp[N[(N[(N[(N[Log[y], $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

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

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

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

Alternative 2: 89.9% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y (log.f64 y)) < 5.0000000000000002e137

    1. Initial program 100.0%

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

      \[\leadsto e^{\color{blue}{x - z}} \]
    4. Step-by-step derivation
      1. lower--.f6492.7

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

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

    if 5.0000000000000002e137 < (*.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 y around inf

      \[\leadsto e^{\color{blue}{-1 \cdot \left(y \cdot \log \left(\frac{1}{y}\right)\right)}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(y \cdot \log \left(\frac{1}{y}\right)\right)}} \]
      2. *-commutativeN/A

        \[\leadsto e^{\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{y}\right) \cdot y}\right)} \]
      3. distribute-lft-neg-inN/A

        \[\leadsto e^{\color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{y}\right)\right)\right) \cdot y}} \]
      4. log-recN/A

        \[\leadsto e^{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right)}\right)\right) \cdot y} \]
      5. remove-double-negN/A

        \[\leadsto e^{\color{blue}{\log y} \cdot y} \]
      6. lower-*.f64N/A

        \[\leadsto e^{\color{blue}{\log y \cdot y}} \]
      7. lower-log.f6491.1

        \[\leadsto e^{\color{blue}{\log y} \cdot y} \]
    5. Applied rewrites91.1%

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

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

Alternative 3: 79.7% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y (log.f64 y)) < 8.00000000000000035e264

    1. Initial program 100.0%

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

      \[\leadsto e^{\color{blue}{x - z}} \]
    4. Step-by-step derivation
      1. lower--.f6484.5

        \[\leadsto e^{\color{blue}{x - z}} \]
    5. Applied rewrites84.5%

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

    if 8.00000000000000035e264 < (*.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 y around 0

      \[\leadsto e^{\color{blue}{x - z}} \]
    4. Step-by-step derivation
      1. lower--.f6434.7

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

      \[\leadsto e^{\color{blue}{x - z}} \]
    6. Step-by-step derivation
      1. Applied rewrites34.7%

        \[\leadsto e^{\mathsf{fma}\left(x \cdot x, \color{blue}{\frac{1}{z + x}}, -z \cdot \frac{z}{z + x}\right)} \]
      2. Taylor expanded in x around 0

        \[\leadsto e^{\mathsf{fma}\left(x \cdot x, \frac{1}{z + x}, \mathsf{neg}\left(\left(z + -1 \cdot x\right)\right)\right)} \]
      3. Step-by-step derivation
        1. Applied rewrites34.7%

          \[\leadsto e^{\mathsf{fma}\left(x \cdot x, \frac{1}{z + x}, -\left(z - x\right)\right)} \]
        2. Taylor expanded in z around inf

          \[\leadsto e^{\mathsf{fma}\left(x \cdot x, \frac{1}{\color{blue}{z}}, \mathsf{neg}\left(\left(z - x\right)\right)\right)} \]
        3. Step-by-step derivation
          1. Applied rewrites56.4%

            \[\leadsto e^{\mathsf{fma}\left(x \cdot x, \frac{1}{\color{blue}{z}}, -\left(z - x\right)\right)} \]
        4. Recombined 2 regimes into one program.
        5. Final simplification81.5%

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

        Alternative 4: 77.8% accurate, 1.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{x - z}\\ \mathbf{if}\;z \leq 5.2 \cdot 10^{-307}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-156}:\\ \;\;\;\;e^{\mathsf{fma}\left(x \cdot x, \frac{1}{z}, -\left(z - x\right)\right)}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+80}:\\ \;\;\;\;e^{\mathsf{fma}\left(x \cdot x, \frac{1}{z + x}, \left(\left(-z\right) \cdot \frac{z}{x \cdot x}\right) \cdot \left(-z\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (let* ((t_0 (exp (- x z))))
           (if (<= z 5.2e-307)
             t_0
             (if (<= z 5.8e-156)
               (exp (fma (* x x) (/ 1.0 z) (- (- z x))))
               (if (<= z 5e+80)
                 (exp (fma (* x x) (/ 1.0 (+ z x)) (* (* (- z) (/ z (* x x))) (- z))))
                 t_0)))))
        double code(double x, double y, double z) {
        	double t_0 = exp((x - z));
        	double tmp;
        	if (z <= 5.2e-307) {
        		tmp = t_0;
        	} else if (z <= 5.8e-156) {
        		tmp = exp(fma((x * x), (1.0 / z), -(z - x)));
        	} else if (z <= 5e+80) {
        		tmp = exp(fma((x * x), (1.0 / (z + x)), ((-z * (z / (x * x))) * -z)));
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	t_0 = exp(Float64(x - z))
        	tmp = 0.0
        	if (z <= 5.2e-307)
        		tmp = t_0;
        	elseif (z <= 5.8e-156)
        		tmp = exp(fma(Float64(x * x), Float64(1.0 / z), Float64(-Float64(z - x))));
        	elseif (z <= 5e+80)
        		tmp = exp(fma(Float64(x * x), Float64(1.0 / Float64(z + x)), Float64(Float64(Float64(-z) * Float64(z / Float64(x * x))) * Float64(-z))));
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := Block[{t$95$0 = N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 5.2e-307], t$95$0, If[LessEqual[z, 5.8e-156], N[Exp[N[(N[(x * x), $MachinePrecision] * N[(1.0 / z), $MachinePrecision] + (-N[(z - x), $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 5e+80], N[Exp[N[(N[(x * x), $MachinePrecision] * N[(1.0 / N[(z + x), $MachinePrecision]), $MachinePrecision] + N[(N[((-z) * N[(z / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-z)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := e^{x - z}\\
        \mathbf{if}\;z \leq 5.2 \cdot 10^{-307}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;z \leq 5.8 \cdot 10^{-156}:\\
        \;\;\;\;e^{\mathsf{fma}\left(x \cdot x, \frac{1}{z}, -\left(z - x\right)\right)}\\
        
        \mathbf{elif}\;z \leq 5 \cdot 10^{+80}:\\
        \;\;\;\;e^{\mathsf{fma}\left(x \cdot x, \frac{1}{z + x}, \left(\left(-z\right) \cdot \frac{z}{x \cdot x}\right) \cdot \left(-z\right)\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if z < 5.19999999999999992e-307 or 4.99999999999999961e80 < z

          1. Initial program 100.0%

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

            \[\leadsto e^{\color{blue}{x - z}} \]
          4. Step-by-step derivation
            1. lower--.f6490.9

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

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

          if 5.19999999999999992e-307 < z < 5.80000000000000041e-156

          1. Initial program 100.0%

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

            \[\leadsto e^{\color{blue}{x - z}} \]
          4. Step-by-step derivation
            1. lower--.f6451.6

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

            \[\leadsto e^{\color{blue}{x - z}} \]
          6. Step-by-step derivation
            1. Applied rewrites51.6%

              \[\leadsto e^{\mathsf{fma}\left(x \cdot x, \color{blue}{\frac{1}{z + x}}, -z \cdot \frac{z}{z + x}\right)} \]
            2. Taylor expanded in x around 0

              \[\leadsto e^{\mathsf{fma}\left(x \cdot x, \frac{1}{z + x}, \mathsf{neg}\left(\left(z + -1 \cdot x\right)\right)\right)} \]
            3. Step-by-step derivation
              1. Applied rewrites50.1%

                \[\leadsto e^{\mathsf{fma}\left(x \cdot x, \frac{1}{z + x}, -\left(z - x\right)\right)} \]
              2. Taylor expanded in z around inf

                \[\leadsto e^{\mathsf{fma}\left(x \cdot x, \frac{1}{\color{blue}{z}}, \mathsf{neg}\left(\left(z - x\right)\right)\right)} \]
              3. Step-by-step derivation
                1. Applied rewrites76.7%

                  \[\leadsto e^{\mathsf{fma}\left(x \cdot x, \frac{1}{\color{blue}{z}}, -\left(z - x\right)\right)} \]

                if 5.80000000000000041e-156 < z < 4.99999999999999961e80

                1. Initial program 100.0%

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

                  \[\leadsto e^{\color{blue}{x - z}} \]
                4. Step-by-step derivation
                  1. lower--.f6458.1

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

                  \[\leadsto e^{\color{blue}{x - z}} \]
                6. Step-by-step derivation
                  1. Applied rewrites58.1%

                    \[\leadsto e^{\mathsf{fma}\left(x \cdot x, \color{blue}{\frac{1}{z + x}}, -z \cdot \frac{z}{z + x}\right)} \]
                  2. Taylor expanded in z around 0

                    \[\leadsto e^{\mathsf{fma}\left(x \cdot x, \frac{1}{z + x}, \mathsf{neg}\left(z \cdot \left(z \cdot \left(-1 \cdot \frac{z}{{x}^{2}} + \frac{1}{x}\right)\right)\right)\right)} \]
                  3. Step-by-step derivation
                    1. Applied rewrites76.1%

                      \[\leadsto e^{\mathsf{fma}\left(x \cdot x, \frac{1}{z + x}, -z \cdot \frac{z - \frac{z}{x} \cdot z}{x}\right)} \]
                    2. Taylor expanded in z around inf

                      \[\leadsto e^{\mathsf{fma}\left(x \cdot x, \frac{1}{z + x}, \mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{{z}^{2}}{{x}^{2}}\right)\right)\right)} \]
                    3. Step-by-step derivation
                      1. Applied rewrites76.1%

                        \[\leadsto e^{\mathsf{fma}\left(x \cdot x, \frac{1}{z + x}, -z \cdot \left(\frac{z}{x \cdot x} \cdot \left(-z\right)\right)\right)} \]
                    4. Recombined 3 regimes into one program.
                    5. Final simplification86.1%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 5.2 \cdot 10^{-307}:\\ \;\;\;\;e^{x - z}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-156}:\\ \;\;\;\;e^{\mathsf{fma}\left(x \cdot x, \frac{1}{z}, -\left(z - x\right)\right)}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+80}:\\ \;\;\;\;e^{\mathsf{fma}\left(x \cdot x, \frac{1}{z + x}, \left(\left(-z\right) \cdot \frac{z}{x \cdot x}\right) \cdot \left(-z\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{x - z}\\ \end{array} \]
                    6. Add Preprocessing

                    Alternative 5: 79.4% accurate, 2.0× speedup?

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

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

                      \[\leadsto e^{\color{blue}{x - z}} \]
                    4. Step-by-step derivation
                      1. lower--.f6479.2

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

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

                    Alternative 6: 52.9% accurate, 2.1× speedup?

                    \[\begin{array}{l} \\ e^{-z} \end{array} \]
                    (FPCore (x y z) :precision binary64 (exp (- z)))
                    double code(double x, double y, double z) {
                    	return exp(-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(-z)
                    end function
                    
                    public static double code(double x, double y, double z) {
                    	return Math.exp(-z);
                    }
                    
                    def code(x, y, z):
                    	return math.exp(-z)
                    
                    function code(x, y, z)
                    	return exp(Float64(-z))
                    end
                    
                    function tmp = code(x, y, z)
                    	tmp = exp(-z);
                    end
                    
                    code[x_, y_, z_] := N[Exp[(-z)], $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    e^{-z}
                    \end{array}
                    
                    Derivation
                    1. Initial program 100.0%

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

                      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
                    4. Step-by-step derivation
                      1. mul-1-negN/A

                        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
                      2. lower-neg.f6449.7

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

                      \[\leadsto e^{\color{blue}{-z}} \]
                    6. 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 2024235 
                    (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)))