
(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 13 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 (<= y 5e-79) (exp x) (if (<= y 1250000000.0) (exp (- z)) (pow y y))))
double code(double x, double y, double z) {
double tmp;
if (y <= 5e-79) {
tmp = exp(x);
} else if (y <= 1250000000.0) {
tmp = exp(-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 <= 5d-79) then
tmp = exp(x)
else if (y <= 1250000000.0d0) then
tmp = exp(-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 <= 5e-79) {
tmp = Math.exp(x);
} else if (y <= 1250000000.0) {
tmp = Math.exp(-z);
} else {
tmp = Math.pow(y, y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 5e-79: tmp = math.exp(x) elif y <= 1250000000.0: tmp = math.exp(-z) else: tmp = math.pow(y, y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 5e-79) tmp = exp(x); elseif (y <= 1250000000.0) tmp = exp(Float64(-z)); else tmp = y ^ y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 5e-79) tmp = exp(x); elseif (y <= 1250000000.0) tmp = exp(-z); else tmp = y ^ y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 5e-79], N[Exp[x], $MachinePrecision], If[LessEqual[y, 1250000000.0], N[Exp[(-z)], $MachinePrecision], N[Power[y, y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5 \cdot 10^{-79}:\\
\;\;\;\;e^{x}\\
\mathbf{elif}\;y \leq 1250000000:\\
\;\;\;\;e^{-z}\\
\mathbf{else}:\\
\;\;\;\;{y}^{y}\\
\end{array}
\end{array}
if y < 4.99999999999999999e-79Initial program 100.0%
Taylor expanded in x around inf 74.4%
if 4.99999999999999999e-79 < y < 1.25e9Initial program 100.0%
Taylor expanded in z around inf 83.4%
neg-mul-183.4%
Simplified83.4%
if 1.25e9 < y Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
exp-sum69.8%
*-commutative69.8%
exp-to-pow69.8%
Simplified69.8%
Taylor expanded in z around 0 80.3%
Taylor expanded in x around 0 85.6%
(FPCore (x y z) :precision binary64 (if (<= x -9.2e+106) 0.0 (if (<= x 8.2e-23) (exp (- z)) (exp x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -9.2e+106) {
tmp = 0.0;
} else if (x <= 8.2e-23) {
tmp = exp(-z);
} else {
tmp = exp(x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-9.2d+106)) then
tmp = 0.0d0
else if (x <= 8.2d-23) then
tmp = exp(-z)
else
tmp = exp(x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -9.2e+106) {
tmp = 0.0;
} else if (x <= 8.2e-23) {
tmp = Math.exp(-z);
} else {
tmp = Math.exp(x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -9.2e+106: tmp = 0.0 elif x <= 8.2e-23: tmp = math.exp(-z) else: tmp = math.exp(x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -9.2e+106) tmp = 0.0; elseif (x <= 8.2e-23) tmp = exp(Float64(-z)); else tmp = exp(x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -9.2e+106) tmp = 0.0; elseif (x <= 8.2e-23) tmp = exp(-z); else tmp = exp(x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -9.2e+106], 0.0, If[LessEqual[x, 8.2e-23], N[Exp[(-z)], $MachinePrecision], N[Exp[x], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{+106}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-23}:\\
\;\;\;\;e^{-z}\\
\mathbf{else}:\\
\;\;\;\;e^{x}\\
\end{array}
\end{array}
if x < -9.2000000000000008e106Initial program 100.0%
Taylor expanded in z around inf 54.6%
neg-mul-154.6%
Simplified54.6%
Taylor expanded in z around 0 2.7%
mul-1-neg2.7%
unsub-neg2.7%
Simplified2.7%
Taylor expanded in z around inf 3.4%
neg-mul-13.4%
Simplified3.4%
add-log-exp31.3%
exp-neg31.3%
add-sqr-sqrt31.3%
associate-/r*31.3%
metadata-eval31.3%
sqrt-div31.3%
exp-neg31.3%
pow131.3%
pow131.3%
add-sqr-sqrt18.9%
sqrt-unprod30.6%
sqr-neg30.6%
sqrt-unprod11.7%
add-sqr-sqrt23.3%
pow123.3%
pow123.3%
log-div23.3%
Applied egg-rr90.8%
+-inverses90.8%
Simplified90.8%
if -9.2000000000000008e106 < x < 8.20000000000000059e-23Initial program 100.0%
Taylor expanded in z around inf 64.0%
neg-mul-164.0%
Simplified64.0%
if 8.20000000000000059e-23 < x Initial program 100.0%
Taylor expanded in x around inf 83.7%
(FPCore (x y z) :precision binary64 (if (<= z -9.5e+104) (+ 1.0 (* z (+ (* z (* z -0.16666666666666666)) -1.0))) (if (<= z 3.35e+125) (exp x) 0.0)))
double code(double x, double y, double z) {
double tmp;
if (z <= -9.5e+104) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else if (z <= 3.35e+125) {
tmp = exp(x);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-9.5d+104)) then
tmp = 1.0d0 + (z * ((z * (z * (-0.16666666666666666d0))) + (-1.0d0)))
else if (z <= 3.35d+125) then
tmp = exp(x)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -9.5e+104) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else if (z <= 3.35e+125) {
tmp = Math.exp(x);
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -9.5e+104: tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)) elif z <= 3.35e+125: tmp = math.exp(x) else: tmp = 0.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= -9.5e+104) tmp = Float64(1.0 + Float64(z * Float64(Float64(z * Float64(z * -0.16666666666666666)) + -1.0))); elseif (z <= 3.35e+125) tmp = exp(x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -9.5e+104) tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)); elseif (z <= 3.35e+125) tmp = exp(x); else tmp = 0.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -9.5e+104], N[(1.0 + N[(z * N[(N[(z * N[(z * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.35e+125], N[Exp[x], $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+104}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\
\mathbf{elif}\;z \leq 3.35 \cdot 10^{+125}:\\
\;\;\;\;e^{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if z < -9.5e104Initial program 100.0%
Taylor expanded in z around inf 86.5%
neg-mul-186.5%
Simplified86.5%
Taylor expanded in z around 0 86.5%
Taylor expanded in z around inf 86.5%
*-commutative86.5%
Simplified86.5%
if -9.5e104 < z < 3.3500000000000002e125Initial program 100.0%
Taylor expanded in x around inf 63.7%
if 3.3500000000000002e125 < z Initial program 100.0%
Taylor expanded in z around inf 82.9%
neg-mul-182.9%
Simplified82.9%
Taylor expanded in z around 0 1.6%
mul-1-neg1.6%
unsub-neg1.6%
Simplified1.6%
Taylor expanded in z around inf 1.6%
neg-mul-11.6%
Simplified1.6%
add-log-exp1.3%
exp-neg1.3%
add-sqr-sqrt1.3%
associate-/r*1.3%
metadata-eval1.3%
sqrt-div1.3%
exp-neg1.3%
pow11.3%
pow11.3%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
pow10.0%
log-div0.0%
Applied egg-rr82.9%
+-inverses82.9%
Simplified82.9%
Final simplification71.7%
(FPCore (x y z) :precision binary64 (if (<= y 7.6e+24) (exp (- x z)) (pow y y)))
double code(double x, double y, double z) {
double tmp;
if (y <= 7.6e+24) {
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.6d+24) 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.6e+24) {
tmp = Math.exp((x - z));
} else {
tmp = Math.pow(y, y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 7.6e+24: tmp = math.exp((x - z)) else: tmp = math.pow(y, y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 7.6e+24) 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.6e+24) tmp = exp((x - z)); else tmp = y ^ y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 7.6e+24], N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision], N[Power[y, y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.6 \cdot 10^{+24}:\\
\;\;\;\;e^{x - z}\\
\mathbf{else}:\\
\;\;\;\;{y}^{y}\\
\end{array}
\end{array}
if y < 7.6000000000000003e24Initial program 100.0%
Taylor expanded in y around 0 98.9%
if 7.6000000000000003e24 < y Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
exp-sum69.4%
*-commutative69.4%
exp-to-pow69.4%
Simplified69.4%
Taylor expanded in z around 0 80.3%
Taylor expanded in x around 0 85.8%
(FPCore (x y z)
:precision binary64
(if (<= z -9.5e+102)
(+ 1.0 (* z (+ (* z (* z -0.16666666666666666)) -1.0)))
(if (<= z 5.3e-24)
(+ 1.0 (* x (+ 1.0 (* x (+ 0.5 (* x 0.16666666666666666))))))
0.0)))
double code(double x, double y, double z) {
double tmp;
if (z <= -9.5e+102) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else if (z <= 5.3e-24) {
tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-9.5d+102)) then
tmp = 1.0d0 + (z * ((z * (z * (-0.16666666666666666d0))) + (-1.0d0)))
else if (z <= 5.3d-24) then
tmp = 1.0d0 + (x * (1.0d0 + (x * (0.5d0 + (x * 0.16666666666666666d0)))))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -9.5e+102) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else if (z <= 5.3e-24) {
tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))));
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -9.5e+102: tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)) elif z <= 5.3e-24: tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666))))) else: tmp = 0.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= -9.5e+102) tmp = Float64(1.0 + Float64(z * Float64(Float64(z * Float64(z * -0.16666666666666666)) + -1.0))); elseif (z <= 5.3e-24) tmp = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * 0.16666666666666666)))))); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -9.5e+102) tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)); elseif (z <= 5.3e-24) tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666))))); else tmp = 0.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -9.5e+102], N[(1.0 + N[(z * N[(N[(z * N[(z * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.3e-24], N[(1.0 + N[(x * N[(1.0 + N[(x * N[(0.5 + N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+102}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{-24}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if z < -9.4999999999999992e102Initial program 100.0%
Taylor expanded in z around inf 86.5%
neg-mul-186.5%
Simplified86.5%
Taylor expanded in z around 0 86.5%
Taylor expanded in z around inf 86.5%
*-commutative86.5%
Simplified86.5%
if -9.4999999999999992e102 < z < 5.29999999999999969e-24Initial program 100.0%
Taylor expanded in x around inf 64.2%
Taylor expanded in x around 0 45.2%
*-commutative45.2%
Simplified45.2%
if 5.29999999999999969e-24 < z Initial program 100.0%
Taylor expanded in z around inf 64.4%
neg-mul-164.4%
Simplified64.4%
Taylor expanded in z around 0 3.1%
mul-1-neg3.1%
unsub-neg3.1%
Simplified3.1%
Taylor expanded in z around inf 1.6%
neg-mul-11.6%
Simplified1.6%
add-log-exp3.4%
exp-neg4.5%
add-sqr-sqrt4.5%
associate-/r*4.5%
metadata-eval4.5%
sqrt-div4.5%
exp-neg3.4%
pow13.4%
pow13.4%
add-sqr-sqrt0.0%
sqrt-unprod3.7%
sqr-neg3.7%
sqrt-unprod3.7%
add-sqr-sqrt3.7%
pow13.7%
pow13.7%
log-div3.7%
Applied egg-rr64.3%
+-inverses64.3%
Simplified64.3%
Final simplification60.0%
(FPCore (x y z) :precision binary64 (if (<= z -4.5e+102) (+ 1.0 (* z (+ (* z (* z -0.16666666666666666)) -1.0))) (if (<= z 5.3e-24) (+ 1.0 (* x (+ 1.0 (* x 0.5)))) 0.0)))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.5e+102) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else if (z <= 5.3e-24) {
tmp = 1.0 + (x * (1.0 + (x * 0.5)));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-4.5d+102)) then
tmp = 1.0d0 + (z * ((z * (z * (-0.16666666666666666d0))) + (-1.0d0)))
else if (z <= 5.3d-24) then
tmp = 1.0d0 + (x * (1.0d0 + (x * 0.5d0)))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4.5e+102) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else if (z <= 5.3e-24) {
tmp = 1.0 + (x * (1.0 + (x * 0.5)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.5e+102: tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)) elif z <= 5.3e-24: tmp = 1.0 + (x * (1.0 + (x * 0.5))) else: tmp = 0.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.5e+102) tmp = Float64(1.0 + Float64(z * Float64(Float64(z * Float64(z * -0.16666666666666666)) + -1.0))); elseif (z <= 5.3e-24) tmp = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * 0.5)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.5e+102) tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)); elseif (z <= 5.3e-24) tmp = 1.0 + (x * (1.0 + (x * 0.5))); else tmp = 0.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.5e+102], N[(1.0 + N[(z * N[(N[(z * N[(z * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.3e-24], N[(1.0 + N[(x * N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+102}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{-24}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if z < -4.50000000000000021e102Initial program 100.0%
Taylor expanded in z around inf 86.5%
neg-mul-186.5%
Simplified86.5%
Taylor expanded in z around 0 86.5%
Taylor expanded in z around inf 86.5%
*-commutative86.5%
Simplified86.5%
if -4.50000000000000021e102 < z < 5.29999999999999969e-24Initial program 100.0%
Taylor expanded in x around inf 64.2%
Taylor expanded in x around 0 39.8%
*-commutative39.8%
Simplified39.8%
if 5.29999999999999969e-24 < z Initial program 100.0%
Taylor expanded in z around inf 64.4%
neg-mul-164.4%
Simplified64.4%
Taylor expanded in z around 0 3.1%
mul-1-neg3.1%
unsub-neg3.1%
Simplified3.1%
Taylor expanded in z around inf 1.6%
neg-mul-11.6%
Simplified1.6%
add-log-exp3.4%
exp-neg4.5%
add-sqr-sqrt4.5%
associate-/r*4.5%
metadata-eval4.5%
sqrt-div4.5%
exp-neg3.4%
pow13.4%
pow13.4%
add-sqr-sqrt0.0%
sqrt-unprod3.7%
sqr-neg3.7%
sqrt-unprod3.7%
add-sqr-sqrt3.7%
pow13.7%
pow13.7%
log-div3.7%
Applied egg-rr64.3%
+-inverses64.3%
Simplified64.3%
Final simplification57.5%
(FPCore (x y z)
:precision binary64
(if (<= x -4.1e-25)
0.0
(if (<= x 3.5e+108)
(+ 1.0 (* z (+ (* z 0.5) -1.0)))
(+ 1.0 (* x (+ 1.0 (* x 0.5)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.1e-25) {
tmp = 0.0;
} else if (x <= 3.5e+108) {
tmp = 1.0 + (z * ((z * 0.5) + -1.0));
} else {
tmp = 1.0 + (x * (1.0 + (x * 0.5)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4.1d-25)) then
tmp = 0.0d0
else if (x <= 3.5d+108) then
tmp = 1.0d0 + (z * ((z * 0.5d0) + (-1.0d0)))
else
tmp = 1.0d0 + (x * (1.0d0 + (x * 0.5d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4.1e-25) {
tmp = 0.0;
} else if (x <= 3.5e+108) {
tmp = 1.0 + (z * ((z * 0.5) + -1.0));
} else {
tmp = 1.0 + (x * (1.0 + (x * 0.5)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.1e-25: tmp = 0.0 elif x <= 3.5e+108: tmp = 1.0 + (z * ((z * 0.5) + -1.0)) else: tmp = 1.0 + (x * (1.0 + (x * 0.5))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.1e-25) tmp = 0.0; elseif (x <= 3.5e+108) tmp = Float64(1.0 + Float64(z * Float64(Float64(z * 0.5) + -1.0))); else tmp = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * 0.5)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.1e-25) tmp = 0.0; elseif (x <= 3.5e+108) tmp = 1.0 + (z * ((z * 0.5) + -1.0)); else tmp = 1.0 + (x * (1.0 + (x * 0.5))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.1e-25], 0.0, If[LessEqual[x, 3.5e+108], N[(1.0 + N[(z * N[(N[(z * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.1 \cdot 10^{-25}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+108}:\\
\;\;\;\;1 + z \cdot \left(z \cdot 0.5 + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot 0.5\right)\\
\end{array}
\end{array}
if x < -4.09999999999999987e-25Initial program 100.0%
Taylor expanded in z around inf 59.0%
neg-mul-159.0%
Simplified59.0%
Taylor expanded in z around 0 5.1%
mul-1-neg5.1%
unsub-neg5.1%
Simplified5.1%
Taylor expanded in z around inf 3.3%
neg-mul-13.3%
Simplified3.3%
add-log-exp32.5%
exp-neg33.9%
add-sqr-sqrt33.9%
associate-/r*33.9%
metadata-eval33.9%
sqrt-div33.9%
exp-neg32.5%
pow132.5%
pow132.5%
add-sqr-sqrt23.2%
sqrt-unprod33.3%
sqr-neg33.3%
sqrt-unprod10.1%
add-sqr-sqrt18.8%
pow118.8%
pow118.8%
log-div18.8%
Applied egg-rr74.7%
+-inverses74.7%
Simplified74.7%
if -4.09999999999999987e-25 < x < 3.5000000000000002e108Initial program 100.0%
Taylor expanded in z around inf 59.2%
neg-mul-159.2%
Simplified59.2%
Taylor expanded in z around 0 35.6%
if 3.5000000000000002e108 < x Initial program 100.0%
Taylor expanded in x around inf 87.7%
Taylor expanded in x around 0 70.5%
*-commutative70.5%
Simplified70.5%
Final simplification52.8%
(FPCore (x y z)
:precision binary64
(if (<= x -4.5e-27)
0.0
(if (<= x 3.5e+108)
(+ 1.0 (* z (* z 0.5)))
(+ 1.0 (* x (+ 1.0 (* x 0.5)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.5e-27) {
tmp = 0.0;
} else if (x <= 3.5e+108) {
tmp = 1.0 + (z * (z * 0.5));
} else {
tmp = 1.0 + (x * (1.0 + (x * 0.5)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4.5d-27)) then
tmp = 0.0d0
else if (x <= 3.5d+108) then
tmp = 1.0d0 + (z * (z * 0.5d0))
else
tmp = 1.0d0 + (x * (1.0d0 + (x * 0.5d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4.5e-27) {
tmp = 0.0;
} else if (x <= 3.5e+108) {
tmp = 1.0 + (z * (z * 0.5));
} else {
tmp = 1.0 + (x * (1.0 + (x * 0.5)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.5e-27: tmp = 0.0 elif x <= 3.5e+108: tmp = 1.0 + (z * (z * 0.5)) else: tmp = 1.0 + (x * (1.0 + (x * 0.5))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.5e-27) tmp = 0.0; elseif (x <= 3.5e+108) tmp = Float64(1.0 + Float64(z * Float64(z * 0.5))); else tmp = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * 0.5)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.5e-27) tmp = 0.0; elseif (x <= 3.5e+108) tmp = 1.0 + (z * (z * 0.5)); else tmp = 1.0 + (x * (1.0 + (x * 0.5))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.5e-27], 0.0, If[LessEqual[x, 3.5e+108], N[(1.0 + N[(z * N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{-27}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+108}:\\
\;\;\;\;1 + z \cdot \left(z \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot 0.5\right)\\
\end{array}
\end{array}
if x < -4.5000000000000002e-27Initial program 100.0%
Taylor expanded in z around inf 59.0%
neg-mul-159.0%
Simplified59.0%
Taylor expanded in z around 0 5.1%
mul-1-neg5.1%
unsub-neg5.1%
Simplified5.1%
Taylor expanded in z around inf 3.3%
neg-mul-13.3%
Simplified3.3%
add-log-exp32.5%
exp-neg33.9%
add-sqr-sqrt33.9%
associate-/r*33.9%
metadata-eval33.9%
sqrt-div33.9%
exp-neg32.5%
pow132.5%
pow132.5%
add-sqr-sqrt23.2%
sqrt-unprod33.3%
sqr-neg33.3%
sqrt-unprod10.1%
add-sqr-sqrt18.8%
pow118.8%
pow118.8%
log-div18.8%
Applied egg-rr74.7%
+-inverses74.7%
Simplified74.7%
if -4.5000000000000002e-27 < x < 3.5000000000000002e108Initial program 100.0%
Taylor expanded in z around inf 59.2%
neg-mul-159.2%
Simplified59.2%
Taylor expanded in z around 0 35.6%
Taylor expanded in z around inf 34.6%
*-commutative34.6%
Simplified34.6%
if 3.5000000000000002e108 < x Initial program 100.0%
Taylor expanded in x around inf 87.7%
Taylor expanded in x around 0 70.5%
*-commutative70.5%
Simplified70.5%
(FPCore (x y z) :precision binary64 (if (<= z -3500.0) 0.0 (if (<= z 3.5e-26) (+ x 1.0) 0.0)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3500.0) {
tmp = 0.0;
} else if (z <= 3.5e-26) {
tmp = x + 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-3500.0d0)) then
tmp = 0.0d0
else if (z <= 3.5d-26) then
tmp = x + 1.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3500.0) {
tmp = 0.0;
} else if (z <= 3.5e-26) {
tmp = x + 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3500.0: tmp = 0.0 elif z <= 3.5e-26: tmp = x + 1.0 else: tmp = 0.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3500.0) tmp = 0.0; elseif (z <= 3.5e-26) tmp = Float64(x + 1.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3500.0) tmp = 0.0; elseif (z <= 3.5e-26) tmp = x + 1.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3500.0], 0.0, If[LessEqual[z, 3.5e-26], N[(x + 1.0), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3500:\\
\;\;\;\;0\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-26}:\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if z < -3500 or 3.49999999999999985e-26 < z Initial program 100.0%
Taylor expanded in z around inf 73.3%
neg-mul-173.3%
Simplified73.3%
Taylor expanded in z around 0 3.9%
mul-1-neg3.9%
unsub-neg3.9%
Simplified3.9%
Taylor expanded in z around inf 3.0%
neg-mul-13.0%
Simplified3.0%
add-log-exp38.4%
exp-neg39.0%
add-sqr-sqrt39.0%
associate-/r*39.0%
metadata-eval39.0%
sqrt-div39.0%
exp-neg38.4%
pow138.4%
pow138.4%
add-sqr-sqrt36.5%
sqrt-unprod38.6%
sqr-neg38.6%
sqrt-unprod2.1%
add-sqr-sqrt2.1%
pow12.1%
pow12.1%
log-div2.1%
Applied egg-rr43.8%
+-inverses43.8%
Simplified43.8%
if -3500 < z < 3.49999999999999985e-26Initial program 100.0%
Taylor expanded in x around inf 64.6%
Taylor expanded in x around 0 27.3%
Final simplification37.2%
(FPCore (x y z) :precision binary64 (if (<= z 3.3e-28) (+ 1.0 (* z (* z 0.5))) 0.0))
double code(double x, double y, double z) {
double tmp;
if (z <= 3.3e-28) {
tmp = 1.0 + (z * (z * 0.5));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= 3.3d-28) then
tmp = 1.0d0 + (z * (z * 0.5d0))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 3.3e-28) {
tmp = 1.0 + (z * (z * 0.5));
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 3.3e-28: tmp = 1.0 + (z * (z * 0.5)) else: tmp = 0.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= 3.3e-28) tmp = Float64(1.0 + Float64(z * Float64(z * 0.5))); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 3.3e-28) tmp = 1.0 + (z * (z * 0.5)); else tmp = 0.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 3.3e-28], N[(1.0 + N[(z * N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.3 \cdot 10^{-28}:\\
\;\;\;\;1 + z \cdot \left(z \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if z < 3.3000000000000002e-28Initial program 100.0%
Taylor expanded in z around inf 50.1%
neg-mul-150.1%
Simplified50.1%
Taylor expanded in z around 0 33.4%
Taylor expanded in z around inf 33.1%
*-commutative33.1%
Simplified33.1%
if 3.3000000000000002e-28 < z Initial program 100.0%
Taylor expanded in z around inf 64.4%
neg-mul-164.4%
Simplified64.4%
Taylor expanded in z around 0 3.1%
mul-1-neg3.1%
unsub-neg3.1%
Simplified3.1%
Taylor expanded in z around inf 1.6%
neg-mul-11.6%
Simplified1.6%
add-log-exp3.4%
exp-neg4.5%
add-sqr-sqrt4.5%
associate-/r*4.5%
metadata-eval4.5%
sqrt-div4.5%
exp-neg3.4%
pow13.4%
pow13.4%
add-sqr-sqrt0.0%
sqrt-unprod3.7%
sqr-neg3.7%
sqrt-unprod3.7%
add-sqr-sqrt3.7%
pow13.7%
pow13.7%
log-div3.7%
Applied egg-rr64.3%
+-inverses64.3%
Simplified64.3%
(FPCore (x y z) :precision binary64 (if (<= z -3500.0) 0.0 (if (<= z 3.8e-29) 1.0 0.0)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3500.0) {
tmp = 0.0;
} else if (z <= 3.8e-29) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-3500.0d0)) then
tmp = 0.0d0
else if (z <= 3.8d-29) then
tmp = 1.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3500.0) {
tmp = 0.0;
} else if (z <= 3.8e-29) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3500.0: tmp = 0.0 elif z <= 3.8e-29: tmp = 1.0 else: tmp = 0.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3500.0) tmp = 0.0; elseif (z <= 3.8e-29) tmp = 1.0; else tmp = 0.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3500.0) tmp = 0.0; elseif (z <= 3.8e-29) tmp = 1.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3500.0], 0.0, If[LessEqual[z, 3.8e-29], 1.0, 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3500:\\
\;\;\;\;0\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-29}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if z < -3500 or 3.79999999999999976e-29 < z Initial program 100.0%
Taylor expanded in z around inf 73.3%
neg-mul-173.3%
Simplified73.3%
Taylor expanded in z around 0 3.9%
mul-1-neg3.9%
unsub-neg3.9%
Simplified3.9%
Taylor expanded in z around inf 3.0%
neg-mul-13.0%
Simplified3.0%
add-log-exp38.4%
exp-neg39.0%
add-sqr-sqrt39.0%
associate-/r*39.0%
metadata-eval39.0%
sqrt-div39.0%
exp-neg38.4%
pow138.4%
pow138.4%
add-sqr-sqrt36.5%
sqrt-unprod38.6%
sqr-neg38.6%
sqrt-unprod2.1%
add-sqr-sqrt2.1%
pow12.1%
pow12.1%
log-div2.1%
Applied egg-rr43.8%
+-inverses43.8%
Simplified43.8%
if -3500 < z < 3.79999999999999976e-29Initial program 100.0%
Taylor expanded in x around inf 64.6%
Taylor expanded in x around 0 26.0%
(FPCore (x y z) :precision binary64 0.0)
double code(double x, double y, double z) {
return 0.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.0d0
end function
public static double code(double x, double y, double z) {
return 0.0;
}
def code(x, y, z): return 0.0
function code(x, y, z) return 0.0 end
function tmp = code(x, y, z) tmp = 0.0; end
code[x_, y_, z_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 100.0%
Taylor expanded in z around inf 55.0%
neg-mul-155.0%
Simplified55.0%
Taylor expanded in z around 0 12.8%
mul-1-neg12.8%
unsub-neg12.8%
Simplified12.8%
Taylor expanded in z around inf 2.9%
neg-mul-12.9%
Simplified2.9%
add-log-exp28.2%
exp-neg28.5%
add-sqr-sqrt28.5%
associate-/r*28.5%
metadata-eval28.5%
sqrt-div28.5%
exp-neg28.2%
pow128.2%
pow128.2%
add-sqr-sqrt25.1%
sqrt-unprod28.3%
sqr-neg28.3%
sqrt-unprod3.2%
add-sqr-sqrt5.9%
pow15.9%
pow15.9%
log-div5.9%
Applied egg-rr31.0%
+-inverses31.0%
Simplified31.0%
(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 2024170
(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)))