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

Percentage Accurate: 100.0% → 100.0%
Time: 5.8s
Alternatives: 9
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 9 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: 94.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.5 \cdot 10^{-7}:\\
\;\;\;\;e^{x - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 3.49999999999999984e-7

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

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

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

    if 3.49999999999999984e-7 < 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

      \[\leadsto e^{\color{blue}{y \cdot \log y} - z} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

Alternative 3: 90.3% accurate, 1.9× speedup?

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

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

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


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

    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--.f6493.8

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

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

    if 7.49999999999999998e62 < y

    1. Initial program 100.0%

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

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

        \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
      2. exp-sumN/A

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

        \[\leadsto \color{blue}{e^{y \cdot \log y} \cdot e^{x}} \]
      4. *-commutativeN/A

        \[\leadsto e^{\color{blue}{\log y \cdot y}} \cdot e^{x} \]
      5. exp-to-powN/A

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

        \[\leadsto \color{blue}{{y}^{y}} \cdot e^{x} \]
      7. lower-exp.f6470.6

        \[\leadsto {y}^{y} \cdot \color{blue}{e^{x}} \]
    5. Applied rewrites70.6%

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

      \[\leadsto {y}^{\color{blue}{y}} \]
    7. Step-by-step derivation
      1. Applied rewrites87.6%

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

    Alternative 4: 73.2% accurate, 2.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 3.5 \cdot 10^{-7}:\\ \;\;\;\;e^{x}\\ \mathbf{else}:\\ \;\;\;\;{y}^{y}\\ \end{array} \end{array} \]
    (FPCore (x y z) :precision binary64 (if (<= y 3.5e-7) (exp x) (pow y y)))
    double code(double x, double y, double z) {
    	double tmp;
    	if (y <= 3.5e-7) {
    		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 <= 3.5d-7) 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 <= 3.5e-7) {
    		tmp = Math.exp(x);
    	} else {
    		tmp = Math.pow(y, y);
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if y <= 3.5e-7:
    		tmp = math.exp(x)
    	else:
    		tmp = math.pow(y, y)
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if (y <= 3.5e-7)
    		tmp = exp(x);
    	else
    		tmp = y ^ y;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if (y <= 3.5e-7)
    		tmp = exp(x);
    	else
    		tmp = y ^ y;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[LessEqual[y, 3.5e-7], N[Exp[x], $MachinePrecision], N[Power[y, y], $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 3.5 \cdot 10^{-7}:\\
    \;\;\;\;e^{x}\\
    
    \mathbf{else}:\\
    \;\;\;\;{y}^{y}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 3.49999999999999984e-7

      1. Initial program 100.0%

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

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

          \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
        2. exp-sumN/A

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

          \[\leadsto \color{blue}{e^{y \cdot \log y} \cdot e^{x}} \]
        4. *-commutativeN/A

          \[\leadsto e^{\color{blue}{\log y \cdot y}} \cdot e^{x} \]
        5. exp-to-powN/A

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

          \[\leadsto \color{blue}{{y}^{y}} \cdot e^{x} \]
        7. lower-exp.f6476.6

          \[\leadsto {y}^{y} \cdot \color{blue}{e^{x}} \]
      5. Applied rewrites76.6%

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

        \[\leadsto {y}^{\color{blue}{y}} \]
      7. Step-by-step derivation
        1. Applied rewrites23.9%

          \[\leadsto {y}^{\color{blue}{y}} \]
        2. Taylor expanded in y around 0

          \[\leadsto e^{x} \]
        3. Step-by-step derivation
          1. Applied rewrites76.2%

            \[\leadsto e^{x} \]

          if 3.49999999999999984e-7 < y

          1. Initial program 100.0%

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

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

              \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
            2. exp-sumN/A

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

              \[\leadsto \color{blue}{e^{y \cdot \log y} \cdot e^{x}} \]
            4. *-commutativeN/A

              \[\leadsto e^{\color{blue}{\log y \cdot y}} \cdot e^{x} \]
            5. exp-to-powN/A

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

              \[\leadsto \color{blue}{{y}^{y}} \cdot e^{x} \]
            7. lower-exp.f6466.6

              \[\leadsto {y}^{y} \cdot \color{blue}{e^{x}} \]
          5. Applied rewrites66.6%

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

            \[\leadsto {y}^{\color{blue}{y}} \]
          7. Step-by-step derivation
            1. Applied rewrites79.6%

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

          Alternative 5: 52.7% accurate, 2.1× speedup?

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

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

              \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
            2. exp-sumN/A

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

              \[\leadsto \color{blue}{e^{y \cdot \log y} \cdot e^{x}} \]
            4. *-commutativeN/A

              \[\leadsto e^{\color{blue}{\log y \cdot y}} \cdot e^{x} \]
            5. exp-to-powN/A

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

              \[\leadsto \color{blue}{{y}^{y}} \cdot e^{x} \]
            7. lower-exp.f6471.7

              \[\leadsto {y}^{y} \cdot \color{blue}{e^{x}} \]
          5. Applied rewrites71.7%

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

            \[\leadsto {y}^{\color{blue}{y}} \]
          7. Step-by-step derivation
            1. Applied rewrites51.1%

              \[\leadsto {y}^{\color{blue}{y}} \]
            2. Taylor expanded in y around 0

              \[\leadsto e^{x} \]
            3. Step-by-step derivation
              1. Applied rewrites58.3%

                \[\leadsto e^{x} \]
              2. Add Preprocessing

              Alternative 6: 31.0% accurate, 8.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{-125}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, 1\right), x, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, x, 0.5\right), x, 1\right), x, 1\right)\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (if (<= x 5e-125)
                 (fma (fma 0.5 x 1.0) x 1.0)
                 (fma (fma (fma 0.16666666666666666 x 0.5) x 1.0) x 1.0)))
              double code(double x, double y, double z) {
              	double tmp;
              	if (x <= 5e-125) {
              		tmp = fma(fma(0.5, x, 1.0), x, 1.0);
              	} else {
              		tmp = fma(fma(fma(0.16666666666666666, x, 0.5), x, 1.0), x, 1.0);
              	}
              	return tmp;
              }
              
              function code(x, y, z)
              	tmp = 0.0
              	if (x <= 5e-125)
              		tmp = fma(fma(0.5, x, 1.0), x, 1.0);
              	else
              		tmp = fma(fma(fma(0.16666666666666666, x, 0.5), x, 1.0), x, 1.0);
              	end
              	return tmp
              end
              
              code[x_, y_, z_] := If[LessEqual[x, 5e-125], N[(N[(0.5 * x + 1.0), $MachinePrecision] * x + 1.0), $MachinePrecision], N[(N[(N[(0.16666666666666666 * x + 0.5), $MachinePrecision] * x + 1.0), $MachinePrecision] * x + 1.0), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;x \leq 5 \cdot 10^{-125}:\\
              \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, 1\right), x, 1\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, x, 0.5\right), x, 1\right), x, 1\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < 4.99999999999999967e-125

                1. Initial program 100.0%

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

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

                    \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
                  2. exp-sumN/A

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

                    \[\leadsto \color{blue}{e^{y \cdot \log y} \cdot e^{x}} \]
                  4. *-commutativeN/A

                    \[\leadsto e^{\color{blue}{\log y \cdot y}} \cdot e^{x} \]
                  5. exp-to-powN/A

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

                    \[\leadsto \color{blue}{{y}^{y}} \cdot e^{x} \]
                  7. lower-exp.f6457.8

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

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

                  \[\leadsto {y}^{\color{blue}{y}} \]
                7. Step-by-step derivation
                  1. Applied rewrites49.7%

                    \[\leadsto {y}^{\color{blue}{y}} \]
                  2. Taylor expanded in y around 0

                    \[\leadsto e^{x} \]
                  3. Step-by-step derivation
                    1. Applied rewrites42.6%

                      \[\leadsto e^{x} \]
                    2. Taylor expanded in x around 0

                      \[\leadsto 1 + x \cdot \color{blue}{\left(1 + \frac{1}{2} \cdot x\right)} \]
                    3. Step-by-step derivation
                      1. Applied rewrites19.2%

                        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(0.5, x, 1\right), x, 1\right) \]

                      if 4.99999999999999967e-125 < x

                      1. Initial program 100.0%

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

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

                          \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
                        2. exp-sumN/A

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

                          \[\leadsto \color{blue}{e^{y \cdot \log y} \cdot e^{x}} \]
                        4. *-commutativeN/A

                          \[\leadsto e^{\color{blue}{\log y \cdot y}} \cdot e^{x} \]
                        5. exp-to-powN/A

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

                          \[\leadsto \color{blue}{{y}^{y}} \cdot e^{x} \]
                        7. lower-exp.f6492.4

                          \[\leadsto {y}^{y} \cdot \color{blue}{e^{x}} \]
                      5. Applied rewrites92.4%

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

                        \[\leadsto {y}^{\color{blue}{y}} \]
                      7. Step-by-step derivation
                        1. Applied rewrites53.1%

                          \[\leadsto {y}^{\color{blue}{y}} \]
                        2. Taylor expanded in y around 0

                          \[\leadsto e^{x} \]
                        3. Step-by-step derivation
                          1. Applied rewrites81.6%

                            \[\leadsto e^{x} \]
                          2. Taylor expanded in x around 0

                            \[\leadsto 1 + x \cdot \color{blue}{\left(1 + x \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot x\right)\right)} \]
                          3. Step-by-step derivation
                            1. Applied rewrites55.6%

                              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, x, 0.5\right), x, 1\right), x, 1\right) \]
                          4. Recombined 2 regimes into one program.
                          5. Add Preprocessing

                          Alternative 7: 27.8% accurate, 16.3× speedup?

                          \[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{fma}\left(0.5, x, 1\right), x, 1\right) \end{array} \]
                          (FPCore (x y z) :precision binary64 (fma (fma 0.5 x 1.0) x 1.0))
                          double code(double x, double y, double z) {
                          	return fma(fma(0.5, x, 1.0), x, 1.0);
                          }
                          
                          function code(x, y, z)
                          	return fma(fma(0.5, x, 1.0), x, 1.0)
                          end
                          
                          code[x_, y_, z_] := N[(N[(0.5 * x + 1.0), $MachinePrecision] * x + 1.0), $MachinePrecision]
                          
                          \begin{array}{l}
                          
                          \\
                          \mathsf{fma}\left(\mathsf{fma}\left(0.5, x, 1\right), x, 1\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 0

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

                              \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
                            2. exp-sumN/A

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

                              \[\leadsto \color{blue}{e^{y \cdot \log y} \cdot e^{x}} \]
                            4. *-commutativeN/A

                              \[\leadsto e^{\color{blue}{\log y \cdot y}} \cdot e^{x} \]
                            5. exp-to-powN/A

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

                              \[\leadsto \color{blue}{{y}^{y}} \cdot e^{x} \]
                            7. lower-exp.f6471.7

                              \[\leadsto {y}^{y} \cdot \color{blue}{e^{x}} \]
                          5. Applied rewrites71.7%

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

                            \[\leadsto {y}^{\color{blue}{y}} \]
                          7. Step-by-step derivation
                            1. Applied rewrites51.1%

                              \[\leadsto {y}^{\color{blue}{y}} \]
                            2. Taylor expanded in y around 0

                              \[\leadsto e^{x} \]
                            3. Step-by-step derivation
                              1. Applied rewrites58.3%

                                \[\leadsto e^{x} \]
                              2. Taylor expanded in x around 0

                                \[\leadsto 1 + x \cdot \color{blue}{\left(1 + \frac{1}{2} \cdot x\right)} \]
                              3. Step-by-step derivation
                                1. Applied rewrites29.3%

                                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(0.5, x, 1\right), x, 1\right) \]
                                2. Add Preprocessing

                                Alternative 8: 14.8% accurate, 53.0× speedup?

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

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

                                    \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
                                  2. exp-sumN/A

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

                                    \[\leadsto \color{blue}{e^{y \cdot \log y} \cdot e^{x}} \]
                                  4. *-commutativeN/A

                                    \[\leadsto e^{\color{blue}{\log y \cdot y}} \cdot e^{x} \]
                                  5. exp-to-powN/A

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

                                    \[\leadsto \color{blue}{{y}^{y}} \cdot e^{x} \]
                                  7. lower-exp.f6471.7

                                    \[\leadsto {y}^{y} \cdot \color{blue}{e^{x}} \]
                                5. Applied rewrites71.7%

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

                                  \[\leadsto {y}^{\color{blue}{y}} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites51.1%

                                    \[\leadsto {y}^{\color{blue}{y}} \]
                                  2. Taylor expanded in y around 0

                                    \[\leadsto e^{x} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites58.3%

                                      \[\leadsto e^{x} \]
                                    2. Taylor expanded in x around 0

                                      \[\leadsto 1 + x \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites14.2%

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

                                      Alternative 9: 14.5% accurate, 212.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 z around 0

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

                                          \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
                                        2. exp-sumN/A

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

                                          \[\leadsto \color{blue}{e^{y \cdot \log y} \cdot e^{x}} \]
                                        4. *-commutativeN/A

                                          \[\leadsto e^{\color{blue}{\log y \cdot y}} \cdot e^{x} \]
                                        5. exp-to-powN/A

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

                                          \[\leadsto \color{blue}{{y}^{y}} \cdot e^{x} \]
                                        7. lower-exp.f6471.7

                                          \[\leadsto {y}^{y} \cdot \color{blue}{e^{x}} \]
                                      5. Applied rewrites71.7%

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

                                        \[\leadsto {y}^{\color{blue}{y}} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites51.1%

                                          \[\leadsto {y}^{\color{blue}{y}} \]
                                        2. Taylor expanded in y around 0

                                          \[\leadsto 1 \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites13.7%

                                            \[\leadsto 1 \]
                                          2. 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 2024298 
                                          (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)))