
(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
(if (<= x 1e+15)
(+
(- (* (log x) (+ x -0.5)) (+ x -0.91893853320467))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(+
(+
(* 0.083333333333333 (/ 1.0 x))
(* z (* (+ 0.0007936500793651 y) (/ z x))))
(* x (+ (log x) -1.0)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1e+15) {
tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (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 <= 1d+15) then
tmp = ((log(x) * (x + (-0.5d0))) - (x + (-0.91893853320467d0))) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = ((0.083333333333333d0 * (1.0d0 / x)) + (z * ((0.0007936500793651d0 + y) * (z / x)))) + (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 <= 1e+15) {
tmp = ((Math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (x * (Math.log(x) + -1.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1e+15: tmp = ((math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (x * (math.log(x) + -1.0)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1e+15) tmp = Float64(Float64(Float64(log(x) * Float64(x + -0.5)) - Float64(x + -0.91893853320467)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(z * Float64(Float64(0.0007936500793651 + y) * Float64(z / x)))) + Float64(x * Float64(log(x) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1e+15) tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (x * (log(x) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1e+15], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{+15}:\\
\;\;\;\;\left(\log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\right) + x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 1e15Initial 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%
if 1e15 < x Initial program 85.4%
Taylor expanded in z around 0 99.5%
Taylor expanded in z around inf 88.6%
unpow288.6%
associate-*l*99.5%
associate-*r/99.5%
metadata-eval99.5%
distribute-rgt-out99.5%
associate-*l/99.5%
associate-*r/99.5%
associate-*l/97.2%
associate-/l*99.5%
distribute-rgt-out99.5%
Simplified99.5%
Taylor expanded in x around inf 99.6%
sub-neg99.6%
mul-1-neg99.6%
log-rec99.6%
remove-double-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= x 4e+15)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(+
(+
(* 0.083333333333333 (/ 1.0 x))
(* z (* (+ 0.0007936500793651 y) (/ z x))))
(* x (+ (log x) -1.0)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4e+15) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (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 <= 4d+15) then
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = ((0.083333333333333d0 * (1.0d0 / x)) + (z * ((0.0007936500793651d0 + y) * (z / x)))) + (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 <= 4e+15) {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (x * (Math.log(x) + -1.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 4e+15: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (x * (math.log(x) + -1.0)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 4e+15) tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(z * Float64(Float64(0.0007936500793651 + y) * Float64(z / x)))) + Float64(x * Float64(log(x) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 4e+15) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (x * (log(x) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 4e+15], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\right) + x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 4e15Initial program 99.7%
if 4e15 < x Initial program 85.4%
Taylor expanded in z around 0 99.5%
Taylor expanded in z around inf 88.6%
unpow288.6%
associate-*l*99.5%
associate-*r/99.5%
metadata-eval99.5%
distribute-rgt-out99.5%
associate-*l/99.5%
associate-*r/99.5%
associate-*l/97.2%
associate-/l*99.5%
distribute-rgt-out99.5%
Simplified99.5%
Taylor expanded in x around inf 99.6%
sub-neg99.6%
mul-1-neg99.6%
log-rec99.6%
remove-double-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)))
(if (or (<= z -5.8e-57) (not (<= z 1e-53)))
(+ t_0 (* y (* z (/ z x))))
(+ t_0 (/ 1.0 (* x 12.000000000000048))))))
double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if ((z <= -5.8e-57) || !(z <= 1e-53)) {
tmp = t_0 + (y * (z * (z / x)));
} else {
tmp = t_0 + (1.0 / (x * 12.000000000000048));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0
if ((z <= (-5.8d-57)) .or. (.not. (z <= 1d-53))) then
tmp = t_0 + (y * (z * (z / x)))
else
tmp = t_0 + (1.0d0 / (x * 12.000000000000048d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * Math.log(x)) - x) + 0.91893853320467;
double tmp;
if ((z <= -5.8e-57) || !(z <= 1e-53)) {
tmp = t_0 + (y * (z * (z / x)));
} else {
tmp = t_0 + (1.0 / (x * 12.000000000000048));
}
return tmp;
}
def code(x, y, z): t_0 = (((x - 0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if (z <= -5.8e-57) or not (z <= 1e-53): tmp = t_0 + (y * (z * (z / x))) else: tmp = t_0 + (1.0 / (x * 12.000000000000048)) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if ((z <= -5.8e-57) || !(z <= 1e-53)) tmp = Float64(t_0 + Float64(y * Float64(z * Float64(z / x)))); else tmp = Float64(t_0 + Float64(1.0 / Float64(x * 12.000000000000048))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467; tmp = 0.0; if ((z <= -5.8e-57) || ~((z <= 1e-53))) tmp = t_0 + (y * (z * (z / x))); else tmp = t_0 + (1.0 / (x * 12.000000000000048)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[Or[LessEqual[z, -5.8e-57], N[Not[LessEqual[z, 1e-53]], $MachinePrecision]], N[(t$95$0 + N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{-57} \lor \neg \left(z \leq 10^{-53}\right):\\
\;\;\;\;t\_0 + y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{x \cdot 12.000000000000048}\\
\end{array}
\end{array}
if z < -5.8000000000000005e-57 or 1.00000000000000003e-53 < z Initial program 89.9%
Taylor expanded in y around inf 68.1%
associate-/l*72.0%
Simplified72.0%
unpow272.0%
associate-*r/75.9%
*-commutative75.9%
Applied egg-rr75.9%
if -5.8000000000000005e-57 < z < 1.00000000000000003e-53Initial program 99.4%
Taylor expanded in z around 0 98.2%
div-inv98.3%
*-commutative98.3%
Applied egg-rr98.3%
associate-/r/98.1%
div-inv98.3%
metadata-eval98.3%
Applied egg-rr98.3%
Final simplification83.6%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.3e-56) (not (<= z 1.7e-53)))
(+ (* x (+ (log x) -1.0)) (* y (* z (/ z x))))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 1.0 (* x 12.000000000000048)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.3e-56) || !(z <= 1.7e-53)) {
tmp = (x * (log(x) + -1.0)) + (y * (z * (z / x)));
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (1.0 / (x * 12.000000000000048));
}
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.3d-56)) .or. (.not. (z <= 1.7d-53))) then
tmp = (x * (log(x) + (-1.0d0))) + (y * (z * (z / x)))
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (1.0d0 / (x * 12.000000000000048d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.3e-56) || !(z <= 1.7e-53)) {
tmp = (x * (Math.log(x) + -1.0)) + (y * (z * (z / x)));
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (1.0 / (x * 12.000000000000048));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.3e-56) or not (z <= 1.7e-53): tmp = (x * (math.log(x) + -1.0)) + (y * (z * (z / x))) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (1.0 / (x * 12.000000000000048)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.3e-56) || !(z <= 1.7e-53)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(y * Float64(z * Float64(z / x)))); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(1.0 / Float64(x * 12.000000000000048))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.3e-56) || ~((z <= 1.7e-53))) tmp = (x * (log(x) + -1.0)) + (y * (z * (z / x))); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (1.0 / (x * 12.000000000000048)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.3e-56], N[Not[LessEqual[z, 1.7e-53]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{-56} \lor \neg \left(z \leq 1.7 \cdot 10^{-53}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{1}{x \cdot 12.000000000000048}\\
\end{array}
\end{array}
if z < -1.29999999999999998e-56 or 1.7e-53 < z Initial program 89.9%
Taylor expanded in y around inf 68.1%
associate-/l*72.0%
Simplified72.0%
unpow272.0%
associate-*r/75.9%
*-commutative75.9%
Applied egg-rr75.9%
Taylor expanded in x around inf 75.8%
sub-neg99.0%
mul-1-neg99.0%
log-rec99.0%
remove-double-neg99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified75.8%
if -1.29999999999999998e-56 < z < 1.7e-53Initial program 99.4%
Taylor expanded in z around 0 98.2%
div-inv98.3%
*-commutative98.3%
Applied egg-rr98.3%
associate-/r/98.1%
div-inv98.3%
metadata-eval98.3%
Applied egg-rr98.3%
Final simplification83.6%
(FPCore (x y z) :precision binary64 (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (+ (* z (/ (+ 0.0007936500793651 y) (/ x z))) (* 0.083333333333333 (/ 1.0 x)))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * ((0.0007936500793651 + y) / (x / z))) + (0.083333333333333 * (1.0 / 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 * ((0.0007936500793651d0 + y) / (x / z))) + (0.083333333333333d0 * (1.0d0 / x)))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((z * ((0.0007936500793651 + y) / (x / z))) + (0.083333333333333 * (1.0 / x)));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((z * ((0.0007936500793651 + y) / (x / z))) + (0.083333333333333 * (1.0 / x)))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(z * Float64(Float64(0.0007936500793651 + y) / Float64(x / z))) + Float64(0.083333333333333 * Float64(1.0 / x)))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * ((0.0007936500793651 + y) / (x / z))) + (0.083333333333333 * (1.0 / 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[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \frac{0.0007936500793651 + y}{\frac{x}{z}} + 0.083333333333333 \cdot \frac{1}{x}\right)
\end{array}
Initial program 93.2%
Taylor expanded in z around 0 94.4%
Taylor expanded in z around inf 88.8%
unpow288.8%
associate-*l*93.9%
associate-*r/93.9%
metadata-eval93.9%
distribute-rgt-out88.4%
associate-*l/88.4%
associate-*r/88.4%
associate-*l/91.8%
associate-/l*90.2%
distribute-rgt-out98.4%
Simplified98.4%
Taylor expanded in z around 0 97.3%
*-commutative97.3%
associate-*l/93.9%
associate-/r/98.4%
Simplified98.4%
(FPCore (x y z) :precision binary64 (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (+ (* 0.083333333333333 (/ 1.0 x)) (* z (* (+ 0.0007936500793651 y) (/ z x))))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / 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 * (1.0d0 / x)) + (z * ((0.0007936500793651d0 + y) * (z / 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 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x))));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x))))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(z * Float64(Float64(0.0007936500793651 + y) * Float64(z / x))))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / 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[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\right)
\end{array}
Initial program 93.2%
Taylor expanded in z around 0 94.4%
Taylor expanded in z around inf 88.8%
unpow288.8%
associate-*l*93.9%
associate-*r/93.9%
metadata-eval93.9%
distribute-rgt-out88.4%
associate-*l/88.4%
associate-*r/88.4%
associate-*l/91.8%
associate-/l*90.2%
distribute-rgt-out98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= x 1.65e+93)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
t_0)
(+ t_0 (* y (* z (/ z x)))))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (x <= 1.65e+93) {
tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + t_0;
} else {
tmp = t_0 + (y * (z * (z / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (log(x) + (-1.0d0))
if (x <= 1.65d+93) then
tmp = ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x) + t_0
else
tmp = t_0 + (y * (z * (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if (x <= 1.65e+93) {
tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + t_0;
} else {
tmp = t_0 + (y * (z * (z / x)));
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if x <= 1.65e+93: tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + t_0 else: tmp = t_0 + (y * (z * (z / x))) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (x <= 1.65e+93) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x) + t_0); else tmp = Float64(t_0 + Float64(y * Float64(z * Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (x <= 1.65e+93) tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + t_0; else tmp = t_0 + (y * (z * (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.65e+93], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + t$95$0), $MachinePrecision], N[(t$95$0 + N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;x \leq 1.65 \cdot 10^{+93}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 + y \cdot \left(z \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if x < 1.65000000000000004e93Initial program 98.0%
Taylor expanded in x around inf 96.5%
sub-neg96.2%
mul-1-neg96.2%
log-rec96.2%
remove-double-neg96.2%
metadata-eval96.2%
+-commutative96.2%
Simplified96.5%
if 1.65000000000000004e93 < x Initial program 84.2%
Taylor expanded in y around inf 82.3%
associate-/l*85.4%
Simplified85.4%
unpow285.4%
associate-*r/92.0%
*-commutative92.0%
Applied egg-rr92.0%
Taylor expanded in x around inf 92.1%
sub-neg99.7%
mul-1-neg99.7%
log-rec99.7%
remove-double-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified92.1%
Final simplification95.0%
(FPCore (x y z)
:precision binary64
(if (or (<= z -7.2e-57) (not (<= z 1.2e-52)))
(+ (* x (+ (log x) -1.0)) (* y (* z (/ z x))))
(+
(- (* (log x) (+ x -0.5)) (+ x -0.91893853320467))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -7.2e-57) || !(z <= 1.2e-52)) {
tmp = (x * (log(x) + -1.0)) + (y * (z * (z / x)));
} else {
tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-7.2d-57)) .or. (.not. (z <= 1.2d-52))) then
tmp = (x * (log(x) + (-1.0d0))) + (y * (z * (z / x)))
else
tmp = ((log(x) * (x + (-0.5d0))) - (x + (-0.91893853320467d0))) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -7.2e-57) || !(z <= 1.2e-52)) {
tmp = (x * (Math.log(x) + -1.0)) + (y * (z * (z / x)));
} else {
tmp = ((Math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -7.2e-57) or not (z <= 1.2e-52): tmp = (x * (math.log(x) + -1.0)) + (y * (z * (z / x))) else: tmp = ((math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -7.2e-57) || !(z <= 1.2e-52)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(y * Float64(z * Float64(z / x)))); else tmp = Float64(Float64(Float64(log(x) * Float64(x + -0.5)) - Float64(x + -0.91893853320467)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -7.2e-57) || ~((z <= 1.2e-52))) tmp = (x * (log(x) + -1.0)) + (y * (z * (z / x))); else tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -7.2e-57], N[Not[LessEqual[z, 1.2e-52]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-57} \lor \neg \left(z \leq 1.2 \cdot 10^{-52}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -7.2000000000000005e-57 or 1.2000000000000001e-52 < z Initial program 89.9%
Taylor expanded in y around inf 68.1%
associate-/l*72.0%
Simplified72.0%
unpow272.0%
associate-*r/75.9%
*-commutative75.9%
Applied egg-rr75.9%
Taylor expanded in x around inf 75.8%
sub-neg99.0%
mul-1-neg99.0%
log-rec99.0%
remove-double-neg99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified75.8%
if -7.2000000000000005e-57 < z < 1.2000000000000001e-52Initial program 99.4%
Taylor expanded in z around 0 98.2%
associate-+l-99.4%
sub-neg99.4%
metadata-eval99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
Applied egg-rr98.3%
Final simplification83.6%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.6e-56) (not (<= z 1.02e-51)))
(+ (* x (+ (log x) -1.0)) (* y (* z (/ z x))))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.6e-56) || !(z <= 1.02e-51)) {
tmp = (x * (log(x) + -1.0)) + (y * (z * (z / x)));
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.6d-56)) .or. (.not. (z <= 1.02d-51))) then
tmp = (x * (log(x) + (-1.0d0))) + (y * (z * (z / x)))
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.6e-56) || !(z <= 1.02e-51)) {
tmp = (x * (Math.log(x) + -1.0)) + (y * (z * (z / x)));
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.6e-56) or not (z <= 1.02e-51): tmp = (x * (math.log(x) + -1.0)) + (y * (z * (z / x))) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.6e-56) || !(z <= 1.02e-51)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(y * Float64(z * Float64(z / x)))); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.6e-56) || ~((z <= 1.02e-51))) tmp = (x * (log(x) + -1.0)) + (y * (z * (z / x))); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.6e-56], N[Not[LessEqual[z, 1.02e-51]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-56} \lor \neg \left(z \leq 1.02 \cdot 10^{-51}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.59999999999999993e-56 or 1.01999999999999998e-51 < z Initial program 89.9%
Taylor expanded in y around inf 68.1%
associate-/l*72.0%
Simplified72.0%
unpow272.0%
associate-*r/75.9%
*-commutative75.9%
Applied egg-rr75.9%
Taylor expanded in x around inf 75.8%
sub-neg99.0%
mul-1-neg99.0%
log-rec99.0%
remove-double-neg99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified75.8%
if -1.59999999999999993e-56 < z < 1.01999999999999998e-51Initial program 99.4%
Taylor expanded in z around 0 98.2%
Final simplification83.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= z -6.2e-58) (not (<= z 3e-52)))
(+ t_0 (* y (* z (/ z x))))
(+ t_0 (/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if ((z <= -6.2e-58) || !(z <= 3e-52)) {
tmp = t_0 + (y * (z * (z / x)));
} else {
tmp = t_0 + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (log(x) + (-1.0d0))
if ((z <= (-6.2d-58)) .or. (.not. (z <= 3d-52))) then
tmp = t_0 + (y * (z * (z / x)))
else
tmp = t_0 + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if ((z <= -6.2e-58) || !(z <= 3e-52)) {
tmp = t_0 + (y * (z * (z / x)));
} else {
tmp = t_0 + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if (z <= -6.2e-58) or not (z <= 3e-52): tmp = t_0 + (y * (z * (z / x))) else: tmp = t_0 + (0.083333333333333 / x) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if ((z <= -6.2e-58) || !(z <= 3e-52)) tmp = Float64(t_0 + Float64(y * Float64(z * Float64(z / x)))); else tmp = Float64(t_0 + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if ((z <= -6.2e-58) || ~((z <= 3e-52))) tmp = t_0 + (y * (z * (z / x))); else tmp = t_0 + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -6.2e-58], N[Not[LessEqual[z, 3e-52]], $MachinePrecision]], N[(t$95$0 + N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{-58} \lor \neg \left(z \leq 3 \cdot 10^{-52}\right):\\
\;\;\;\;t\_0 + y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -6.1999999999999998e-58 or 3e-52 < z Initial program 89.9%
Taylor expanded in y around inf 68.1%
associate-/l*72.0%
Simplified72.0%
unpow272.0%
associate-*r/75.9%
*-commutative75.9%
Applied egg-rr75.9%
Taylor expanded in x around inf 75.8%
sub-neg99.0%
mul-1-neg99.0%
log-rec99.0%
remove-double-neg99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified75.8%
if -6.1999999999999998e-58 < z < 3e-52Initial program 99.4%
Taylor expanded in z around 0 98.2%
Taylor expanded in x around inf 95.5%
sub-neg94.4%
mul-1-neg94.4%
log-rec94.4%
remove-double-neg94.4%
metadata-eval94.4%
+-commutative94.4%
Simplified95.5%
Final simplification82.6%
(FPCore (x y z) :precision binary64 (+ (+ (* z (/ (+ 0.0007936500793651 y) (/ x z))) (* 0.083333333333333 (/ 1.0 x))) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
return ((z * ((0.0007936500793651 + y) / (x / z))) + (0.083333333333333 * (1.0 / x))) + (x * (log(x) + -1.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((z * ((0.0007936500793651d0 + y) / (x / z))) + (0.083333333333333d0 * (1.0d0 / x))) + (x * (log(x) + (-1.0d0)))
end function
public static double code(double x, double y, double z) {
return ((z * ((0.0007936500793651 + y) / (x / z))) + (0.083333333333333 * (1.0 / x))) + (x * (Math.log(x) + -1.0));
}
def code(x, y, z): return ((z * ((0.0007936500793651 + y) / (x / z))) + (0.083333333333333 * (1.0 / x))) + (x * (math.log(x) + -1.0))
function code(x, y, z) return Float64(Float64(Float64(z * Float64(Float64(0.0007936500793651 + y) / Float64(x / z))) + Float64(0.083333333333333 * Float64(1.0 / x))) + Float64(x * Float64(log(x) + -1.0))) end
function tmp = code(x, y, z) tmp = ((z * ((0.0007936500793651 + y) / (x / z))) + (0.083333333333333 * (1.0 / x))) + (x * (log(x) + -1.0)); end
code[x_, y_, z_] := N[(N[(N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(z \cdot \frac{0.0007936500793651 + y}{\frac{x}{z}} + 0.083333333333333 \cdot \frac{1}{x}\right) + x \cdot \left(\log x + -1\right)
\end{array}
Initial program 93.2%
Taylor expanded in z around 0 94.4%
Taylor expanded in z around inf 88.8%
unpow288.8%
associate-*l*93.9%
associate-*r/93.9%
metadata-eval93.9%
distribute-rgt-out88.4%
associate-*l/88.4%
associate-*r/88.4%
associate-*l/91.8%
associate-/l*90.2%
distribute-rgt-out98.4%
Simplified98.4%
Taylor expanded in z around 0 97.3%
*-commutative97.3%
associate-*l/93.9%
associate-/r/98.4%
Simplified98.4%
Taylor expanded in x around inf 97.4%
sub-neg97.4%
mul-1-neg97.4%
log-rec97.4%
remove-double-neg97.4%
metadata-eval97.4%
+-commutative97.4%
Simplified97.4%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (+ (+ (* 0.083333333333333 (/ 1.0 x)) (* z (* (+ 0.0007936500793651 y) (/ z x)))) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
return ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (x * (log(x) + -1.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((0.083333333333333d0 * (1.0d0 / x)) + (z * ((0.0007936500793651d0 + y) * (z / x)))) + (x * (log(x) + (-1.0d0)))
end function
public static double code(double x, double y, double z) {
return ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (x * (Math.log(x) + -1.0));
}
def code(x, y, z): return ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (x * (math.log(x) + -1.0))
function code(x, y, z) return Float64(Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(z * Float64(Float64(0.0007936500793651 + y) * Float64(z / x)))) + Float64(x * Float64(log(x) + -1.0))) end
function tmp = code(x, y, z) tmp = ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (x * (log(x) + -1.0)); end
code[x_, y_, z_] := N[(N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\right) + x \cdot \left(\log x + -1\right)
\end{array}
Initial program 93.2%
Taylor expanded in z around 0 94.4%
Taylor expanded in z around inf 88.8%
unpow288.8%
associate-*l*93.9%
associate-*r/93.9%
metadata-eval93.9%
distribute-rgt-out88.4%
associate-*l/88.4%
associate-*r/88.4%
associate-*l/91.8%
associate-/l*90.2%
distribute-rgt-out98.4%
Simplified98.4%
Taylor expanded in x around inf 97.4%
sub-neg97.4%
mul-1-neg97.4%
log-rec97.4%
remove-double-neg97.4%
metadata-eval97.4%
+-commutative97.4%
Simplified97.4%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (if (<= x 1.0) (/ 0.083333333333333 x) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.0) {
tmp = 0.083333333333333 / x;
} else {
tmp = x * (log(x) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.0d0) then
tmp = 0.083333333333333d0 / x
else
tmp = x * (log(x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.0) {
tmp = 0.083333333333333 / x;
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.0: tmp = 0.083333333333333 / x else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.0) tmp = Float64(0.083333333333333 / x); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.0) tmp = 0.083333333333333 / x; else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.0], N[(0.083333333333333 / x), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 1Initial program 99.7%
associate-+l+99.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 35.3%
Taylor expanded in x around 0 35.3%
Taylor expanded in x around 0 34.0%
if 1 < x Initial program 86.0%
associate-+l+86.0%
fma-neg86.1%
sub-neg86.1%
metadata-eval86.1%
fma-define86.1%
fma-neg86.1%
metadata-eval86.1%
Simplified86.1%
Taylor expanded in z around 0 68.2%
Taylor expanded in x around inf 67.5%
sub-neg67.5%
*-commutative67.5%
metadata-eval67.5%
distribute-lft1-in67.5%
+-commutative67.5%
log-rec67.5%
mul-1-neg67.5%
associate-*l*67.5%
*-commutative67.5%
mul-1-neg67.5%
distribute-rgt-neg-in67.5%
mul-1-neg67.5%
log-rec67.5%
distribute-neg-in67.5%
metadata-eval67.5%
log-rec67.5%
remove-double-neg67.5%
Simplified67.5%
Final simplification50.0%
(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.2%
Taylor expanded in z around 0 50.9%
Taylor expanded in x around inf 50.0%
sub-neg97.4%
mul-1-neg97.4%
log-rec97.4%
remove-double-neg97.4%
metadata-eval97.4%
+-commutative97.4%
Simplified50.0%
Final simplification50.0%
(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.2%
associate-+l+93.2%
fma-neg93.2%
sub-neg93.2%
metadata-eval93.2%
fma-define93.2%
fma-neg93.2%
metadata-eval93.2%
Simplified93.2%
Taylor expanded in z around 0 51.0%
Taylor expanded in x around 0 33.2%
Taylor expanded in x around 0 19.2%
(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 2024085
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:alt
(+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))