
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= x 5e+90)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(+ (* z (* (+ y 0.0007936500793651) z)) (* z -0.0027777777777778))
0.083333333333333)
x))
(+ (* x (+ (log x) -1.0)) (/ y (* (/ 1.0 z) (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5e+90) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((z * ((y + 0.0007936500793651) * z)) + (z * -0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = (x * (log(x) + -1.0)) + (y / ((1.0 / z) * (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 (x <= 5d+90) then
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((z * ((y + 0.0007936500793651d0) * z)) + (z * (-0.0027777777777778d0))) + 0.083333333333333d0) / x)
else
tmp = (x * (log(x) + (-1.0d0))) + (y / ((1.0d0 / z) * (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5e+90) {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((z * ((y + 0.0007936500793651) * z)) + (z * -0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = (x * (Math.log(x) + -1.0)) + (y / ((1.0 / z) * (x / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5e+90: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((z * ((y + 0.0007936500793651) * z)) + (z * -0.0027777777777778)) + 0.083333333333333) / x) else: tmp = (x * (math.log(x) + -1.0)) + (y / ((1.0 / z) * (x / z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5e+90) tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(z * Float64(Float64(y + 0.0007936500793651) * z)) + Float64(z * -0.0027777777777778)) + 0.083333333333333) / x)); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(y / Float64(Float64(1.0 / z) * Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5e+90) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((z * ((y + 0.0007936500793651) * z)) + (z * -0.0027777777777778)) + 0.083333333333333) / x); else tmp = (x * (log(x) + -1.0)) + (y / ((1.0 / z) * (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5e+90], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(1.0 / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{+90}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z\right) + z \cdot -0.0027777777777778\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{y}{\frac{1}{z} \cdot \frac{x}{z}}\\
\end{array}
\end{array}
if x < 5.0000000000000004e90Initial program 98.6%
*-commutative98.6%
sub-neg98.6%
metadata-eval98.6%
distribute-rgt-in98.6%
Applied egg-rr98.6%
if 5.0000000000000004e90 < x Initial program 88.1%
Taylor expanded in x around inf 88.2%
sub-neg88.2%
mul-1-neg88.2%
log-rec88.2%
remove-double-neg88.2%
metadata-eval88.2%
Simplified88.2%
Taylor expanded in y around inf 85.1%
associate-/l*89.1%
Simplified89.1%
*-un-lft-identity89.1%
unpow289.1%
times-frac97.2%
Applied egg-rr97.2%
Final simplification98.2%
(FPCore (x y z)
:precision binary64
(if (<= x 5.8e+90)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
0.083333333333333
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778)))
x))
(+ (* x (+ (log x) -1.0)) (/ y (* (/ 1.0 z) (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5.8e+90) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x);
} else {
tmp = (x * (log(x) + -1.0)) + (y / ((1.0 / z) * (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 (x <= 5.8d+90) then
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((0.083333333333333d0 + (z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0))) / x)
else
tmp = (x * (log(x) + (-1.0d0))) + (y / ((1.0d0 / z) * (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5.8e+90) {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x);
} else {
tmp = (x * (Math.log(x) + -1.0)) + (y / ((1.0 / z) * (x / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5.8e+90: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x) else: tmp = (x * (math.log(x) + -1.0)) + (y / ((1.0 / z) * (x / z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5.8e+90) tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(y / Float64(Float64(1.0 / z) * Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5.8e+90) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x); else tmp = (x * (log(x) + -1.0)) + (y / ((1.0 / z) * (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5.8e+90], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(1.0 / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.8 \cdot 10^{+90}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333 + z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{y}{\frac{1}{z} \cdot \frac{x}{z}}\\
\end{array}
\end{array}
if x < 5.8000000000000003e90Initial program 98.6%
if 5.8000000000000003e90 < x Initial program 88.1%
Taylor expanded in x around inf 88.2%
sub-neg88.2%
mul-1-neg88.2%
log-rec88.2%
remove-double-neg88.2%
metadata-eval88.2%
Simplified88.2%
Taylor expanded in y around inf 85.1%
associate-/l*89.1%
Simplified89.1%
*-un-lft-identity89.1%
unpow289.1%
times-frac97.2%
Applied egg-rr97.2%
Final simplification98.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= y -3500000000.0) (and (not (<= y 1.02e+235)) (<= y 1.45e+276)))
(+ t_0 (/ y (* (/ 1.0 z) (/ x z))))
(+
t_0
(/
(+
0.083333333333333
(* z (- (* 0.0007936500793651 z) 0.0027777777777778)))
x)))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if ((y <= -3500000000.0) || (!(y <= 1.02e+235) && (y <= 1.45e+276))) {
tmp = t_0 + (y / ((1.0 / z) * (x / z)));
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / 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 = x * (log(x) + (-1.0d0))
if ((y <= (-3500000000.0d0)) .or. (.not. (y <= 1.02d+235)) .and. (y <= 1.45d+276)) then
tmp = t_0 + (y / ((1.0d0 / z) * (x / z)))
else
tmp = t_0 + ((0.083333333333333d0 + (z * ((0.0007936500793651d0 * z) - 0.0027777777777778d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if ((y <= -3500000000.0) || (!(y <= 1.02e+235) && (y <= 1.45e+276))) {
tmp = t_0 + (y / ((1.0 / z) * (x / z)));
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x);
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if (y <= -3500000000.0) or (not (y <= 1.02e+235) and (y <= 1.45e+276)): tmp = t_0 + (y / ((1.0 / z) * (x / z))) else: tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if ((y <= -3500000000.0) || (!(y <= 1.02e+235) && (y <= 1.45e+276))) tmp = Float64(t_0 + Float64(y / Float64(Float64(1.0 / z) * Float64(x / z)))); else tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778))) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if ((y <= -3500000000.0) || (~((y <= 1.02e+235)) && (y <= 1.45e+276))) tmp = t_0 + (y / ((1.0 / z) * (x / z))); else tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y, -3500000000.0], And[N[Not[LessEqual[y, 1.02e+235]], $MachinePrecision], LessEqual[y, 1.45e+276]]], N[(t$95$0 + N[(y / N[(N[(1.0 / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;y \leq -3500000000 \lor \neg \left(y \leq 1.02 \cdot 10^{+235}\right) \land y \leq 1.45 \cdot 10^{+276}:\\
\;\;\;\;t_0 + \frac{y}{\frac{1}{z} \cdot \frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if y < -3.5e9 or 1.02e235 < y < 1.44999999999999996e276Initial program 94.1%
Taylor expanded in x around inf 93.5%
sub-neg93.5%
mul-1-neg93.5%
log-rec93.5%
remove-double-neg93.5%
metadata-eval93.5%
Simplified93.5%
Taylor expanded in y around inf 75.8%
associate-/l*80.0%
Simplified80.0%
*-un-lft-identity80.0%
unpow280.0%
times-frac81.3%
Applied egg-rr81.3%
if -3.5e9 < y < 1.02e235 or 1.44999999999999996e276 < y Initial program 96.2%
Taylor expanded in x around inf 94.7%
sub-neg94.7%
mul-1-neg94.7%
log-rec94.7%
remove-double-neg94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in y around 0 90.6%
*-commutative90.6%
Simplified90.6%
Final simplification88.2%
(FPCore (x y z)
:precision binary64
(if (<= x 18000.0)
(+
(/
(+
(+ (* z (* (+ y 0.0007936500793651) z)) (* z -0.0027777777777778))
0.083333333333333)
x)
(+ 0.91893853320467 (* (log x) -0.5)))
(+ (* x (+ (log x) -1.0)) (/ y (* (/ 1.0 z) (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 18000.0) {
tmp = ((((z * ((y + 0.0007936500793651) * z)) + (z * -0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (log(x) * -0.5));
} else {
tmp = (x * (log(x) + -1.0)) + (y / ((1.0 / z) * (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 (x <= 18000.0d0) then
tmp = ((((z * ((y + 0.0007936500793651d0) * z)) + (z * (-0.0027777777777778d0))) + 0.083333333333333d0) / x) + (0.91893853320467d0 + (log(x) * (-0.5d0)))
else
tmp = (x * (log(x) + (-1.0d0))) + (y / ((1.0d0 / z) * (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 18000.0) {
tmp = ((((z * ((y + 0.0007936500793651) * z)) + (z * -0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (Math.log(x) * -0.5));
} else {
tmp = (x * (Math.log(x) + -1.0)) + (y / ((1.0 / z) * (x / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 18000.0: tmp = ((((z * ((y + 0.0007936500793651) * z)) + (z * -0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (math.log(x) * -0.5)) else: tmp = (x * (math.log(x) + -1.0)) + (y / ((1.0 / z) * (x / z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 18000.0) tmp = Float64(Float64(Float64(Float64(Float64(z * Float64(Float64(y + 0.0007936500793651) * z)) + Float64(z * -0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(log(x) * -0.5))); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(y / Float64(Float64(1.0 / z) * Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 18000.0) tmp = ((((z * ((y + 0.0007936500793651) * z)) + (z * -0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (log(x) * -0.5)); else tmp = (x * (log(x) + -1.0)) + (y / ((1.0 / z) * (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 18000.0], N[(N[(N[(N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(1.0 / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 18000:\\
\;\;\;\;\frac{\left(z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z\right) + z \cdot -0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{y}{\frac{1}{z} \cdot \frac{x}{z}}\\
\end{array}
\end{array}
if x < 18000Initial program 99.6%
*-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
distribute-rgt-in99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 98.7%
if 18000 < x Initial program 89.9%
Taylor expanded in x around inf 89.5%
sub-neg89.5%
mul-1-neg89.5%
log-rec89.5%
remove-double-neg89.5%
metadata-eval89.5%
Simplified89.5%
Taylor expanded in y around inf 85.7%
associate-/l*89.2%
Simplified89.2%
*-un-lft-identity89.2%
unpow289.2%
times-frac94.9%
Applied egg-rr94.9%
Final simplification97.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= y -26000000.0) (not (<= y 5e-7)))
(+ t_0 (/ (+ 0.083333333333333 (* z (- (* y z) 0.0027777777777778))) x))
(+
t_0
(/
(+
0.083333333333333
(* z (- (* 0.0007936500793651 z) 0.0027777777777778)))
x)))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if ((y <= -26000000.0) || !(y <= 5e-7)) {
tmp = t_0 + ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / 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 = x * (log(x) + (-1.0d0))
if ((y <= (-26000000.0d0)) .or. (.not. (y <= 5d-7))) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((y * z) - 0.0027777777777778d0))) / x)
else
tmp = t_0 + ((0.083333333333333d0 + (z * ((0.0007936500793651d0 * z) - 0.0027777777777778d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if ((y <= -26000000.0) || !(y <= 5e-7)) {
tmp = t_0 + ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x);
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if (y <= -26000000.0) or not (y <= 5e-7): tmp = t_0 + ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x) else: tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if ((y <= -26000000.0) || !(y <= 5e-7)) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(y * z) - 0.0027777777777778))) / x)); else tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778))) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if ((y <= -26000000.0) || ~((y <= 5e-7))) tmp = t_0 + ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x); else tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y, -26000000.0], N[Not[LessEqual[y, 5e-7]], $MachinePrecision]], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(y * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;y \leq -26000000 \lor \neg \left(y \leq 5 \cdot 10^{-7}\right):\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(y \cdot z - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if y < -2.6e7 or 4.99999999999999977e-7 < y Initial program 96.1%
Taylor expanded in x around inf 94.0%
sub-neg94.0%
mul-1-neg94.0%
log-rec94.0%
remove-double-neg94.0%
metadata-eval94.0%
Simplified94.0%
Taylor expanded in y around inf 94.0%
*-commutative94.0%
Simplified94.0%
if -2.6e7 < y < 4.99999999999999977e-7Initial program 95.2%
Taylor expanded in x around inf 94.8%
sub-neg94.8%
mul-1-neg94.8%
log-rec94.8%
remove-double-neg94.8%
metadata-eval94.8%
Simplified94.8%
Taylor expanded in y around 0 94.3%
*-commutative94.3%
Simplified94.3%
Final simplification94.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= x 5.6e+88)
(+
t_0
(/
(+
0.083333333333333
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778)))
x))
(+ t_0 (/ y (* (/ 1.0 z) (/ x z)))))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (x <= 5.6e+88) {
tmp = t_0 + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + (y / ((1.0 / z) * (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) :: t_0
real(8) :: tmp
t_0 = x * (log(x) + (-1.0d0))
if (x <= 5.6d+88) then
tmp = t_0 + ((0.083333333333333d0 + (z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0))) / x)
else
tmp = t_0 + (y / ((1.0d0 / z) * (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if (x <= 5.6e+88) {
tmp = t_0 + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + (y / ((1.0 / z) * (x / z)));
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if x <= 5.6e+88: tmp = t_0 + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x) else: tmp = t_0 + (y / ((1.0 / z) * (x / z))) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (x <= 5.6e+88) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778))) / x)); else tmp = Float64(t_0 + Float64(y / Float64(Float64(1.0 / z) * Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (x <= 5.6e+88) tmp = t_0 + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x); else tmp = t_0 + (y / ((1.0 / z) * (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 5.6e+88], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(y / N[(N[(1.0 / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;x \leq 5.6 \cdot 10^{+88}:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{y}{\frac{1}{z} \cdot \frac{x}{z}}\\
\end{array}
\end{array}
if x < 5.59999999999999977e88Initial program 98.6%
Taylor expanded in x around inf 96.9%
sub-neg96.9%
mul-1-neg96.9%
log-rec96.9%
remove-double-neg96.9%
metadata-eval96.9%
Simplified96.9%
if 5.59999999999999977e88 < x Initial program 88.1%
Taylor expanded in x around inf 88.2%
sub-neg88.2%
mul-1-neg88.2%
log-rec88.2%
remove-double-neg88.2%
metadata-eval88.2%
Simplified88.2%
Taylor expanded in y around inf 85.1%
associate-/l*89.1%
Simplified89.1%
*-un-lft-identity89.1%
unpow289.1%
times-frac97.2%
Applied egg-rr97.2%
Final simplification97.0%
(FPCore (x y z)
:precision binary64
(if (or (<= z -30000000.0) (not (<= z 3.5)))
(+ (* x (+ (log x) -1.0)) (/ y (* (/ 1.0 z) (/ x z))))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -30000000.0) || !(z <= 3.5)) {
tmp = (x * (log(x) + -1.0)) + (y / ((1.0 / z) * (x / z)));
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / 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 <= (-30000000.0d0)) .or. (.not. (z <= 3.5d0))) then
tmp = (x * (log(x) + (-1.0d0))) + (y / ((1.0d0 / z) * (x / z)))
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -30000000.0) || !(z <= 3.5)) {
tmp = (x * (Math.log(x) + -1.0)) + (y / ((1.0 / z) * (x / z)));
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -30000000.0) or not (z <= 3.5): tmp = (x * (math.log(x) + -1.0)) + (y / ((1.0 / z) * (x / z))) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -30000000.0) || !(z <= 3.5)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(y / Float64(Float64(1.0 / z) * Float64(x / z)))); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -30000000.0) || ~((z <= 3.5))) tmp = (x * (log(x) + -1.0)) + (y / ((1.0 / z) * (x / z))); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -30000000.0], N[Not[LessEqual[z, 3.5]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(1.0 / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -30000000 \lor \neg \left(z \leq 3.5\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{y}{\frac{1}{z} \cdot \frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -3e7 or 3.5 < z Initial program 91.4%
Taylor expanded in x around inf 91.5%
sub-neg91.5%
mul-1-neg91.5%
log-rec91.5%
remove-double-neg91.5%
metadata-eval91.5%
Simplified91.5%
Taylor expanded in y around inf 71.4%
associate-/l*74.4%
Simplified74.4%
*-un-lft-identity74.4%
unpow274.4%
times-frac79.3%
Applied egg-rr79.3%
if -3e7 < z < 3.5Initial program 99.5%
Taylor expanded in z around 0 91.3%
Final simplification85.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -30000000.0) (not (<= z 0.26))) (+ (* x (+ (log x) -1.0)) (* z (* z (/ y x)))) (+ (/ 0.083333333333333 x) (+ 0.91893853320467 (- (* x (log x)) x)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -30000000.0) || !(z <= 0.26)) {
tmp = (x * (log(x) + -1.0)) + (z * (z * (y / x)));
} else {
tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * log(x)) - 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 <= (-30000000.0d0)) .or. (.not. (z <= 0.26d0))) then
tmp = (x * (log(x) + (-1.0d0))) + (z * (z * (y / x)))
else
tmp = (0.083333333333333d0 / x) + (0.91893853320467d0 + ((x * log(x)) - x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -30000000.0) || !(z <= 0.26)) {
tmp = (x * (Math.log(x) + -1.0)) + (z * (z * (y / x)));
} else {
tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * Math.log(x)) - x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -30000000.0) or not (z <= 0.26): tmp = (x * (math.log(x) + -1.0)) + (z * (z * (y / x))) else: tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * math.log(x)) - x)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -30000000.0) || !(z <= 0.26)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(z * Float64(z * Float64(y / x)))); else tmp = Float64(Float64(0.083333333333333 / x) + Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -30000000.0) || ~((z <= 0.26))) tmp = (x * (log(x) + -1.0)) + (z * (z * (y / x))); else tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * log(x)) - x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -30000000.0], N[Not[LessEqual[z, 0.26]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -30000000 \lor \neg \left(z \leq 0.26\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + z \cdot \left(z \cdot \frac{y}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\
\end{array}
\end{array}
if z < -3e7 or 0.26000000000000001 < z Initial program 91.5%
Taylor expanded in x around inf 91.3%
sub-neg91.3%
mul-1-neg91.3%
log-rec91.3%
remove-double-neg91.3%
metadata-eval91.3%
Simplified91.3%
Taylor expanded in y around inf 71.4%
associate-/l*74.4%
Simplified74.4%
associate-/r/73.4%
unpow273.4%
associate-*r*75.5%
Applied egg-rr75.5%
if -3e7 < z < 0.26000000000000001Initial program 99.5%
Taylor expanded in z around 0 91.2%
Taylor expanded in x around inf 89.1%
mul-1-neg89.1%
distribute-rgt-neg-in89.1%
log-rec89.1%
remove-double-neg89.1%
Simplified89.1%
Final simplification82.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= z -30000000.0) (not (<= z 0.26)))
(+ t_0 (* z (* z (/ y x))))
(+ t_0 (/ (+ (* z -0.0027777777777778) 0.083333333333333) x)))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if ((z <= -30000000.0) || !(z <= 0.26)) {
tmp = t_0 + (z * (z * (y / x)));
} else {
tmp = t_0 + (((z * -0.0027777777777778) + 0.083333333333333) / 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 = x * (log(x) + (-1.0d0))
if ((z <= (-30000000.0d0)) .or. (.not. (z <= 0.26d0))) then
tmp = t_0 + (z * (z * (y / x)))
else
tmp = t_0 + (((z * (-0.0027777777777778d0)) + 0.083333333333333d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if ((z <= -30000000.0) || !(z <= 0.26)) {
tmp = t_0 + (z * (z * (y / x)));
} else {
tmp = t_0 + (((z * -0.0027777777777778) + 0.083333333333333) / x);
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if (z <= -30000000.0) or not (z <= 0.26): tmp = t_0 + (z * (z * (y / x))) else: tmp = t_0 + (((z * -0.0027777777777778) + 0.083333333333333) / x) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if ((z <= -30000000.0) || !(z <= 0.26)) tmp = Float64(t_0 + Float64(z * Float64(z * Float64(y / x)))); else tmp = Float64(t_0 + Float64(Float64(Float64(z * -0.0027777777777778) + 0.083333333333333) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if ((z <= -30000000.0) || ~((z <= 0.26))) tmp = t_0 + (z * (z * (y / x))); else tmp = t_0 + (((z * -0.0027777777777778) + 0.083333333333333) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -30000000.0], N[Not[LessEqual[z, 0.26]], $MachinePrecision]], N[(t$95$0 + N[(z * N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(N[(z * -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;z \leq -30000000 \lor \neg \left(z \leq 0.26\right):\\
\;\;\;\;t_0 + z \cdot \left(z \cdot \frac{y}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{z \cdot -0.0027777777777778 + 0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -3e7 or 0.26000000000000001 < z Initial program 91.5%
Taylor expanded in x around inf 91.3%
sub-neg91.3%
mul-1-neg91.3%
log-rec91.3%
remove-double-neg91.3%
metadata-eval91.3%
Simplified91.3%
Taylor expanded in y around inf 71.4%
associate-/l*74.4%
Simplified74.4%
associate-/r/73.4%
unpow273.4%
associate-*r*75.5%
Applied egg-rr75.5%
if -3e7 < z < 0.26000000000000001Initial program 99.5%
Taylor expanded in x around inf 97.3%
sub-neg97.3%
mul-1-neg97.3%
log-rec97.3%
remove-double-neg97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in z around 0 89.6%
*-commutative89.6%
Simplified89.6%
Final simplification82.8%
(FPCore (x y z)
:precision binary64
(if (or (<= z -30000000.0) (not (<= z 3.6)))
(+ (* x (+ (log x) -1.0)) (* z (* z (/ y x))))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -30000000.0) || !(z <= 3.6)) {
tmp = (x * (log(x) + -1.0)) + (z * (z * (y / x)));
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / 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 <= (-30000000.0d0)) .or. (.not. (z <= 3.6d0))) then
tmp = (x * (log(x) + (-1.0d0))) + (z * (z * (y / x)))
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -30000000.0) || !(z <= 3.6)) {
tmp = (x * (Math.log(x) + -1.0)) + (z * (z * (y / x)));
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -30000000.0) or not (z <= 3.6): tmp = (x * (math.log(x) + -1.0)) + (z * (z * (y / x))) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -30000000.0) || !(z <= 3.6)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(z * Float64(z * Float64(y / x)))); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -30000000.0) || ~((z <= 3.6))) tmp = (x * (log(x) + -1.0)) + (z * (z * (y / x))); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -30000000.0], N[Not[LessEqual[z, 3.6]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -30000000 \lor \neg \left(z \leq 3.6\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + z \cdot \left(z \cdot \frac{y}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -3e7 or 3.60000000000000009 < z Initial program 91.4%
Taylor expanded in x around inf 91.5%
sub-neg91.5%
mul-1-neg91.5%
log-rec91.5%
remove-double-neg91.5%
metadata-eval91.5%
Simplified91.5%
Taylor expanded in y around inf 71.4%
associate-/l*74.4%
Simplified74.4%
associate-/r/73.5%
unpow273.5%
associate-*r*75.5%
Applied egg-rr75.5%
if -3e7 < z < 3.60000000000000009Initial program 99.5%
Taylor expanded in z around 0 91.3%
Final simplification83.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= z -30000000.0) (not (<= z 3.4e+211)))
(+ t_0 (* -0.0027777777777778 (/ z x)))
(+ t_0 (/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if ((z <= -30000000.0) || !(z <= 3.4e+211)) {
tmp = t_0 + (-0.0027777777777778 * (z / x));
} else {
tmp = t_0 + (0.083333333333333 / 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 = x * (log(x) + (-1.0d0))
if ((z <= (-30000000.0d0)) .or. (.not. (z <= 3.4d+211))) then
tmp = t_0 + ((-0.0027777777777778d0) * (z / x))
else
tmp = t_0 + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if ((z <= -30000000.0) || !(z <= 3.4e+211)) {
tmp = t_0 + (-0.0027777777777778 * (z / x));
} else {
tmp = t_0 + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if (z <= -30000000.0) or not (z <= 3.4e+211): tmp = t_0 + (-0.0027777777777778 * (z / x)) else: tmp = t_0 + (0.083333333333333 / x) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if ((z <= -30000000.0) || !(z <= 3.4e+211)) tmp = Float64(t_0 + Float64(-0.0027777777777778 * Float64(z / x))); else tmp = Float64(t_0 + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if ((z <= -30000000.0) || ~((z <= 3.4e+211))) tmp = t_0 + (-0.0027777777777778 * (z / x)); else tmp = t_0 + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -30000000.0], N[Not[LessEqual[z, 3.4e+211]], $MachinePrecision]], N[(t$95$0 + N[(-0.0027777777777778 * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;z \leq -30000000 \lor \neg \left(z \leq 3.4 \cdot 10^{+211}\right):\\
\;\;\;\;t_0 + -0.0027777777777778 \cdot \frac{z}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -3e7 or 3.3999999999999999e211 < z Initial program 91.3%
Taylor expanded in x around inf 91.3%
sub-neg91.3%
mul-1-neg91.3%
log-rec91.3%
remove-double-neg91.3%
metadata-eval91.3%
Simplified91.3%
Taylor expanded in z around 0 43.2%
Taylor expanded in z around inf 43.2%
if -3e7 < z < 3.3999999999999999e211Initial program 97.8%
Taylor expanded in z around 0 79.3%
Taylor expanded in x around inf 77.4%
sub-neg96.0%
mul-1-neg96.0%
log-rec96.0%
remove-double-neg96.0%
metadata-eval96.0%
Simplified77.4%
Final simplification65.9%
(FPCore (x y z) :precision binary64 (+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return (x * (log(x) + -1.0)) + (0.083333333333333 / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
}
def code(x, y, z): return (x * (math.log(x) + -1.0)) + (0.083333333333333 / x)
function code(x, y, z) return Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}
\end{array}
Initial program 95.6%
Taylor expanded in z around 0 60.0%
Taylor expanded in x around inf 58.8%
sub-neg94.4%
mul-1-neg94.4%
log-rec94.4%
remove-double-neg94.4%
metadata-eval94.4%
Simplified58.8%
Final simplification58.8%
(FPCore (x y z) :precision binary64 (pow (* x 12.000000000000048) -1.0))
double code(double x, double y, double z) {
return pow((x * 12.000000000000048), -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 * 12.000000000000048d0) ** (-1.0d0)
end function
public static double code(double x, double y, double z) {
return Math.pow((x * 12.000000000000048), -1.0);
}
def code(x, y, z): return math.pow((x * 12.000000000000048), -1.0)
function code(x, y, z) return Float64(x * 12.000000000000048) ^ -1.0 end
function tmp = code(x, y, z) tmp = (x * 12.000000000000048) ^ -1.0; end
code[x_, y_, z_] := N[Power[N[(x * 12.000000000000048), $MachinePrecision], -1.0], $MachinePrecision]
\begin{array}{l}
\\
{\left(x \cdot 12.000000000000048\right)}^{-1}
\end{array}
Initial program 95.6%
Taylor expanded in z around 0 60.0%
Taylor expanded in x around inf 58.8%
sub-neg94.4%
mul-1-neg94.4%
log-rec94.4%
remove-double-neg94.4%
metadata-eval94.4%
Simplified58.8%
Taylor expanded in x around 0 28.5%
clear-num28.5%
inv-pow28.5%
div-inv28.5%
metadata-eval28.5%
Applied egg-rr28.5%
Final simplification28.5%
(FPCore (x y z) :precision binary64 (/ 0.083333333333333 x))
double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.083333333333333d0 / x
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
def code(x, y, z): return 0.083333333333333 / x
function code(x, y, z) return Float64(0.083333333333333 / x) end
function tmp = code(x, y, z) tmp = 0.083333333333333 / x; end
code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x}
\end{array}
Initial program 95.6%
Taylor expanded in z around 0 60.0%
Taylor expanded in x around inf 58.8%
sub-neg94.4%
mul-1-neg94.4%
log-rec94.4%
remove-double-neg94.4%
metadata-eval94.4%
Simplified58.8%
Taylor expanded in x around 0 28.5%
Final simplification28.5%
(FPCore (x y z) :precision binary64 (+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) + (0.91893853320467d0 - x)) + (0.083333333333333d0 / x)) + ((z / x) * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) + Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)) + Float64(Float64(z / x) * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)
\end{array}
herbie shell --seed 2023318
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))