
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= x 8e+15)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x))
(+
(* x (+ (log x) -1.0))
(+
(*
z
(+
(* z (+ (* 0.0007936500793651 (/ 1.0 x)) (/ y x)))
(* 0.0027777777777778 (/ -1.0 x))))
(* 0.083333333333333 (/ 1.0 x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 8e+15) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = (x * (log(x) + -1.0)) + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / 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 <= 8d+15) then
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (((z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)) + 0.083333333333333d0) / x)
else
tmp = (x * (log(x) + (-1.0d0))) + ((z * ((z * ((0.0007936500793651d0 * (1.0d0 / x)) + (y / x))) + (0.0027777777777778d0 * ((-1.0d0) / x)))) + (0.083333333333333d0 * (1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 8e+15) {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = (x * (Math.log(x) + -1.0)) + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 8e+15: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) else: tmp = (x * (math.log(x) + -1.0)) + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 8e+15) tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x)); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(z * Float64(Float64(z * Float64(Float64(0.0007936500793651 * Float64(1.0 / x)) + Float64(y / x))) + Float64(0.0027777777777778 * Float64(-1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 8e+15) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x); else tmp = (x * (log(x) + -1.0)) + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 8e+15], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $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[(z * N[(N[(z * N[(N[(0.0007936500793651 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \left(z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) + 0.0027777777777778 \cdot \frac{-1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < 8e15Initial program 99.7%
if 8e15 < x Initial program 93.0%
Taylor expanded in x around inf 93.2%
sub-neg93.2%
mul-1-neg93.2%
log-rec93.2%
remove-double-neg93.2%
metadata-eval93.2%
+-commutative93.2%
Simplified93.2%
Taylor expanded in z around 0 99.8%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= x 5.5e+254)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x))
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5.5e+254) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 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 <= 5.5d+254) then
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (((z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)) + 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 <= 5.5e+254) {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5.5e+254: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5.5e+254) tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) + 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 <= 5.5e+254) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x); else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5.5e+254], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $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 5.5 \cdot 10^{+254}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 5.50000000000000004e254Initial program 98.5%
if 5.50000000000000004e254 < x Initial program 75.4%
associate-+l+75.4%
fma-neg75.6%
sub-neg75.6%
metadata-eval75.6%
fma-define75.6%
fma-neg75.6%
metadata-eval75.6%
Simplified75.6%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around inf 99.9%
sub-neg99.9%
mul-1-neg99.9%
log-rec99.9%
remove-double-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification98.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= y -3.6) (not (<= y 3.1e-18)))
(+ t_0 (/ (+ 0.083333333333333 (* z (- (* y z) 0.0027777777777778))) x))
(+
t_0
(/
(+
0.083333333333333
(* z (- (* 0.0007936500793651 z) 0.0027777777777778)))
x)))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if ((y <= -3.6) || !(y <= 3.1e-18)) {
tmp = t_0 + ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (log(x) + (-1.0d0))
if ((y <= (-3.6d0)) .or. (.not. (y <= 3.1d-18))) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((y * z) - 0.0027777777777778d0))) / x)
else
tmp = t_0 + ((0.083333333333333d0 + (z * ((0.0007936500793651d0 * z) - 0.0027777777777778d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if ((y <= -3.6) || !(y <= 3.1e-18)) {
tmp = t_0 + ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x);
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if (y <= -3.6) or not (y <= 3.1e-18): tmp = t_0 + ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x) else: tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if ((y <= -3.6) || !(y <= 3.1e-18)) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(y * z) - 0.0027777777777778))) / x)); else tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778))) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if ((y <= -3.6) || ~((y <= 3.1e-18))) tmp = t_0 + ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x); else tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y, -3.6], N[Not[LessEqual[y, 3.1e-18]], $MachinePrecision]], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(y * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;y \leq -3.6 \lor \neg \left(y \leq 3.1 \cdot 10^{-18}\right):\\
\;\;\;\;t\_0 + \frac{0.083333333333333 + z \cdot \left(y \cdot z - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if y < -3.60000000000000009 or 3.10000000000000007e-18 < y Initial program 96.5%
Taylor expanded in x around inf 96.5%
sub-neg96.5%
mul-1-neg96.5%
log-rec96.5%
remove-double-neg96.5%
metadata-eval96.5%
+-commutative96.5%
Simplified96.5%
Taylor expanded in y around inf 95.5%
*-commutative95.5%
Simplified95.5%
if -3.60000000000000009 < y < 3.10000000000000007e-18Initial program 96.3%
Taylor expanded in x around inf 95.2%
sub-neg95.2%
mul-1-neg95.2%
log-rec95.2%
remove-double-neg95.2%
metadata-eval95.2%
+-commutative95.2%
Simplified95.2%
Taylor expanded in y around 0 95.3%
*-commutative95.3%
Simplified95.3%
Final simplification95.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= x 5.5e+254)
(+
t_0
(/
(+
0.083333333333333
(+ (* z (* (+ y 0.0007936500793651) z)) (* z -0.0027777777777778)))
x))
t_0)))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (x <= 5.5e+254) {
tmp = t_0 + ((0.083333333333333 + ((z * ((y + 0.0007936500793651) * z)) + (z * -0.0027777777777778))) / x);
} else {
tmp = 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 (x <= 5.5d+254) then
tmp = t_0 + ((0.083333333333333d0 + ((z * ((y + 0.0007936500793651d0) * z)) + (z * (-0.0027777777777778d0)))) / x)
else
tmp = 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 (x <= 5.5e+254) {
tmp = t_0 + ((0.083333333333333 + ((z * ((y + 0.0007936500793651) * z)) + (z * -0.0027777777777778))) / x);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if x <= 5.5e+254: tmp = t_0 + ((0.083333333333333 + ((z * ((y + 0.0007936500793651) * z)) + (z * -0.0027777777777778))) / x) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (x <= 5.5e+254) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(Float64(z * Float64(Float64(y + 0.0007936500793651) * z)) + Float64(z * -0.0027777777777778))) / x)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (x <= 5.5e+254) tmp = t_0 + ((0.083333333333333 + ((z * ((y + 0.0007936500793651) * z)) + (z * -0.0027777777777778))) / x); else tmp = 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[LessEqual[x, 5.5e+254], N[(t$95$0 + N[(N[(0.083333333333333 + N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;x \leq 5.5 \cdot 10^{+254}:\\
\;\;\;\;t\_0 + \frac{0.083333333333333 + \left(z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z\right) + z \cdot -0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < 5.50000000000000004e254Initial program 98.5%
Taylor expanded in x around inf 97.8%
sub-neg97.8%
mul-1-neg97.8%
log-rec97.8%
remove-double-neg97.8%
metadata-eval97.8%
+-commutative97.8%
Simplified97.8%
*-commutative97.8%
sub-neg97.8%
distribute-rgt-in97.8%
metadata-eval97.8%
Applied egg-rr97.8%
if 5.50000000000000004e254 < x Initial program 75.4%
associate-+l+75.4%
fma-neg75.6%
sub-neg75.6%
metadata-eval75.6%
fma-define75.6%
fma-neg75.6%
metadata-eval75.6%
Simplified75.6%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around inf 99.9%
sub-neg99.9%
mul-1-neg99.9%
log-rec99.9%
remove-double-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification98.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= x 5.5e+254)
(+
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x)
t_0)
t_0)))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (x <= 5.5e+254) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0;
} else {
tmp = 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 (x <= 5.5d+254) then
tmp = (((z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + t_0
else
tmp = 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 (x <= 5.5e+254) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if x <= 5.5e+254: tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (x <= 5.5e+254) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (x <= 5.5e+254) tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0; else tmp = 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[LessEqual[x, 5.5e+254], N[(N[(N[(N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + t$95$0), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;x \leq 5.5 \cdot 10^{+254}:\\
\;\;\;\;\frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x} + t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < 5.50000000000000004e254Initial program 98.5%
Taylor expanded in x around inf 97.8%
sub-neg97.8%
mul-1-neg97.8%
log-rec97.8%
remove-double-neg97.8%
metadata-eval97.8%
+-commutative97.8%
Simplified97.8%
if 5.50000000000000004e254 < x Initial program 75.4%
associate-+l+75.4%
fma-neg75.6%
sub-neg75.6%
metadata-eval75.6%
fma-define75.6%
fma-neg75.6%
metadata-eval75.6%
Simplified75.6%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around inf 99.9%
sub-neg99.9%
mul-1-neg99.9%
log-rec99.9%
remove-double-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification98.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= y -0.00078)
(+ t_0 (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))
(+
t_0
(/
(+
0.083333333333333
(* z (- (* 0.0007936500793651 z) 0.0027777777777778)))
x)))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (y <= -0.00078) {
tmp = t_0 + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (log(x) + (-1.0d0))
if (y <= (-0.00078d0)) then
tmp = t_0 + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x)
else
tmp = t_0 + ((0.083333333333333d0 + (z * ((0.0007936500793651d0 * z) - 0.0027777777777778d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if (y <= -0.00078) {
tmp = t_0 + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x);
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if y <= -0.00078: tmp = t_0 + ((0.083333333333333 + (z * -0.0027777777777778)) / x) else: tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (y <= -0.00078) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)); else tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778))) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (y <= -0.00078) tmp = t_0 + ((0.083333333333333 + (z * -0.0027777777777778)) / x); else tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.00078], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;y \leq -0.00078:\\
\;\;\;\;t\_0 + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if y < -7.79999999999999986e-4Initial program 94.6%
Taylor expanded in x around inf 94.7%
sub-neg94.7%
mul-1-neg94.7%
log-rec94.7%
remove-double-neg94.7%
metadata-eval94.7%
+-commutative94.7%
Simplified94.7%
Taylor expanded in z around 0 58.5%
*-commutative58.5%
Simplified58.5%
if -7.79999999999999986e-4 < y Initial program 96.9%
Taylor expanded in x around inf 96.1%
sub-neg96.1%
mul-1-neg96.1%
log-rec96.1%
remove-double-neg96.1%
metadata-eval96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in y around 0 89.1%
*-commutative89.1%
Simplified89.1%
Final simplification82.2%
(FPCore (x y z) :precision binary64 (if (<= x 1.0) (+ (+ 0.91893853320467 (* (log x) -0.5)) (/ 1.0 (/ x 0.083333333333333))) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.0) {
tmp = (0.91893853320467 + (log(x) * -0.5)) + (1.0 / (x / 0.083333333333333));
} 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.91893853320467d0 + (log(x) * (-0.5d0))) + (1.0d0 / (x / 0.083333333333333d0))
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.91893853320467 + (Math.log(x) * -0.5)) + (1.0 / (x / 0.083333333333333));
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.0: tmp = (0.91893853320467 + (math.log(x) * -0.5)) + (1.0 / (x / 0.083333333333333)) else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.0) tmp = Float64(Float64(0.91893853320467 + Float64(log(x) * -0.5)) + Float64(1.0 / Float64(x / 0.083333333333333))); 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.91893853320467 + (log(x) * -0.5)) + (1.0 / (x / 0.083333333333333)); else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.0], N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(x / 0.083333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\left(0.91893853320467 + \log x \cdot -0.5\right) + \frac{1}{\frac{x}{0.083333333333333}}\\
\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 50.0%
clear-num49.1%
inv-pow49.1%
Applied egg-rr50.0%
unpow-149.1%
Simplified50.0%
Taylor expanded in x around 0 49.4%
if 1 < x Initial program 93.3%
associate-+l+93.3%
fma-neg93.4%
sub-neg93.4%
metadata-eval93.4%
fma-define93.4%
fma-neg93.4%
metadata-eval93.4%
Simplified93.4%
Taylor expanded in z around 0 70.0%
Taylor expanded in x around inf 69.6%
sub-neg69.6%
mul-1-neg69.6%
log-rec69.6%
remove-double-neg69.6%
metadata-eval69.6%
Simplified69.6%
Final simplification59.8%
(FPCore (x y z) :precision binary64 (if (<= x 1.6) (+ (/ 0.083333333333333 x) (+ 0.91893853320467 (- (* (log x) -0.5) x))) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.6) {
tmp = (0.083333333333333 / x) + (0.91893853320467 + ((log(x) * -0.5) - 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.6d0) then
tmp = (0.083333333333333d0 / x) + (0.91893853320467d0 + ((log(x) * (-0.5d0)) - 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.6) {
tmp = (0.083333333333333 / x) + (0.91893853320467 + ((Math.log(x) * -0.5) - x));
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.6: tmp = (0.083333333333333 / x) + (0.91893853320467 + ((math.log(x) * -0.5) - x)) else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.6) tmp = Float64(Float64(0.083333333333333 / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * -0.5) - 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.6) tmp = (0.083333333333333 / x) + (0.91893853320467 + ((log(x) * -0.5) - x)); else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.6], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.6:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot -0.5 - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 1.6000000000000001Initial program 99.7%
Taylor expanded in z around 0 50.0%
Taylor expanded in x around 0 49.4%
if 1.6000000000000001 < x Initial program 93.3%
associate-+l+93.3%
fma-neg93.4%
sub-neg93.4%
metadata-eval93.4%
fma-define93.4%
fma-neg93.4%
metadata-eval93.4%
Simplified93.4%
Taylor expanded in z around 0 70.0%
Taylor expanded in x around inf 69.6%
sub-neg69.6%
mul-1-neg69.6%
log-rec69.6%
remove-double-neg69.6%
metadata-eval69.6%
Simplified69.6%
Final simplification59.8%
(FPCore (x y z) :precision binary64 (if (<= x 1.0) (+ (/ 0.083333333333333 x) (+ 0.91893853320467 (* (log x) -0.5))) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.0) {
tmp = (0.083333333333333 / x) + (0.91893853320467 + (log(x) * -0.5));
} 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) + (0.91893853320467d0 + (log(x) * (-0.5d0)))
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) + (0.91893853320467 + (Math.log(x) * -0.5));
} 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) + (0.91893853320467 + (math.log(x) * -0.5)) else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.0) tmp = Float64(Float64(0.083333333333333 / x) + Float64(0.91893853320467 + Float64(log(x) * -0.5))); 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) + (0.91893853320467 + (log(x) * -0.5)); else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.0], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $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} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\
\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 50.0%
Taylor expanded in x around 0 49.4%
if 1 < x Initial program 93.3%
associate-+l+93.3%
fma-neg93.4%
sub-neg93.4%
metadata-eval93.4%
fma-define93.4%
fma-neg93.4%
metadata-eval93.4%
Simplified93.4%
Taylor expanded in z around 0 70.0%
Taylor expanded in x around inf 69.6%
sub-neg69.6%
mul-1-neg69.6%
log-rec69.6%
remove-double-neg69.6%
metadata-eval69.6%
Simplified69.6%
Final simplification59.8%
(FPCore (x y z) :precision binary64 (+ (* x (+ (log x) -1.0)) (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x)))
double code(double x, double y, double z) {
return (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / 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 + (z * (-0.0027777777777778d0))) / x)
end function
public static double code(double x, double y, double z) {
return (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
}
def code(x, y, z): return (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x)
function code(x, y, z) return Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)) end
function tmp = code(x, y, z) tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x); end
code[x_, y_, z_] := N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}
\end{array}
Initial program 96.4%
Taylor expanded in x around inf 95.8%
sub-neg95.8%
mul-1-neg95.8%
log-rec95.8%
remove-double-neg95.8%
metadata-eval95.8%
+-commutative95.8%
Simplified95.8%
Taylor expanded in z around 0 65.3%
*-commutative65.3%
Simplified65.3%
Final simplification65.3%
(FPCore (x y z) :precision binary64 (+ (+ 0.91893853320467 (- (* x (log x)) x)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return (0.91893853320467 + ((x * log(x)) - x)) + (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.91893853320467d0 + ((x * log(x)) - x)) + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 + ((x * Math.log(x)) - x)) + (0.083333333333333 / x);
}
def code(x, y, z): return (0.91893853320467 + ((x * math.log(x)) - x)) + (0.083333333333333 / x)
function code(x, y, z) return Float64(Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x)) + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = (0.91893853320467 + ((x * log(x)) - x)) + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 + \left(x \cdot \log x - x\right)\right) + \frac{0.083333333333333}{x}
\end{array}
Initial program 96.4%
Taylor expanded in z around 0 60.2%
Taylor expanded in x around inf 59.6%
mul-1-neg59.6%
distribute-rgt-neg-in59.6%
log-rec59.6%
remove-double-neg59.6%
Simplified59.6%
Final simplification59.6%
(FPCore (x y z) :precision binary64 (if (<= x 1.0) (/ 1.0 (/ x 0.083333333333333)) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.0) {
tmp = 1.0 / (x / 0.083333333333333);
} 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 = 1.0d0 / (x / 0.083333333333333d0)
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 = 1.0 / (x / 0.083333333333333);
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.0: tmp = 1.0 / (x / 0.083333333333333) else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.0) tmp = Float64(1.0 / Float64(x / 0.083333333333333)); 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 = 1.0 / (x / 0.083333333333333); else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.0], N[(1.0 / N[(x / 0.083333333333333), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{1}{\frac{x}{0.083333333333333}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 1Initial program 99.7%
associate-+l+99.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 50.0%
Taylor expanded in x around 0 49.4%
Taylor expanded in x around 0 49.1%
clear-num49.1%
inv-pow49.1%
Applied egg-rr49.1%
unpow-149.1%
Simplified49.1%
if 1 < x Initial program 93.3%
associate-+l+93.3%
fma-neg93.4%
sub-neg93.4%
metadata-eval93.4%
fma-define93.4%
fma-neg93.4%
metadata-eval93.4%
Simplified93.4%
Taylor expanded in z around 0 70.0%
Taylor expanded in x around inf 69.6%
sub-neg69.6%
mul-1-neg69.6%
log-rec69.6%
remove-double-neg69.6%
metadata-eval69.6%
Simplified69.6%
Final simplification59.7%
(FPCore (x y z) :precision binary64 (/ 1.0 (/ x 0.083333333333333)))
double code(double x, double y, double z) {
return 1.0 / (x / 0.083333333333333);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 / (x / 0.083333333333333d0)
end function
public static double code(double x, double y, double z) {
return 1.0 / (x / 0.083333333333333);
}
def code(x, y, z): return 1.0 / (x / 0.083333333333333)
function code(x, y, z) return Float64(1.0 / Float64(x / 0.083333333333333)) end
function tmp = code(x, y, z) tmp = 1.0 / (x / 0.083333333333333); end
code[x_, y_, z_] := N[(1.0 / N[(x / 0.083333333333333), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{x}{0.083333333333333}}
\end{array}
Initial program 96.4%
associate-+l+96.4%
fma-neg96.4%
sub-neg96.4%
metadata-eval96.4%
fma-define96.4%
fma-neg96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in z around 0 60.3%
Taylor expanded in x around 0 24.6%
Taylor expanded in x around 0 25.3%
clear-num25.3%
inv-pow25.3%
Applied egg-rr25.3%
unpow-125.3%
Simplified25.3%
Final simplification25.3%
(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 96.4%
associate-+l+96.4%
fma-neg96.4%
sub-neg96.4%
metadata-eval96.4%
fma-define96.4%
fma-neg96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in z around 0 60.3%
Taylor expanded in x around 0 24.6%
Taylor expanded in x around 0 25.3%
Final simplification25.3%
(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 2024066
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:alt
(+ (+ (+ (* (- 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)))