
(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 17 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 (let* ((t_0 (* y (log y)))) (if (<= t_0 -1e-287) (* (pow y y) (exp (- x z))) (exp (+ x t_0)))))
double code(double x, double y, double z) {
double t_0 = y * log(y);
double tmp;
if (t_0 <= -1e-287) {
tmp = pow(y, y) * exp((x - z));
} else {
tmp = exp((x + t_0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = y * log(y)
if (t_0 <= (-1d-287)) then
tmp = (y ** y) * exp((x - z))
else
tmp = exp((x + t_0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * Math.log(y);
double tmp;
if (t_0 <= -1e-287) {
tmp = Math.pow(y, y) * Math.exp((x - z));
} else {
tmp = Math.exp((x + t_0));
}
return tmp;
}
def code(x, y, z): t_0 = y * math.log(y) tmp = 0 if t_0 <= -1e-287: tmp = math.pow(y, y) * math.exp((x - z)) else: tmp = math.exp((x + t_0)) return tmp
function code(x, y, z) t_0 = Float64(y * log(y)) tmp = 0.0 if (t_0 <= -1e-287) tmp = Float64((y ^ y) * exp(Float64(x - z))); else tmp = exp(Float64(x + t_0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * log(y); tmp = 0.0; if (t_0 <= -1e-287) tmp = (y ^ y) * exp((x - z)); else tmp = exp((x + t_0)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-287], N[(N[Power[y, y], $MachinePrecision] * N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[N[(x + t$95$0), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \log y\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-287}:\\
\;\;\;\;{y}^{y} \cdot e^{x - z}\\
\mathbf{else}:\\
\;\;\;\;e^{x + t\_0}\\
\end{array}
\end{array}
if (*.f64 y (log.f64 y)) < -1.00000000000000002e-287Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
exp-sum100.0%
*-commutative100.0%
exp-to-pow100.0%
Simplified100.0%
if -1.00000000000000002e-287 < (*.f64 y (log.f64 y)) Initial program 100.0%
Taylor expanded in z around 0 91.4%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* y (log y)))) (if (<= t_0 -1e-287) (exp (- x z)) (exp (+ x t_0)))))
double code(double x, double y, double z) {
double t_0 = y * log(y);
double tmp;
if (t_0 <= -1e-287) {
tmp = exp((x - z));
} else {
tmp = exp((x + t_0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = y * log(y)
if (t_0 <= (-1d-287)) then
tmp = exp((x - z))
else
tmp = exp((x + t_0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * Math.log(y);
double tmp;
if (t_0 <= -1e-287) {
tmp = Math.exp((x - z));
} else {
tmp = Math.exp((x + t_0));
}
return tmp;
}
def code(x, y, z): t_0 = y * math.log(y) tmp = 0 if t_0 <= -1e-287: tmp = math.exp((x - z)) else: tmp = math.exp((x + t_0)) return tmp
function code(x, y, z) t_0 = Float64(y * log(y)) tmp = 0.0 if (t_0 <= -1e-287) tmp = exp(Float64(x - z)); else tmp = exp(Float64(x + t_0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * log(y); tmp = 0.0; if (t_0 <= -1e-287) tmp = exp((x - z)); else tmp = exp((x + t_0)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-287], N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision], N[Exp[N[(x + t$95$0), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \log y\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-287}:\\
\;\;\;\;e^{x - z}\\
\mathbf{else}:\\
\;\;\;\;e^{x + t\_0}\\
\end{array}
\end{array}
if (*.f64 y (log.f64 y)) < -1.00000000000000002e-287Initial program 100.0%
Taylor expanded in y around 0 99.8%
if -1.00000000000000002e-287 < (*.f64 y (log.f64 y)) Initial program 100.0%
Taylor expanded in z around 0 91.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -280000000000.0) (not (<= x 1250.0))) (exp x) (exp (- z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -280000000000.0) || !(x <= 1250.0)) {
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 <= (-280000000000.0d0)) .or. (.not. (x <= 1250.0d0))) 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 <= -280000000000.0) || !(x <= 1250.0)) {
tmp = Math.exp(x);
} else {
tmp = Math.exp(-z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -280000000000.0) or not (x <= 1250.0): tmp = math.exp(x) else: tmp = math.exp(-z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -280000000000.0) || !(x <= 1250.0)) tmp = exp(x); else tmp = exp(Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -280000000000.0) || ~((x <= 1250.0))) tmp = exp(x); else tmp = exp(-z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -280000000000.0], N[Not[LessEqual[x, 1250.0]], $MachinePrecision]], N[Exp[x], $MachinePrecision], N[Exp[(-z)], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -280000000000 \lor \neg \left(x \leq 1250\right):\\
\;\;\;\;e^{x}\\
\mathbf{else}:\\
\;\;\;\;e^{-z}\\
\end{array}
\end{array}
if x < -2.8e11 or 1250 < x Initial program 100.0%
Taylor expanded in x around inf 78.5%
if -2.8e11 < x < 1250Initial program 100.0%
Taylor expanded in z around inf 66.4%
neg-mul-166.4%
Simplified66.4%
Final simplification72.0%
(FPCore (x y z) :precision binary64 (if (<= y 1.25e-13) (exp x) (if (<= y 1020000000.0) (exp (- z)) (pow y y))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.25e-13) {
tmp = exp(x);
} else if (y <= 1020000000.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 <= 1.25d-13) then
tmp = exp(x)
else if (y <= 1020000000.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 <= 1.25e-13) {
tmp = Math.exp(x);
} else if (y <= 1020000000.0) {
tmp = Math.exp(-z);
} else {
tmp = Math.pow(y, y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.25e-13: tmp = math.exp(x) elif y <= 1020000000.0: tmp = math.exp(-z) else: tmp = math.pow(y, y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.25e-13) tmp = exp(x); elseif (y <= 1020000000.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 <= 1.25e-13) tmp = exp(x); elseif (y <= 1020000000.0) tmp = exp(-z); else tmp = y ^ y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.25e-13], N[Exp[x], $MachinePrecision], If[LessEqual[y, 1020000000.0], N[Exp[(-z)], $MachinePrecision], N[Power[y, y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.25 \cdot 10^{-13}:\\
\;\;\;\;e^{x}\\
\mathbf{elif}\;y \leq 1020000000:\\
\;\;\;\;e^{-z}\\
\mathbf{else}:\\
\;\;\;\;{y}^{y}\\
\end{array}
\end{array}
if y < 1.24999999999999997e-13Initial program 100.0%
Taylor expanded in x around inf 74.5%
if 1.24999999999999997e-13 < y < 1.02e9Initial program 100.0%
Taylor expanded in z around inf 86.5%
neg-mul-186.5%
Simplified86.5%
if 1.02e9 < y Initial program 100.0%
Taylor expanded in z around 0 91.1%
Taylor expanded in x around 0 80.5%
(FPCore (x y z) :precision binary64 (if (<= z -1.55e+83) (+ 1.0 (* z (+ (* z (* z -0.16666666666666666)) -1.0))) (if (<= z 700.0) (exp x) (exp z))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.55e+83) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else if (z <= 700.0) {
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.55d+83)) then
tmp = 1.0d0 + (z * ((z * (z * (-0.16666666666666666d0))) + (-1.0d0)))
else if (z <= 700.0d0) 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.55e+83) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else if (z <= 700.0) {
tmp = Math.exp(x);
} else {
tmp = Math.exp(z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.55e+83: tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)) elif z <= 700.0: tmp = math.exp(x) else: tmp = math.exp(z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.55e+83) tmp = Float64(1.0 + Float64(z * Float64(Float64(z * Float64(z * -0.16666666666666666)) + -1.0))); elseif (z <= 700.0) tmp = exp(x); else tmp = exp(z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.55e+83) tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)); elseif (z <= 700.0) tmp = exp(x); else tmp = exp(z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.55e+83], N[(1.0 + N[(z * N[(N[(z * N[(z * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 700.0], N[Exp[x], $MachinePrecision], N[Exp[z], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+83}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\
\mathbf{elif}\;z \leq 700:\\
\;\;\;\;e^{x}\\
\mathbf{else}:\\
\;\;\;\;e^{z}\\
\end{array}
\end{array}
if z < -1.54999999999999996e83Initial program 100.0%
Taylor expanded in z around inf 91.3%
neg-mul-191.3%
Simplified91.3%
Taylor expanded in z around 0 83.1%
Taylor expanded in z around inf 83.1%
*-commutative83.1%
Simplified83.1%
if -1.54999999999999996e83 < z < 700Initial program 100.0%
Taylor expanded in x around inf 69.1%
if 700 < z Initial program 100.0%
Taylor expanded in z around inf 56.1%
neg-mul-156.1%
Simplified56.1%
expm1-log1p-u56.1%
expm1-undefine56.1%
add-sqr-sqrt0.0%
sqrt-unprod45.5%
sqr-neg45.5%
sqrt-unprod45.5%
add-sqr-sqrt45.5%
Applied egg-rr45.5%
log1p-undefine45.5%
rem-exp-log45.5%
associate-+r-45.5%
expm1-undefine45.5%
rem-exp-log45.5%
log1p-define45.5%
log1p-expm145.5%
Simplified45.5%
Final simplification65.6%
(FPCore (x y z) :precision binary64 (if (<= y 2.8e+112) (exp (- x z)) (pow y y)))
double code(double x, double y, double z) {
double tmp;
if (y <= 2.8e+112) {
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 <= 2.8d+112) 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 <= 2.8e+112) {
tmp = Math.exp((x - z));
} else {
tmp = Math.pow(y, y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 2.8e+112: tmp = math.exp((x - z)) else: tmp = math.pow(y, y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 2.8e+112) 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 <= 2.8e+112) tmp = exp((x - z)); else tmp = y ^ y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 2.8e+112], N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision], N[Power[y, y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.8 \cdot 10^{+112}:\\
\;\;\;\;e^{x - z}\\
\mathbf{else}:\\
\;\;\;\;{y}^{y}\\
\end{array}
\end{array}
if y < 2.8000000000000001e112Initial program 100.0%
Taylor expanded in y around 0 91.7%
if 2.8000000000000001e112 < y Initial program 100.0%
Taylor expanded in z around 0 96.2%
Taylor expanded in x around 0 89.9%
(FPCore (x y z) :precision binary64 (if (<= z -1.55e+83) (+ 1.0 (* z (+ (* z (* z -0.16666666666666666)) -1.0))) (exp x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.55e+83) {
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 <= (-1.55d+83)) 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 <= -1.55e+83) {
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 <= -1.55e+83: 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 <= -1.55e+83) 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 <= -1.55e+83) 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, -1.55e+83], 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 -1.55 \cdot 10^{+83}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;e^{x}\\
\end{array}
\end{array}
if z < -1.54999999999999996e83Initial program 100.0%
Taylor expanded in z around inf 91.3%
neg-mul-191.3%
Simplified91.3%
Taylor expanded in z around 0 83.1%
Taylor expanded in z around inf 83.1%
*-commutative83.1%
Simplified83.1%
if -1.54999999999999996e83 < z Initial program 100.0%
Taylor expanded in x around inf 59.3%
Final simplification63.5%
(FPCore (x y z) :precision binary64 (if (<= x 2.8e+59) (+ 1.0 (* z (+ (* z (+ 0.5 (* 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 (x <= 2.8e+59) {
tmp = 1.0 + (z * ((z * (0.5 + (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 (x <= 2.8d+59) then
tmp = 1.0d0 + (z * ((z * (0.5d0 + (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 (x <= 2.8e+59) {
tmp = 1.0 + (z * ((z * (0.5 + (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 x <= 2.8e+59: tmp = 1.0 + (z * ((z * (0.5 + (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 (x <= 2.8e+59) tmp = Float64(1.0 + Float64(z * Float64(Float64(z * Float64(0.5 + 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 (x <= 2.8e+59) tmp = 1.0 + (z * ((z * (0.5 + (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[x, 2.8e+59], N[(1.0 + N[(z * N[(N[(z * N[(0.5 + N[(z * -0.16666666666666666), $MachinePrecision]), $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}\;x \leq 2.8 \cdot 10^{+59}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(0.5 + 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 x < 2.7999999999999998e59Initial program 100.0%
Taylor expanded in z around inf 55.9%
neg-mul-155.9%
Simplified55.9%
Taylor expanded in z around 0 36.6%
if 2.7999999999999998e59 < x Initial program 100.0%
Taylor expanded in x around inf 91.8%
Taylor expanded in x around 0 76.4%
*-commutative76.4%
Simplified76.4%
Final simplification44.1%
(FPCore (x y z) :precision binary64 (if (<= x 2.8e+59) (+ 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 (x <= 2.8e+59) {
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 (x <= 2.8d+59) 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 (x <= 2.8e+59) {
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 x <= 2.8e+59: 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 (x <= 2.8e+59) 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 (x <= 2.8e+59) 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[x, 2.8e+59], 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}\;x \leq 2.8 \cdot 10^{+59}:\\
\;\;\;\;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 x < 2.7999999999999998e59Initial program 100.0%
Taylor expanded in z around inf 55.9%
neg-mul-155.9%
Simplified55.9%
Taylor expanded in z around 0 36.6%
Taylor expanded in z around inf 36.5%
*-commutative36.5%
Simplified36.5%
if 2.7999999999999998e59 < x Initial program 100.0%
Taylor expanded in x around inf 91.8%
Taylor expanded in x around 0 76.4%
*-commutative76.4%
Simplified76.4%
Final simplification44.0%
(FPCore (x y z) :precision binary64 (if (<= z -1.2e+53) (+ 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.2e+53) {
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.2d+53)) 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.2e+53) {
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.2e+53: 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.2e+53) 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.2e+53) 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.2e+53], 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.2 \cdot 10^{+53}:\\
\;\;\;\;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.2e53Initial program 100.0%
Taylor expanded in z around inf 87.4%
neg-mul-187.4%
Simplified87.4%
Taylor expanded in z around 0 79.6%
Taylor expanded in z around inf 79.6%
*-commutative79.6%
Simplified79.6%
if -1.2e53 < z Initial program 100.0%
Taylor expanded in x around inf 58.9%
Taylor expanded in x around 0 34.6%
*-commutative34.6%
Simplified34.6%
Final simplification42.9%
(FPCore (x y z) :precision binary64 (if (<= x 2.1e+135) (+ 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 <= 2.1e+135) {
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 <= 2.1d+135) 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 <= 2.1e+135) {
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 <= 2.1e+135: 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 <= 2.1e+135) 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 <= 2.1e+135) 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, 2.1e+135], 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 2.1 \cdot 10^{+135}:\\
\;\;\;\;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 < 2.1000000000000001e135Initial program 100.0%
Taylor expanded in z around inf 54.7%
neg-mul-154.7%
Simplified54.7%
Taylor expanded in z around 0 34.3%
if 2.1000000000000001e135 < x Initial program 100.0%
Taylor expanded in x around inf 94.5%
Taylor expanded in x around 0 84.5%
*-commutative84.5%
Simplified84.5%
Final simplification41.4%
(FPCore (x y z) :precision binary64 (if (<= z -1.2e+53) (+ 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 (z <= -1.2e+53) {
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 (z <= (-1.2d+53)) 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 (z <= -1.2e+53) {
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 z <= -1.2e+53: 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 (z <= -1.2e+53) 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 (z <= -1.2e+53) 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[z, -1.2e+53], 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}\;z \leq -1.2 \cdot 10^{+53}:\\
\;\;\;\;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 z < -1.2e53Initial program 100.0%
Taylor expanded in z around inf 87.4%
neg-mul-187.4%
Simplified87.4%
Taylor expanded in z around 0 69.5%
Taylor expanded in z around inf 69.5%
*-commutative69.5%
Simplified69.5%
if -1.2e53 < z Initial program 100.0%
Taylor expanded in x around inf 58.9%
Taylor expanded in x around 0 34.6%
*-commutative34.6%
Simplified34.6%
(FPCore (x y z) :precision binary64 (+ 1.0 (* z (* z 0.5))))
double code(double x, double y, double z) {
return 1.0 + (z * (z * 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 + (z * (z * 0.5d0))
end function
public static double code(double x, double y, double z) {
return 1.0 + (z * (z * 0.5));
}
def code(x, y, z): return 1.0 + (z * (z * 0.5))
function code(x, y, z) return Float64(1.0 + Float64(z * Float64(z * 0.5))) end
function tmp = code(x, y, z) tmp = 1.0 + (z * (z * 0.5)); end
code[x_, y_, z_] := N[(1.0 + N[(z * N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + z \cdot \left(z \cdot 0.5\right)
\end{array}
Initial program 100.0%
Taylor expanded in z around inf 49.7%
neg-mul-149.7%
Simplified49.7%
Taylor expanded in z around 0 31.8%
Taylor expanded in z around inf 31.4%
*-commutative31.4%
Simplified31.4%
(FPCore (x y z) :precision binary64 (- 1.0 z))
double code(double x, double y, double z) {
return 1.0 - z;
}
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 - z
end function
public static double code(double x, double y, double z) {
return 1.0 - z;
}
def code(x, y, z): return 1.0 - z
function code(x, y, z) return Float64(1.0 - z) end
function tmp = code(x, y, z) tmp = 1.0 - z; end
code[x_, y_, z_] := N[(1.0 - z), $MachinePrecision]
\begin{array}{l}
\\
1 - z
\end{array}
Initial program 100.0%
Taylor expanded in z around inf 49.7%
neg-mul-149.7%
Simplified49.7%
Taylor expanded in z around 0 17.4%
mul-1-neg17.4%
unsub-neg17.4%
Simplified17.4%
(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 x around inf 52.8%
Taylor expanded in x around 0 17.3%
+-commutative17.3%
Simplified17.3%
(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 x around inf 52.8%
Taylor expanded in x around 0 17.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 2024139
(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)))