
(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 10 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 4.6e+17) (exp (- x z)) (exp (- (* y (log y)) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= 4.6e+17) {
tmp = exp((x - z));
} else {
tmp = exp(((y * log(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 <= 4.6d+17) then
tmp = exp((x - z))
else
tmp = exp(((y * log(y)) - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 4.6e+17) {
tmp = Math.exp((x - z));
} else {
tmp = Math.exp(((y * Math.log(y)) - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 4.6e+17: tmp = math.exp((x - z)) else: tmp = math.exp(((y * math.log(y)) - z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 4.6e+17) tmp = exp(Float64(x - z)); else tmp = exp(Float64(Float64(y * log(y)) - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 4.6e+17) tmp = exp((x - z)); else tmp = exp(((y * log(y)) - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 4.6e+17], N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.6 \cdot 10^{+17}:\\
\;\;\;\;e^{x - z}\\
\mathbf{else}:\\
\;\;\;\;e^{y \cdot \log y - z}\\
\end{array}
\end{array}
if y < 4.6e17Initial program 100.0%
Taylor expanded in x around inf 99.2%
if 4.6e17 < y Initial program 100.0%
Taylor expanded in x around 0 95.2%
(FPCore (x y z)
:precision binary64
(if (<= z -0.76)
(exp (- z))
(if (<= z -2.25e-181)
(pow y y)
(if (<= z -1.6e-221)
(exp x)
(if (<= z 1.25e-31) (pow y y) (if (<= z 2.1e+17) (exp x) 0.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.76) {
tmp = exp(-z);
} else if (z <= -2.25e-181) {
tmp = pow(y, y);
} else if (z <= -1.6e-221) {
tmp = exp(x);
} else if (z <= 1.25e-31) {
tmp = pow(y, y);
} else if (z <= 2.1e+17) {
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 <= (-0.76d0)) then
tmp = exp(-z)
else if (z <= (-2.25d-181)) then
tmp = y ** y
else if (z <= (-1.6d-221)) then
tmp = exp(x)
else if (z <= 1.25d-31) then
tmp = y ** y
else if (z <= 2.1d+17) 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 <= -0.76) {
tmp = Math.exp(-z);
} else if (z <= -2.25e-181) {
tmp = Math.pow(y, y);
} else if (z <= -1.6e-221) {
tmp = Math.exp(x);
} else if (z <= 1.25e-31) {
tmp = Math.pow(y, y);
} else if (z <= 2.1e+17) {
tmp = Math.exp(x);
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.76: tmp = math.exp(-z) elif z <= -2.25e-181: tmp = math.pow(y, y) elif z <= -1.6e-221: tmp = math.exp(x) elif z <= 1.25e-31: tmp = math.pow(y, y) elif z <= 2.1e+17: tmp = math.exp(x) else: tmp = 0.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.76) tmp = exp(Float64(-z)); elseif (z <= -2.25e-181) tmp = y ^ y; elseif (z <= -1.6e-221) tmp = exp(x); elseif (z <= 1.25e-31) tmp = y ^ y; elseif (z <= 2.1e+17) tmp = exp(x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.76) tmp = exp(-z); elseif (z <= -2.25e-181) tmp = y ^ y; elseif (z <= -1.6e-221) tmp = exp(x); elseif (z <= 1.25e-31) tmp = y ^ y; elseif (z <= 2.1e+17) tmp = exp(x); else tmp = 0.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.76], N[Exp[(-z)], $MachinePrecision], If[LessEqual[z, -2.25e-181], N[Power[y, y], $MachinePrecision], If[LessEqual[z, -1.6e-221], N[Exp[x], $MachinePrecision], If[LessEqual[z, 1.25e-31], N[Power[y, y], $MachinePrecision], If[LessEqual[z, 2.1e+17], N[Exp[x], $MachinePrecision], 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.76:\\
\;\;\;\;e^{-z}\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{-181}:\\
\;\;\;\;{y}^{y}\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-221}:\\
\;\;\;\;e^{x}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-31}:\\
\;\;\;\;{y}^{y}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+17}:\\
\;\;\;\;e^{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if z < -0.76000000000000001Initial program 100.0%
Taylor expanded in x around 0 94.2%
Taylor expanded in y around 0 94.2%
neg-mul-194.2%
Simplified94.2%
if -0.76000000000000001 < z < -2.2499999999999999e-181 or -1.60000000000000008e-221 < z < 1.25e-31Initial program 100.0%
Taylor expanded in z around 0 99.1%
+-commutative99.1%
exp-sum85.0%
*-commutative85.0%
exp-to-pow85.0%
Simplified85.0%
Taylor expanded in x around 0 76.9%
if -2.2499999999999999e-181 < z < -1.60000000000000008e-221 or 1.25e-31 < z < 2.1e17Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
exp-sum76.2%
exp-diff71.4%
associate-/r/71.4%
*-commutative71.4%
exp-to-pow71.4%
div-exp80.9%
Simplified80.9%
Taylor expanded in y around 0 90.7%
Taylor expanded in z around 0 87.0%
exp-neg87.0%
remove-double-div87.0%
Simplified87.0%
if 2.1e17 < z Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
exp-sum75.9%
exp-diff46.6%
associate-/r/46.6%
*-commutative46.6%
exp-to-pow46.6%
div-exp62.1%
Simplified62.1%
Taylor expanded in y around 0 83.0%
Taylor expanded in z around 0 33.0%
Applied egg-rr72.8%
(FPCore (x y z) :precision binary64 (if (<= z -3.6e+32) (exp (- z)) (if (<= z 1.4e+18) (exp x) 0.0)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.6e+32) {
tmp = exp(-z);
} else if (z <= 1.4e+18) {
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 <= (-3.6d+32)) then
tmp = exp(-z)
else if (z <= 1.4d+18) 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 <= -3.6e+32) {
tmp = Math.exp(-z);
} else if (z <= 1.4e+18) {
tmp = Math.exp(x);
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.6e+32: tmp = math.exp(-z) elif z <= 1.4e+18: tmp = math.exp(x) else: tmp = 0.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.6e+32) tmp = exp(Float64(-z)); elseif (z <= 1.4e+18) tmp = exp(x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.6e+32) tmp = exp(-z); elseif (z <= 1.4e+18) tmp = exp(x); else tmp = 0.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.6e+32], N[Exp[(-z)], $MachinePrecision], If[LessEqual[z, 1.4e+18], N[Exp[x], $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+32}:\\
\;\;\;\;e^{-z}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+18}:\\
\;\;\;\;e^{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if z < -3.5999999999999997e32Initial program 100.0%
Taylor expanded in x around 0 96.8%
Taylor expanded in y around 0 96.8%
neg-mul-196.8%
Simplified96.8%
if -3.5999999999999997e32 < z < 1.4e18Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
exp-sum84.6%
exp-diff83.8%
associate-/r/83.8%
*-commutative83.8%
exp-to-pow83.8%
div-exp85.3%
Simplified85.3%
Taylor expanded in y around 0 69.7%
Taylor expanded in z around 0 64.9%
exp-neg64.9%
remove-double-div64.9%
Simplified64.9%
if 1.4e18 < z Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
exp-sum75.9%
exp-diff46.6%
associate-/r/46.6%
*-commutative46.6%
exp-to-pow46.6%
div-exp62.1%
Simplified62.1%
Taylor expanded in y around 0 83.0%
Taylor expanded in z around 0 33.0%
Applied egg-rr72.8%
(FPCore (x y z) :precision binary64 (if (<= y 1.65e+45) (exp (- x z)) (pow y y)))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.65e+45) {
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 <= 1.65d+45) 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 <= 1.65e+45) {
tmp = Math.exp((x - z));
} else {
tmp = Math.pow(y, y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.65e+45: tmp = math.exp((x - z)) else: tmp = math.pow(y, y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.65e+45) 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 <= 1.65e+45) tmp = exp((x - z)); else tmp = y ^ y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.65e+45], N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision], N[Power[y, y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.65 \cdot 10^{+45}:\\
\;\;\;\;e^{x - z}\\
\mathbf{else}:\\
\;\;\;\;{y}^{y}\\
\end{array}
\end{array}
if y < 1.65e45Initial program 100.0%
Taylor expanded in x around inf 98.0%
if 1.65e45 < y Initial program 100.0%
Taylor expanded in z around 0 92.9%
+-commutative92.9%
exp-sum71.2%
*-commutative71.2%
exp-to-pow71.2%
Simplified71.2%
Taylor expanded in x around 0 87.8%
(FPCore (x y z) :precision binary64 (if (<= z 1.45e+17) (exp x) 0.0))
double code(double x, double y, double z) {
double tmp;
if (z <= 1.45e+17) {
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 <= 1.45d+17) 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 <= 1.45e+17) {
tmp = Math.exp(x);
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 1.45e+17: tmp = math.exp(x) else: tmp = 0.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= 1.45e+17) tmp = exp(x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 1.45e+17) tmp = exp(x); else tmp = 0.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 1.45e+17], N[Exp[x], $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.45 \cdot 10^{+17}:\\
\;\;\;\;e^{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if z < 1.45e17Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
exp-sum84.3%
exp-diff83.8%
associate-/r/83.8%
*-commutative83.8%
exp-to-pow83.8%
div-exp89.9%
Simplified89.9%
Taylor expanded in y around 0 79.2%
Taylor expanded in z around 0 55.3%
exp-neg55.3%
remove-double-div55.3%
Simplified55.3%
if 1.45e17 < z Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
exp-sum75.9%
exp-diff46.6%
associate-/r/46.6%
*-commutative46.6%
exp-to-pow46.6%
div-exp62.1%
Simplified62.1%
Taylor expanded in y around 0 83.0%
Taylor expanded in z around 0 33.0%
Applied egg-rr72.8%
(FPCore (x y z) :precision binary64 (if (<= z 6.2e-13) (+ 1.0 (* x (+ 1.0 (* x 0.5)))) 0.0))
double code(double x, double y, double z) {
double tmp;
if (z <= 6.2e-13) {
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 <= 6.2d-13) 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 <= 6.2e-13) {
tmp = 1.0 + (x * (1.0 + (x * 0.5)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 6.2e-13: 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 <= 6.2e-13) 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 <= 6.2e-13) 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, 6.2e-13], 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 6.2 \cdot 10^{-13}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if z < 6.1999999999999998e-13Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
exp-sum85.3%
exp-diff85.3%
associate-/r/85.2%
*-commutative85.2%
exp-to-pow85.2%
div-exp90.5%
Simplified90.5%
Taylor expanded in y around 0 78.3%
Taylor expanded in z around 0 53.8%
Taylor expanded in x around 0 38.9%
*-commutative38.9%
Simplified38.9%
if 6.1999999999999998e-13 < z Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
exp-sum74.2%
exp-diff46.9%
associate-/r/46.9%
*-commutative46.9%
exp-to-pow46.9%
div-exp63.6%
Simplified63.6%
Taylor expanded in y around 0 85.1%
Taylor expanded in z around 0 39.9%
Applied egg-rr68.7%
(FPCore (x y z) :precision binary64 (if (<= z 8.2e-61) (+ x 1.0) 0.0))
double code(double x, double y, double z) {
double tmp;
if (z <= 8.2e-61) {
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 <= 8.2d-61) 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 <= 8.2e-61) {
tmp = x + 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 8.2e-61: tmp = x + 1.0 else: tmp = 0.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= 8.2e-61) 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 <= 8.2e-61) tmp = x + 1.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 8.2e-61], N[(x + 1.0), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 8.2 \cdot 10^{-61}:\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if z < 8.19999999999999998e-61Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
exp-sum85.4%
exp-diff85.4%
associate-/r/85.4%
*-commutative85.4%
exp-to-pow85.4%
div-exp90.8%
Simplified90.8%
Taylor expanded in y around 0 79.8%
Taylor expanded in z around 0 54.7%
Taylor expanded in x around 0 22.1%
if 8.19999999999999998e-61 < z Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
exp-sum74.6%
exp-diff49.3%
associate-/r/49.3%
*-commutative49.3%
exp-to-pow49.3%
div-exp64.8%
Simplified64.8%
Taylor expanded in y around 0 80.6%
Taylor expanded in z around 0 38.7%
Applied egg-rr64.0%
Final simplification33.7%
(FPCore (x y z) :precision binary64 (if (<= z 9e-109) 1.0 0.0))
double code(double x, double y, double z) {
double tmp;
if (z <= 9e-109) {
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 <= 9d-109) 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 <= 9e-109) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 9e-109: tmp = 1.0 else: tmp = 0.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= 9e-109) tmp = 1.0; else tmp = 0.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 9e-109) tmp = 1.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 9e-109], 1.0, 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 9 \cdot 10^{-109}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if z < 9.0000000000000002e-109Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
exp-sum85.2%
exp-diff85.2%
associate-/r/85.2%
*-commutative85.2%
exp-to-pow85.2%
div-exp90.9%
Simplified90.9%
Taylor expanded in y around 0 79.9%
Taylor expanded in z around 0 53.5%
Taylor expanded in x around 0 20.4%
if 9.0000000000000002e-109 < z Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
exp-sum76.3%
exp-diff53.7%
associate-/r/53.7%
*-commutative53.7%
exp-to-pow53.7%
div-exp67.5%
Simplified67.5%
Taylor expanded in y around 0 80.4%
Taylor expanded in z around 0 43.1%
Applied egg-rr57.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%
associate--l+100.0%
+-commutative100.0%
exp-sum82.4%
exp-diff75.4%
associate-/r/75.4%
*-commutative75.4%
exp-to-pow75.4%
div-exp83.6%
Simplified83.6%
Taylor expanded in y around 0 80.0%
Taylor expanded in z around 0 50.2%
Applied egg-rr24.9%
(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 2024107
(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)))