
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)))
(if (<= x 400000000.0)
(+
t_0
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x))
(+ t_0 (/ z (/ (/ x (+ y 0.0007936500793651)) z))))))
double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 400000000.0) {
tmp = t_0 + (fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x);
} else {
tmp = t_0 + (z / ((x / (y + 0.0007936500793651)) / z));
}
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 (x <= 400000000.0) tmp = Float64(t_0 + Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x)); else tmp = Float64(t_0 + Float64(z / Float64(Float64(x / Float64(y + 0.0007936500793651)) / z))); end return 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[LessEqual[x, 400000000.0], N[(t$95$0 + N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(z / N[(N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / z), $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}\;x \leq 400000000:\\
\;\;\;\;t_0 + \frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{z}{\frac{\frac{x}{y + 0.0007936500793651}}{z}}\\
\end{array}
\end{array}
if x < 4e8Initial program 99.8%
sub-neg99.8%
metadata-eval99.8%
fma-def99.8%
fma-neg99.8%
metadata-eval99.8%
Simplified99.8%
if 4e8 < x Initial program 89.2%
sub-neg89.2%
metadata-eval89.2%
fma-def89.2%
fma-neg89.2%
metadata-eval89.2%
Simplified89.2%
metadata-eval89.2%
fma-neg89.2%
fma-def89.2%
*-un-lft-identity89.2%
add-sqr-sqrt89.2%
times-frac89.2%
*-commutative89.2%
fma-udef89.2%
fma-neg89.2%
metadata-eval89.2%
Applied egg-rr89.2%
associate-*l/89.2%
*-lft-identity89.2%
fma-udef89.2%
+-commutative89.2%
*-commutative89.2%
fma-def89.2%
Simplified89.2%
div-inv89.2%
pow1/289.2%
pow-flip89.2%
metadata-eval89.2%
Applied egg-rr89.2%
Taylor expanded in z around inf 89.2%
unpow289.2%
associate-/l*93.0%
associate-/l*99.5%
+-commutative99.5%
Simplified99.5%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)))
(if (or (<= z -5.5e-5) (not (<= z 2.55e-39)))
(+ t_0 (/ z (/ (/ x (+ y 0.0007936500793651)) z)))
(+
t_0
(/
(+
0.083333333333333
(* z (- (* 0.0007936500793651 z) 0.0027777777777778)))
x)))))
double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if ((z <= -5.5e-5) || !(z <= 2.55e-39)) {
tmp = t_0 + (z / ((x / (y + 0.0007936500793651)) / z));
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0
if ((z <= (-5.5d-5)) .or. (.not. (z <= 2.55d-39))) then
tmp = t_0 + (z / ((x / (y + 0.0007936500793651d0)) / z))
else
tmp = t_0 + ((0.083333333333333d0 + (z * ((0.0007936500793651d0 * z) - 0.0027777777777778d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * Math.log(x)) - x) + 0.91893853320467;
double tmp;
if ((z <= -5.5e-5) || !(z <= 2.55e-39)) {
tmp = t_0 + (z / ((x / (y + 0.0007936500793651)) / z));
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x);
}
return tmp;
}
def code(x, y, z): t_0 = (((x + -0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if (z <= -5.5e-5) or not (z <= 2.55e-39): tmp = t_0 + (z / ((x / (y + 0.0007936500793651)) / z)) else: tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) 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.5e-5) || !(z <= 2.55e-39)) tmp = Float64(t_0 + Float64(z / Float64(Float64(x / Float64(y + 0.0007936500793651)) / z))); else tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778))) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467; tmp = 0.0; if ((z <= -5.5e-5) || ~((z <= 2.55e-39))) tmp = t_0 + (z / ((x / (y + 0.0007936500793651)) / z)); else tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[Or[LessEqual[z, -5.5e-5], N[Not[LessEqual[z, 2.55e-39]], $MachinePrecision]], N[(t$95$0 + N[(z / N[(N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{-5} \lor \neg \left(z \leq 2.55 \cdot 10^{-39}\right):\\
\;\;\;\;t_0 + \frac{z}{\frac{\frac{x}{y + 0.0007936500793651}}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if z < -5.5000000000000002e-5 or 2.54999999999999994e-39 < z Initial program 90.3%
sub-neg90.3%
metadata-eval90.3%
fma-def90.3%
fma-neg90.3%
metadata-eval90.3%
Simplified90.3%
metadata-eval90.3%
fma-neg90.3%
fma-def90.3%
*-un-lft-identity90.3%
add-sqr-sqrt90.3%
times-frac90.3%
*-commutative90.3%
fma-udef90.3%
fma-neg90.3%
metadata-eval90.3%
Applied egg-rr90.3%
associate-*l/90.3%
*-lft-identity90.3%
fma-udef90.3%
+-commutative90.3%
*-commutative90.3%
fma-def90.3%
Simplified90.3%
div-inv90.3%
pow1/290.3%
pow-flip90.3%
metadata-eval90.3%
Applied egg-rr90.3%
Taylor expanded in z around inf 90.3%
unpow290.3%
associate-/l*93.8%
associate-/l*99.8%
+-commutative99.8%
Simplified99.8%
if -5.5000000000000002e-5 < z < 2.54999999999999994e-39Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 96.4%
Final simplification98.2%
(FPCore (x y z)
:precision binary64
(if (<= x 400000000.0)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
0.083333333333333
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778)))
x))
(+
(+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)
(/ z (/ (/ x (+ y 0.0007936500793651)) z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 400000000.0) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x);
} else {
tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (z / ((x / (y + 0.0007936500793651)) / 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 <= 400000000.0d0) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((0.083333333333333d0 + (z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0))) / x)
else
tmp = ((((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0) + (z / ((x / (y + 0.0007936500793651d0)) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 400000000.0) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x);
} else {
tmp = ((((x + -0.5) * Math.log(x)) - x) + 0.91893853320467) + (z / ((x / (y + 0.0007936500793651)) / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 400000000.0: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x) else: tmp = ((((x + -0.5) * math.log(x)) - x) + 0.91893853320467) + (z / ((x / (y + 0.0007936500793651)) / z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 400000000.0) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) + Float64(z / Float64(Float64(x / Float64(y + 0.0007936500793651)) / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 400000000.0) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x); else tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (z / ((x / (y + 0.0007936500793651)) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 400000000.0], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(z / N[(N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 400000000:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{z}{\frac{\frac{x}{y + 0.0007936500793651}}{z}}\\
\end{array}
\end{array}
if x < 4e8Initial program 99.8%
if 4e8 < x Initial program 89.2%
sub-neg89.2%
metadata-eval89.2%
fma-def89.2%
fma-neg89.2%
metadata-eval89.2%
Simplified89.2%
metadata-eval89.2%
fma-neg89.2%
fma-def89.2%
*-un-lft-identity89.2%
add-sqr-sqrt89.2%
times-frac89.2%
*-commutative89.2%
fma-udef89.2%
fma-neg89.2%
metadata-eval89.2%
Applied egg-rr89.2%
associate-*l/89.2%
*-lft-identity89.2%
fma-udef89.2%
+-commutative89.2%
*-commutative89.2%
fma-def89.2%
Simplified89.2%
div-inv89.2%
pow1/289.2%
pow-flip89.2%
metadata-eval89.2%
Applied egg-rr89.2%
Taylor expanded in z around inf 89.2%
unpow289.2%
associate-/l*93.0%
associate-/l*99.5%
+-commutative99.5%
Simplified99.5%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)))
(if (or (<= z -1.9e-5) (not (<= z 1.9e-39)))
(+ t_0 (* (+ y 0.0007936500793651) (/ (* z z) x)))
(+ t_0 (/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if ((z <= -1.9e-5) || !(z <= 1.9e-39)) {
tmp = t_0 + ((y + 0.0007936500793651) * ((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 + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0
if ((z <= (-1.9d-5)) .or. (.not. (z <= 1.9d-39))) then
tmp = t_0 + ((y + 0.0007936500793651d0) * ((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 + -0.5) * Math.log(x)) - x) + 0.91893853320467;
double tmp;
if ((z <= -1.9e-5) || !(z <= 1.9e-39)) {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x));
} else {
tmp = t_0 + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): t_0 = (((x + -0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if (z <= -1.9e-5) or not (z <= 1.9e-39): tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x)) else: tmp = t_0 + (0.083333333333333 / x) 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 <= -1.9e-5) || !(z <= 1.9e-39)) tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * 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 + -0.5) * log(x)) - x) + 0.91893853320467; tmp = 0.0; if ((z <= -1.9e-5) || ~((z <= 1.9e-39))) tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x)); else tmp = t_0 + (0.083333333333333 / x); 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, -1.9e-5], N[Not[LessEqual[z, 1.9e-39]], $MachinePrecision]], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(0.083333333333333 / x), $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 -1.9 \cdot 10^{-5} \lor \neg \left(z \leq 1.9 \cdot 10^{-39}\right):\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.9000000000000001e-5 or 1.9000000000000001e-39 < z Initial program 90.3%
sub-neg90.3%
metadata-eval90.3%
fma-def90.3%
fma-neg90.3%
metadata-eval90.3%
Simplified90.3%
Taylor expanded in z around inf 90.3%
associate-/l*93.8%
associate-/r/93.7%
unpow293.7%
Simplified93.7%
if -1.9000000000000001e-5 < z < 1.9000000000000001e-39Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 96.0%
Final simplification94.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)))
(if (or (<= z -1.9e-5) (not (<= z 2.4e-39)))
(+ t_0 (* (+ y 0.0007936500793651) (/ (* z z) x)))
(+ t_0 (+ (/ 0.083333333333333 x) (/ (* z -0.0027777777777778) x))))))
double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if ((z <= -1.9e-5) || !(z <= 2.4e-39)) {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x));
} else {
tmp = t_0 + ((0.083333333333333 / x) + ((z * -0.0027777777777778) / x));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0
if ((z <= (-1.9d-5)) .or. (.not. (z <= 2.4d-39))) then
tmp = t_0 + ((y + 0.0007936500793651d0) * ((z * z) / x))
else
tmp = t_0 + ((0.083333333333333d0 / x) + ((z * (-0.0027777777777778d0)) / x))
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 <= -1.9e-5) || !(z <= 2.4e-39)) {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x));
} else {
tmp = t_0 + ((0.083333333333333 / x) + ((z * -0.0027777777777778) / x));
}
return tmp;
}
def code(x, y, z): t_0 = (((x + -0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if (z <= -1.9e-5) or not (z <= 2.4e-39): tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x)) else: tmp = t_0 + ((0.083333333333333 / x) + ((z * -0.0027777777777778) / x)) 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 <= -1.9e-5) || !(z <= 2.4e-39)) tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) / x))); else tmp = Float64(t_0 + Float64(Float64(0.083333333333333 / x) + Float64(Float64(z * -0.0027777777777778) / x))); 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 <= -1.9e-5) || ~((z <= 2.4e-39))) tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x)); else tmp = t_0 + ((0.083333333333333 / x) + ((z * -0.0027777777777778) / x)); 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, -1.9e-5], N[Not[LessEqual[z, 2.4e-39]], $MachinePrecision]], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(z * -0.0027777777777778), $MachinePrecision] / x), $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 -1.9 \cdot 10^{-5} \lor \neg \left(z \leq 2.4 \cdot 10^{-39}\right):\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(\frac{0.083333333333333}{x} + \frac{z \cdot -0.0027777777777778}{x}\right)\\
\end{array}
\end{array}
if z < -1.9000000000000001e-5 or 2.40000000000000016e-39 < z Initial program 90.3%
sub-neg90.3%
metadata-eval90.3%
fma-def90.3%
fma-neg90.3%
metadata-eval90.3%
Simplified90.3%
Taylor expanded in z around inf 90.3%
associate-/l*93.8%
associate-/r/93.7%
unpow293.7%
Simplified93.7%
if -1.9000000000000001e-5 < z < 2.40000000000000016e-39Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 96.2%
associate-*r/96.2%
metadata-eval96.2%
associate-*r/96.2%
*-commutative96.2%
Simplified96.2%
Final simplification94.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)))
(if (or (<= z -3.8e-5) (not (<= z 7.2e-40)))
(+ t_0 (/ z (/ (/ x (+ y 0.0007936500793651)) z)))
(+ t_0 (+ (/ 0.083333333333333 x) (/ (* z -0.0027777777777778) x))))))
double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if ((z <= -3.8e-5) || !(z <= 7.2e-40)) {
tmp = t_0 + (z / ((x / (y + 0.0007936500793651)) / z));
} else {
tmp = t_0 + ((0.083333333333333 / x) + ((z * -0.0027777777777778) / x));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0
if ((z <= (-3.8d-5)) .or. (.not. (z <= 7.2d-40))) then
tmp = t_0 + (z / ((x / (y + 0.0007936500793651d0)) / z))
else
tmp = t_0 + ((0.083333333333333d0 / x) + ((z * (-0.0027777777777778d0)) / x))
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 <= -3.8e-5) || !(z <= 7.2e-40)) {
tmp = t_0 + (z / ((x / (y + 0.0007936500793651)) / z));
} else {
tmp = t_0 + ((0.083333333333333 / x) + ((z * -0.0027777777777778) / x));
}
return tmp;
}
def code(x, y, z): t_0 = (((x + -0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if (z <= -3.8e-5) or not (z <= 7.2e-40): tmp = t_0 + (z / ((x / (y + 0.0007936500793651)) / z)) else: tmp = t_0 + ((0.083333333333333 / x) + ((z * -0.0027777777777778) / x)) 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 <= -3.8e-5) || !(z <= 7.2e-40)) tmp = Float64(t_0 + Float64(z / Float64(Float64(x / Float64(y + 0.0007936500793651)) / z))); else tmp = Float64(t_0 + Float64(Float64(0.083333333333333 / x) + Float64(Float64(z * -0.0027777777777778) / x))); 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 <= -3.8e-5) || ~((z <= 7.2e-40))) tmp = t_0 + (z / ((x / (y + 0.0007936500793651)) / z)); else tmp = t_0 + ((0.083333333333333 / x) + ((z * -0.0027777777777778) / x)); 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, -3.8e-5], N[Not[LessEqual[z, 7.2e-40]], $MachinePrecision]], N[(t$95$0 + N[(z / N[(N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(z * -0.0027777777777778), $MachinePrecision] / x), $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 -3.8 \cdot 10^{-5} \lor \neg \left(z \leq 7.2 \cdot 10^{-40}\right):\\
\;\;\;\;t_0 + \frac{z}{\frac{\frac{x}{y + 0.0007936500793651}}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(\frac{0.083333333333333}{x} + \frac{z \cdot -0.0027777777777778}{x}\right)\\
\end{array}
\end{array}
if z < -3.8000000000000002e-5 or 7.2e-40 < z Initial program 90.3%
sub-neg90.3%
metadata-eval90.3%
fma-def90.3%
fma-neg90.3%
metadata-eval90.3%
Simplified90.3%
metadata-eval90.3%
fma-neg90.3%
fma-def90.3%
*-un-lft-identity90.3%
add-sqr-sqrt90.3%
times-frac90.3%
*-commutative90.3%
fma-udef90.3%
fma-neg90.3%
metadata-eval90.3%
Applied egg-rr90.3%
associate-*l/90.3%
*-lft-identity90.3%
fma-udef90.3%
+-commutative90.3%
*-commutative90.3%
fma-def90.3%
Simplified90.3%
div-inv90.3%
pow1/290.3%
pow-flip90.3%
metadata-eval90.3%
Applied egg-rr90.3%
Taylor expanded in z around inf 90.3%
unpow290.3%
associate-/l*93.8%
associate-/l*99.8%
+-commutative99.8%
Simplified99.8%
if -3.8000000000000002e-5 < z < 7.2e-40Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 96.2%
associate-*r/96.2%
metadata-eval96.2%
associate-*r/96.2%
*-commutative96.2%
Simplified96.2%
Final simplification98.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (+ 0.91893853320467 (* -0.5 (log x))) (* y (/ (* z z) x)))))
(if (<= z -4e+152)
t_0
(if (<= z -7.5e+131)
(+ (/ 0.083333333333333 x) (+ 0.91893853320467 (- (* x (log x)) x)))
(if (or (<= z -5.2e+48) (not (<= z 7.5e+129)))
t_0
(+
(/ 0.083333333333333 x)
(+ 0.91893853320467 (* x (+ (log x) -1.0)))))))))
double code(double x, double y, double z) {
double t_0 = (0.91893853320467 + (-0.5 * log(x))) + (y * ((z * z) / x));
double tmp;
if (z <= -4e+152) {
tmp = t_0;
} else if (z <= -7.5e+131) {
tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * log(x)) - x));
} else if ((z <= -5.2e+48) || !(z <= 7.5e+129)) {
tmp = t_0;
} else {
tmp = (0.083333333333333 / x) + (0.91893853320467 + (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) :: t_0
real(8) :: tmp
t_0 = (0.91893853320467d0 + ((-0.5d0) * log(x))) + (y * ((z * z) / x))
if (z <= (-4d+152)) then
tmp = t_0
else if (z <= (-7.5d+131)) then
tmp = (0.083333333333333d0 / x) + (0.91893853320467d0 + ((x * log(x)) - x))
else if ((z <= (-5.2d+48)) .or. (.not. (z <= 7.5d+129))) then
tmp = t_0
else
tmp = (0.083333333333333d0 / x) + (0.91893853320467d0 + (x * (log(x) + (-1.0d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (0.91893853320467 + (-0.5 * Math.log(x))) + (y * ((z * z) / x));
double tmp;
if (z <= -4e+152) {
tmp = t_0;
} else if (z <= -7.5e+131) {
tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * Math.log(x)) - x));
} else if ((z <= -5.2e+48) || !(z <= 7.5e+129)) {
tmp = t_0;
} else {
tmp = (0.083333333333333 / x) + (0.91893853320467 + (x * (Math.log(x) + -1.0)));
}
return tmp;
}
def code(x, y, z): t_0 = (0.91893853320467 + (-0.5 * math.log(x))) + (y * ((z * z) / x)) tmp = 0 if z <= -4e+152: tmp = t_0 elif z <= -7.5e+131: tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * math.log(x)) - x)) elif (z <= -5.2e+48) or not (z <= 7.5e+129): tmp = t_0 else: tmp = (0.083333333333333 / x) + (0.91893853320467 + (x * (math.log(x) + -1.0))) return tmp
function code(x, y, z) t_0 = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(y * Float64(Float64(z * z) / x))) tmp = 0.0 if (z <= -4e+152) tmp = t_0; elseif (z <= -7.5e+131) tmp = Float64(Float64(0.083333333333333 / x) + Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x))); elseif ((z <= -5.2e+48) || !(z <= 7.5e+129)) tmp = t_0; else tmp = Float64(Float64(0.083333333333333 / x) + Float64(0.91893853320467 + Float64(x * Float64(log(x) + -1.0)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (0.91893853320467 + (-0.5 * log(x))) + (y * ((z * z) / x)); tmp = 0.0; if (z <= -4e+152) tmp = t_0; elseif (z <= -7.5e+131) tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * log(x)) - x)); elseif ((z <= -5.2e+48) || ~((z <= 7.5e+129))) tmp = t_0; else tmp = (0.083333333333333 / x) + (0.91893853320467 + (x * (log(x) + -1.0))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e+152], t$95$0, If[LessEqual[z, -7.5e+131], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -5.2e+48], N[Not[LessEqual[z, 7.5e+129]], $MachinePrecision]], t$95$0, N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.91893853320467 + -0.5 \cdot \log x\right) + y \cdot \frac{z \cdot z}{x}\\
\mathbf{if}\;z \leq -4 \cdot 10^{+152}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{+131}:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{+48} \lor \neg \left(z \leq 7.5 \cdot 10^{+129}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right)\\
\end{array}
\end{array}
if z < -4.0000000000000002e152 or -7.4999999999999995e131 < z < -5.1999999999999999e48 or 7.4999999999999998e129 < z Initial program 88.6%
sub-neg88.6%
metadata-eval88.6%
fma-def88.6%
fma-neg88.6%
metadata-eval88.6%
Simplified88.6%
Taylor expanded in y around inf 66.2%
*-lft-identity66.2%
times-frac68.2%
/-rgt-identity68.2%
unpow268.2%
Simplified68.2%
Taylor expanded in x around 0 65.0%
if -4.0000000000000002e152 < z < -7.4999999999999995e131Initial program 85.8%
sub-neg85.8%
metadata-eval85.8%
fma-def85.8%
fma-neg85.8%
metadata-eval85.8%
Simplified85.8%
Taylor expanded in z around 0 59.9%
Taylor expanded in x around inf 59.7%
*-commutative59.7%
sub-neg59.7%
mul-1-neg59.7%
log-rec59.7%
remove-double-neg59.7%
metadata-eval59.7%
distribute-rgt-in59.9%
neg-mul-159.9%
sub-neg59.9%
*-commutative59.9%
Simplified59.9%
if -5.1999999999999999e48 < z < 7.4999999999999998e129Initial program 98.3%
sub-neg98.3%
metadata-eval98.3%
fma-def98.4%
fma-neg98.4%
metadata-eval98.4%
Simplified98.4%
Taylor expanded in z around 0 86.1%
Taylor expanded in x around inf 84.6%
*-commutative84.6%
sub-neg84.6%
mul-1-neg84.6%
log-rec84.6%
remove-double-neg84.6%
metadata-eval84.6%
Simplified84.6%
Final simplification77.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (+ 0.91893853320467 (* -0.5 (log x))) (* y (/ (* z z) x)))))
(if (<= z -7.6e+152)
t_0
(if (<= z -6.2e+131)
(+ (/ 0.083333333333333 x) (+ 0.91893853320467 (- (* x (log x)) x)))
(if (or (<= z -2.4e+50) (not (<= z 2.5e+130)))
t_0
(+
(+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x)))))))
double code(double x, double y, double z) {
double t_0 = (0.91893853320467 + (-0.5 * log(x))) + (y * ((z * z) / x));
double tmp;
if (z <= -7.6e+152) {
tmp = t_0;
} else if (z <= -6.2e+131) {
tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * log(x)) - x));
} else if ((z <= -2.4e+50) || !(z <= 2.5e+130)) {
tmp = t_0;
} else {
tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (0.91893853320467d0 + ((-0.5d0) * log(x))) + (y * ((z * z) / x))
if (z <= (-7.6d+152)) then
tmp = t_0
else if (z <= (-6.2d+131)) then
tmp = (0.083333333333333d0 / x) + (0.91893853320467d0 + ((x * log(x)) - x))
else if ((z <= (-2.4d+50)) .or. (.not. (z <= 2.5d+130))) then
tmp = t_0
else
tmp = ((((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (0.91893853320467 + (-0.5 * Math.log(x))) + (y * ((z * z) / x));
double tmp;
if (z <= -7.6e+152) {
tmp = t_0;
} else if (z <= -6.2e+131) {
tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * Math.log(x)) - x));
} else if ((z <= -2.4e+50) || !(z <= 2.5e+130)) {
tmp = t_0;
} else {
tmp = ((((x + -0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): t_0 = (0.91893853320467 + (-0.5 * math.log(x))) + (y * ((z * z) / x)) tmp = 0 if z <= -7.6e+152: tmp = t_0 elif z <= -6.2e+131: tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * math.log(x)) - x)) elif (z <= -2.4e+50) or not (z <= 2.5e+130): tmp = t_0 else: tmp = ((((x + -0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) return tmp
function code(x, y, z) t_0 = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(y * Float64(Float64(z * z) / x))) tmp = 0.0 if (z <= -7.6e+152) tmp = t_0; elseif (z <= -6.2e+131) tmp = Float64(Float64(0.083333333333333 / x) + Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x))); elseif ((z <= -2.4e+50) || !(z <= 2.5e+130)) tmp = t_0; 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) t_0 = (0.91893853320467 + (-0.5 * log(x))) + (y * ((z * z) / x)); tmp = 0.0; if (z <= -7.6e+152) tmp = t_0; elseif (z <= -6.2e+131) tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * log(x)) - x)); elseif ((z <= -2.4e+50) || ~((z <= 2.5e+130))) tmp = t_0; else tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.6e+152], t$95$0, If[LessEqual[z, -6.2e+131], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.4e+50], N[Not[LessEqual[z, 2.5e+130]], $MachinePrecision]], t$95$0, 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}
t_0 := \left(0.91893853320467 + -0.5 \cdot \log x\right) + y \cdot \frac{z \cdot z}{x}\\
\mathbf{if}\;z \leq -7.6 \cdot 10^{+152}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{+131}:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{+50} \lor \neg \left(z \leq 2.5 \cdot 10^{+130}\right):\\
\;\;\;\;t_0\\
\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 < -7.6000000000000001e152 or -6.20000000000000032e131 < z < -2.4000000000000002e50 or 2.4999999999999998e130 < z Initial program 88.6%
sub-neg88.6%
metadata-eval88.6%
fma-def88.6%
fma-neg88.6%
metadata-eval88.6%
Simplified88.6%
Taylor expanded in y around inf 66.2%
*-lft-identity66.2%
times-frac68.2%
/-rgt-identity68.2%
unpow268.2%
Simplified68.2%
Taylor expanded in x around 0 65.0%
if -7.6000000000000001e152 < z < -6.20000000000000032e131Initial program 85.8%
sub-neg85.8%
metadata-eval85.8%
fma-def85.8%
fma-neg85.8%
metadata-eval85.8%
Simplified85.8%
Taylor expanded in z around 0 59.9%
Taylor expanded in x around inf 59.7%
*-commutative59.7%
sub-neg59.7%
mul-1-neg59.7%
log-rec59.7%
remove-double-neg59.7%
metadata-eval59.7%
distribute-rgt-in59.9%
neg-mul-159.9%
sub-neg59.9%
*-commutative59.9%
Simplified59.9%
if -2.4000000000000002e50 < z < 2.4999999999999998e130Initial program 98.3%
sub-neg98.3%
metadata-eval98.3%
fma-def98.4%
fma-neg98.4%
metadata-eval98.4%
Simplified98.4%
Taylor expanded in z around 0 86.1%
Final simplification77.9%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.9e-5) (not (<= z 2.55e-39)))
(+ (+ 0.91893853320467 (- (* x (log x)) x)) (* 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.9e-5) || !(z <= 2.55e-39)) {
tmp = (0.91893853320467 + ((x * log(x)) - x)) + (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.9d-5)) .or. (.not. (z <= 2.55d-39))) then
tmp = (0.91893853320467d0 + ((x * log(x)) - x)) + (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.9e-5) || !(z <= 2.55e-39)) {
tmp = (0.91893853320467 + ((x * Math.log(x)) - x)) + (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.9e-5) or not (z <= 2.55e-39): tmp = (0.91893853320467 + ((x * math.log(x)) - x)) + (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.9e-5) || !(z <= 2.55e-39)) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x)) + 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.9e-5) || ~((z <= 2.55e-39))) tmp = (0.91893853320467 + ((x * log(x)) - x)) + (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.9e-5], N[Not[LessEqual[z, 2.55e-39]], $MachinePrecision]], N[(N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $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.9 \cdot 10^{-5} \lor \neg \left(z \leq 2.55 \cdot 10^{-39}\right):\\
\;\;\;\;\left(0.91893853320467 + \left(x \cdot \log x - x\right)\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.9000000000000001e-5 or 2.54999999999999994e-39 < z Initial program 90.3%
sub-neg90.3%
metadata-eval90.3%
fma-def90.3%
fma-neg90.3%
metadata-eval90.3%
Simplified90.3%
Taylor expanded in y around inf 68.6%
*-lft-identity68.6%
times-frac72.0%
/-rgt-identity72.0%
unpow272.0%
Simplified72.0%
Taylor expanded in x around inf 72.0%
*-commutative26.9%
sub-neg26.9%
mul-1-neg26.9%
log-rec26.9%
remove-double-neg26.9%
metadata-eval26.9%
distribute-rgt-in26.9%
neg-mul-126.9%
sub-neg26.9%
*-commutative26.9%
Simplified72.0%
Taylor expanded in z around 0 72.0%
unpow272.0%
associate-*r/75.7%
Simplified75.7%
if -1.9000000000000001e-5 < z < 2.54999999999999994e-39Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 96.0%
Final simplification85.1%
(FPCore (x y z) :precision binary64 (+ (/ 0.083333333333333 x) (+ 0.91893853320467 (* x (+ (log x) -1.0)))))
double code(double x, double y, double z) {
return (0.083333333333333 / x) + (0.91893853320467 + (x * (log(x) + -1.0)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.083333333333333d0 / x) + (0.91893853320467d0 + (x * (log(x) + (-1.0d0))))
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 / x) + (0.91893853320467 + (x * (Math.log(x) + -1.0)));
}
def code(x, y, z): return (0.083333333333333 / x) + (0.91893853320467 + (x * (math.log(x) + -1.0)))
function code(x, y, z) return Float64(Float64(0.083333333333333 / x) + Float64(0.91893853320467 + Float64(x * Float64(log(x) + -1.0)))) end
function tmp = code(x, y, z) tmp = (0.083333333333333 / x) + (0.91893853320467 + (x * (log(x) + -1.0))); end
code[x_, y_, z_] := N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x} + \left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right)
\end{array}
Initial program 94.6%
sub-neg94.6%
metadata-eval94.6%
fma-def94.6%
fma-neg94.6%
metadata-eval94.6%
Simplified94.6%
Taylor expanded in z around 0 59.0%
Taylor expanded in x around inf 58.1%
*-commutative58.1%
sub-neg58.1%
mul-1-neg58.1%
log-rec58.1%
remove-double-neg58.1%
metadata-eval58.1%
Simplified58.1%
Final simplification58.1%
(FPCore (x y z) :precision binary64 (+ 0.91893853320467 (+ (/ 0.083333333333333 x) (* -0.5 (log x)))))
double code(double x, double y, double z) {
return 0.91893853320467 + ((0.083333333333333 / x) + (-0.5 * log(x)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.91893853320467d0 + ((0.083333333333333d0 / x) + ((-0.5d0) * log(x)))
end function
public static double code(double x, double y, double z) {
return 0.91893853320467 + ((0.083333333333333 / x) + (-0.5 * Math.log(x)));
}
def code(x, y, z): return 0.91893853320467 + ((0.083333333333333 / x) + (-0.5 * math.log(x)))
function code(x, y, z) return Float64(0.91893853320467 + Float64(Float64(0.083333333333333 / x) + Float64(-0.5 * log(x)))) end
function tmp = code(x, y, z) tmp = 0.91893853320467 + ((0.083333333333333 / x) + (-0.5 * log(x))); end
code[x_, y_, z_] := N[(0.91893853320467 + N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.91893853320467 + \left(\frac{0.083333333333333}{x} + -0.5 \cdot \log x\right)
\end{array}
Initial program 94.6%
sub-neg94.6%
metadata-eval94.6%
fma-def94.6%
fma-neg94.6%
metadata-eval94.6%
Simplified94.6%
Taylor expanded in z around 0 59.0%
Taylor expanded in x around 0 24.5%
Taylor expanded in x around 0 24.5%
Taylor expanded in x around 0 24.5%
Final simplification24.5%
(FPCore (x y z) :precision binary64 (- 0.91893853320467 (* (log x) 0.5)))
double code(double x, double y, double z) {
return 0.91893853320467 - (log(x) * 0.5);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.91893853320467d0 - (log(x) * 0.5d0)
end function
public static double code(double x, double y, double z) {
return 0.91893853320467 - (Math.log(x) * 0.5);
}
def code(x, y, z): return 0.91893853320467 - (math.log(x) * 0.5)
function code(x, y, z) return Float64(0.91893853320467 - Float64(log(x) * 0.5)) end
function tmp = code(x, y, z) tmp = 0.91893853320467 - (log(x) * 0.5); end
code[x_, y_, z_] := N[(0.91893853320467 - N[(N[Log[x], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.91893853320467 - \log x \cdot 0.5
\end{array}
Initial program 94.6%
sub-neg94.6%
metadata-eval94.6%
fma-def94.6%
fma-neg94.6%
metadata-eval94.6%
Simplified94.6%
Taylor expanded in z around 0 59.0%
Taylor expanded in x around 0 24.5%
Taylor expanded in x around 0 24.5%
Taylor expanded in x around inf 2.6%
log-rec2.6%
Simplified2.6%
Final simplification2.6%
(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 2023268
(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)))