
(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 13 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
(let* ((t_0 (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)))
(if (<= x 900.0)
(+
t_0
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x))
(+ t_0 (pow (/ (/ (/ x z) z) (+ y 0.0007936500793651)) -1.0)))))
double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 900.0) {
tmp = t_0 + (fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x);
} else {
tmp = t_0 + pow((((x / z) / z) / (y + 0.0007936500793651)), -1.0);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if (x <= 900.0) tmp = Float64(t_0 + Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x)); else tmp = Float64(t_0 + (Float64(Float64(Float64(x / z) / z) / Float64(y + 0.0007936500793651)) ^ -1.0)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[LessEqual[x, 900.0], N[(t$95$0 + N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[Power[N[(N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision] / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;x \leq 900:\\
\;\;\;\;t_0 + \frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + {\left(\frac{\frac{\frac{x}{z}}{z}}{y + 0.0007936500793651}\right)}^{-1}\\
\end{array}
\end{array}
if x < 900Initial program 99.7%
sub-neg99.7%
metadata-eval99.7%
fma-def99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
if 900 < x Initial program 89.3%
sub-neg89.3%
metadata-eval89.3%
fma-def89.3%
fma-neg89.3%
metadata-eval89.3%
Simplified89.3%
metadata-eval89.3%
fma-neg89.3%
fma-def89.3%
clear-num89.3%
inv-pow89.3%
*-commutative89.3%
fma-udef89.3%
fma-neg89.3%
metadata-eval89.3%
Applied egg-rr89.3%
Taylor expanded in z around inf 89.3%
associate-/r*92.5%
unpow292.5%
associate-/r*99.6%
Simplified99.6%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= x 900.0)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(+
(+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)
(pow (/ (/ (/ x z) z) (+ y 0.0007936500793651)) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 900.0) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + pow((((x / z) / z) / (y + 0.0007936500793651)), -1.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 (x <= 900.0d0) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
else
tmp = ((((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0) + ((((x / z) / z) / (y + 0.0007936500793651d0)) ** (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 900.0) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = ((((x + -0.5) * Math.log(x)) - x) + 0.91893853320467) + Math.pow((((x / z) / z) / (y + 0.0007936500793651)), -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 900.0: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) else: tmp = ((((x + -0.5) * math.log(x)) - x) + 0.91893853320467) + math.pow((((x / z) / z) / (y + 0.0007936500793651)), -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 900.0) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) + (Float64(Float64(Float64(x / z) / z) / Float64(y + 0.0007936500793651)) ^ -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 900.0) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + ((((x / z) / z) / (y + 0.0007936500793651)) ^ -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 900.0], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[Power[N[(N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision] / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 900:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + {\left(\frac{\frac{\frac{x}{z}}{z}}{y + 0.0007936500793651}\right)}^{-1}\\
\end{array}
\end{array}
if x < 900Initial program 99.7%
if 900 < x Initial program 89.3%
sub-neg89.3%
metadata-eval89.3%
fma-def89.3%
fma-neg89.3%
metadata-eval89.3%
Simplified89.3%
metadata-eval89.3%
fma-neg89.3%
fma-def89.3%
clear-num89.3%
inv-pow89.3%
*-commutative89.3%
fma-udef89.3%
fma-neg89.3%
metadata-eval89.3%
Applied egg-rr89.3%
Taylor expanded in z around inf 89.3%
associate-/r*92.5%
unpow292.5%
associate-/r*99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467))
(t_1 (+ t_0 (* (* 0.0007936500793651 z) (/ z x))))
(t_2 (* (* z z) (/ y x))))
(if (<= z -6.5e+138)
t_1
(if (<= z -3.6e-48)
(+ t_0 t_2)
(if (<= z 1.7e-23)
(+ t_0 (/ 0.083333333333333 x))
(if (or (<= z 6.8e+114) (and (not (<= z 1.95e+226)) (<= z 3.5e+250)))
(+ t_2 (* x (+ (log x) -1.0)))
t_1))))))
double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467;
double t_1 = t_0 + ((0.0007936500793651 * z) * (z / x));
double t_2 = (z * z) * (y / x);
double tmp;
if (z <= -6.5e+138) {
tmp = t_1;
} else if (z <= -3.6e-48) {
tmp = t_0 + t_2;
} else if (z <= 1.7e-23) {
tmp = t_0 + (0.083333333333333 / x);
} else if ((z <= 6.8e+114) || (!(z <= 1.95e+226) && (z <= 3.5e+250))) {
tmp = t_2 + (x * (log(x) + -1.0));
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0
t_1 = t_0 + ((0.0007936500793651d0 * z) * (z / x))
t_2 = (z * z) * (y / x)
if (z <= (-6.5d+138)) then
tmp = t_1
else if (z <= (-3.6d-48)) then
tmp = t_0 + t_2
else if (z <= 1.7d-23) then
tmp = t_0 + (0.083333333333333d0 / x)
else if ((z <= 6.8d+114) .or. (.not. (z <= 1.95d+226)) .and. (z <= 3.5d+250)) then
tmp = t_2 + (x * (log(x) + (-1.0d0)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * Math.log(x)) - x) + 0.91893853320467;
double t_1 = t_0 + ((0.0007936500793651 * z) * (z / x));
double t_2 = (z * z) * (y / x);
double tmp;
if (z <= -6.5e+138) {
tmp = t_1;
} else if (z <= -3.6e-48) {
tmp = t_0 + t_2;
} else if (z <= 1.7e-23) {
tmp = t_0 + (0.083333333333333 / x);
} else if ((z <= 6.8e+114) || (!(z <= 1.95e+226) && (z <= 3.5e+250))) {
tmp = t_2 + (x * (Math.log(x) + -1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = (((x + -0.5) * math.log(x)) - x) + 0.91893853320467 t_1 = t_0 + ((0.0007936500793651 * z) * (z / x)) t_2 = (z * z) * (y / x) tmp = 0 if z <= -6.5e+138: tmp = t_1 elif z <= -3.6e-48: tmp = t_0 + t_2 elif z <= 1.7e-23: tmp = t_0 + (0.083333333333333 / x) elif (z <= 6.8e+114) or (not (z <= 1.95e+226) and (z <= 3.5e+250)): tmp = t_2 + (x * (math.log(x) + -1.0)) else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) t_1 = Float64(t_0 + Float64(Float64(0.0007936500793651 * z) * Float64(z / x))) t_2 = Float64(Float64(z * z) * Float64(y / x)) tmp = 0.0 if (z <= -6.5e+138) tmp = t_1; elseif (z <= -3.6e-48) tmp = Float64(t_0 + t_2); elseif (z <= 1.7e-23) tmp = Float64(t_0 + Float64(0.083333333333333 / x)); elseif ((z <= 6.8e+114) || (!(z <= 1.95e+226) && (z <= 3.5e+250))) tmp = Float64(t_2 + Float64(x * Float64(log(x) + -1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467; t_1 = t_0 + ((0.0007936500793651 * z) * (z / x)); t_2 = (z * z) * (y / x); tmp = 0.0; if (z <= -6.5e+138) tmp = t_1; elseif (z <= -3.6e-48) tmp = t_0 + t_2; elseif (z <= 1.7e-23) tmp = t_0 + (0.083333333333333 / x); elseif ((z <= 6.8e+114) || (~((z <= 1.95e+226)) && (z <= 3.5e+250))) tmp = t_2 + (x * (log(x) + -1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(N[(0.0007936500793651 * z), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * z), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.5e+138], t$95$1, If[LessEqual[z, -3.6e-48], N[(t$95$0 + t$95$2), $MachinePrecision], If[LessEqual[z, 1.7e-23], N[(t$95$0 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 6.8e+114], And[N[Not[LessEqual[z, 1.95e+226]], $MachinePrecision], LessEqual[z, 3.5e+250]]], N[(t$95$2 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
t_1 := t_0 + \left(0.0007936500793651 \cdot z\right) \cdot \frac{z}{x}\\
t_2 := \left(z \cdot z\right) \cdot \frac{y}{x}\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{+138}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-48}:\\
\;\;\;\;t_0 + t_2\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-23}:\\
\;\;\;\;t_0 + \frac{0.083333333333333}{x}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+114} \lor \neg \left(z \leq 1.95 \cdot 10^{+226}\right) \land z \leq 3.5 \cdot 10^{+250}:\\
\;\;\;\;t_2 + x \cdot \left(\log x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -6.50000000000000054e138 or 6.8000000000000001e114 < z < 1.94999999999999992e226 or 3.5e250 < z Initial program 88.0%
sub-neg88.0%
metadata-eval88.0%
fma-def88.0%
fma-neg88.0%
metadata-eval88.0%
Simplified88.0%
Taylor expanded in y around 0 77.1%
Taylor expanded in z around inf 77.1%
unpow277.1%
Simplified77.1%
Taylor expanded in z around 0 77.1%
*-commutative77.1%
unpow277.1%
associate-*l/81.6%
associate-*l*81.7%
Simplified81.7%
if -6.50000000000000054e138 < z < -3.6000000000000002e-48Initial program 96.7%
sub-neg96.7%
metadata-eval96.7%
fma-def96.7%
fma-neg96.7%
metadata-eval96.7%
Simplified96.7%
metadata-eval96.7%
fma-neg96.7%
fma-def96.7%
clear-num96.7%
inv-pow96.7%
*-commutative96.7%
fma-udef96.7%
fma-neg96.7%
metadata-eval96.7%
Applied egg-rr96.7%
Taylor expanded in y around inf 77.4%
associate-/l*80.4%
associate-/r/80.5%
unpow280.5%
Simplified80.5%
if -3.6000000000000002e-48 < z < 1.7e-23Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 96.2%
if 1.7e-23 < z < 6.8000000000000001e114 or 1.94999999999999992e226 < z < 3.5e250Initial program 95.0%
sub-neg95.0%
metadata-eval95.0%
fma-def95.0%
fma-neg95.0%
metadata-eval95.0%
Simplified95.0%
metadata-eval95.0%
fma-neg95.0%
fma-def95.0%
clear-num94.9%
inv-pow94.9%
*-commutative94.9%
fma-udef95.0%
fma-neg95.0%
metadata-eval95.0%
Applied egg-rr95.0%
Taylor expanded in y around inf 81.6%
associate-/l*86.3%
associate-/r/84.1%
unpow284.1%
Simplified84.1%
Taylor expanded in x around inf 84.2%
*-commutative35.4%
sub-neg35.4%
mul-1-neg35.4%
log-rec35.4%
remove-double-neg35.4%
metadata-eval35.4%
Simplified84.2%
Final simplification87.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467))
(t_1 (+ t_0 (* (* 0.0007936500793651 z) (/ z x))))
(t_2 (* (* z z) (/ y x))))
(if (<= z -7.5e+138)
t_1
(if (<= z -3.2e-48)
(+ t_0 t_2)
(if (<= z 3.2e-24)
(+ t_0 (/ 0.083333333333333 x))
(if (<= z 2e+113)
(+ t_0 (/ y (/ x (* z z))))
(if (or (<= z 1.4e+226) (not (<= z 3.8e+251)))
t_1
(+ t_2 (* x (+ (log x) -1.0))))))))))
double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467;
double t_1 = t_0 + ((0.0007936500793651 * z) * (z / x));
double t_2 = (z * z) * (y / x);
double tmp;
if (z <= -7.5e+138) {
tmp = t_1;
} else if (z <= -3.2e-48) {
tmp = t_0 + t_2;
} else if (z <= 3.2e-24) {
tmp = t_0 + (0.083333333333333 / x);
} else if (z <= 2e+113) {
tmp = t_0 + (y / (x / (z * z)));
} else if ((z <= 1.4e+226) || !(z <= 3.8e+251)) {
tmp = t_1;
} else {
tmp = t_2 + (x * (log(x) + -1.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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0
t_1 = t_0 + ((0.0007936500793651d0 * z) * (z / x))
t_2 = (z * z) * (y / x)
if (z <= (-7.5d+138)) then
tmp = t_1
else if (z <= (-3.2d-48)) then
tmp = t_0 + t_2
else if (z <= 3.2d-24) then
tmp = t_0 + (0.083333333333333d0 / x)
else if (z <= 2d+113) then
tmp = t_0 + (y / (x / (z * z)))
else if ((z <= 1.4d+226) .or. (.not. (z <= 3.8d+251))) then
tmp = t_1
else
tmp = t_2 + (x * (log(x) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * Math.log(x)) - x) + 0.91893853320467;
double t_1 = t_0 + ((0.0007936500793651 * z) * (z / x));
double t_2 = (z * z) * (y / x);
double tmp;
if (z <= -7.5e+138) {
tmp = t_1;
} else if (z <= -3.2e-48) {
tmp = t_0 + t_2;
} else if (z <= 3.2e-24) {
tmp = t_0 + (0.083333333333333 / x);
} else if (z <= 2e+113) {
tmp = t_0 + (y / (x / (z * z)));
} else if ((z <= 1.4e+226) || !(z <= 3.8e+251)) {
tmp = t_1;
} else {
tmp = t_2 + (x * (Math.log(x) + -1.0));
}
return tmp;
}
def code(x, y, z): t_0 = (((x + -0.5) * math.log(x)) - x) + 0.91893853320467 t_1 = t_0 + ((0.0007936500793651 * z) * (z / x)) t_2 = (z * z) * (y / x) tmp = 0 if z <= -7.5e+138: tmp = t_1 elif z <= -3.2e-48: tmp = t_0 + t_2 elif z <= 3.2e-24: tmp = t_0 + (0.083333333333333 / x) elif z <= 2e+113: tmp = t_0 + (y / (x / (z * z))) elif (z <= 1.4e+226) or not (z <= 3.8e+251): tmp = t_1 else: tmp = t_2 + (x * (math.log(x) + -1.0)) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) t_1 = Float64(t_0 + Float64(Float64(0.0007936500793651 * z) * Float64(z / x))) t_2 = Float64(Float64(z * z) * Float64(y / x)) tmp = 0.0 if (z <= -7.5e+138) tmp = t_1; elseif (z <= -3.2e-48) tmp = Float64(t_0 + t_2); elseif (z <= 3.2e-24) tmp = Float64(t_0 + Float64(0.083333333333333 / x)); elseif (z <= 2e+113) tmp = Float64(t_0 + Float64(y / Float64(x / Float64(z * z)))); elseif ((z <= 1.4e+226) || !(z <= 3.8e+251)) tmp = t_1; else tmp = Float64(t_2 + Float64(x * Float64(log(x) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467; t_1 = t_0 + ((0.0007936500793651 * z) * (z / x)); t_2 = (z * z) * (y / x); tmp = 0.0; if (z <= -7.5e+138) tmp = t_1; elseif (z <= -3.2e-48) tmp = t_0 + t_2; elseif (z <= 3.2e-24) tmp = t_0 + (0.083333333333333 / x); elseif (z <= 2e+113) tmp = t_0 + (y / (x / (z * z))); elseif ((z <= 1.4e+226) || ~((z <= 3.8e+251))) tmp = t_1; else tmp = t_2 + (x * (log(x) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(N[(0.0007936500793651 * z), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * z), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.5e+138], t$95$1, If[LessEqual[z, -3.2e-48], N[(t$95$0 + t$95$2), $MachinePrecision], If[LessEqual[z, 3.2e-24], N[(t$95$0 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+113], N[(t$95$0 + N[(y / N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.4e+226], N[Not[LessEqual[z, 3.8e+251]], $MachinePrecision]], t$95$1, N[(t$95$2 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
t_1 := t_0 + \left(0.0007936500793651 \cdot z\right) \cdot \frac{z}{x}\\
t_2 := \left(z \cdot z\right) \cdot \frac{y}{x}\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{+138}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-48}:\\
\;\;\;\;t_0 + t_2\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-24}:\\
\;\;\;\;t_0 + \frac{0.083333333333333}{x}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+113}:\\
\;\;\;\;t_0 + \frac{y}{\frac{x}{z \cdot z}}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+226} \lor \neg \left(z \leq 3.8 \cdot 10^{+251}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2 + x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if z < -7.4999999999999999e138 or 2e113 < z < 1.4000000000000001e226 or 3.79999999999999983e251 < z Initial program 88.0%
sub-neg88.0%
metadata-eval88.0%
fma-def88.0%
fma-neg88.0%
metadata-eval88.0%
Simplified88.0%
Taylor expanded in y around 0 77.1%
Taylor expanded in z around inf 77.1%
unpow277.1%
Simplified77.1%
Taylor expanded in z around 0 77.1%
*-commutative77.1%
unpow277.1%
associate-*l/81.6%
associate-*l*81.7%
Simplified81.7%
if -7.4999999999999999e138 < z < -3.1999999999999998e-48Initial program 96.7%
sub-neg96.7%
metadata-eval96.7%
fma-def96.7%
fma-neg96.7%
metadata-eval96.7%
Simplified96.7%
metadata-eval96.7%
fma-neg96.7%
fma-def96.7%
clear-num96.7%
inv-pow96.7%
*-commutative96.7%
fma-udef96.7%
fma-neg96.7%
metadata-eval96.7%
Applied egg-rr96.7%
Taylor expanded in y around inf 77.4%
associate-/l*80.4%
associate-/r/80.5%
unpow280.5%
Simplified80.5%
if -3.1999999999999998e-48 < z < 3.20000000000000012e-24Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 96.2%
if 3.20000000000000012e-24 < z < 2e113Initial program 94.0%
sub-neg94.0%
metadata-eval94.0%
fma-def94.0%
fma-neg94.0%
metadata-eval94.0%
Simplified94.0%
Taylor expanded in y around inf 77.8%
associate-/l*83.5%
unpow283.5%
Simplified83.5%
if 1.4000000000000001e226 < z < 3.79999999999999983e251Initial program 100.0%
sub-neg100.0%
metadata-eval100.0%
fma-def100.0%
fma-neg100.0%
metadata-eval100.0%
Simplified100.0%
metadata-eval100.0%
fma-neg100.0%
fma-def100.0%
clear-num100.0%
inv-pow100.0%
*-commutative100.0%
fma-udef100.0%
fma-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 100.0%
associate-/l*100.0%
associate-/r/100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
*-commutative1.2%
sub-neg1.2%
mul-1-neg1.2%
log-rec1.2%
remove-double-neg1.2%
metadata-eval1.2%
Simplified100.0%
Final simplification88.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (* (* z z) (/ y x)) (* x (+ (log x) -1.0))))
(t_1 (+ (- (* x (log x)) x) (* 0.0007936500793651 (/ (* z z) x)))))
(if (<= z -1.2e+138)
t_1
(if (<= z -3.5e-22)
t_0
(if (<= z 1.45e-22)
(+
(+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))
(if (or (<= z 1.05e+115) (and (not (<= z 1.12e+226)) (<= z 1.4e+251)))
t_0
t_1))))))
double code(double x, double y, double z) {
double t_0 = ((z * z) * (y / x)) + (x * (log(x) + -1.0));
double t_1 = ((x * log(x)) - x) + (0.0007936500793651 * ((z * z) / x));
double tmp;
if (z <= -1.2e+138) {
tmp = t_1;
} else if (z <= -3.5e-22) {
tmp = t_0;
} else if (z <= 1.45e-22) {
tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
} else if ((z <= 1.05e+115) || (!(z <= 1.12e+226) && (z <= 1.4e+251))) {
tmp = t_0;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = ((z * z) * (y / x)) + (x * (log(x) + (-1.0d0)))
t_1 = ((x * log(x)) - x) + (0.0007936500793651d0 * ((z * z) / x))
if (z <= (-1.2d+138)) then
tmp = t_1
else if (z <= (-3.5d-22)) then
tmp = t_0
else if (z <= 1.45d-22) then
tmp = ((((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
else if ((z <= 1.05d+115) .or. (.not. (z <= 1.12d+226)) .and. (z <= 1.4d+251)) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((z * z) * (y / x)) + (x * (Math.log(x) + -1.0));
double t_1 = ((x * Math.log(x)) - x) + (0.0007936500793651 * ((z * z) / x));
double tmp;
if (z <= -1.2e+138) {
tmp = t_1;
} else if (z <= -3.5e-22) {
tmp = t_0;
} else if (z <= 1.45e-22) {
tmp = ((((x + -0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
} else if ((z <= 1.05e+115) || (!(z <= 1.12e+226) && (z <= 1.4e+251))) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = ((z * z) * (y / x)) + (x * (math.log(x) + -1.0)) t_1 = ((x * math.log(x)) - x) + (0.0007936500793651 * ((z * z) / x)) tmp = 0 if z <= -1.2e+138: tmp = t_1 elif z <= -3.5e-22: tmp = t_0 elif z <= 1.45e-22: tmp = ((((x + -0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) elif (z <= 1.05e+115) or (not (z <= 1.12e+226) and (z <= 1.4e+251)): tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(z * z) * Float64(y / x)) + Float64(x * Float64(log(x) + -1.0))) t_1 = Float64(Float64(Float64(x * log(x)) - x) + Float64(0.0007936500793651 * Float64(Float64(z * z) / x))) tmp = 0.0 if (z <= -1.2e+138) tmp = t_1; elseif (z <= -3.5e-22) tmp = t_0; elseif (z <= 1.45e-22) tmp = Float64(Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); elseif ((z <= 1.05e+115) || (!(z <= 1.12e+226) && (z <= 1.4e+251))) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((z * z) * (y / x)) + (x * (log(x) + -1.0)); t_1 = ((x * log(x)) - x) + (0.0007936500793651 * ((z * z) / x)); tmp = 0.0; if (z <= -1.2e+138) tmp = t_1; elseif (z <= -3.5e-22) tmp = t_0; elseif (z <= 1.45e-22) tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); elseif ((z <= 1.05e+115) || (~((z <= 1.12e+226)) && (z <= 1.4e+251))) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(z * z), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + N[(0.0007936500793651 * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+138], t$95$1, If[LessEqual[z, -3.5e-22], t$95$0, If[LessEqual[z, 1.45e-22], 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], If[Or[LessEqual[z, 1.05e+115], And[N[Not[LessEqual[z, 1.12e+226]], $MachinePrecision], LessEqual[z, 1.4e+251]]], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(z \cdot z\right) \cdot \frac{y}{x} + x \cdot \left(\log x + -1\right)\\
t_1 := \left(x \cdot \log x - x\right) + 0.0007936500793651 \cdot \frac{z \cdot z}{x}\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+138}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-22}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-22}:\\
\;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+115} \lor \neg \left(z \leq 1.12 \cdot 10^{+226}\right) \land z \leq 1.4 \cdot 10^{+251}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.2e138 or 1.05000000000000002e115 < z < 1.12e226 or 1.4e251 < z Initial program 88.0%
sub-neg88.0%
metadata-eval88.0%
fma-def88.0%
fma-neg88.0%
metadata-eval88.0%
Simplified88.0%
Taylor expanded in y around 0 77.1%
Taylor expanded in z around inf 77.1%
unpow277.1%
Simplified77.1%
Taylor expanded in x around inf 77.1%
*-commutative77.1%
sub-neg77.1%
mul-1-neg77.1%
log-rec77.1%
remove-double-neg77.1%
metadata-eval77.1%
distribute-rgt-in77.1%
neg-mul-177.1%
sub-neg77.1%
*-commutative77.1%
Simplified77.1%
if -1.2e138 < z < -3.50000000000000005e-22 or 1.4500000000000001e-22 < z < 1.05000000000000002e115 or 1.12e226 < z < 1.4e251Initial program 95.5%
sub-neg95.5%
metadata-eval95.5%
fma-def95.5%
fma-neg95.5%
metadata-eval95.5%
Simplified95.5%
metadata-eval95.5%
fma-neg95.5%
fma-def95.5%
clear-num95.4%
inv-pow95.4%
*-commutative95.4%
fma-udef95.5%
fma-neg95.5%
metadata-eval95.5%
Applied egg-rr95.5%
Taylor expanded in y around inf 81.3%
associate-/l*85.5%
associate-/r/84.2%
unpow284.2%
Simplified84.2%
Taylor expanded in x around inf 84.3%
*-commutative35.0%
sub-neg35.0%
mul-1-neg35.0%
log-rec35.0%
remove-double-neg35.0%
metadata-eval35.0%
Simplified84.3%
if -3.50000000000000005e-22 < z < 1.4500000000000001e-22Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 94.6%
Final simplification86.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467))
(t_1 (+ (- (* x (log x)) x) (* 0.0007936500793651 (/ (* z z) x))))
(t_2 (* (* z z) (/ y x))))
(if (<= z -5.5e+138)
t_1
(if (<= z -6e-46)
(+ t_0 t_2)
(if (<= z 1.2e-21)
(+ t_0 (/ 0.083333333333333 x))
(if (or (<= z 3.1e+114) (and (not (<= z 2e+226)) (<= z 1.7e+250)))
(+ t_2 (* x (+ (log x) -1.0)))
t_1))))))
double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467;
double t_1 = ((x * log(x)) - x) + (0.0007936500793651 * ((z * z) / x));
double t_2 = (z * z) * (y / x);
double tmp;
if (z <= -5.5e+138) {
tmp = t_1;
} else if (z <= -6e-46) {
tmp = t_0 + t_2;
} else if (z <= 1.2e-21) {
tmp = t_0 + (0.083333333333333 / x);
} else if ((z <= 3.1e+114) || (!(z <= 2e+226) && (z <= 1.7e+250))) {
tmp = t_2 + (x * (log(x) + -1.0));
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0
t_1 = ((x * log(x)) - x) + (0.0007936500793651d0 * ((z * z) / x))
t_2 = (z * z) * (y / x)
if (z <= (-5.5d+138)) then
tmp = t_1
else if (z <= (-6d-46)) then
tmp = t_0 + t_2
else if (z <= 1.2d-21) then
tmp = t_0 + (0.083333333333333d0 / x)
else if ((z <= 3.1d+114) .or. (.not. (z <= 2d+226)) .and. (z <= 1.7d+250)) then
tmp = t_2 + (x * (log(x) + (-1.0d0)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * Math.log(x)) - x) + 0.91893853320467;
double t_1 = ((x * Math.log(x)) - x) + (0.0007936500793651 * ((z * z) / x));
double t_2 = (z * z) * (y / x);
double tmp;
if (z <= -5.5e+138) {
tmp = t_1;
} else if (z <= -6e-46) {
tmp = t_0 + t_2;
} else if (z <= 1.2e-21) {
tmp = t_0 + (0.083333333333333 / x);
} else if ((z <= 3.1e+114) || (!(z <= 2e+226) && (z <= 1.7e+250))) {
tmp = t_2 + (x * (Math.log(x) + -1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = (((x + -0.5) * math.log(x)) - x) + 0.91893853320467 t_1 = ((x * math.log(x)) - x) + (0.0007936500793651 * ((z * z) / x)) t_2 = (z * z) * (y / x) tmp = 0 if z <= -5.5e+138: tmp = t_1 elif z <= -6e-46: tmp = t_0 + t_2 elif z <= 1.2e-21: tmp = t_0 + (0.083333333333333 / x) elif (z <= 3.1e+114) or (not (z <= 2e+226) and (z <= 1.7e+250)): tmp = t_2 + (x * (math.log(x) + -1.0)) else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) t_1 = Float64(Float64(Float64(x * log(x)) - x) + Float64(0.0007936500793651 * Float64(Float64(z * z) / x))) t_2 = Float64(Float64(z * z) * Float64(y / x)) tmp = 0.0 if (z <= -5.5e+138) tmp = t_1; elseif (z <= -6e-46) tmp = Float64(t_0 + t_2); elseif (z <= 1.2e-21) tmp = Float64(t_0 + Float64(0.083333333333333 / x)); elseif ((z <= 3.1e+114) || (!(z <= 2e+226) && (z <= 1.7e+250))) tmp = Float64(t_2 + Float64(x * Float64(log(x) + -1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467; t_1 = ((x * log(x)) - x) + (0.0007936500793651 * ((z * z) / x)); t_2 = (z * z) * (y / x); tmp = 0.0; if (z <= -5.5e+138) tmp = t_1; elseif (z <= -6e-46) tmp = t_0 + t_2; elseif (z <= 1.2e-21) tmp = t_0 + (0.083333333333333 / x); elseif ((z <= 3.1e+114) || (~((z <= 2e+226)) && (z <= 1.7e+250))) tmp = t_2 + (x * (log(x) + -1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + N[(0.0007936500793651 * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * z), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+138], t$95$1, If[LessEqual[z, -6e-46], N[(t$95$0 + t$95$2), $MachinePrecision], If[LessEqual[z, 1.2e-21], N[(t$95$0 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 3.1e+114], And[N[Not[LessEqual[z, 2e+226]], $MachinePrecision], LessEqual[z, 1.7e+250]]], N[(t$95$2 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
t_1 := \left(x \cdot \log x - x\right) + 0.0007936500793651 \cdot \frac{z \cdot z}{x}\\
t_2 := \left(z \cdot z\right) \cdot \frac{y}{x}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+138}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-46}:\\
\;\;\;\;t_0 + t_2\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-21}:\\
\;\;\;\;t_0 + \frac{0.083333333333333}{x}\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+114} \lor \neg \left(z \leq 2 \cdot 10^{+226}\right) \land z \leq 1.7 \cdot 10^{+250}:\\
\;\;\;\;t_2 + x \cdot \left(\log x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.4999999999999999e138 or 3.1e114 < z < 1.99999999999999992e226 or 1.69999999999999987e250 < z Initial program 88.0%
sub-neg88.0%
metadata-eval88.0%
fma-def88.0%
fma-neg88.0%
metadata-eval88.0%
Simplified88.0%
Taylor expanded in y around 0 77.1%
Taylor expanded in z around inf 77.1%
unpow277.1%
Simplified77.1%
Taylor expanded in x around inf 77.1%
*-commutative77.1%
sub-neg77.1%
mul-1-neg77.1%
log-rec77.1%
remove-double-neg77.1%
metadata-eval77.1%
distribute-rgt-in77.1%
neg-mul-177.1%
sub-neg77.1%
*-commutative77.1%
Simplified77.1%
if -5.4999999999999999e138 < z < -5.99999999999999975e-46Initial program 96.7%
sub-neg96.7%
metadata-eval96.7%
fma-def96.7%
fma-neg96.7%
metadata-eval96.7%
Simplified96.7%
metadata-eval96.7%
fma-neg96.7%
fma-def96.7%
clear-num96.7%
inv-pow96.7%
*-commutative96.7%
fma-udef96.7%
fma-neg96.7%
metadata-eval96.7%
Applied egg-rr96.7%
Taylor expanded in y around inf 77.4%
associate-/l*80.4%
associate-/r/80.5%
unpow280.5%
Simplified80.5%
if -5.99999999999999975e-46 < z < 1.2e-21Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 96.2%
if 1.2e-21 < z < 3.1e114 or 1.99999999999999992e226 < z < 1.69999999999999987e250Initial program 95.0%
sub-neg95.0%
metadata-eval95.0%
fma-def95.0%
fma-neg95.0%
metadata-eval95.0%
Simplified95.0%
metadata-eval95.0%
fma-neg95.0%
fma-def95.0%
clear-num94.9%
inv-pow94.9%
*-commutative94.9%
fma-udef95.0%
fma-neg95.0%
metadata-eval95.0%
Applied egg-rr95.0%
Taylor expanded in y around inf 81.6%
associate-/l*86.3%
associate-/r/84.1%
unpow284.1%
Simplified84.1%
Taylor expanded in x around inf 84.2%
*-commutative35.4%
sub-neg35.4%
mul-1-neg35.4%
log-rec35.4%
remove-double-neg35.4%
metadata-eval35.4%
Simplified84.2%
Final simplification86.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)))
(if (or (<= z -6.2e-46) (not (<= z 6.5e-21)))
(+ t_0 (/ 1.0 (/ (/ x z) (* z (+ y 0.0007936500793651)))))
(+ t_0 (/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if ((z <= -6.2e-46) || !(z <= 6.5e-21)) {
tmp = t_0 + (1.0 / ((x / z) / (z * (y + 0.0007936500793651))));
} 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 + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0
if ((z <= (-6.2d-46)) .or. (.not. (z <= 6.5d-21))) then
tmp = t_0 + (1.0d0 / ((x / z) / (z * (y + 0.0007936500793651d0))))
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 + -0.5) * Math.log(x)) - x) + 0.91893853320467;
double tmp;
if ((z <= -6.2e-46) || !(z <= 6.5e-21)) {
tmp = t_0 + (1.0 / ((x / z) / (z * (y + 0.0007936500793651))));
} else {
tmp = t_0 + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): t_0 = (((x + -0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if (z <= -6.2e-46) or not (z <= 6.5e-21): tmp = t_0 + (1.0 / ((x / z) / (z * (y + 0.0007936500793651)))) else: tmp = t_0 + (0.083333333333333 / x) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if ((z <= -6.2e-46) || !(z <= 6.5e-21)) tmp = Float64(t_0 + Float64(1.0 / Float64(Float64(x / z) / Float64(z * Float64(y + 0.0007936500793651))))); else tmp = Float64(t_0 + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467; tmp = 0.0; if ((z <= -6.2e-46) || ~((z <= 6.5e-21))) tmp = t_0 + (1.0 / ((x / z) / (z * (y + 0.0007936500793651)))); else tmp = t_0 + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[Or[LessEqual[z, -6.2e-46], N[Not[LessEqual[z, 6.5e-21]], $MachinePrecision]], N[(t$95$0 + N[(1.0 / N[(N[(x / z), $MachinePrecision] / N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{-46} \lor \neg \left(z \leq 6.5 \cdot 10^{-21}\right):\\
\;\;\;\;t_0 + \frac{1}{\frac{\frac{x}{z}}{z \cdot \left(y + 0.0007936500793651\right)}}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -6.2000000000000002e-46 or 6.49999999999999987e-21 < z Initial program 91.6%
sub-neg91.6%
metadata-eval91.6%
fma-def91.6%
fma-neg91.6%
metadata-eval91.6%
Simplified91.6%
metadata-eval91.6%
fma-neg91.6%
fma-def91.6%
clear-num91.6%
inv-pow91.6%
*-commutative91.6%
fma-udef91.6%
fma-neg91.6%
metadata-eval91.6%
Applied egg-rr91.6%
Taylor expanded in z around inf 89.7%
associate-/r*92.3%
unpow292.3%
associate-/r*97.9%
Simplified97.9%
unpow-197.9%
associate-/l/96.0%
+-commutative96.0%
Applied egg-rr96.0%
if -6.2000000000000002e-46 < z < 6.49999999999999987e-21Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 96.2%
Final simplification96.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (+ y 0.0007936500793651))))
(if (<= x 900.0)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ (+ 0.083333333333333 (* z (- t_0 0.0027777777777778))) x))
(+
(+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)
(/ 1.0 (/ (/ x z) t_0))))))
double code(double x, double y, double z) {
double t_0 = z * (y + 0.0007936500793651);
double tmp;
if (x <= 900.0) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * (t_0 - 0.0027777777777778))) / x);
} else {
tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (1.0 / ((x / z) / 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 = z * (y + 0.0007936500793651d0)
if (x <= 900.0d0) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((0.083333333333333d0 + (z * (t_0 - 0.0027777777777778d0))) / x)
else
tmp = ((((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0) + (1.0d0 / ((x / z) / t_0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (y + 0.0007936500793651);
double tmp;
if (x <= 900.0) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * (t_0 - 0.0027777777777778))) / x);
} else {
tmp = ((((x + -0.5) * Math.log(x)) - x) + 0.91893853320467) + (1.0 / ((x / z) / t_0));
}
return tmp;
}
def code(x, y, z): t_0 = z * (y + 0.0007936500793651) tmp = 0 if x <= 900.0: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * (t_0 - 0.0027777777777778))) / x) else: tmp = ((((x + -0.5) * math.log(x)) - x) + 0.91893853320467) + (1.0 / ((x / z) / t_0)) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(y + 0.0007936500793651)) tmp = 0.0 if (x <= 900.0) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(t_0 - 0.0027777777777778))) / x)); else tmp = Float64(Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) + Float64(1.0 / Float64(Float64(x / z) / t_0))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (y + 0.0007936500793651); tmp = 0.0; if (x <= 900.0) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * (t_0 - 0.0027777777777778))) / x); else tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (1.0 / ((x / z) / t_0)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 900.0], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(1.0 / N[(N[(x / z), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(y + 0.0007936500793651\right)\\
\mathbf{if}\;x \leq 900:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(t_0 - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{1}{\frac{\frac{x}{z}}{t_0}}\\
\end{array}
\end{array}
if x < 900Initial program 99.7%
if 900 < x Initial program 89.3%
sub-neg89.3%
metadata-eval89.3%
fma-def89.3%
fma-neg89.3%
metadata-eval89.3%
Simplified89.3%
metadata-eval89.3%
fma-neg89.3%
fma-def89.3%
clear-num89.3%
inv-pow89.3%
*-commutative89.3%
fma-udef89.3%
fma-neg89.3%
metadata-eval89.3%
Applied egg-rr89.3%
Taylor expanded in z around inf 89.3%
associate-/r*92.5%
unpow292.5%
associate-/r*99.6%
Simplified99.6%
unpow-199.6%
associate-/l/97.2%
+-commutative97.2%
Applied egg-rr97.2%
Final simplification98.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)))
(if (or (<= z -1.65e-46) (not (<= z 7e-28)))
(+ t_0 (* (+ y 0.0007936500793651) (/ (* z z) x)))
(+ t_0 (/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if ((z <= -1.65e-46) || !(z <= 7e-28)) {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * 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 + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0
if ((z <= (-1.65d-46)) .or. (.not. (z <= 7d-28))) then
tmp = t_0 + ((y + 0.0007936500793651d0) * ((z * 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 + -0.5) * Math.log(x)) - x) + 0.91893853320467;
double tmp;
if ((z <= -1.65e-46) || !(z <= 7e-28)) {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x));
} else {
tmp = t_0 + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): t_0 = (((x + -0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if (z <= -1.65e-46) or not (z <= 7e-28): tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x)) else: tmp = t_0 + (0.083333333333333 / x) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if ((z <= -1.65e-46) || !(z <= 7e-28)) tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * 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 + -0.5) * log(x)) - x) + 0.91893853320467; tmp = 0.0; if ((z <= -1.65e-46) || ~((z <= 7e-28))) tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x)); else tmp = t_0 + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[Or[LessEqual[z, -1.65e-46], N[Not[LessEqual[z, 7e-28]], $MachinePrecision]], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{-46} \lor \neg \left(z \leq 7 \cdot 10^{-28}\right):\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.65000000000000007e-46 or 6.9999999999999999e-28 < z Initial program 91.6%
sub-neg91.6%
metadata-eval91.6%
fma-def91.6%
fma-neg91.6%
metadata-eval91.6%
Simplified91.6%
Taylor expanded in z around inf 89.7%
associate-/l*91.4%
associate-/r/92.3%
unpow292.3%
Simplified92.3%
if -1.65000000000000007e-46 < z < 6.9999999999999999e-28Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 96.2%
Final simplification93.9%
(FPCore (x y z)
:precision binary64
(if (or (<= y -3.1e+29) (not (<= y 3.75e+180)))
(+ (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467) (/ y (/ x (* z z))))
(+
(- (* x (log x)) x)
(/
(+
0.083333333333333
(* z (- (* 0.0007936500793651 z) 0.0027777777777778)))
x))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.1e+29) || !(y <= 3.75e+180)) {
tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (y / (x / (z * z)));
} else {
tmp = ((x * log(x)) - x) + ((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) :: tmp
if ((y <= (-3.1d+29)) .or. (.not. (y <= 3.75d+180))) then
tmp = ((((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0) + (y / (x / (z * z)))
else
tmp = ((x * log(x)) - x) + ((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 tmp;
if ((y <= -3.1e+29) || !(y <= 3.75e+180)) {
tmp = ((((x + -0.5) * Math.log(x)) - x) + 0.91893853320467) + (y / (x / (z * z)));
} else {
tmp = ((x * Math.log(x)) - x) + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.1e+29) or not (y <= 3.75e+180): tmp = ((((x + -0.5) * math.log(x)) - x) + 0.91893853320467) + (y / (x / (z * z))) else: tmp = ((x * math.log(x)) - x) + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.1e+29) || !(y <= 3.75e+180)) tmp = Float64(Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) + Float64(y / Float64(x / Float64(z * z)))); else tmp = Float64(Float64(Float64(x * log(x)) - x) + 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) tmp = 0.0; if ((y <= -3.1e+29) || ~((y <= 3.75e+180))) tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (y / (x / (z * z))); else tmp = ((x * log(x)) - x) + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.1e+29], N[Not[LessEqual[y, 3.75e+180]], $MachinePrecision]], N[(N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(y / N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 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}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+29} \lor \neg \left(y \leq 3.75 \cdot 10^{+180}\right):\\
\;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{y}{\frac{x}{z \cdot z}}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \log x - x\right) + \frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if y < -3.0999999999999999e29 or 3.75000000000000015e180 < y Initial program 92.3%
sub-neg92.3%
metadata-eval92.3%
fma-def92.3%
fma-neg92.3%
metadata-eval92.3%
Simplified92.3%
Taylor expanded in y around inf 78.0%
associate-/l*82.2%
unpow282.2%
Simplified82.2%
if -3.0999999999999999e29 < y < 3.75000000000000015e180Initial program 96.2%
sub-neg96.2%
metadata-eval96.2%
fma-def96.2%
fma-neg96.2%
metadata-eval96.2%
Simplified96.2%
Taylor expanded in y around 0 92.5%
Taylor expanded in x around inf 91.7%
*-commutative64.9%
sub-neg64.9%
mul-1-neg64.9%
log-rec64.9%
remove-double-neg64.9%
metadata-eval64.9%
distribute-rgt-in64.8%
neg-mul-164.8%
sub-neg64.8%
*-commutative64.8%
Simplified91.6%
Final simplification88.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= z -5.6e-25) (not (<= z 4.7e-20)))
(+ (* (* z z) (/ y x)) t_0)
(+ (/ 0.083333333333333 x) t_0))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if ((z <= -5.6e-25) || !(z <= 4.7e-20)) {
tmp = ((z * z) * (y / x)) + t_0;
} else {
tmp = (0.083333333333333 / 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 = x * (log(x) + (-1.0d0))
if ((z <= (-5.6d-25)) .or. (.not. (z <= 4.7d-20))) then
tmp = ((z * z) * (y / x)) + t_0
else
tmp = (0.083333333333333d0 / x) + t_0
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 <= -5.6e-25) || !(z <= 4.7e-20)) {
tmp = ((z * z) * (y / x)) + t_0;
} else {
tmp = (0.083333333333333 / x) + t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if (z <= -5.6e-25) or not (z <= 4.7e-20): tmp = ((z * z) * (y / x)) + t_0 else: tmp = (0.083333333333333 / x) + t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if ((z <= -5.6e-25) || !(z <= 4.7e-20)) tmp = Float64(Float64(Float64(z * z) * Float64(y / x)) + t_0); else tmp = Float64(Float64(0.083333333333333 / x) + t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if ((z <= -5.6e-25) || ~((z <= 4.7e-20))) tmp = ((z * z) * (y / x)) + t_0; else tmp = (0.083333333333333 / x) + t_0; 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, -5.6e-25], N[Not[LessEqual[z, 4.7e-20]], $MachinePrecision]], N[(N[(N[(z * z), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(0.083333333333333 / x), $MachinePrecision] + t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;z \leq -5.6 \cdot 10^{-25} \lor \neg \left(z \leq 4.7 \cdot 10^{-20}\right):\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{y}{x} + t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333}{x} + t_0\\
\end{array}
\end{array}
if z < -5.59999999999999976e-25 or 4.70000000000000015e-20 < z Initial program 91.4%
sub-neg91.4%
metadata-eval91.4%
fma-def91.4%
fma-neg91.4%
metadata-eval91.4%
Simplified91.4%
metadata-eval91.4%
fma-neg91.4%
fma-def91.4%
clear-num91.4%
inv-pow91.4%
*-commutative91.4%
fma-udef91.4%
fma-neg91.4%
metadata-eval91.4%
Applied egg-rr91.4%
Taylor expanded in y around inf 65.7%
associate-/l*68.9%
associate-/r/66.3%
unpow266.3%
Simplified66.3%
Taylor expanded in x around inf 66.3%
*-commutative25.1%
sub-neg25.1%
mul-1-neg25.1%
log-rec25.1%
remove-double-neg25.1%
metadata-eval25.1%
Simplified66.3%
if -5.59999999999999976e-25 < z < 4.70000000000000015e-20Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 94.6%
Taylor expanded in x around inf 92.6%
*-commutative92.6%
sub-neg92.6%
mul-1-neg92.6%
log-rec92.6%
remove-double-neg92.6%
metadata-eval92.6%
Simplified92.6%
Final simplification77.4%
(FPCore (x y z)
:precision binary64
(if (or (<= z -3e-21) (not (<= z 1.52e-24)))
(+ (* (* z z) (/ y x)) (* x (+ (log x) -1.0)))
(+
(+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3e-21) || !(z <= 1.52e-24)) {
tmp = ((z * z) * (y / x)) + (x * (log(x) + -1.0));
} 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 <= (-3d-21)) .or. (.not. (z <= 1.52d-24))) then
tmp = ((z * z) * (y / x)) + (x * (log(x) + (-1.0d0)))
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 <= -3e-21) || !(z <= 1.52e-24)) {
tmp = ((z * z) * (y / x)) + (x * (Math.log(x) + -1.0));
} 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 <= -3e-21) or not (z <= 1.52e-24): tmp = ((z * z) * (y / x)) + (x * (math.log(x) + -1.0)) 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 <= -3e-21) || !(z <= 1.52e-24)) tmp = Float64(Float64(Float64(z * z) * Float64(y / x)) + Float64(x * Float64(log(x) + -1.0))); 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 <= -3e-21) || ~((z <= 1.52e-24))) tmp = ((z * z) * (y / x)) + (x * (log(x) + -1.0)); 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, -3e-21], N[Not[LessEqual[z, 1.52e-24]], $MachinePrecision]], N[(N[(N[(z * z), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $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 -3 \cdot 10^{-21} \lor \neg \left(z \leq 1.52 \cdot 10^{-24}\right):\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{y}{x} + x \cdot \left(\log x + -1\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 < -2.99999999999999991e-21 or 1.51999999999999992e-24 < z Initial program 91.4%
sub-neg91.4%
metadata-eval91.4%
fma-def91.4%
fma-neg91.4%
metadata-eval91.4%
Simplified91.4%
metadata-eval91.4%
fma-neg91.4%
fma-def91.4%
clear-num91.4%
inv-pow91.4%
*-commutative91.4%
fma-udef91.4%
fma-neg91.4%
metadata-eval91.4%
Applied egg-rr91.4%
Taylor expanded in y around inf 65.7%
associate-/l*68.9%
associate-/r/66.3%
unpow266.3%
Simplified66.3%
Taylor expanded in x around inf 66.3%
*-commutative25.1%
sub-neg25.1%
mul-1-neg25.1%
log-rec25.1%
remove-double-neg25.1%
metadata-eval25.1%
Simplified66.3%
if -2.99999999999999991e-21 < z < 1.51999999999999992e-24Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 94.6%
Final simplification78.3%
(FPCore (x y z) :precision binary64 (+ (/ 0.083333333333333 x) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
return (0.083333333333333 / x) + (x * (log(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 = (0.083333333333333d0 / x) + (x * (log(x) + (-1.0d0)))
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 / x) + (x * (Math.log(x) + -1.0));
}
def code(x, y, z): return (0.083333333333333 / x) + (x * (math.log(x) + -1.0))
function code(x, y, z) return Float64(Float64(0.083333333333333 / x) + Float64(x * Float64(log(x) + -1.0))) end
function tmp = code(x, y, z) tmp = (0.083333333333333 / x) + (x * (log(x) + -1.0)); end
code[x_, y_, z_] := N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x} + x \cdot \left(\log x + -1\right)
\end{array}
Initial program 94.8%
sub-neg94.8%
metadata-eval94.8%
fma-def94.8%
fma-neg94.8%
metadata-eval94.8%
Simplified94.8%
Taylor expanded in z around 0 54.4%
Taylor expanded in x around inf 53.6%
*-commutative53.6%
sub-neg53.6%
mul-1-neg53.6%
log-rec53.6%
remove-double-neg53.6%
metadata-eval53.6%
Simplified53.6%
Final simplification53.6%
(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 2023279
(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)))