
(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 8.5e+64)
(+
(fma (+ x -0.5) (log x) (- 0.91893853320467 x))
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* (+ y 0.0007936500793651) (/ z (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 8.5e+64) {
tmp = fma((x + -0.5), log(x), (0.91893853320467 - x)) + (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 8.5e+64) tmp = Float64(fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - x)) + Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 8.5e+64], N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.5 \cdot 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 8.4999999999999998e64Initial program 99.7%
remove-double-neg99.7%
sub-neg99.7%
associate-+l+99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
unsub-neg99.7%
remove-double-neg99.7%
*-commutative99.7%
fma-def99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
if 8.4999999999999998e64 < x Initial program 87.0%
Taylor expanded in z around inf 87.0%
associate-/l*89.6%
unpow289.6%
Simplified89.6%
associate-/r/90.5%
associate-/l*99.4%
+-commutative99.4%
Applied egg-rr99.4%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (* (+ x -0.5) (log x)) x)))
(if (<= x 2e+17)
(+
(/ (- 0.8444480278083504 (pow t_0 2.0)) (- 0.91893853320467 t_0))
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* (+ y 0.0007936500793651) (/ z (/ x z)))))))
double code(double x, double y, double z) {
double t_0 = ((x + -0.5) * log(x)) - x;
double tmp;
if (x <= 2e+17) {
tmp = ((0.8444480278083504 - pow(t_0, 2.0)) / (0.91893853320467 - t_0)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((x + (-0.5d0)) * log(x)) - x
if (x <= 2d+17) then
tmp = ((0.8444480278083504d0 - (t_0 ** 2.0d0)) / (0.91893853320467d0 - t_0)) + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((y + 0.0007936500793651d0) * (z / (x / z)))
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;
double tmp;
if (x <= 2e+17) {
tmp = ((0.8444480278083504 - Math.pow(t_0, 2.0)) / (0.91893853320467 - t_0)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
def code(x, y, z): t_0 = ((x + -0.5) * math.log(x)) - x tmp = 0 if x <= 2e+17: tmp = ((0.8444480278083504 - math.pow(t_0, 2.0)) / (0.91893853320467 - t_0)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z / (x / z))) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(x + -0.5) * log(x)) - x) tmp = 0.0 if (x <= 2e+17) tmp = Float64(Float64(Float64(0.8444480278083504 - (t_0 ^ 2.0)) / Float64(0.91893853320467 - t_0)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((x + -0.5) * log(x)) - x; tmp = 0.0; if (x <= 2e+17) tmp = ((0.8444480278083504 - (t_0 ^ 2.0)) / (0.91893853320467 - t_0)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z / (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[x, 2e+17], N[(N[(N[(0.8444480278083504 - N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision] / N[(0.91893853320467 - t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x + -0.5\right) \cdot \log x - x\\
\mathbf{if}\;x \leq 2 \cdot 10^{+17}:\\
\;\;\;\;\frac{0.8444480278083504 - {t_0}^{2}}{0.91893853320467 - t_0} + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 2e17Initial program 99.7%
+-commutative99.7%
flip-+99.7%
metadata-eval99.7%
pow299.7%
sub-neg99.7%
metadata-eval99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
*-commutative99.7%
Applied egg-rr99.7%
if 2e17 < x Initial program 89.2%
Taylor expanded in z around inf 89.2%
associate-/l*91.3%
unpow291.3%
Simplified91.3%
associate-/r/92.0%
associate-/l*99.5%
+-commutative99.5%
Applied egg-rr99.5%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
(if (<= x 4e+16)
(+
t_0
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(+ t_0 (* (+ y 0.0007936500793651) (/ z (/ x z)))))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 4e+16) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
if (x <= 4d+16) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
else
tmp = t_0 + ((y + 0.0007936500793651d0) * (z / (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 4e+16) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x) tmp = 0 if x <= 4e+16: tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) else: tmp = t_0 + ((y + 0.0007936500793651) * (z / (x / z))) return tmp
function code(x, y, z) t_0 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) tmp = 0.0 if (x <= 4e+16) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)); else tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x); tmp = 0.0; if (x <= 4e+16) tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = t_0 + ((y + 0.0007936500793651) * (z / (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 4e+16], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;x \leq 4 \cdot 10^{+16}:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 4e16Initial program 99.7%
if 4e16 < x Initial program 89.2%
Taylor expanded in z around inf 89.2%
associate-/l*91.3%
unpow291.3%
Simplified91.3%
associate-/r/92.0%
associate-/l*99.5%
+-commutative99.5%
Applied egg-rr99.5%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ 0.91893853320467 (* -0.5 (log x)))
(/ (* z z) (/ x (+ y 0.0007936500793651)))))
(t_1
(+ (+ 0.91893853320467 (* x (+ (log x) -1.0))) (/ y (/ x (* z z))))))
(if (<= z -2.9e+101)
t_0
(if (<= z -3.8e-22)
t_1
(if (<= z 1.95e-40)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))
(if (<= z 3e+42) t_1 t_0))))))
double code(double x, double y, double z) {
double t_0 = (0.91893853320467 + (-0.5 * log(x))) + ((z * z) / (x / (y + 0.0007936500793651)));
double t_1 = (0.91893853320467 + (x * (log(x) + -1.0))) + (y / (x / (z * z)));
double tmp;
if (z <= -2.9e+101) {
tmp = t_0;
} else if (z <= -3.8e-22) {
tmp = t_1;
} else if (z <= 1.95e-40) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
} else if (z <= 3e+42) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (0.91893853320467d0 + ((-0.5d0) * log(x))) + ((z * z) / (x / (y + 0.0007936500793651d0)))
t_1 = (0.91893853320467d0 + (x * (log(x) + (-1.0d0)))) + (y / (x / (z * z)))
if (z <= (-2.9d+101)) then
tmp = t_0
else if (z <= (-3.8d-22)) then
tmp = t_1
else if (z <= 1.95d-40) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (0.083333333333333d0 / x)
else if (z <= 3d+42) then
tmp = t_1
else
tmp = t_0
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))) + ((z * z) / (x / (y + 0.0007936500793651)));
double t_1 = (0.91893853320467 + (x * (Math.log(x) + -1.0))) + (y / (x / (z * z)));
double tmp;
if (z <= -2.9e+101) {
tmp = t_0;
} else if (z <= -3.8e-22) {
tmp = t_1;
} else if (z <= 1.95e-40) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
} else if (z <= 3e+42) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (0.91893853320467 + (-0.5 * math.log(x))) + ((z * z) / (x / (y + 0.0007936500793651))) t_1 = (0.91893853320467 + (x * (math.log(x) + -1.0))) + (y / (x / (z * z))) tmp = 0 if z <= -2.9e+101: tmp = t_0 elif z <= -3.8e-22: tmp = t_1 elif z <= 1.95e-40: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x) elif z <= 3e+42: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(Float64(z * z) / Float64(x / Float64(y + 0.0007936500793651)))) t_1 = Float64(Float64(0.91893853320467 + Float64(x * Float64(log(x) + -1.0))) + Float64(y / Float64(x / Float64(z * z)))) tmp = 0.0 if (z <= -2.9e+101) tmp = t_0; elseif (z <= -3.8e-22) tmp = t_1; elseif (z <= 1.95e-40) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x)); elseif (z <= 3e+42) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (0.91893853320467 + (-0.5 * log(x))) + ((z * z) / (x / (y + 0.0007936500793651))); t_1 = (0.91893853320467 + (x * (log(x) + -1.0))) + (y / (x / (z * z))); tmp = 0.0; if (z <= -2.9e+101) tmp = t_0; elseif (z <= -3.8e-22) tmp = t_1; elseif (z <= 1.95e-40) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x); elseif (z <= 3e+42) tmp = t_1; else tmp = t_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[(N[(z * z), $MachinePrecision] / N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+101], t$95$0, If[LessEqual[z, -3.8e-22], t$95$1, If[LessEqual[z, 1.95e-40], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+42], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\
t_1 := \left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + \frac{y}{\frac{x}{z \cdot z}}\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+101}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-40}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+42}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -2.89999999999999987e101 or 3.00000000000000029e42 < z Initial program 86.3%
Taylor expanded in z around inf 86.3%
associate-/l*89.1%
unpow289.1%
Simplified89.1%
Taylor expanded in x around 0 80.6%
if -2.89999999999999987e101 < z < -3.80000000000000023e-22 or 1.9499999999999999e-40 < z < 3.00000000000000029e42Initial program 99.4%
Taylor expanded in x around inf 98.4%
*-commutative48.5%
sub-neg48.5%
mul-1-neg48.5%
log-rec48.5%
remove-double-neg48.5%
metadata-eval48.5%
Simplified98.4%
Taylor expanded in y around inf 81.3%
associate-/l*81.3%
unpow281.3%
Simplified81.3%
if -3.80000000000000023e-22 < z < 1.9499999999999999e-40Initial program 99.4%
Taylor expanded in z around 0 96.0%
Final simplification87.5%
(FPCore (x y z)
:precision binary64
(if (or (<= z -7.4e-23) (not (<= z 2.65e-40)))
(+
(+ 0.91893853320467 (* x (+ (log x) -1.0)))
(* (+ y 0.0007936500793651) (/ (* z z) x)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -7.4e-23) || !(z <= 2.65e-40)) {
tmp = (0.91893853320467 + (x * (log(x) + -1.0))) + ((y + 0.0007936500793651) * ((z * z) / x));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-7.4d-23)) .or. (.not. (z <= 2.65d-40))) then
tmp = (0.91893853320467d0 + (x * (log(x) + (-1.0d0)))) + ((y + 0.0007936500793651d0) * ((z * z) / x))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -7.4e-23) || !(z <= 2.65e-40)) {
tmp = (0.91893853320467 + (x * (Math.log(x) + -1.0))) + ((y + 0.0007936500793651) * ((z * z) / x));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -7.4e-23) or not (z <= 2.65e-40): tmp = (0.91893853320467 + (x * (math.log(x) + -1.0))) + ((y + 0.0007936500793651) * ((z * z) / x)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -7.4e-23) || !(z <= 2.65e-40)) tmp = Float64(Float64(0.91893853320467 + Float64(x * Float64(log(x) + -1.0))) + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) / x))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -7.4e-23) || ~((z <= 2.65e-40))) tmp = (0.91893853320467 + (x * (log(x) + -1.0))) + ((y + 0.0007936500793651) * ((z * z) / x)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -7.4e-23], N[Not[LessEqual[z, 2.65e-40]], $MachinePrecision]], N[(N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{-23} \lor \neg \left(z \leq 2.65 \cdot 10^{-40}\right):\\
\;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -7.4000000000000005e-23 or 2.6500000000000001e-40 < z Initial program 89.9%
Taylor expanded in x around inf 89.6%
*-commutative27.1%
sub-neg27.1%
mul-1-neg27.1%
log-rec27.1%
remove-double-neg27.1%
metadata-eval27.1%
Simplified89.6%
Taylor expanded in z around inf 87.9%
associate-/l*89.9%
+-commutative89.9%
associate-/r/90.7%
unpow290.7%
+-commutative90.7%
Simplified90.7%
if -7.4000000000000005e-23 < z < 2.6500000000000001e-40Initial program 99.4%
Taylor expanded in z around 0 96.0%
Final simplification93.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (* x (+ (log x) -1.0)))))
(if (or (<= z -400.0) (not (<= z 0.116)))
(+ t_0 (* (+ y 0.0007936500793651) (/ (* z z) x)))
(+ t_0 (/ (+ 0.083333333333333 (* z (* z y))) x)))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + (x * (log(x) + -1.0));
double tmp;
if ((z <= -400.0) || !(z <= 0.116)) {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x));
} else {
tmp = t_0 + ((0.083333333333333 + (z * (z * y))) / 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 + (x * (log(x) + (-1.0d0)))
if ((z <= (-400.0d0)) .or. (.not. (z <= 0.116d0))) then
tmp = t_0 + ((y + 0.0007936500793651d0) * ((z * z) / x))
else
tmp = t_0 + ((0.083333333333333d0 + (z * (z * y))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + (x * (Math.log(x) + -1.0));
double tmp;
if ((z <= -400.0) || !(z <= 0.116)) {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x));
} else {
tmp = t_0 + ((0.083333333333333 + (z * (z * y))) / x);
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + (x * (math.log(x) + -1.0)) tmp = 0 if (z <= -400.0) or not (z <= 0.116): tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x)) else: tmp = t_0 + ((0.083333333333333 + (z * (z * y))) / x) return tmp
function code(x, y, z) t_0 = Float64(0.91893853320467 + Float64(x * Float64(log(x) + -1.0))) tmp = 0.0 if ((z <= -400.0) || !(z <= 0.116)) tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) / x))); else tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(z * y))) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 0.91893853320467 + (x * (log(x) + -1.0)); tmp = 0.0; if ((z <= -400.0) || ~((z <= 0.116))) tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x)); else tmp = t_0 + ((0.083333333333333 + (z * (z * y))) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -400.0], N[Not[LessEqual[z, 0.116]], $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 + N[(z * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.91893853320467 + x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;z \leq -400 \lor \neg \left(z \leq 0.116\right):\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot y\right)}{x}\\
\end{array}
\end{array}
if z < -400 or 0.116000000000000006 < z Initial program 89.4%
Taylor expanded in x around inf 89.3%
*-commutative26.7%
sub-neg26.7%
mul-1-neg26.7%
log-rec26.7%
remove-double-neg26.7%
metadata-eval26.7%
Simplified89.3%
Taylor expanded in z around inf 88.0%
associate-/l*90.1%
+-commutative90.1%
associate-/r/90.9%
unpow290.9%
+-commutative90.9%
Simplified90.9%
if -400 < z < 0.116000000000000006Initial program 99.4%
Taylor expanded in x around inf 97.2%
*-commutative90.4%
sub-neg90.4%
mul-1-neg90.4%
log-rec90.4%
remove-double-neg90.4%
metadata-eval90.4%
Simplified97.2%
Taylor expanded in y around inf 96.8%
*-commutative96.8%
unpow296.8%
associate-*l*96.8%
Simplified96.8%
Final simplification93.7%
(FPCore (x y z)
:precision binary64
(if (<= x 0.0015)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (* -0.5 (log x))))
(if (<= x 7e+159)
(+
(+ 0.91893853320467 (* x (+ (log x) -1.0)))
(* (+ y 0.0007936500793651) (/ (* z z) x)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* 0.0007936500793651 (* z (/ z x)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.0015) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (-0.5 * log(x)));
} else if (x <= 7e+159) {
tmp = (0.91893853320467 + (x * (log(x) + -1.0))) + ((y + 0.0007936500793651) * ((z * z) / x));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.0007936500793651 * (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) :: tmp
if (x <= 0.0015d0) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + ((-0.5d0) * log(x)))
else if (x <= 7d+159) then
tmp = (0.91893853320467d0 + (x * (log(x) + (-1.0d0)))) + ((y + 0.0007936500793651d0) * ((z * z) / x))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (0.0007936500793651d0 * (z * (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 0.0015) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (-0.5 * Math.log(x)));
} else if (x <= 7e+159) {
tmp = (0.91893853320467 + (x * (Math.log(x) + -1.0))) + ((y + 0.0007936500793651) * ((z * z) / x));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.0007936500793651 * (z * (z / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 0.0015: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (-0.5 * math.log(x))) elif x <= 7e+159: tmp = (0.91893853320467 + (x * (math.log(x) + -1.0))) + ((y + 0.0007936500793651) * ((z * z) / x)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.0007936500793651 * (z * (z / x))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 0.0015) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(-0.5 * log(x)))); elseif (x <= 7e+159) tmp = Float64(Float64(0.91893853320467 + Float64(x * Float64(log(x) + -1.0))) + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) / x))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.0007936500793651 * Float64(z * Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 0.0015) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (-0.5 * log(x))); elseif (x <= 7e+159) tmp = (0.91893853320467 + (x * (log(x) + -1.0))) + ((y + 0.0007936500793651) * ((z * z) / x)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.0007936500793651 * (z * (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 0.0015], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7e+159], N[(N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.0007936500793651 * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0015:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+159}:\\
\;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + 0.0007936500793651 \cdot \left(z \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if x < 0.0015Initial program 99.7%
Taylor expanded in x around 0 98.8%
if 0.0015 < x < 6.9999999999999999e159Initial program 95.8%
Taylor expanded in x around inf 94.4%
*-commutative54.2%
sub-neg54.2%
mul-1-neg54.2%
log-rec54.2%
remove-double-neg54.2%
metadata-eval54.2%
Simplified94.4%
Taylor expanded in z around inf 94.5%
associate-/l*97.0%
+-commutative97.0%
associate-/r/97.0%
unpow297.0%
+-commutative97.0%
Simplified97.0%
if 6.9999999999999999e159 < x Initial program 82.6%
Taylor expanded in z around inf 82.6%
associate-/l*84.1%
unpow284.1%
Simplified84.1%
Taylor expanded in y around 0 85.7%
unpow285.7%
associate-*l/96.5%
Simplified96.5%
Final simplification97.7%
(FPCore (x y z)
:precision binary64
(if (<= x 0.0015)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (* -0.5 (log x))))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* (+ y 0.0007936500793651) (/ z (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.0015) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (-0.5 * log(x)));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 0.0015d0) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + ((-0.5d0) * log(x)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((y + 0.0007936500793651d0) * (z / (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 0.0015) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (-0.5 * Math.log(x)));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 0.0015: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (-0.5 * math.log(x))) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z / (x / z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 0.0015) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(-0.5 * log(x)))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 0.0015) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (-0.5 * log(x))); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z / (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 0.0015], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0015:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 0.0015Initial program 99.7%
Taylor expanded in x around 0 98.8%
if 0.0015 < x Initial program 89.6%
Taylor expanded in z around inf 89.1%
associate-/l*91.1%
unpow291.1%
Simplified91.1%
associate-/r/91.8%
associate-/l*99.0%
+-commutative99.0%
Applied egg-rr99.0%
Final simplification98.9%
(FPCore (x y z)
:precision binary64
(if (or (<= z -3e+70) (not (<= z 7.2e-31)))
(+
(+ 0.91893853320467 (* -0.5 (log x)))
(/ (* z z) (/ x (+ y 0.0007936500793651))))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3e+70) || !(z <= 7.2e-31)) {
tmp = (0.91893853320467 + (-0.5 * log(x))) + ((z * z) / (x / (y + 0.0007936500793651)));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-3d+70)) .or. (.not. (z <= 7.2d-31))) then
tmp = (0.91893853320467d0 + ((-0.5d0) * log(x))) + ((z * z) / (x / (y + 0.0007936500793651d0)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -3e+70) || !(z <= 7.2e-31)) {
tmp = (0.91893853320467 + (-0.5 * Math.log(x))) + ((z * z) / (x / (y + 0.0007936500793651)));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3e+70) or not (z <= 7.2e-31): tmp = (0.91893853320467 + (-0.5 * math.log(x))) + ((z * z) / (x / (y + 0.0007936500793651))) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3e+70) || !(z <= 7.2e-31)) tmp = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(Float64(z * z) / Float64(x / Float64(y + 0.0007936500793651)))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3e+70) || ~((z <= 7.2e-31))) tmp = (0.91893853320467 + (-0.5 * log(x))) + ((z * z) / (x / (y + 0.0007936500793651))); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3e+70], N[Not[LessEqual[z, 7.2e-31]], $MachinePrecision]], N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * z), $MachinePrecision] / N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+70} \lor \neg \left(z \leq 7.2 \cdot 10^{-31}\right):\\
\;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -2.99999999999999976e70 or 7.20000000000000007e-31 < z Initial program 88.6%
Taylor expanded in z around inf 87.0%
associate-/l*89.3%
unpow289.3%
Simplified89.3%
Taylor expanded in x around 0 75.6%
if -2.99999999999999976e70 < z < 7.20000000000000007e-31Initial program 99.4%
Taylor expanded in z around 0 91.3%
Final simplification83.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (* x (+ (log x) -1.0)))))
(if (<= z -3.9e-22)
(+ t_0 (* -0.0027777777777778 (/ z x)))
(+ t_0 (/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + (x * (log(x) + -1.0));
double tmp;
if (z <= -3.9e-22) {
tmp = t_0 + (-0.0027777777777778 * (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 = 0.91893853320467d0 + (x * (log(x) + (-1.0d0)))
if (z <= (-3.9d-22)) then
tmp = t_0 + ((-0.0027777777777778d0) * (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 = 0.91893853320467 + (x * (Math.log(x) + -1.0));
double tmp;
if (z <= -3.9e-22) {
tmp = t_0 + (-0.0027777777777778 * (z / x));
} else {
tmp = t_0 + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + (x * (math.log(x) + -1.0)) tmp = 0 if z <= -3.9e-22: tmp = t_0 + (-0.0027777777777778 * (z / x)) else: tmp = t_0 + (0.083333333333333 / x) return tmp
function code(x, y, z) t_0 = Float64(0.91893853320467 + Float64(x * Float64(log(x) + -1.0))) tmp = 0.0 if (z <= -3.9e-22) tmp = Float64(t_0 + Float64(-0.0027777777777778 * 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 = 0.91893853320467 + (x * (log(x) + -1.0)); tmp = 0.0; if (z <= -3.9e-22) tmp = t_0 + (-0.0027777777777778 * (z / x)); else tmp = t_0 + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.9e-22], N[(t$95$0 + N[(-0.0027777777777778 * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.91893853320467 + x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;z \leq -3.9 \cdot 10^{-22}:\\
\;\;\;\;t_0 + -0.0027777777777778 \cdot \frac{z}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -3.89999999999999998e-22Initial program 89.2%
Taylor expanded in x around inf 89.2%
*-commutative28.9%
sub-neg28.9%
mul-1-neg28.9%
log-rec28.9%
remove-double-neg28.9%
metadata-eval28.9%
Simplified89.2%
Taylor expanded in z around 0 46.1%
Taylor expanded in z around inf 46.1%
if -3.89999999999999998e-22 < z Initial program 96.0%
Taylor expanded in z around 0 68.5%
Taylor expanded in x around inf 67.1%
*-commutative67.1%
sub-neg67.1%
mul-1-neg67.1%
log-rec67.1%
remove-double-neg67.1%
metadata-eval67.1%
Simplified67.1%
Final simplification61.3%
(FPCore (x y z)
:precision binary64
(if (<= z -2.5e+41)
(+
(+ 0.91893853320467 (* x (+ (log x) -1.0)))
(* -0.0027777777777778 (/ z x)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.5e+41) {
tmp = (0.91893853320467 + (x * (log(x) + -1.0))) + (-0.0027777777777778 * (z / x));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-2.5d+41)) then
tmp = (0.91893853320467d0 + (x * (log(x) + (-1.0d0)))) + ((-0.0027777777777778d0) * (z / x))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.5e+41) {
tmp = (0.91893853320467 + (x * (Math.log(x) + -1.0))) + (-0.0027777777777778 * (z / x));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.5e+41: tmp = (0.91893853320467 + (x * (math.log(x) + -1.0))) + (-0.0027777777777778 * (z / x)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.5e+41) tmp = Float64(Float64(0.91893853320467 + Float64(x * Float64(log(x) + -1.0))) + Float64(-0.0027777777777778 * Float64(z / x))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.5e+41) tmp = (0.91893853320467 + (x * (log(x) + -1.0))) + (-0.0027777777777778 * (z / x)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.5e+41], N[(N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.0027777777777778 * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+41}:\\
\;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + -0.0027777777777778 \cdot \frac{z}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -2.50000000000000011e41Initial program 87.5%
Taylor expanded in x around inf 87.5%
*-commutative25.3%
sub-neg25.3%
mul-1-neg25.3%
log-rec25.3%
remove-double-neg25.3%
metadata-eval25.3%
Simplified87.5%
Taylor expanded in z around 0 45.3%
Taylor expanded in z around inf 45.3%
if -2.50000000000000011e41 < z Initial program 96.2%
Taylor expanded in z around 0 67.6%
Final simplification62.3%
(FPCore (x y z)
:precision binary64
(if (<= z -2.5e+41)
(+
(+ 0.91893853320467 (* x (+ (log x) -1.0)))
(* -0.0027777777777778 (/ z x)))
(+
(/ 0.083333333333333 x)
(- (* (+ x -0.5) (log x)) (+ x -0.91893853320467)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.5e+41) {
tmp = (0.91893853320467 + (x * (log(x) + -1.0))) + (-0.0027777777777778 * (z / x));
} else {
tmp = (0.083333333333333 / x) + (((x + -0.5) * log(x)) - (x + -0.91893853320467));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-2.5d+41)) then
tmp = (0.91893853320467d0 + (x * (log(x) + (-1.0d0)))) + ((-0.0027777777777778d0) * (z / x))
else
tmp = (0.083333333333333d0 / x) + (((x + (-0.5d0)) * log(x)) - (x + (-0.91893853320467d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.5e+41) {
tmp = (0.91893853320467 + (x * (Math.log(x) + -1.0))) + (-0.0027777777777778 * (z / x));
} else {
tmp = (0.083333333333333 / x) + (((x + -0.5) * Math.log(x)) - (x + -0.91893853320467));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.5e+41: tmp = (0.91893853320467 + (x * (math.log(x) + -1.0))) + (-0.0027777777777778 * (z / x)) else: tmp = (0.083333333333333 / x) + (((x + -0.5) * math.log(x)) - (x + -0.91893853320467)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.5e+41) tmp = Float64(Float64(0.91893853320467 + Float64(x * Float64(log(x) + -1.0))) + Float64(-0.0027777777777778 * Float64(z / x))); else tmp = Float64(Float64(0.083333333333333 / x) + Float64(Float64(Float64(x + -0.5) * log(x)) - Float64(x + -0.91893853320467))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.5e+41) tmp = (0.91893853320467 + (x * (log(x) + -1.0))) + (-0.0027777777777778 * (z / x)); else tmp = (0.083333333333333 / x) + (((x + -0.5) * log(x)) - (x + -0.91893853320467)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.5e+41], N[(N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.0027777777777778 * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+41}:\\
\;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + -0.0027777777777778 \cdot \frac{z}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right)\\
\end{array}
\end{array}
if z < -2.50000000000000011e41Initial program 87.5%
Taylor expanded in x around inf 87.5%
*-commutative25.3%
sub-neg25.3%
mul-1-neg25.3%
log-rec25.3%
remove-double-neg25.3%
metadata-eval25.3%
Simplified87.5%
Taylor expanded in z around 0 45.3%
Taylor expanded in z around inf 45.3%
if -2.50000000000000011e41 < z Initial program 96.2%
Taylor expanded in z around 0 67.6%
associate-+l-67.6%
sub-neg67.6%
metadata-eval67.6%
*-commutative67.6%
sub-neg67.6%
metadata-eval67.6%
Applied egg-rr67.6%
Final simplification62.3%
(FPCore (x y z) :precision binary64 (+ (+ 0.91893853320467 (* x (+ (log x) -1.0))) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return (0.91893853320467 + (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 = (0.91893853320467d0 + (x * (log(x) + (-1.0d0)))) + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 + (x * (Math.log(x) + -1.0))) + (0.083333333333333 / x);
}
def code(x, y, z): return (0.91893853320467 + (x * (math.log(x) + -1.0))) + (0.083333333333333 / x)
function code(x, y, z) return Float64(Float64(0.91893853320467 + Float64(x * Float64(log(x) + -1.0))) + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = (0.91893853320467 + (x * (log(x) + -1.0))) + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + \frac{0.083333333333333}{x}
\end{array}
Initial program 94.1%
Taylor expanded in z around 0 57.5%
Taylor expanded in x around inf 56.5%
*-commutative56.5%
sub-neg56.5%
mul-1-neg56.5%
log-rec56.5%
remove-double-neg56.5%
metadata-eval56.5%
Simplified56.5%
Final simplification56.5%
(FPCore (x y z) :precision binary64 (+ (+ 0.91893853320467 (* -0.5 (log x))) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return (0.91893853320467 + (-0.5 * log(x))) + (0.083333333333333 / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.91893853320467d0 + ((-0.5d0) * log(x))) + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 + (-0.5 * Math.log(x))) + (0.083333333333333 / x);
}
def code(x, y, z): return (0.91893853320467 + (-0.5 * math.log(x))) + (0.083333333333333 / x)
function code(x, y, z) return Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = (0.91893853320467 + (-0.5 * log(x))) + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{0.083333333333333}{x}
\end{array}
Initial program 94.1%
Taylor expanded in z around 0 57.5%
Taylor expanded in x around 0 19.5%
Final simplification19.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.1%
Taylor expanded in z around 0 57.5%
Taylor expanded in x around 0 19.5%
div-inv19.4%
Applied egg-rr19.4%
Taylor expanded in x around inf 2.5%
*-commutative2.5%
log-rec2.5%
distribute-lft-neg-out2.5%
unsub-neg2.5%
Simplified2.5%
Final simplification2.5%
(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 2023178
(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)))