
(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 1.8e+193)
(+
(- 0.91893853320467 (fma (log x) (- 0.5 x) x))
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x))
(+ (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)) (* y (/ z (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.8e+193) {
tmp = (0.91893853320467 - fma(log(x), (0.5 - x), x)) + (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (y * (z / (x / z)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.8e+193) tmp = Float64(Float64(0.91893853320467 - fma(log(x), Float64(0.5 - x), x)) + Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(y * Float64(z / Float64(x / z)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.8e+193], N[(N[(0.91893853320467 - N[(N[Log[x], $MachinePrecision] * N[(0.5 - x), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 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[(y * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.8 \cdot 10^{+193}:\\
\;\;\;\;\left(0.91893853320467 - \mathsf{fma}\left(\log x, 0.5 - x, x\right)\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + y \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 1.8e193Initial program 97.3%
remove-double-neg97.3%
+-commutative97.3%
associate-+r-97.3%
remove-double-neg97.3%
sub-neg97.3%
associate--r+97.3%
*-commutative97.3%
distribute-rgt-neg-in97.3%
fma-def97.4%
neg-sub097.4%
associate-+l-97.4%
neg-sub097.4%
+-commutative97.4%
unsub-neg97.4%
remove-double-neg97.4%
Simplified97.4%
if 1.8e193 < x Initial program 87.0%
Taylor expanded in z around inf 87.0%
associate-/l*90.8%
+-commutative90.8%
associate-/r/90.8%
unpow290.8%
+-commutative90.8%
Simplified90.8%
Taylor expanded in y around inf 86.7%
unpow286.7%
associate-*r/90.5%
associate-/l*97.8%
Simplified97.8%
Final simplification97.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
(if (<= x 5e+176)
(+
t_0
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(+ t_0 (* y (/ z (/ x z)))))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 5e+176) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + (y * (z / (x / z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
if (x <= 5d+176) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
else
tmp = t_0 + (y * (z / (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 5e+176) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + (y * (z / (x / z)));
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x) tmp = 0 if x <= 5e+176: tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) else: tmp = t_0 + (y * (z / (x / z))) return tmp
function code(x, y, z) t_0 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) tmp = 0.0 if (x <= 5e+176) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)); else tmp = Float64(t_0 + Float64(y * Float64(z / Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x); tmp = 0.0; if (x <= 5e+176) tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = t_0 + (y * (z / (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 5e+176], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(y * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;x \leq 5 \cdot 10^{+176}:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + y \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 5e176Initial program 97.2%
if 5e176 < x Initial program 88.4%
Taylor expanded in z around inf 88.4%
associate-/l*91.8%
+-commutative91.8%
associate-/r/91.8%
unpow291.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in y around inf 88.2%
unpow288.2%
associate-*r/91.5%
associate-/l*98.0%
Simplified98.0%
Final simplification97.4%
(FPCore (x y z)
:precision binary64
(if (<= x 2.7e+176)
(+
(+ (* (log x) (+ x -0.5)) (- 0.91893853320467 x))
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(+ (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)) (* y (/ z (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.7e+176) {
tmp = ((log(x) * (x + -0.5)) + (0.91893853320467 - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (y * (z / (x / z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 2.7d+176) then
tmp = ((log(x) * (x + (-0.5d0))) + (0.91893853320467d0 - x)) + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (y * (z / (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 2.7e+176) {
tmp = ((Math.log(x) * (x + -0.5)) + (0.91893853320467 - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (y * (z / (x / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2.7e+176: tmp = ((math.log(x) * (x + -0.5)) + (0.91893853320467 - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (y * (z / (x / z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2.7e+176) tmp = Float64(Float64(Float64(log(x) * Float64(x + -0.5)) + Float64(0.91893853320467 - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(y * Float64(z / Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 2.7e+176) tmp = ((log(x) * (x + -0.5)) + (0.91893853320467 - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (y * (z / (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2.7e+176], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.7 \cdot 10^{+176}:\\
\;\;\;\;\left(\log x \cdot \left(x + -0.5\right) + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + y \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 2.6999999999999998e176Initial program 97.2%
associate-+l-97.3%
sub-neg97.3%
metadata-eval97.3%
Applied egg-rr97.3%
if 2.6999999999999998e176 < x Initial program 88.4%
Taylor expanded in z around inf 88.4%
associate-/l*91.8%
+-commutative91.8%
associate-/r/91.8%
unpow291.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in y around inf 88.2%
unpow288.2%
associate-*r/91.5%
associate-/l*98.0%
Simplified98.0%
Final simplification97.4%
(FPCore (x y z)
:precision binary64
(if (<= x 1e+192)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(* x (+ (log x) -1.0)))
(+ (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)) (* y (/ z (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1e+192) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (y * (z / (x / z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1d+192) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (x * (log(x) + (-1.0d0)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (y * (z / (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1e+192) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (Math.log(x) + -1.0));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (y * (z / (x / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1e+192: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (math.log(x) + -1.0)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (y * (z / (x / z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1e+192) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(x * Float64(log(x) + -1.0))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(y * Float64(z / Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1e+192) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (y * (z / (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1e+192], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{+192}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + x \cdot \left(\log x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + y \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 1.00000000000000004e192Initial program 97.3%
Taylor expanded in x around inf 95.1%
*-commutative48.7%
mul-1-neg48.7%
log-rec48.7%
remove-double-neg48.7%
sub-neg48.7%
metadata-eval48.7%
Simplified95.1%
if 1.00000000000000004e192 < x Initial program 87.0%
Taylor expanded in z around inf 87.0%
associate-/l*90.8%
+-commutative90.8%
associate-/r/90.8%
unpow290.8%
+-commutative90.8%
Simplified90.8%
Taylor expanded in y around inf 86.7%
unpow286.7%
associate-*r/90.5%
associate-/l*97.8%
Simplified97.8%
Final simplification95.7%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.2e-20) (not (<= z 1.15e-33)))
(+ (* x (+ (log x) -1.0)) (* (+ y 0.0007936500793651) (/ (* z z) x)))
(+
(+ (* (log x) (+ x -0.5)) (- 0.91893853320467 x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.2e-20) || !(z <= 1.15e-33)) {
tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * ((z * z) / x));
} else {
tmp = ((log(x) * (x + -0.5)) + (0.91893853320467 - x)) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.2d-20)) .or. (.not. (z <= 1.15d-33))) then
tmp = (x * (log(x) + (-1.0d0))) + ((y + 0.0007936500793651d0) * ((z * z) / x))
else
tmp = ((log(x) * (x + (-0.5d0))) + (0.91893853320467d0 - x)) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.2e-20) || !(z <= 1.15e-33)) {
tmp = (x * (Math.log(x) + -1.0)) + ((y + 0.0007936500793651) * ((z * z) / x));
} else {
tmp = ((Math.log(x) * (x + -0.5)) + (0.91893853320467 - x)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.2e-20) or not (z <= 1.15e-33): tmp = (x * (math.log(x) + -1.0)) + ((y + 0.0007936500793651) * ((z * z) / x)) else: tmp = ((math.log(x) * (x + -0.5)) + (0.91893853320467 - x)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.2e-20) || !(z <= 1.15e-33)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) / x))); else tmp = Float64(Float64(Float64(log(x) * Float64(x + -0.5)) + Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.2e-20) || ~((z <= 1.15e-33))) tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * ((z * z) / x)); else tmp = ((log(x) * (x + -0.5)) + (0.91893853320467 - x)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.2e-20], N[Not[LessEqual[z, 1.15e-33]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-20} \lor \neg \left(z \leq 1.15 \cdot 10^{-33}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\log x \cdot \left(x + -0.5\right) + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.19999999999999996e-20 or 1.14999999999999993e-33 < z Initial program 91.9%
Taylor expanded in z around inf 90.6%
associate-/l*92.1%
+-commutative92.1%
associate-/r/92.1%
unpow292.1%
+-commutative92.1%
Simplified92.1%
Taylor expanded in x around inf 92.1%
*-commutative24.0%
mul-1-neg24.0%
log-rec24.0%
remove-double-neg24.0%
sub-neg24.0%
metadata-eval24.0%
Simplified92.1%
if -1.19999999999999996e-20 < z < 1.14999999999999993e-33Initial program 99.3%
associate-+l-99.4%
sub-neg99.4%
metadata-eval99.4%
Applied egg-rr99.4%
Taylor expanded in z around 0 96.8%
Final simplification94.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= z -3.2e-19)
(+ t_0 (* (+ y 0.0007936500793651) (/ (* z z) x)))
(if (<= z 1.3e-37)
(+
(+ (* (log x) (+ x -0.5)) (- 0.91893853320467 x))
(/ 0.083333333333333 x))
(+ t_0 (/ (* z z) (/ x (+ y 0.0007936500793651))))))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (z <= -3.2e-19) {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x));
} else if (z <= 1.3e-37) {
tmp = ((log(x) * (x + -0.5)) + (0.91893853320467 - x)) + (0.083333333333333 / x);
} else {
tmp = t_0 + ((z * z) / (x / (y + 0.0007936500793651)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (log(x) + (-1.0d0))
if (z <= (-3.2d-19)) then
tmp = t_0 + ((y + 0.0007936500793651d0) * ((z * z) / x))
else if (z <= 1.3d-37) then
tmp = ((log(x) * (x + (-0.5d0))) + (0.91893853320467d0 - x)) + (0.083333333333333d0 / x)
else
tmp = t_0 + ((z * z) / (x / (y + 0.0007936500793651d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if (z <= -3.2e-19) {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x));
} else if (z <= 1.3e-37) {
tmp = ((Math.log(x) * (x + -0.5)) + (0.91893853320467 - x)) + (0.083333333333333 / x);
} else {
tmp = t_0 + ((z * z) / (x / (y + 0.0007936500793651)));
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if z <= -3.2e-19: tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x)) elif z <= 1.3e-37: tmp = ((math.log(x) * (x + -0.5)) + (0.91893853320467 - x)) + (0.083333333333333 / x) else: tmp = t_0 + ((z * z) / (x / (y + 0.0007936500793651))) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (z <= -3.2e-19) tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) / x))); elseif (z <= 1.3e-37) tmp = Float64(Float64(Float64(log(x) * Float64(x + -0.5)) + Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)); else tmp = Float64(t_0 + Float64(Float64(z * z) / Float64(x / Float64(y + 0.0007936500793651)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (z <= -3.2e-19) tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x)); elseif (z <= 1.3e-37) tmp = ((log(x) * (x + -0.5)) + (0.91893853320467 - x)) + (0.083333333333333 / x); else tmp = t_0 + ((z * z) / (x / (y + 0.0007936500793651))); 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[z, -3.2e-19], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e-37], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(z * z), $MachinePrecision] / N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{-19}:\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-37}:\\
\;\;\;\;\left(\log x \cdot \left(x + -0.5\right) + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\
\end{array}
\end{array}
if z < -3.19999999999999982e-19Initial program 91.0%
Taylor expanded in z around inf 89.7%
associate-/l*92.4%
+-commutative92.4%
associate-/r/92.4%
unpow292.4%
+-commutative92.4%
Simplified92.4%
Taylor expanded in x around inf 92.4%
*-commutative25.0%
mul-1-neg25.0%
log-rec25.0%
remove-double-neg25.0%
sub-neg25.0%
metadata-eval25.0%
Simplified92.4%
if -3.19999999999999982e-19 < z < 1.2999999999999999e-37Initial program 99.3%
associate-+l-99.4%
sub-neg99.4%
metadata-eval99.4%
Applied egg-rr99.4%
Taylor expanded in z around 0 96.8%
if 1.2999999999999999e-37 < z Initial program 93.0%
associate-+l-93.0%
sub-neg93.0%
metadata-eval93.0%
Applied egg-rr93.0%
Taylor expanded in z around inf 91.7%
associate-/l*91.7%
unpow291.7%
Simplified91.7%
Taylor expanded in x around inf 91.8%
*-commutative76.7%
sub-neg76.7%
mul-1-neg76.7%
log-rec76.7%
remove-double-neg76.7%
metadata-eval76.7%
Simplified91.8%
Final simplification94.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.9e-14) (not (<= z 7e-36))) (+ (* x (+ (log x) -1.0)) (/ y (/ x (* z z)))) (+ (/ 0.083333333333333 x) (+ (* x (log x)) (- 0.91893853320467 x)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.9e-14) || !(z <= 7e-36)) {
tmp = (x * (log(x) + -1.0)) + (y / (x / (z * z)));
} else {
tmp = (0.083333333333333 / x) + ((x * log(x)) + (0.91893853320467 - x));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.9d-14)) .or. (.not. (z <= 7d-36))) then
tmp = (x * (log(x) + (-1.0d0))) + (y / (x / (z * z)))
else
tmp = (0.083333333333333d0 / x) + ((x * log(x)) + (0.91893853320467d0 - x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.9e-14) || !(z <= 7e-36)) {
tmp = (x * (Math.log(x) + -1.0)) + (y / (x / (z * z)));
} else {
tmp = (0.083333333333333 / x) + ((x * Math.log(x)) + (0.91893853320467 - x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.9e-14) or not (z <= 7e-36): tmp = (x * (math.log(x) + -1.0)) + (y / (x / (z * z))) else: tmp = (0.083333333333333 / x) + ((x * math.log(x)) + (0.91893853320467 - x)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.9e-14) || !(z <= 7e-36)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(y / Float64(x / Float64(z * z)))); else tmp = Float64(Float64(0.083333333333333 / x) + Float64(Float64(x * log(x)) + Float64(0.91893853320467 - x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.9e-14) || ~((z <= 7e-36))) tmp = (x * (log(x) + -1.0)) + (y / (x / (z * z))); else tmp = (0.083333333333333 / x) + ((x * log(x)) + (0.91893853320467 - x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.9e-14], N[Not[LessEqual[z, 7e-36]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-14} \lor \neg \left(z \leq 7 \cdot 10^{-36}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{y}{\frac{x}{z \cdot z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(x \cdot \log x + \left(0.91893853320467 - x\right)\right)\\
\end{array}
\end{array}
if z < -1.9000000000000001e-14 or 6.9999999999999999e-36 < z Initial program 91.7%
associate-+l-91.7%
sub-neg91.7%
metadata-eval91.7%
Applied egg-rr91.7%
Taylor expanded in y around inf 69.0%
associate-/l*71.8%
unpow271.8%
Simplified71.8%
Taylor expanded in x around inf 71.9%
*-commutative71.9%
sub-neg71.9%
mul-1-neg71.9%
log-rec71.9%
remove-double-neg71.9%
metadata-eval71.9%
Simplified71.9%
if -1.9000000000000001e-14 < z < 6.9999999999999999e-36Initial program 99.3%
associate-+l-99.4%
sub-neg99.4%
metadata-eval99.4%
Applied egg-rr99.4%
Taylor expanded in z around 0 96.0%
Taylor expanded in x around inf 92.1%
mul-1-neg92.1%
distribute-lft-neg-in92.1%
log-rec92.1%
remove-double-neg92.1%
*-commutative92.1%
Simplified92.1%
Final simplification81.0%
(FPCore (x y z)
:precision binary64
(if (or (<= z -2.7e-14) (not (<= z 2.3e-36)))
(+ (* x (+ (log x) -1.0)) (/ y (/ x (* z z))))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.7e-14) || !(z <= 2.3e-36)) {
tmp = (x * (log(x) + -1.0)) + (y / (x / (z * z)));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-2.7d-14)) .or. (.not. (z <= 2.3d-36))) then
tmp = (x * (log(x) + (-1.0d0))) + (y / (x / (z * z)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.7e-14) || !(z <= 2.3e-36)) {
tmp = (x * (Math.log(x) + -1.0)) + (y / (x / (z * z)));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.7e-14) or not (z <= 2.3e-36): tmp = (x * (math.log(x) + -1.0)) + (y / (x / (z * z))) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.7e-14) || !(z <= 2.3e-36)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(y / Float64(x / Float64(z * z)))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.7e-14) || ~((z <= 2.3e-36))) tmp = (x * (log(x) + -1.0)) + (y / (x / (z * z))); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.7e-14], N[Not[LessEqual[z, 2.3e-36]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-14} \lor \neg \left(z \leq 2.3 \cdot 10^{-36}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{y}{\frac{x}{z \cdot z}}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -2.6999999999999999e-14 or 2.29999999999999996e-36 < z Initial program 91.7%
associate-+l-91.7%
sub-neg91.7%
metadata-eval91.7%
Applied egg-rr91.7%
Taylor expanded in y around inf 69.0%
associate-/l*71.8%
unpow271.8%
Simplified71.8%
Taylor expanded in x around inf 71.9%
*-commutative71.9%
sub-neg71.9%
mul-1-neg71.9%
log-rec71.9%
remove-double-neg71.9%
metadata-eval71.9%
Simplified71.9%
if -2.6999999999999999e-14 < z < 2.29999999999999996e-36Initial program 99.3%
Taylor expanded in z around 0 96.0%
Final simplification82.8%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.95e-14) (not (<= z 1.05e-35)))
(+ (* x (+ (log x) -1.0)) (/ y (/ x (* z z))))
(+
(+ (* (log x) (+ x -0.5)) (- 0.91893853320467 x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.95e-14) || !(z <= 1.05e-35)) {
tmp = (x * (log(x) + -1.0)) + (y / (x / (z * z)));
} else {
tmp = ((log(x) * (x + -0.5)) + (0.91893853320467 - x)) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.95d-14)) .or. (.not. (z <= 1.05d-35))) then
tmp = (x * (log(x) + (-1.0d0))) + (y / (x / (z * z)))
else
tmp = ((log(x) * (x + (-0.5d0))) + (0.91893853320467d0 - x)) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.95e-14) || !(z <= 1.05e-35)) {
tmp = (x * (Math.log(x) + -1.0)) + (y / (x / (z * z)));
} else {
tmp = ((Math.log(x) * (x + -0.5)) + (0.91893853320467 - x)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.95e-14) or not (z <= 1.05e-35): tmp = (x * (math.log(x) + -1.0)) + (y / (x / (z * z))) else: tmp = ((math.log(x) * (x + -0.5)) + (0.91893853320467 - x)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.95e-14) || !(z <= 1.05e-35)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(y / Float64(x / Float64(z * z)))); else tmp = Float64(Float64(Float64(log(x) * Float64(x + -0.5)) + Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.95e-14) || ~((z <= 1.05e-35))) tmp = (x * (log(x) + -1.0)) + (y / (x / (z * z))); else tmp = ((log(x) * (x + -0.5)) + (0.91893853320467 - x)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.95e-14], N[Not[LessEqual[z, 1.05e-35]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{-14} \lor \neg \left(z \leq 1.05 \cdot 10^{-35}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{y}{\frac{x}{z \cdot z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\log x \cdot \left(x + -0.5\right) + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.9499999999999999e-14 or 1.05e-35 < z Initial program 91.7%
associate-+l-91.7%
sub-neg91.7%
metadata-eval91.7%
Applied egg-rr91.7%
Taylor expanded in y around inf 69.0%
associate-/l*71.8%
unpow271.8%
Simplified71.8%
Taylor expanded in x around inf 71.9%
*-commutative71.9%
sub-neg71.9%
mul-1-neg71.9%
log-rec71.9%
remove-double-neg71.9%
metadata-eval71.9%
Simplified71.9%
if -1.9499999999999999e-14 < z < 1.05e-35Initial program 99.3%
associate-+l-99.4%
sub-neg99.4%
metadata-eval99.4%
Applied egg-rr99.4%
Taylor expanded in z around 0 96.0%
Final simplification82.8%
(FPCore (x y z) :precision binary64 (+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return (x * (log(x) + -1.0)) + (0.083333333333333 / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
}
def code(x, y, z): return (x * (math.log(x) + -1.0)) + (0.083333333333333 / x)
function code(x, y, z) return Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}
\end{array}
Initial program 95.2%
Taylor expanded in z around 0 56.1%
Taylor expanded in x around inf 54.4%
*-commutative54.4%
mul-1-neg54.4%
log-rec54.4%
remove-double-neg54.4%
sub-neg54.4%
metadata-eval54.4%
Simplified54.4%
Final simplification54.4%
(FPCore (x y z) :precision binary64 (if (<= x 1.75) (+ (/ 0.083333333333333 x) (- 0.91893853320467 x)) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.75) {
tmp = (0.083333333333333 / x) + (0.91893853320467 - 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.75d0) then
tmp = (0.083333333333333d0 / x) + (0.91893853320467d0 - 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.75) {
tmp = (0.083333333333333 / x) + (0.91893853320467 - x);
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.75: tmp = (0.083333333333333 / x) + (0.91893853320467 - x) else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.75) tmp = Float64(Float64(0.083333333333333 / x) + Float64(0.91893853320467 - 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.75) tmp = (0.083333333333333 / x) + (0.91893853320467 - x); else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.75], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(0.91893853320467 - 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.75:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 - x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 1.75Initial program 99.7%
Taylor expanded in z around 0 45.2%
add-cube-cbrt45.2%
pow345.2%
sub-neg45.2%
metadata-eval45.2%
Applied egg-rr45.2%
Taylor expanded in x around inf 44.0%
neg-mul-144.0%
unsub-neg44.0%
Simplified44.0%
if 1.75 < x Initial program 90.4%
associate-+l-90.4%
sub-neg90.4%
metadata-eval90.4%
Applied egg-rr90.4%
Taylor expanded in z around 0 67.7%
Taylor expanded in x around inf 65.5%
*-commutative65.5%
sub-neg65.5%
mul-1-neg65.5%
log-rec65.5%
remove-double-neg65.5%
metadata-eval65.5%
+-commutative65.5%
Simplified65.5%
Final simplification54.4%
(FPCore (x y z) :precision binary64 (+ (/ 0.083333333333333 x) (- 0.91893853320467 x)))
double code(double x, double y, double z) {
return (0.083333333333333 / x) + (0.91893853320467 - 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) + (0.91893853320467d0 - x)
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 / x) + (0.91893853320467 - x);
}
def code(x, y, z): return (0.083333333333333 / x) + (0.91893853320467 - x)
function code(x, y, z) return Float64(Float64(0.083333333333333 / x) + Float64(0.91893853320467 - x)) end
function tmp = code(x, y, z) tmp = (0.083333333333333 / x) + (0.91893853320467 - x); end
code[x_, y_, z_] := N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x} + \left(0.91893853320467 - x\right)
\end{array}
Initial program 95.2%
Taylor expanded in z around 0 56.1%
add-cube-cbrt55.7%
pow355.7%
sub-neg55.7%
metadata-eval55.7%
Applied egg-rr55.7%
Taylor expanded in x around inf 23.2%
neg-mul-123.2%
unsub-neg23.2%
Simplified23.2%
Final simplification23.2%
(FPCore (x y z) :precision binary64 (- (/ 0.083333333333333 x) x))
double code(double x, double y, double z) {
return (0.083333333333333 / x) - 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) - x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 / x) - x;
}
def code(x, y, z): return (0.083333333333333 / x) - x
function code(x, y, z) return Float64(Float64(0.083333333333333 / x) - x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 / x) - x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 / x), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x} - x
\end{array}
Initial program 95.2%
Taylor expanded in z around 0 56.1%
add-cube-cbrt55.7%
pow355.7%
sub-neg55.7%
metadata-eval55.7%
Applied egg-rr55.7%
Taylor expanded in x around inf 23.2%
neg-mul-123.2%
Simplified23.2%
Taylor expanded in x around 0 23.2%
neg-mul-123.2%
associate-*r/23.2%
metadata-eval23.2%
+-commutative23.2%
unsub-neg23.2%
Simplified23.2%
Final simplification23.2%
(FPCore (x y z) :precision binary64 (- x))
double code(double x, double y, double z) {
return -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
end function
public static double code(double x, double y, double z) {
return -x;
}
def code(x, y, z): return -x
function code(x, y, z) return Float64(-x) end
function tmp = code(x, y, z) tmp = -x; end
code[x_, y_, z_] := (-x)
\begin{array}{l}
\\
-x
\end{array}
Initial program 95.2%
Taylor expanded in z around 0 56.1%
add-cube-cbrt55.7%
pow355.7%
sub-neg55.7%
metadata-eval55.7%
Applied egg-rr55.7%
Taylor expanded in x around inf 23.2%
neg-mul-123.2%
Simplified23.2%
Taylor expanded in x around inf 1.3%
neg-mul-11.3%
Simplified1.3%
Final simplification1.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 2023257
(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)))