
(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 11 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 1e+17)
(+
(- (* (+ x -0.5) (log x)) (+ x -0.91893853320467))
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x))
(+ (* x (+ (log x) -1.0)) (* (+ y 0.0007936500793651) (/ z (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1e+17) {
tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (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 <= 1d+17) then
tmp = (((x + (-0.5d0)) * log(x)) - (x + (-0.91893853320467d0))) + (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x)
else
tmp = (x * (log(x) + (-1.0d0))) + ((y + 0.0007936500793651d0) * (z / (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1e+17) {
tmp = (((x + -0.5) * Math.log(x)) - (x + -0.91893853320467)) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = (x * (Math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1e+17: tmp = (((x + -0.5) * math.log(x)) - (x + -0.91893853320467)) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) else: tmp = (x * (math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1e+17) tmp = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - Float64(x + -0.91893853320467)) + Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x)); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1e+17) tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x); else tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1e+17], N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{+17}:\\
\;\;\;\;\left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right) + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 1e17Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
if 1e17 < x Initial program 88.3%
Taylor expanded in z around inf 88.3%
associate-/l*90.4%
unpow290.4%
Simplified90.4%
Taylor expanded in z around 0 88.3%
+-commutative88.3%
*-commutative88.3%
associate-*r/91.2%
unpow291.2%
associate-/l*99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 99.7%
*-commutative99.7%
sub-neg99.7%
mul-1-neg99.7%
log-rec99.7%
remove-double-neg99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= x 5e+16)
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
(+ (- (* (log x) (- x 0.5)) x) 0.91893853320467))
(+ (* x (+ (log x) -1.0)) (* (+ y 0.0007936500793651) (/ z (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5e+16) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (((log(x) * (x - 0.5)) - x) + 0.91893853320467);
} else {
tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (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+16) then
tmp = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (((log(x) * (x - 0.5d0)) - x) + 0.91893853320467d0)
else
tmp = (x * (log(x) + (-1.0d0))) + ((y + 0.0007936500793651d0) * (z / (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5e+16) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (((Math.log(x) * (x - 0.5)) - x) + 0.91893853320467);
} else {
tmp = (x * (Math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5e+16: tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (((math.log(x) * (x - 0.5)) - x) + 0.91893853320467) else: tmp = (x * (math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5e+16) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(Float64(Float64(log(x) * Float64(x - 0.5)) - x) + 0.91893853320467)); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5e+16) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (((log(x) * (x - 0.5)) - x) + 0.91893853320467); else tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5e+16], N[(N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{+16}:\\
\;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(\left(\log x \cdot \left(x - 0.5\right) - x\right) + 0.91893853320467\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 5e16Initial program 99.7%
if 5e16 < x Initial program 88.3%
Taylor expanded in z around inf 88.3%
associate-/l*90.4%
unpow290.4%
Simplified90.4%
Taylor expanded in z around 0 88.3%
+-commutative88.3%
*-commutative88.3%
associate-*r/91.2%
unpow291.2%
associate-/l*99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 99.7%
*-commutative99.7%
sub-neg99.7%
mul-1-neg99.7%
log-rec99.7%
remove-double-neg99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= x 5e+15)
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
t_0)
(+ t_0 (* (+ y 0.0007936500793651) (/ z (/ x z)))))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (x <= 5e+15) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0;
} else {
tmp = t_0 + ((y + 0.0007936500793651) * (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 <= 5d+15) then
tmp = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + t_0
else
tmp = t_0 + ((y + 0.0007936500793651d0) * (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 <= 5e+15) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0;
} else {
tmp = t_0 + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if x <= 5e+15: tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0 else: tmp = t_0 + ((y + 0.0007936500793651) * (z / (x / z))) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (x <= 5e+15) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0); else tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(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 <= 5e+15) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0; else tmp = t_0 + ((y + 0.0007936500793651) * (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, 5e+15], N[(N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + t$95$0), $MachinePrecision], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / 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 \cdot 10^{+15}:\\
\;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 5e15Initial program 99.7%
Taylor expanded in x around inf 99.1%
*-commutative62.4%
sub-neg62.4%
mul-1-neg62.4%
log-rec62.4%
remove-double-neg62.4%
metadata-eval62.4%
Simplified99.1%
if 5e15 < x Initial program 88.3%
Taylor expanded in z around inf 88.3%
associate-/l*90.4%
unpow290.4%
Simplified90.4%
Taylor expanded in z around 0 88.3%
+-commutative88.3%
*-commutative88.3%
associate-*r/91.2%
unpow291.2%
associate-/l*99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 99.7%
*-commutative99.7%
sub-neg99.7%
mul-1-neg99.7%
log-rec99.7%
remove-double-neg99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.4%
(FPCore (x y z)
:precision binary64
(if (<= x 3.2)
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
(+ 0.91893853320467 (* -0.5 (log x))))
(+ (* x (+ (log x) -1.0)) (* (+ y 0.0007936500793651) (/ z (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.2) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (-0.5 * log(x)));
} else {
tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (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 <= 3.2d0) then
tmp = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (0.91893853320467d0 + ((-0.5d0) * log(x)))
else
tmp = (x * (log(x) + (-1.0d0))) + ((y + 0.0007936500793651d0) * (z / (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 3.2) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (-0.5 * Math.log(x)));
} else {
tmp = (x * (Math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 3.2: tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (-0.5 * math.log(x))) else: tmp = (x * (math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 3.2) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(-0.5 * log(x)))); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 3.2) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (-0.5 * log(x))); else tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 3.2], N[(N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.2:\\
\;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 3.2000000000000002Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 99.5%
if 3.2000000000000002 < x Initial program 88.5%
Taylor expanded in z around inf 88.5%
associate-/l*90.5%
unpow290.5%
Simplified90.5%
Taylor expanded in z around 0 88.5%
+-commutative88.5%
*-commutative88.5%
associate-*r/91.3%
unpow291.3%
associate-/l*99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in x around inf 99.6%
*-commutative99.6%
sub-neg99.6%
mul-1-neg99.6%
log-rec99.6%
remove-double-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.5%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.12e-58) (not (<= z 1.16e-57)))
(+ (* x (+ (log x) -1.0)) (* (+ y 0.0007936500793651) (/ 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 <= -1.12e-58) || !(z <= 1.16e-57)) {
tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (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 <= (-1.12d-58)) .or. (.not. (z <= 1.16d-57))) then
tmp = (x * (log(x) + (-1.0d0))) + ((y + 0.0007936500793651d0) * (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 <= -1.12e-58) || !(z <= 1.16e-57)) {
tmp = (x * (Math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (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 <= -1.12e-58) or not (z <= 1.16e-57): tmp = (x * (math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (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 <= -1.12e-58) || !(z <= 1.16e-57)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z)))); else tmp = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - Float64(x + -0.91893853320467)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.12e-58) || ~((z <= 1.16e-57))) tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (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, -1.12e-58], N[Not[LessEqual[z, 1.16e-57]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{-58} \lor \neg \left(z \leq 1.16 \cdot 10^{-57}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.11999999999999992e-58 or 1.15999999999999996e-57 < z Initial program 90.0%
Taylor expanded in z around inf 87.5%
associate-/l*89.3%
unpow289.3%
Simplified89.3%
Taylor expanded in z around 0 87.5%
+-commutative87.5%
*-commutative87.5%
associate-*r/90.0%
unpow290.0%
associate-/l*97.3%
+-commutative97.3%
Simplified97.3%
Taylor expanded in x around inf 97.3%
*-commutative97.3%
sub-neg97.3%
mul-1-neg97.3%
log-rec97.3%
remove-double-neg97.3%
metadata-eval97.3%
Simplified97.3%
if -1.11999999999999992e-58 < z < 1.15999999999999996e-57Initial program 99.5%
associate-+l-99.5%
sub-neg99.5%
metadata-eval99.5%
sub-neg99.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in z around 0 94.7%
Final simplification96.2%
(FPCore (x y z)
:precision binary64
(if (<= x 3.2)
(+
(+ 0.91893853320467 (* -0.5 (log x)))
(/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.2) {
tmp = (0.91893853320467 + (-0.5 * log(x))) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
} else {
tmp = 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) :: tmp
if (x <= 3.2d0) then
tmp = (0.91893853320467d0 + ((-0.5d0) * log(x))) + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x)
else
tmp = x * (log(x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 3.2) {
tmp = (0.91893853320467 + (-0.5 * Math.log(x))) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 3.2: tmp = (0.91893853320467 + (-0.5 * math.log(x))) + ((0.083333333333333 + (z * -0.0027777777777778)) / x) else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 3.2) tmp = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 3.2) tmp = (0.91893853320467 + (-0.5 * log(x))) + ((0.083333333333333 + (z * -0.0027777777777778)) / x); else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 3.2], N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.2:\\
\;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 3.2000000000000002Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 53.5%
*-commutative53.5%
Simplified53.5%
Taylor expanded in x around 0 53.2%
if 3.2000000000000002 < x Initial program 88.5%
associate-+l-88.5%
sub-neg88.5%
metadata-eval88.5%
sub-neg88.5%
metadata-eval88.5%
Applied egg-rr88.5%
Taylor expanded in z around 0 71.7%
Taylor expanded in x around inf 71.8%
*-commutative71.8%
sub-neg71.8%
mul-1-neg71.8%
log-rec71.8%
remove-double-neg71.8%
metadata-eval71.8%
+-commutative71.8%
Simplified71.8%
Final simplification62.7%
(FPCore (x y z)
:precision binary64
(if (<= x 1.9e-129)
(+
(+ 0.91893853320467 (* -0.5 (log x)))
(/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))
(+
(+ (- (* (log x) (- x 0.5)) x) 0.91893853320467)
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.9e-129) {
tmp = (0.91893853320467 + (-0.5 * log(x))) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
} else {
tmp = (((log(x) * (x - 0.5)) - 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 (x <= 1.9d-129) then
tmp = (0.91893853320467d0 + ((-0.5d0) * log(x))) + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x)
else
tmp = (((log(x) * (x - 0.5d0)) - 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 (x <= 1.9e-129) {
tmp = (0.91893853320467 + (-0.5 * Math.log(x))) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
} else {
tmp = (((Math.log(x) * (x - 0.5)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.9e-129: tmp = (0.91893853320467 + (-0.5 * math.log(x))) + ((0.083333333333333 + (z * -0.0027777777777778)) / x) else: tmp = (((math.log(x) * (x - 0.5)) - x) + 0.91893853320467) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.9e-129) tmp = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)); else tmp = Float64(Float64(Float64(Float64(log(x) * Float64(x - 0.5)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.9e-129) tmp = (0.91893853320467 + (-0.5 * log(x))) + ((0.083333333333333 + (z * -0.0027777777777778)) / x); else tmp = (((log(x) * (x - 0.5)) - x) + 0.91893853320467) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.9e-129], N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9 \cdot 10^{-129}:\\
\;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\log x \cdot \left(x - 0.5\right) - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if x < 1.89999999999999992e-129Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 58.8%
*-commutative58.8%
Simplified58.8%
Taylor expanded in x around 0 58.8%
if 1.89999999999999992e-129 < x Initial program 91.5%
Taylor expanded in z around 0 64.5%
Final simplification62.8%
(FPCore (x y z)
:precision binary64
(if (<= x 1.9e-129)
(+
(+ 0.91893853320467 (* -0.5 (log x)))
(/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))
(+
(- (* (+ x -0.5) (log x)) (+ x -0.91893853320467))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.9e-129) {
tmp = (0.91893853320467 + (-0.5 * log(x))) + ((0.083333333333333 + (z * -0.0027777777777778)) / 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 (x <= 1.9d-129) then
tmp = (0.91893853320467d0 + ((-0.5d0) * log(x))) + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / 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 (x <= 1.9e-129) {
tmp = (0.91893853320467 + (-0.5 * Math.log(x))) + ((0.083333333333333 + (z * -0.0027777777777778)) / 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 x <= 1.9e-129: tmp = (0.91893853320467 + (-0.5 * math.log(x))) + ((0.083333333333333 + (z * -0.0027777777777778)) / 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 (x <= 1.9e-129) tmp = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)); else tmp = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - Float64(x + -0.91893853320467)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.9e-129) tmp = (0.91893853320467 + (-0.5 * log(x))) + ((0.083333333333333 + (z * -0.0027777777777778)) / x); else tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.9e-129], N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9 \cdot 10^{-129}:\\
\;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if x < 1.89999999999999992e-129Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 58.8%
*-commutative58.8%
Simplified58.8%
Taylor expanded in x around 0 58.8%
if 1.89999999999999992e-129 < x Initial program 91.5%
associate-+l-91.5%
sub-neg91.5%
metadata-eval91.5%
sub-neg91.5%
metadata-eval91.5%
Applied egg-rr91.5%
Taylor expanded in z around 0 64.5%
Final simplification62.8%
(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 94.0%
Taylor expanded in z around 0 56.3%
Taylor expanded in x around inf 56.1%
*-commutative81.2%
sub-neg81.2%
mul-1-neg81.2%
log-rec81.2%
remove-double-neg81.2%
metadata-eval81.2%
Simplified56.1%
Final simplification56.1%
(FPCore (x y z) :precision binary64 (if (<= x 1.0) (/ 0.083333333333333 x) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.0) {
tmp = 0.083333333333333 / x;
} else {
tmp = 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) :: tmp
if (x <= 1.0d0) then
tmp = 0.083333333333333d0 / x
else
tmp = x * (log(x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.0) {
tmp = 0.083333333333333 / x;
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.0: tmp = 0.083333333333333 / x else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.0) tmp = Float64(0.083333333333333 / x); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.0) tmp = 0.083333333333333 / x; else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.0], N[(0.083333333333333 / x), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 1Initial program 99.7%
Taylor expanded in z around 0 40.2%
Taylor expanded in x around 0 40.0%
Taylor expanded in x around 0 39.7%
if 1 < x Initial program 88.5%
associate-+l-88.5%
sub-neg88.5%
metadata-eval88.5%
sub-neg88.5%
metadata-eval88.5%
Applied egg-rr88.5%
Taylor expanded in z around 0 71.7%
Taylor expanded in x around inf 71.8%
*-commutative71.8%
sub-neg71.8%
mul-1-neg71.8%
log-rec71.8%
remove-double-neg71.8%
metadata-eval71.8%
+-commutative71.8%
Simplified71.8%
Final simplification56.1%
(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 94.0%
Taylor expanded in z around 0 56.3%
Taylor expanded in x around 0 20.1%
Taylor expanded in x around 0 20.8%
Final simplification20.8%
(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 2023185
(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)))