
(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:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(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}
Initial program 100.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.38e-30) (not (<= z 3e+107))) (exp (- x z)) (* (pow y y) (exp x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.38e-30) || !(z <= 3e+107)) {
tmp = exp((x - 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 <= (-1.38d-30)) .or. (.not. (z <= 3d+107))) then
tmp = exp((x - 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 <= -1.38e-30) || !(z <= 3e+107)) {
tmp = Math.exp((x - z));
} else {
tmp = Math.pow(y, y) * Math.exp(x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.38e-30) or not (z <= 3e+107): tmp = math.exp((x - z)) else: tmp = math.pow(y, y) * math.exp(x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.38e-30) || !(z <= 3e+107)) tmp = exp(Float64(x - z)); else tmp = Float64((y ^ y) * exp(x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.38e-30) || ~((z <= 3e+107))) tmp = exp((x - z)); else tmp = (y ^ y) * exp(x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.38e-30], N[Not[LessEqual[z, 3e+107]], $MachinePrecision]], N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision], N[(N[Power[y, y], $MachinePrecision] * N[Exp[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.38 \cdot 10^{-30} \lor \neg \left(z \leq 3 \cdot 10^{+107}\right):\\
\;\;\;\;e^{x - z}\\
\mathbf{else}:\\
\;\;\;\;{y}^{y} \cdot e^{x}\\
\end{array}
\end{array}
if z < -1.38000000000000008e-30 or 3.00000000000000023e107 < z Initial program 100.0%
Taylor expanded in y around 0 97.0%
if -1.38000000000000008e-30 < z < 3.00000000000000023e107Initial program 99.9%
Taylor expanded in z around 0 96.1%
+-commutative96.1%
exp-sum87.3%
*-commutative87.3%
exp-to-pow87.3%
Simplified87.3%
Final simplification91.5%
(FPCore (x y z) :precision binary64 (if (<= z 0.0165) (/ (pow y y) (exp (- z x))) (exp (- x z))))
double code(double x, double y, double z) {
double tmp;
if (z <= 0.0165) {
tmp = pow(y, y) / exp((z - x));
} else {
tmp = exp((x - 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 (z <= 0.0165d0) then
tmp = (y ** y) / exp((z - x))
else
tmp = exp((x - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 0.0165) {
tmp = Math.pow(y, y) / Math.exp((z - x));
} else {
tmp = Math.exp((x - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 0.0165: tmp = math.pow(y, y) / math.exp((z - x)) else: tmp = math.exp((x - z)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 0.0165) tmp = Float64((y ^ y) / exp(Float64(z - x))); else tmp = exp(Float64(x - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 0.0165) tmp = (y ^ y) / exp((z - x)); else tmp = exp((x - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 0.0165], N[(N[Power[y, y], $MachinePrecision] / N[Exp[N[(z - x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.0165:\\
\;\;\;\;\frac{{y}^{y}}{e^{z - x}}\\
\mathbf{else}:\\
\;\;\;\;e^{x - z}\\
\end{array}
\end{array}
if z < 0.016500000000000001Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
exp-sum86.6%
exp-diff86.6%
associate-/r/86.6%
*-commutative86.6%
exp-to-pow86.6%
div-exp92.0%
Simplified92.0%
if 0.016500000000000001 < z Initial program 100.0%
Taylor expanded in y around 0 84.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (exp (- z))))
(if (<= x -1.35e+69)
(exp x)
(if (<= x -2.25e-122)
t_0
(if (<= x -1.2e-306)
(pow y y)
(if (<= x 2.1e-244) t_0 (if (<= x 7.2e-6) (pow y y) (exp x))))))))
double code(double x, double y, double z) {
double t_0 = exp(-z);
double tmp;
if (x <= -1.35e+69) {
tmp = exp(x);
} else if (x <= -2.25e-122) {
tmp = t_0;
} else if (x <= -1.2e-306) {
tmp = pow(y, y);
} else if (x <= 2.1e-244) {
tmp = t_0;
} else if (x <= 7.2e-6) {
tmp = pow(y, y);
} else {
tmp = exp(x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = exp(-z)
if (x <= (-1.35d+69)) then
tmp = exp(x)
else if (x <= (-2.25d-122)) then
tmp = t_0
else if (x <= (-1.2d-306)) then
tmp = y ** y
else if (x <= 2.1d-244) then
tmp = t_0
else if (x <= 7.2d-6) then
tmp = y ** y
else
tmp = exp(x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.exp(-z);
double tmp;
if (x <= -1.35e+69) {
tmp = Math.exp(x);
} else if (x <= -2.25e-122) {
tmp = t_0;
} else if (x <= -1.2e-306) {
tmp = Math.pow(y, y);
} else if (x <= 2.1e-244) {
tmp = t_0;
} else if (x <= 7.2e-6) {
tmp = Math.pow(y, y);
} else {
tmp = Math.exp(x);
}
return tmp;
}
def code(x, y, z): t_0 = math.exp(-z) tmp = 0 if x <= -1.35e+69: tmp = math.exp(x) elif x <= -2.25e-122: tmp = t_0 elif x <= -1.2e-306: tmp = math.pow(y, y) elif x <= 2.1e-244: tmp = t_0 elif x <= 7.2e-6: tmp = math.pow(y, y) else: tmp = math.exp(x) return tmp
function code(x, y, z) t_0 = exp(Float64(-z)) tmp = 0.0 if (x <= -1.35e+69) tmp = exp(x); elseif (x <= -2.25e-122) tmp = t_0; elseif (x <= -1.2e-306) tmp = y ^ y; elseif (x <= 2.1e-244) tmp = t_0; elseif (x <= 7.2e-6) tmp = y ^ y; else tmp = exp(x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = exp(-z); tmp = 0.0; if (x <= -1.35e+69) tmp = exp(x); elseif (x <= -2.25e-122) tmp = t_0; elseif (x <= -1.2e-306) tmp = y ^ y; elseif (x <= 2.1e-244) tmp = t_0; elseif (x <= 7.2e-6) tmp = y ^ y; else tmp = exp(x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Exp[(-z)], $MachinePrecision]}, If[LessEqual[x, -1.35e+69], N[Exp[x], $MachinePrecision], If[LessEqual[x, -2.25e-122], t$95$0, If[LessEqual[x, -1.2e-306], N[Power[y, y], $MachinePrecision], If[LessEqual[x, 2.1e-244], t$95$0, If[LessEqual[x, 7.2e-6], N[Power[y, y], $MachinePrecision], N[Exp[x], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-z}\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+69}:\\
\;\;\;\;e^{x}\\
\mathbf{elif}\;x \leq -2.25 \cdot 10^{-122}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{-306}:\\
\;\;\;\;{y}^{y}\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-244}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-6}:\\
\;\;\;\;{y}^{y}\\
\mathbf{else}:\\
\;\;\;\;e^{x}\\
\end{array}
\end{array}
if x < -1.3499999999999999e69 or 7.19999999999999967e-6 < x Initial program 100.0%
Taylor expanded in y around 0 97.5%
Taylor expanded in z around 0 88.1%
if -1.3499999999999999e69 < x < -2.2499999999999999e-122 or -1.2e-306 < x < 2.10000000000000002e-244Initial program 99.8%
Taylor expanded in z around inf 72.9%
neg-mul-172.9%
Simplified72.9%
if -2.2499999999999999e-122 < x < -1.2e-306 or 2.10000000000000002e-244 < x < 7.19999999999999967e-6Initial program 100.0%
Taylor expanded in z around 0 79.9%
+-commutative79.9%
exp-sum79.9%
*-commutative79.9%
exp-to-pow79.9%
Simplified79.9%
Taylor expanded in x around 0 79.9%
(FPCore (x y z) :precision binary64 (if (<= z -1.02e+103) (+ 1.0 (* z (+ (* z (* z -0.16666666666666666)) -1.0))) (if (or (<= z 72000000000000.0) (not (<= z 1.62e+111))) (exp x) (exp z))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.02e+103) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else if ((z <= 72000000000000.0) || !(z <= 1.62e+111)) {
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 (z <= (-1.02d+103)) then
tmp = 1.0d0 + (z * ((z * (z * (-0.16666666666666666d0))) + (-1.0d0)))
else if ((z <= 72000000000000.0d0) .or. (.not. (z <= 1.62d+111))) 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 (z <= -1.02e+103) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else if ((z <= 72000000000000.0) || !(z <= 1.62e+111)) {
tmp = Math.exp(x);
} else {
tmp = Math.exp(z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.02e+103: tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)) elif (z <= 72000000000000.0) or not (z <= 1.62e+111): tmp = math.exp(x) else: tmp = math.exp(z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.02e+103) tmp = Float64(1.0 + Float64(z * Float64(Float64(z * Float64(z * -0.16666666666666666)) + -1.0))); elseif ((z <= 72000000000000.0) || !(z <= 1.62e+111)) tmp = exp(x); else tmp = exp(z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.02e+103) tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)); elseif ((z <= 72000000000000.0) || ~((z <= 1.62e+111))) tmp = exp(x); else tmp = exp(z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.02e+103], N[(1.0 + N[(z * N[(N[(z * N[(z * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 72000000000000.0], N[Not[LessEqual[z, 1.62e+111]], $MachinePrecision]], N[Exp[x], $MachinePrecision], N[Exp[z], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+103}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\
\mathbf{elif}\;z \leq 72000000000000 \lor \neg \left(z \leq 1.62 \cdot 10^{+111}\right):\\
\;\;\;\;e^{x}\\
\mathbf{else}:\\
\;\;\;\;e^{z}\\
\end{array}
\end{array}
if z < -1.01999999999999991e103Initial program 100.0%
Taylor expanded in z around inf 89.6%
neg-mul-189.6%
Simplified89.6%
Taylor expanded in z around 0 89.6%
Taylor expanded in z around inf 89.6%
*-commutative89.6%
Simplified89.6%
if -1.01999999999999991e103 < z < 7.2e13 or 1.61999999999999999e111 < z Initial program 99.9%
Taylor expanded in y around 0 80.5%
Taylor expanded in z around 0 60.5%
if 7.2e13 < z < 1.61999999999999999e111Initial program 100.0%
Taylor expanded in z around inf 36.0%
neg-mul-136.0%
Simplified36.0%
add-sqr-sqrt0.0%
sqrt-unprod65.5%
sqr-neg65.5%
sqrt-unprod65.5%
add-sqr-sqrt65.5%
expm1-log1p-u65.5%
expm1-undefine65.5%
Applied egg-rr65.5%
log1p-undefine65.5%
rem-exp-log65.5%
associate-+r-65.5%
expm1-undefine65.5%
rem-exp-log65.5%
log1p-define65.5%
log1p-expm165.5%
Simplified65.5%
Final simplification65.2%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.05e+70) (not (<= x 1.7e+22))) (exp x) (exp (- z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.05e+70) || !(x <= 1.7e+22)) {
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.05d+70)) .or. (.not. (x <= 1.7d+22))) 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.05e+70) || !(x <= 1.7e+22)) {
tmp = Math.exp(x);
} else {
tmp = Math.exp(-z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.05e+70) or not (x <= 1.7e+22): tmp = math.exp(x) else: tmp = math.exp(-z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.05e+70) || !(x <= 1.7e+22)) 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.05e+70) || ~((x <= 1.7e+22))) tmp = exp(x); else tmp = exp(-z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.05e+70], N[Not[LessEqual[x, 1.7e+22]], $MachinePrecision]], N[Exp[x], $MachinePrecision], N[Exp[(-z)], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+70} \lor \neg \left(x \leq 1.7 \cdot 10^{+22}\right):\\
\;\;\;\;e^{x}\\
\mathbf{else}:\\
\;\;\;\;e^{-z}\\
\end{array}
\end{array}
if x < -1.05000000000000004e70 or 1.7e22 < x Initial program 100.0%
Taylor expanded in y around 0 97.2%
Taylor expanded in z around 0 90.6%
if -1.05000000000000004e70 < x < 1.7e22Initial program 99.9%
Taylor expanded in z around inf 68.2%
neg-mul-168.2%
Simplified68.2%
Final simplification77.4%
(FPCore (x y z) :precision binary64 (if (<= y 8.4e+129) (exp (- x z)) (pow y y)))
double code(double x, double y, double z) {
double tmp;
if (y <= 8.4e+129) {
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 <= 8.4d+129) 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 <= 8.4e+129) {
tmp = Math.exp((x - z));
} else {
tmp = Math.pow(y, y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 8.4e+129: tmp = math.exp((x - z)) else: tmp = math.pow(y, y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 8.4e+129) 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 <= 8.4e+129) tmp = exp((x - z)); else tmp = y ^ y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 8.4e+129], N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision], N[Power[y, y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.4 \cdot 10^{+129}:\\
\;\;\;\;e^{x - z}\\
\mathbf{else}:\\
\;\;\;\;{y}^{y}\\
\end{array}
\end{array}
if y < 8.39999999999999986e129Initial program 99.9%
Taylor expanded in y around 0 90.9%
if 8.39999999999999986e129 < y Initial program 100.0%
Taylor expanded in z around 0 92.7%
+-commutative92.7%
exp-sum77.7%
*-commutative77.7%
exp-to-pow77.7%
Simplified77.7%
Taylor expanded in x around 0 86.8%
(FPCore (x y z) :precision binary64 (if (<= z -4.05e+102) (+ 1.0 (* z (+ (* z (* z -0.16666666666666666)) -1.0))) (exp x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.05e+102) {
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 <= (-4.05d+102)) 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 <= -4.05e+102) {
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 <= -4.05e+102: 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 <= -4.05e+102) 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 <= -4.05e+102) 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, -4.05e+102], 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 -4.05 \cdot 10^{+102}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;e^{x}\\
\end{array}
\end{array}
if z < -4.05000000000000019e102Initial program 100.0%
Taylor expanded in z around inf 89.6%
neg-mul-189.6%
Simplified89.6%
Taylor expanded in z around 0 89.6%
Taylor expanded in z around inf 89.6%
*-commutative89.6%
Simplified89.6%
if -4.05000000000000019e102 < z Initial program 99.9%
Taylor expanded in y around 0 78.6%
Taylor expanded in z around 0 58.3%
Final simplification63.0%
(FPCore (x y z) :precision binary64 (if (<= z -1.8e+101) (+ 1.0 (* z (+ (* z (* z -0.16666666666666666)) -1.0))) (+ 1.0 (* x (+ 1.0 (* x (+ 0.5 (* x 0.16666666666666666))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.8e+101) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else {
tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.8d+101)) then
tmp = 1.0d0 + (z * ((z * (z * (-0.16666666666666666d0))) + (-1.0d0)))
else
tmp = 1.0d0 + (x * (1.0d0 + (x * (0.5d0 + (x * 0.16666666666666666d0)))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.8e+101) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else {
tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.8e+101: tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)) else: tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666))))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.8e+101) tmp = Float64(1.0 + Float64(z * Float64(Float64(z * Float64(z * -0.16666666666666666)) + -1.0))); else tmp = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * 0.16666666666666666)))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.8e+101) tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)); else tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666))))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.8e+101], N[(1.0 + N[(z * N[(N[(z * N[(z * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(1.0 + N[(x * N[(0.5 + N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+101}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if z < -1.80000000000000015e101Initial program 100.0%
Taylor expanded in z around inf 87.4%
neg-mul-187.4%
Simplified87.4%
Taylor expanded in z around 0 87.4%
Taylor expanded in z around inf 87.4%
*-commutative87.4%
Simplified87.4%
if -1.80000000000000015e101 < z Initial program 99.9%
Taylor expanded in y around 0 78.6%
Taylor expanded in z around 0 58.2%
Taylor expanded in x around 0 32.6%
*-commutative32.6%
Simplified32.6%
Final simplification41.0%
(FPCore (x y z) :precision binary64 (if (<= z -1.36e+101) (+ 1.0 (* z (+ (* z (* z -0.16666666666666666)) -1.0))) (+ 1.0 (* x (+ 1.0 (* x 0.5))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.36e+101) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else {
tmp = 1.0 + (x * (1.0 + (x * 0.5)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.36d+101)) then
tmp = 1.0d0 + (z * ((z * (z * (-0.16666666666666666d0))) + (-1.0d0)))
else
tmp = 1.0d0 + (x * (1.0d0 + (x * 0.5d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.36e+101) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else {
tmp = 1.0 + (x * (1.0 + (x * 0.5)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.36e+101: tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)) else: tmp = 1.0 + (x * (1.0 + (x * 0.5))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.36e+101) tmp = Float64(1.0 + Float64(z * Float64(Float64(z * Float64(z * -0.16666666666666666)) + -1.0))); else tmp = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * 0.5)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.36e+101) tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)); else tmp = 1.0 + (x * (1.0 + (x * 0.5))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.36e+101], N[(1.0 + N[(z * N[(N[(z * N[(z * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.36 \cdot 10^{+101}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot 0.5\right)\\
\end{array}
\end{array}
if z < -1.35999999999999998e101Initial program 100.0%
Taylor expanded in z around inf 87.4%
neg-mul-187.4%
Simplified87.4%
Taylor expanded in z around 0 87.4%
Taylor expanded in z around inf 87.4%
*-commutative87.4%
Simplified87.4%
if -1.35999999999999998e101 < z Initial program 99.9%
Taylor expanded in y around 0 78.6%
Taylor expanded in z around 0 58.2%
Taylor expanded in x around 0 29.1%
Final simplification38.0%
(FPCore (x y z) :precision binary64 (if (<= x 8e+152) (+ 1.0 (* z (+ (* z 0.5) -1.0))) (+ 1.0 (* x (* x 0.5)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 8e+152) {
tmp = 1.0 + (z * ((z * 0.5) + -1.0));
} else {
tmp = 1.0 + (x * (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 <= 8d+152) then
tmp = 1.0d0 + (z * ((z * 0.5d0) + (-1.0d0)))
else
tmp = 1.0d0 + (x * (x * 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 8e+152) {
tmp = 1.0 + (z * ((z * 0.5) + -1.0));
} else {
tmp = 1.0 + (x * (x * 0.5));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 8e+152: tmp = 1.0 + (z * ((z * 0.5) + -1.0)) else: tmp = 1.0 + (x * (x * 0.5)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 8e+152) tmp = Float64(1.0 + Float64(z * Float64(Float64(z * 0.5) + -1.0))); else tmp = Float64(1.0 + Float64(x * Float64(x * 0.5))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 8e+152) tmp = 1.0 + (z * ((z * 0.5) + -1.0)); else tmp = 1.0 + (x * (x * 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 8e+152], N[(1.0 + N[(z * N[(N[(z * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8 \cdot 10^{+152}:\\
\;\;\;\;1 + z \cdot \left(z \cdot 0.5 + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(x \cdot 0.5\right)\\
\end{array}
\end{array}
if x < 8.0000000000000004e152Initial program 99.9%
Taylor expanded in z around inf 57.1%
neg-mul-157.1%
Simplified57.1%
Taylor expanded in z around 0 27.9%
if 8.0000000000000004e152 < x Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in z around 0 91.1%
Taylor expanded in x around 0 88.5%
Taylor expanded in x around inf 88.5%
*-commutative88.5%
Simplified88.5%
Final simplification35.7%
(FPCore (x y z) :precision binary64 (if (<= x 1.1e+150) (+ 1.0 (* z (* z 0.5))) (+ 1.0 (* x (* x 0.5)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.1e+150) {
tmp = 1.0 + (z * (z * 0.5));
} else {
tmp = 1.0 + (x * (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.1d+150) then
tmp = 1.0d0 + (z * (z * 0.5d0))
else
tmp = 1.0d0 + (x * (x * 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.1e+150) {
tmp = 1.0 + (z * (z * 0.5));
} else {
tmp = 1.0 + (x * (x * 0.5));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.1e+150: tmp = 1.0 + (z * (z * 0.5)) else: tmp = 1.0 + (x * (x * 0.5)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.1e+150) tmp = Float64(1.0 + Float64(z * Float64(z * 0.5))); else tmp = Float64(1.0 + Float64(x * Float64(x * 0.5))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.1e+150) tmp = 1.0 + (z * (z * 0.5)); else tmp = 1.0 + (x * (x * 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.1e+150], N[(1.0 + N[(z * N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.1 \cdot 10^{+150}:\\
\;\;\;\;1 + z \cdot \left(z \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(x \cdot 0.5\right)\\
\end{array}
\end{array}
if x < 1.1e150Initial program 99.9%
Taylor expanded in z around inf 57.1%
neg-mul-157.1%
Simplified57.1%
Taylor expanded in z around 0 27.9%
Taylor expanded in z around inf 27.8%
*-commutative27.8%
Simplified27.8%
if 1.1e150 < x Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in z around 0 91.1%
Taylor expanded in x around 0 88.5%
Taylor expanded in x around inf 88.5%
*-commutative88.5%
Simplified88.5%
(FPCore (x y z) :precision binary64 (+ 1.0 (* x (* x 0.5))))
double code(double x, double y, double z) {
return 1.0 + (x * (x * 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 + (x * (x * 0.5d0))
end function
public static double code(double x, double y, double z) {
return 1.0 + (x * (x * 0.5));
}
def code(x, y, z): return 1.0 + (x * (x * 0.5))
function code(x, y, z) return Float64(1.0 + Float64(x * Float64(x * 0.5))) end
function tmp = code(x, y, z) tmp = 1.0 + (x * (x * 0.5)); end
code[x_, y_, z_] := N[(1.0 + N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + x \cdot \left(x \cdot 0.5\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0 81.8%
Taylor expanded in z around 0 56.2%
Taylor expanded in x around 0 27.9%
Taylor expanded in x around inf 27.7%
*-commutative27.7%
Simplified27.7%
(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}
Initial program 100.0%
Taylor expanded in y around 0 81.8%
Taylor expanded in z around 0 56.2%
Taylor expanded in x around 0 15.8%
Final simplification15.8%
(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}
Initial program 100.0%
Taylor expanded in z around inf 53.5%
neg-mul-153.5%
Simplified53.5%
Taylor expanded in z around 0 15.5%
(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}
herbie shell --seed 2024110
(FPCore (x y z)
:name "Statistics.Distribution.Poisson.Internal:probability from math-functions-0.1.5.2"
:precision binary64
:alt
(exp (+ (- x z) (* (log y) y)))
(exp (- (+ x (* y (log y))) z)))