
(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 15 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 (* z (sqrt (+ y 0.0007936500793651)))))
(if (<= (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)) 5e+306)
(+
(fma (+ x -0.5) (log x) (- x))
(+
0.91893853320467
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)))
(+
(- (* (+ x -0.5) (log x)) (+ x -0.91893853320467))
(+
(* -0.0027777777777778 (/ z x))
(+ (* 0.083333333333333 (/ 1.0 x)) (* t_0 (/ t_0 x))))))))
double code(double x, double y, double z) {
double t_0 = z * sqrt((y + 0.0007936500793651));
double tmp;
if ((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) <= 5e+306) {
tmp = fma((x + -0.5), log(x), -x) + (0.91893853320467 + (fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x));
} else {
tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + ((-0.0027777777777778 * (z / x)) + ((0.083333333333333 * (1.0 / x)) + (t_0 * (t_0 / x))));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * sqrt(Float64(y + 0.0007936500793651))) tmp = 0.0 if (Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) <= 5e+306) tmp = Float64(fma(Float64(x + -0.5), log(x), Float64(-x)) + Float64(0.91893853320467 + Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x))); else tmp = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - Float64(x + -0.91893853320467)) + Float64(Float64(-0.0027777777777778 * Float64(z / x)) + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(t_0 * Float64(t_0 / x))))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sqrt[N[(y + 0.0007936500793651), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision], 5e+306], N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(N[(-0.0027777777777778 * N[(z / x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \sqrt{y + 0.0007936500793651}\\
\mathbf{if}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \leq 5 \cdot 10^{+306}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, -x\right) + \left(0.91893853320467 + \frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right) + \left(-0.0027777777777778 \cdot \frac{z}{x} + \left(0.083333333333333 \cdot \frac{1}{x} + t\_0 \cdot \frac{t\_0}{x}\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 4.99999999999999993e306Initial program 98.6%
associate-+l+98.6%
fma-neg98.8%
sub-neg98.8%
metadata-eval98.8%
fma-def98.8%
fma-neg98.8%
metadata-eval98.8%
Simplified98.8%
if 4.99999999999999993e306 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 73.7%
associate-+l-73.7%
sub-neg73.7%
metadata-eval73.7%
*-commutative73.7%
sub-neg73.7%
metadata-eval73.7%
Applied egg-rr73.7%
Taylor expanded in z around inf 59.4%
add-sqr-sqrt59.4%
*-un-lft-identity59.4%
times-frac59.4%
sqrt-prod59.4%
unpow259.4%
sqrt-prod22.4%
add-sqr-sqrt22.4%
sqrt-prod29.2%
unpow229.2%
sqrt-prod33.8%
add-sqr-sqrt85.5%
Applied egg-rr85.5%
Final simplification95.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (sqrt (+ y 0.0007936500793651)))))
(if (<= (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)) 5e+306)
(+
(fma (+ x -0.5) (log x) (- 0.91893853320467 x))
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x))
(+
(- (* (+ x -0.5) (log x)) (+ x -0.91893853320467))
(+
(* -0.0027777777777778 (/ z x))
(+ (* 0.083333333333333 (/ 1.0 x)) (* t_0 (/ t_0 x))))))))
double code(double x, double y, double z) {
double t_0 = z * sqrt((y + 0.0007936500793651));
double tmp;
if ((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) <= 5e+306) {
tmp = fma((x + -0.5), log(x), (0.91893853320467 - x)) + (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x);
} else {
tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + ((-0.0027777777777778 * (z / x)) + ((0.083333333333333 * (1.0 / x)) + (t_0 * (t_0 / x))));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * sqrt(Float64(y + 0.0007936500793651))) tmp = 0.0 if (Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) <= 5e+306) tmp = Float64(fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - x)) + Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x)); else tmp = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - Float64(x + -0.91893853320467)) + Float64(Float64(-0.0027777777777778 * Float64(z / x)) + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(t_0 * Float64(t_0 / x))))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sqrt[N[(y + 0.0007936500793651), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision], 5e+306], N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(N[(-0.0027777777777778 * N[(z / x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \sqrt{y + 0.0007936500793651}\\
\mathbf{if}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \leq 5 \cdot 10^{+306}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right) + \left(-0.0027777777777778 \cdot \frac{z}{x} + \left(0.083333333333333 \cdot \frac{1}{x} + t\_0 \cdot \frac{t\_0}{x}\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 4.99999999999999993e306Initial program 98.6%
sub-neg98.6%
associate-+l+98.6%
fma-def98.7%
sub-neg98.7%
metadata-eval98.7%
+-commutative98.7%
unsub-neg98.7%
*-commutative98.7%
fma-def98.7%
fma-neg98.7%
metadata-eval98.7%
Simplified98.7%
if 4.99999999999999993e306 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 73.7%
associate-+l-73.7%
sub-neg73.7%
metadata-eval73.7%
*-commutative73.7%
sub-neg73.7%
metadata-eval73.7%
Applied egg-rr73.7%
Taylor expanded in z around inf 59.4%
add-sqr-sqrt59.4%
*-un-lft-identity59.4%
times-frac59.4%
sqrt-prod59.4%
unpow259.4%
sqrt-prod22.4%
add-sqr-sqrt22.4%
sqrt-prod29.2%
unpow229.2%
sqrt-prod33.8%
add-sqr-sqrt85.5%
Applied egg-rr85.5%
Final simplification95.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (sqrt (+ y 0.0007936500793651))))
(t_1 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(t_2 (- (* (+ x -0.5) (log x)) (+ x -0.91893853320467))))
(if (<= t_1 5e+306)
(+ t_2 (/ (+ t_1 0.083333333333333) x))
(+
t_2
(+
(* -0.0027777777777778 (/ z x))
(+ (* 0.083333333333333 (/ 1.0 x)) (* t_0 (/ t_0 x))))))))
double code(double x, double y, double z) {
double t_0 = z * sqrt((y + 0.0007936500793651));
double t_1 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double t_2 = ((x + -0.5) * log(x)) - (x + -0.91893853320467);
double tmp;
if (t_1 <= 5e+306) {
tmp = t_2 + ((t_1 + 0.083333333333333) / x);
} else {
tmp = t_2 + ((-0.0027777777777778 * (z / x)) + ((0.083333333333333 * (1.0 / x)) + (t_0 * (t_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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = z * sqrt((y + 0.0007936500793651d0))
t_1 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
t_2 = ((x + (-0.5d0)) * log(x)) - (x + (-0.91893853320467d0))
if (t_1 <= 5d+306) then
tmp = t_2 + ((t_1 + 0.083333333333333d0) / x)
else
tmp = t_2 + (((-0.0027777777777778d0) * (z / x)) + ((0.083333333333333d0 * (1.0d0 / x)) + (t_0 * (t_0 / x))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * Math.sqrt((y + 0.0007936500793651));
double t_1 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double t_2 = ((x + -0.5) * Math.log(x)) - (x + -0.91893853320467);
double tmp;
if (t_1 <= 5e+306) {
tmp = t_2 + ((t_1 + 0.083333333333333) / x);
} else {
tmp = t_2 + ((-0.0027777777777778 * (z / x)) + ((0.083333333333333 * (1.0 / x)) + (t_0 * (t_0 / x))));
}
return tmp;
}
def code(x, y, z): t_0 = z * math.sqrt((y + 0.0007936500793651)) t_1 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778) t_2 = ((x + -0.5) * math.log(x)) - (x + -0.91893853320467) tmp = 0 if t_1 <= 5e+306: tmp = t_2 + ((t_1 + 0.083333333333333) / x) else: tmp = t_2 + ((-0.0027777777777778 * (z / x)) + ((0.083333333333333 * (1.0 / x)) + (t_0 * (t_0 / x)))) return tmp
function code(x, y, z) t_0 = Float64(z * sqrt(Float64(y + 0.0007936500793651))) t_1 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) t_2 = Float64(Float64(Float64(x + -0.5) * log(x)) - Float64(x + -0.91893853320467)) tmp = 0.0 if (t_1 <= 5e+306) tmp = Float64(t_2 + Float64(Float64(t_1 + 0.083333333333333) / x)); else tmp = Float64(t_2 + Float64(Float64(-0.0027777777777778 * Float64(z / x)) + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(t_0 * Float64(t_0 / x))))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * sqrt((y + 0.0007936500793651)); t_1 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778); t_2 = ((x + -0.5) * log(x)) - (x + -0.91893853320467); tmp = 0.0; if (t_1 <= 5e+306) tmp = t_2 + ((t_1 + 0.083333333333333) / x); else tmp = t_2 + ((-0.0027777777777778 * (z / x)) + ((0.083333333333333 * (1.0 / x)) + (t_0 * (t_0 / x)))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sqrt[N[(y + 0.0007936500793651), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+306], N[(t$95$2 + N[(N[(t$95$1 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(N[(-0.0027777777777778 * N[(z / x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \sqrt{y + 0.0007936500793651}\\
t_1 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
t_2 := \left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t\_2 + \frac{t\_1 + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(-0.0027777777777778 \cdot \frac{z}{x} + \left(0.083333333333333 \cdot \frac{1}{x} + t\_0 \cdot \frac{t\_0}{x}\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 4.99999999999999993e306Initial program 98.6%
associate-+l-98.6%
sub-neg98.6%
metadata-eval98.6%
*-commutative98.6%
sub-neg98.6%
metadata-eval98.6%
Applied egg-rr98.6%
if 4.99999999999999993e306 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 73.7%
associate-+l-73.7%
sub-neg73.7%
metadata-eval73.7%
*-commutative73.7%
sub-neg73.7%
metadata-eval73.7%
Applied egg-rr73.7%
Taylor expanded in z around inf 59.4%
add-sqr-sqrt59.4%
*-un-lft-identity59.4%
times-frac59.4%
sqrt-prod59.4%
unpow259.4%
sqrt-prod22.4%
add-sqr-sqrt22.4%
sqrt-prod29.2%
unpow229.2%
sqrt-prod33.8%
add-sqr-sqrt85.5%
Applied egg-rr85.5%
Final simplification95.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(t_1 (- (* (+ x -0.5) (log x)) (+ x -0.91893853320467))))
(if (<= t_0 5e+306)
(+ t_1 (/ (+ t_0 0.083333333333333) x))
(+
t_1
(+
(* -0.0027777777777778 (/ z x))
(+
(* 0.083333333333333 (/ 1.0 x))
(pow (/ z (sqrt (/ x (+ y 0.0007936500793651)))) 2.0)))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double t_1 = ((x + -0.5) * log(x)) - (x + -0.91893853320467);
double tmp;
if (t_0 <= 5e+306) {
tmp = t_1 + ((t_0 + 0.083333333333333) / x);
} else {
tmp = t_1 + ((-0.0027777777777778 * (z / x)) + ((0.083333333333333 * (1.0 / x)) + pow((z / sqrt((x / (y + 0.0007936500793651)))), 2.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) :: tmp
t_0 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
t_1 = ((x + (-0.5d0)) * log(x)) - (x + (-0.91893853320467d0))
if (t_0 <= 5d+306) then
tmp = t_1 + ((t_0 + 0.083333333333333d0) / x)
else
tmp = t_1 + (((-0.0027777777777778d0) * (z / x)) + ((0.083333333333333d0 * (1.0d0 / x)) + ((z / sqrt((x / (y + 0.0007936500793651d0)))) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double t_1 = ((x + -0.5) * Math.log(x)) - (x + -0.91893853320467);
double tmp;
if (t_0 <= 5e+306) {
tmp = t_1 + ((t_0 + 0.083333333333333) / x);
} else {
tmp = t_1 + ((-0.0027777777777778 * (z / x)) + ((0.083333333333333 * (1.0 / x)) + Math.pow((z / Math.sqrt((x / (y + 0.0007936500793651)))), 2.0)));
}
return tmp;
}
def code(x, y, z): t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778) t_1 = ((x + -0.5) * math.log(x)) - (x + -0.91893853320467) tmp = 0 if t_0 <= 5e+306: tmp = t_1 + ((t_0 + 0.083333333333333) / x) else: tmp = t_1 + ((-0.0027777777777778 * (z / x)) + ((0.083333333333333 * (1.0 / x)) + math.pow((z / math.sqrt((x / (y + 0.0007936500793651)))), 2.0))) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) t_1 = Float64(Float64(Float64(x + -0.5) * log(x)) - Float64(x + -0.91893853320467)) tmp = 0.0 if (t_0 <= 5e+306) tmp = Float64(t_1 + Float64(Float64(t_0 + 0.083333333333333) / x)); else tmp = Float64(t_1 + Float64(Float64(-0.0027777777777778 * Float64(z / x)) + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + (Float64(z / sqrt(Float64(x / Float64(y + 0.0007936500793651)))) ^ 2.0)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778); t_1 = ((x + -0.5) * log(x)) - (x + -0.91893853320467); tmp = 0.0; if (t_0 <= 5e+306) tmp = t_1 + ((t_0 + 0.083333333333333) / x); else tmp = t_1 + ((-0.0027777777777778 * (z / x)) + ((0.083333333333333 * (1.0 / x)) + ((z / sqrt((x / (y + 0.0007936500793651)))) ^ 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e+306], N[(t$95$1 + N[(N[(t$95$0 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(-0.0027777777777778 * N[(z / x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[Power[N[(z / N[Sqrt[N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
t_1 := \left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t\_1 + \frac{t\_0 + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(-0.0027777777777778 \cdot \frac{z}{x} + \left(0.083333333333333 \cdot \frac{1}{x} + {\left(\frac{z}{\sqrt{\frac{x}{y + 0.0007936500793651}}}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 4.99999999999999993e306Initial program 98.6%
associate-+l-98.6%
sub-neg98.6%
metadata-eval98.6%
*-commutative98.6%
sub-neg98.6%
metadata-eval98.6%
Applied egg-rr98.6%
if 4.99999999999999993e306 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 73.7%
associate-+l-73.7%
sub-neg73.7%
metadata-eval73.7%
*-commutative73.7%
sub-neg73.7%
metadata-eval73.7%
Applied egg-rr73.7%
Taylor expanded in z around inf 59.4%
associate-/l*67.6%
add-sqr-sqrt67.6%
sqrt-div67.6%
unpow267.6%
sqrt-prod25.6%
add-sqr-sqrt29.2%
sqrt-div29.2%
unpow229.2%
sqrt-prod33.8%
add-sqr-sqrt85.4%
Applied egg-rr85.4%
unpow285.4%
Simplified85.4%
Final simplification95.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
(if (<= t_0 1e+201)
(+
(- (* (+ x -0.5) (log x)) (+ x -0.91893853320467))
(/ (+ t_0 0.083333333333333) x))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ (+ y 0.0007936500793651) (/ x (pow z 2.0)))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= 1e+201) {
tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + ((t_0 + 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) / (x / pow(z, 2.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 * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
if (t_0 <= 1d+201) then
tmp = (((x + (-0.5d0)) * log(x)) - (x + (-0.91893853320467d0))) + ((t_0 + 0.083333333333333d0) / x)
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((y + 0.0007936500793651d0) / (x / (z ** 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= 1e+201) {
tmp = (((x + -0.5) * Math.log(x)) - (x + -0.91893853320467)) + ((t_0 + 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) / (x / Math.pow(z, 2.0)));
}
return tmp;
}
def code(x, y, z): t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778) tmp = 0 if t_0 <= 1e+201: tmp = (((x + -0.5) * math.log(x)) - (x + -0.91893853320467)) + ((t_0 + 0.083333333333333) / x) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) / (x / math.pow(z, 2.0))) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= 1e+201) tmp = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - Float64(x + -0.91893853320467)) + Float64(Float64(t_0 + 0.083333333333333) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(y + 0.0007936500793651) / Float64(x / (z ^ 2.0)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778); tmp = 0.0; if (t_0 <= 1e+201) tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + ((t_0 + 0.083333333333333) / x); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) / (x / (z ^ 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e+201], N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] / N[(x / N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq 10^{+201}:\\
\;\;\;\;\left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right) + \frac{t\_0 + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{y + 0.0007936500793651}{\frac{x}{{z}^{2}}}\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 1.00000000000000004e201Initial program 98.5%
associate-+l-98.6%
sub-neg98.6%
metadata-eval98.6%
*-commutative98.6%
sub-neg98.6%
metadata-eval98.6%
Applied egg-rr98.6%
if 1.00000000000000004e201 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 76.9%
Taylor expanded in z around inf 76.9%
+-commutative76.9%
*-commutative76.9%
associate-/l*84.2%
+-commutative84.2%
Simplified84.2%
Final simplification95.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
(if (or (<= t_0 -2.8e+205) (not (<= t_0 3.5e+289)))
(+ (/ (+ t_0 0.083333333333333) x) (+ 0.91893853320467 (* -0.5 (log x))))
(+
(- (* (+ x -0.5) (log x)) (+ x -0.91893853320467))
(/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if ((t_0 <= -2.8e+205) || !(t_0 <= 3.5e+289)) {
tmp = ((t_0 + 0.083333333333333) / x) + (0.91893853320467 + (-0.5 * log(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) :: t_0
real(8) :: tmp
t_0 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
if ((t_0 <= (-2.8d+205)) .or. (.not. (t_0 <= 3.5d+289))) then
tmp = ((t_0 + 0.083333333333333d0) / x) + (0.91893853320467d0 + ((-0.5d0) * log(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 t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if ((t_0 <= -2.8e+205) || !(t_0 <= 3.5e+289)) {
tmp = ((t_0 + 0.083333333333333) / x) + (0.91893853320467 + (-0.5 * Math.log(x)));
} else {
tmp = (((x + -0.5) * Math.log(x)) - (x + -0.91893853320467)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778) tmp = 0 if (t_0 <= -2.8e+205) or not (t_0 <= 3.5e+289): tmp = ((t_0 + 0.083333333333333) / x) + (0.91893853320467 + (-0.5 * math.log(x))) else: tmp = (((x + -0.5) * math.log(x)) - (x + -0.91893853320467)) + (0.083333333333333 / x) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) tmp = 0.0 if ((t_0 <= -2.8e+205) || !(t_0 <= 3.5e+289)) tmp = Float64(Float64(Float64(t_0 + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(-0.5 * log(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) t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778); tmp = 0.0; if ((t_0 <= -2.8e+205) || ~((t_0 <= 3.5e+289))) tmp = ((t_0 + 0.083333333333333) / x) + (0.91893853320467 + (-0.5 * log(x))); else tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -2.8e+205], N[Not[LessEqual[t$95$0, 3.5e+289]], $MachinePrecision]], N[(N[(N[(t$95$0 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(-0.5 * N[Log[x], $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}
t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -2.8 \cdot 10^{+205} \lor \neg \left(t\_0 \leq 3.5 \cdot 10^{+289}\right):\\
\;\;\;\;\frac{t\_0 + 0.083333333333333}{x} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\
\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 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < -2.79999999999999991e205 or 3.50000000000000022e289 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 79.9%
Taylor expanded in x around 0 78.7%
+-commutative78.7%
Simplified78.7%
if -2.79999999999999991e205 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 3.50000000000000022e289Initial program 99.5%
associate-+l-99.5%
sub-neg99.5%
metadata-eval99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in z around 0 90.5%
Final simplification86.7%
(FPCore (x y z)
:precision binary64
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
double code(double x, double y, double z) {
return (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x))
end function
public static double code(double x, double y, double z) {
return (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x));
}
def code(x, y, z): return (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x))
function code(x, y, z) return Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))) end
function tmp = code(x, y, z) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x)); end
code[x_, y_, z_] := 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[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)
\end{array}
Initial program 93.1%
Final simplification93.1%
(FPCore (x y z)
:precision binary64
(+
(- (* (+ x -0.5) (log x)) (+ x -0.91893853320467))
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)))
double code(double x, double y, double z) {
return (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 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))) + (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 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)) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
}
def code(x, y, z): return (((x + -0.5) * math.log(x)) - (x + -0.91893853320467)) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x)
function code(x, y, z) return 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)) end
function tmp = code(x, y, z) tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x); end
code[x_, y_, z_] := 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]
\begin{array}{l}
\\
\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}
\end{array}
Initial program 93.1%
associate-+l-93.2%
sub-neg93.2%
metadata-eval93.2%
*-commutative93.2%
sub-neg93.2%
metadata-eval93.2%
Applied egg-rr93.2%
Final simplification93.2%
(FPCore (x y z)
:precision binary64
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
(+ 0.91893853320467 (* x (+ (log x) -1.0)))))
double code(double x, double y, double z) {
return (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (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 = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (0.91893853320467d0 + (x * (log(x) + (-1.0d0))))
end function
public static double code(double x, double y, double z) {
return (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (x * (Math.log(x) + -1.0)));
}
def code(x, y, z): return (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (x * (math.log(x) + -1.0)))
function code(x, y, z) return Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(x * Float64(log(x) + -1.0)))) end
function tmp = code(x, y, z) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (x * (log(x) + -1.0))); end
code[x_, y_, z_] := 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[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right)
\end{array}
Initial program 93.1%
Taylor expanded in x around inf 92.6%
sub-neg92.6%
mul-1-neg92.6%
log-rec92.6%
remove-double-neg92.6%
metadata-eval92.6%
Simplified92.6%
Final simplification92.6%
(FPCore (x y z) :precision binary64 (+ (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return (0.91893853320467 + ((log(x) * (x - 0.5)) - 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 + ((log(x) * (x - 0.5d0)) - x)) + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
def code(x, y, z): return (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x)
function code(x, y, z) return Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}
\end{array}
Initial program 93.1%
Taylor expanded in z around 0 65.0%
Final simplification65.0%
(FPCore (x y z) :precision binary64 (+ (- (* (+ x -0.5) (log x)) (+ x -0.91893853320467)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (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))) + (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)) + (0.083333333333333 / x);
}
def code(x, y, z): return (((x + -0.5) * math.log(x)) - (x + -0.91893853320467)) + (0.083333333333333 / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - Float64(x + -0.91893853320467)) + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (0.083333333333333 / x); end
code[x_, y_, z_] := 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}
\\
\left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right) + \frac{0.083333333333333}{x}
\end{array}
Initial program 93.1%
associate-+l-93.2%
sub-neg93.2%
metadata-eval93.2%
*-commutative93.2%
sub-neg93.2%
metadata-eval93.2%
Applied egg-rr93.2%
Taylor expanded in z around 0 65.0%
Final simplification65.0%
(FPCore (x y z) :precision binary64 (if (<= x 1.0) (+ 0.91893853320467 (/ 0.083333333333333 x)) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.0) {
tmp = 0.91893853320467 + (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.91893853320467d0 + (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.91893853320467 + (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.91893853320467 + (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.91893853320467 + 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.91893853320467 + (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.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;0.91893853320467 + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 1Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
metadata-eval99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 56.7%
Taylor expanded in x around inf 56.2%
mul-1-neg56.2%
distribute-rgt-neg-in56.2%
log-rec56.2%
remove-double-neg56.2%
Simplified56.2%
Taylor expanded in x around 0 56.1%
associate-*r/56.2%
metadata-eval56.2%
+-commutative56.2%
Simplified56.2%
if 1 < x Initial program 88.2%
associate-+l-88.2%
sub-neg88.2%
metadata-eval88.2%
*-commutative88.2%
sub-neg88.2%
metadata-eval88.2%
Applied egg-rr88.2%
Taylor expanded in z around 0 71.3%
Taylor expanded in x around inf 70.8%
sub-neg70.8%
mul-1-neg70.8%
log-rec70.8%
remove-double-neg70.8%
metadata-eval70.8%
+-commutative70.8%
Simplified70.8%
Final simplification64.5%
(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 93.1%
associate-+l-93.2%
sub-neg93.2%
metadata-eval93.2%
*-commutative93.2%
sub-neg93.2%
metadata-eval93.2%
Applied egg-rr93.2%
Taylor expanded in z around 0 65.0%
Taylor expanded in x around inf 64.5%
sub-neg64.5%
mul-1-neg64.5%
log-rec64.5%
remove-double-neg64.5%
metadata-eval64.5%
Simplified64.5%
Final simplification64.5%
(FPCore (x y z) :precision binary64 (+ 0.91893853320467 (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return 0.91893853320467 + (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 + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return 0.91893853320467 + (0.083333333333333 / x);
}
def code(x, y, z): return 0.91893853320467 + (0.083333333333333 / x)
function code(x, y, z) return Float64(0.91893853320467 + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = 0.91893853320467 + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.91893853320467 + \frac{0.083333333333333}{x}
\end{array}
Initial program 93.1%
associate-+l-93.2%
sub-neg93.2%
metadata-eval93.2%
*-commutative93.2%
sub-neg93.2%
metadata-eval93.2%
Applied egg-rr93.2%
Taylor expanded in z around 0 65.0%
Taylor expanded in x around inf 64.4%
mul-1-neg64.4%
distribute-rgt-neg-in64.4%
log-rec64.4%
remove-double-neg64.4%
Simplified64.4%
Taylor expanded in x around 0 26.6%
associate-*r/26.6%
metadata-eval26.6%
+-commutative26.6%
Simplified26.6%
Final simplification26.6%
(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 93.1%
associate-+l+93.1%
fma-neg93.3%
sub-neg93.3%
metadata-eval93.3%
fma-def93.3%
fma-neg93.3%
metadata-eval93.3%
Simplified93.3%
Taylor expanded in z around 0 65.1%
Taylor expanded in x around 0 25.9%
Final simplification25.9%
(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 2024026
(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)))