
(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 19 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 3e+53)
(+
(fma (+ x -0.5) (log x) (- x))
(+
0.91893853320467
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)))
(+
(- (* (log x) (+ x -0.5)) (+ x -0.91893853320467))
(+
(*
z
(-
(* y (+ (* 0.0007936500793651 (/ z (* x y))) (/ z x)))
(* 0.0027777777777778 (/ 1.0 x))))
(* 0.083333333333333 (/ 1.0 x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3e+53) {
tmp = fma((x + -0.5), log(x), -x) + (0.91893853320467 + (fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x));
} else {
tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((z * ((y * ((0.0007936500793651 * (z / (x * y))) + (z / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 3e+53) tmp = Float64(fma(Float64(x + -0.5), log(x), Float64(-x)) + Float64(0.91893853320467 + Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x))); else tmp = Float64(Float64(Float64(log(x) * Float64(x + -0.5)) - Float64(x + -0.91893853320467)) + Float64(Float64(z * Float64(Float64(y * Float64(Float64(0.0007936500793651 * Float64(z / Float64(x * y))) + Float64(z / x))) - Float64(0.0027777777777778 * Float64(1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 3e+53], N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(y * N[(N[(0.0007936500793651 * N[(z / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3 \cdot 10^{+53}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, -x\right) + \left(0.91893853320467 + \frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right) + \left(z \cdot \left(y \cdot \left(0.0007936500793651 \cdot \frac{z}{x \cdot y} + \frac{z}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < 2.99999999999999998e53Initial program 99.7%
associate-+l+99.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
if 2.99999999999999998e53 < x Initial program 86.8%
associate-+l-86.8%
sub-neg86.8%
metadata-eval86.8%
*-commutative86.8%
sub-neg86.8%
metadata-eval86.8%
Applied egg-rr86.8%
Taylor expanded in z around 0 99.5%
Taylor expanded in y around inf 99.6%
(FPCore (x y z)
:precision binary64
(if (<= x 2.7e+53)
(+
(fma (+ x -0.5) (log x) (- 0.91893853320467 x))
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x))
(+
(- (* (log x) (+ x -0.5)) (+ x -0.91893853320467))
(+
(*
z
(-
(* y (+ (* 0.0007936500793651 (/ z (* x y))) (/ z x)))
(* 0.0027777777777778 (/ 1.0 x))))
(* 0.083333333333333 (/ 1.0 x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.7e+53) {
tmp = fma((x + -0.5), log(x), (0.91893853320467 - x)) + (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x);
} else {
tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((z * ((y * ((0.0007936500793651 * (z / (x * y))) + (z / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2.7e+53) tmp = Float64(fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - x)) + Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x)); else tmp = Float64(Float64(Float64(log(x) * Float64(x + -0.5)) - Float64(x + -0.91893853320467)) + Float64(Float64(z * Float64(Float64(y * Float64(Float64(0.0007936500793651 * Float64(z / Float64(x * y))) + Float64(z / x))) - Float64(0.0027777777777778 * Float64(1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2.7e+53], N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(y * N[(N[(0.0007936500793651 * N[(z / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.7 \cdot 10^{+53}:\\
\;\;\;\;\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(\log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right) + \left(z \cdot \left(y \cdot \left(0.0007936500793651 \cdot \frac{z}{x \cdot y} + \frac{z}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < 2.70000000000000019e53Initial program 99.7%
sub-neg99.7%
associate-+l+99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
unsub-neg99.7%
*-commutative99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
if 2.70000000000000019e53 < x Initial program 86.8%
associate-+l-86.8%
sub-neg86.8%
metadata-eval86.8%
*-commutative86.8%
sub-neg86.8%
metadata-eval86.8%
Applied egg-rr86.8%
Taylor expanded in z around 0 99.5%
Taylor expanded in y around inf 99.6%
(FPCore (x y z)
:precision binary64
(if (<= x 2e-23)
(+
(+ (* -0.5 (log x)) 0.91893853320467)
(pow
(/
x
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))))
-1.0))
(+
(- (* (log x) (+ x -0.5)) (+ x -0.91893853320467))
(+
(*
z
(-
(* z (+ (/ 0.0007936500793651 x) (/ y x)))
(* 0.0027777777777778 (/ 1.0 x))))
(* 0.083333333333333 (/ 1.0 x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2e-23) {
tmp = ((-0.5 * log(x)) + 0.91893853320467) + pow((x / (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)))), -1.0);
} else {
tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 2d-23) then
tmp = (((-0.5d0) * log(x)) + 0.91893853320467d0) + ((x / (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0)))) ** (-1.0d0))
else
tmp = ((log(x) * (x + (-0.5d0))) - (x + (-0.91893853320467d0))) + ((z * ((z * ((0.0007936500793651d0 / x) + (y / x))) - (0.0027777777777778d0 * (1.0d0 / x)))) + (0.083333333333333d0 * (1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 2e-23) {
tmp = ((-0.5 * Math.log(x)) + 0.91893853320467) + Math.pow((x / (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)))), -1.0);
} else {
tmp = ((Math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2e-23: tmp = ((-0.5 * math.log(x)) + 0.91893853320467) + math.pow((x / (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)))), -1.0) else: tmp = ((math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2e-23) tmp = Float64(Float64(Float64(-0.5 * log(x)) + 0.91893853320467) + (Float64(x / Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778)))) ^ -1.0)); else tmp = Float64(Float64(Float64(log(x) * Float64(x + -0.5)) - Float64(x + -0.91893853320467)) + Float64(Float64(z * Float64(Float64(z * Float64(Float64(0.0007936500793651 / x) + Float64(y / x))) - Float64(0.0027777777777778 * Float64(1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 2e-23) tmp = ((-0.5 * log(x)) + 0.91893853320467) + ((x / (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)))) ^ -1.0); else tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2e-23], N[(N[(N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[Power[N[(x / N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(z * N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{-23}:\\
\;\;\;\;\left(-0.5 \cdot \log x + 0.91893853320467\right) + {\left(\frac{x}{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;\left(\log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right) + \left(z \cdot \left(z \cdot \left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < 1.99999999999999992e-23Initial program 99.7%
fma-neg99.7%
metadata-eval99.7%
fma-define99.7%
clear-num99.7%
inv-pow99.7%
fma-define99.7%
*-commutative99.7%
fma-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in x around 0 99.7%
if 1.99999999999999992e-23 < x Initial program 89.9%
associate-+l-89.9%
sub-neg89.9%
metadata-eval89.9%
*-commutative89.9%
sub-neg89.9%
metadata-eval89.9%
Applied egg-rr89.9%
Taylor expanded in z around 0 99.6%
Taylor expanded in x around 0 99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)))
(if (<= t_0 INFINITY)
(+
(- (* (log x) (+ x -0.5)) (+ x -0.91893853320467))
(/ (+ t_0 0.083333333333333) x))
(+
(+ 0.91893853320467 (* -0.5 (log x)))
(+
(*
z
(-
(* z (+ (/ 0.0007936500793651 x) (/ y x)))
(* 0.0027777777777778 (/ 1.0 x))))
(* 0.083333333333333 (/ 1.0 x)))))))
double code(double x, double y, double z) {
double t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z;
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((t_0 + 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + (-0.5 * log(x))) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z;
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = ((Math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((t_0 + 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + (-0.5 * Math.log(x))) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
def code(x, y, z): t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z tmp = 0 if t_0 <= math.inf: tmp = ((math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((t_0 + 0.083333333333333) / x) else: tmp = (0.91893853320467 + (-0.5 * math.log(x))) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x))) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) tmp = 0.0 if (t_0 <= Inf) tmp = Float64(Float64(Float64(log(x) * Float64(x + -0.5)) - Float64(x + -0.91893853320467)) + Float64(Float64(t_0 + 0.083333333333333) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(Float64(z * Float64(Float64(z * Float64(Float64(0.0007936500793651 / x) + Float64(y / x))) - Float64(0.0027777777777778 * Float64(1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z; tmp = 0.0; if (t_0 <= Inf) tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((t_0 + 0.083333333333333) / x); else tmp = (0.91893853320467 + (-0.5 * log(x))) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(z * N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z\\
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;\left(\log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right) + \frac{t\_0 + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \left(z \cdot \left(z \cdot \left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < +inf.0Initial program 94.5%
associate-+l-94.5%
sub-neg94.5%
metadata-eval94.5%
*-commutative94.5%
sub-neg94.5%
metadata-eval94.5%
Applied egg-rr94.5%
if +inf.0 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 94.5%
associate-+l-94.5%
sub-neg94.5%
metadata-eval94.5%
*-commutative94.5%
sub-neg94.5%
metadata-eval94.5%
Applied egg-rr94.5%
Taylor expanded in z around 0 94.0%
Taylor expanded in x around 0 94.0%
Taylor expanded in x around 0 64.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (* (log x) (+ x -0.5)) (+ x -0.91893853320467))))
(if (<= x 2e+54)
(+
t_0
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))
(+
t_0
(+
(*
z
(-
(* y (+ (* 0.0007936500793651 (/ z (* x y))) (/ z x)))
(* 0.0027777777777778 (/ 1.0 x))))
(* 0.083333333333333 (/ 1.0 x)))))))
double code(double x, double y, double z) {
double t_0 = (log(x) * (x + -0.5)) - (x + -0.91893853320467);
double tmp;
if (x <= 2e+54) {
tmp = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = t_0 + ((z * ((y * ((0.0007936500793651 * (z / (x * y))) + (z / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (log(x) * (x + (-0.5d0))) - (x + (-0.91893853320467d0))
if (x <= 2d+54) then
tmp = t_0 + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
else
tmp = t_0 + ((z * ((y * ((0.0007936500793651d0 * (z / (x * y))) + (z / x))) - (0.0027777777777778d0 * (1.0d0 / x)))) + (0.083333333333333d0 * (1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (Math.log(x) * (x + -0.5)) - (x + -0.91893853320467);
double tmp;
if (x <= 2e+54) {
tmp = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = t_0 + ((z * ((y * ((0.0007936500793651 * (z / (x * y))) + (z / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
def code(x, y, z): t_0 = (math.log(x) * (x + -0.5)) - (x + -0.91893853320467) tmp = 0 if x <= 2e+54: tmp = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) else: tmp = t_0 + ((z * ((y * ((0.0007936500793651 * (z / (x * y))) + (z / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x))) return tmp
function code(x, y, z) t_0 = Float64(Float64(log(x) * Float64(x + -0.5)) - Float64(x + -0.91893853320467)) tmp = 0.0 if (x <= 2e+54) tmp = Float64(t_0 + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)); else tmp = Float64(t_0 + Float64(Float64(z * Float64(Float64(y * Float64(Float64(0.0007936500793651 * Float64(z / Float64(x * y))) + Float64(z / x))) - Float64(0.0027777777777778 * Float64(1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (log(x) * (x + -0.5)) - (x + -0.91893853320467); tmp = 0.0; if (x <= 2e+54) tmp = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); else tmp = t_0 + ((z * ((y * ((0.0007936500793651 * (z / (x * y))) + (z / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2e+54], N[(t$95$0 + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(z * N[(N[(y * N[(N[(0.0007936500793651 * N[(z / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\\
\mathbf{if}\;x \leq 2 \cdot 10^{+54}:\\
\;\;\;\;t\_0 + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \left(z \cdot \left(y \cdot \left(0.0007936500793651 \cdot \frac{z}{x \cdot y} + \frac{z}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < 2.0000000000000002e54Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
metadata-eval99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
if 2.0000000000000002e54 < x Initial program 86.8%
associate-+l-86.8%
sub-neg86.8%
metadata-eval86.8%
*-commutative86.8%
sub-neg86.8%
metadata-eval86.8%
Applied egg-rr86.8%
Taylor expanded in z around 0 99.5%
Taylor expanded in y around inf 99.6%
(FPCore (x y z)
:precision binary64
(if (<= x 1.35e-22)
(+
(+ (* -0.5 (log x)) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))
(+
(- (* (log x) (+ x -0.5)) (+ x -0.91893853320467))
(+
(*
z
(-
(* z (+ (/ 0.0007936500793651 x) (/ y x)))
(* 0.0027777777777778 (/ 1.0 x))))
(* 0.083333333333333 (/ 1.0 x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.35e-22) {
tmp = ((-0.5 * log(x)) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.35d-22) then
tmp = (((-0.5d0) * log(x)) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
else
tmp = ((log(x) * (x + (-0.5d0))) - (x + (-0.91893853320467d0))) + ((z * ((z * ((0.0007936500793651d0 / x) + (y / x))) - (0.0027777777777778d0 * (1.0d0 / x)))) + (0.083333333333333d0 * (1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.35e-22) {
tmp = ((-0.5 * Math.log(x)) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = ((Math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.35e-22: tmp = ((-0.5 * math.log(x)) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) else: tmp = ((math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.35e-22) tmp = Float64(Float64(Float64(-0.5 * log(x)) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)); else tmp = Float64(Float64(Float64(log(x) * Float64(x + -0.5)) - Float64(x + -0.91893853320467)) + Float64(Float64(z * Float64(Float64(z * Float64(Float64(0.0007936500793651 / x) + Float64(y / x))) - Float64(0.0027777777777778 * Float64(1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.35e-22) tmp = ((-0.5 * log(x)) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); else tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((z * ((z * ((0.0007936500793651 / x) + (y / x))) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.35e-22], N[(N[(N[(-0.5 * N[Log[x], $MachinePrecision]), $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], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(z * N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.35 \cdot 10^{-22}:\\
\;\;\;\;\left(-0.5 \cdot \log x + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right) + \left(z \cdot \left(z \cdot \left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < 1.3500000000000001e-22Initial program 99.7%
Taylor expanded in x around 0 99.7%
if 1.3500000000000001e-22 < x Initial program 89.9%
associate-+l-89.9%
sub-neg89.9%
metadata-eval89.9%
*-commutative89.9%
sub-neg89.9%
metadata-eval89.9%
Applied egg-rr89.9%
Taylor expanded in z around 0 99.6%
Taylor expanded in x around 0 99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (* (log x) (+ x -0.5)) (+ x -0.91893853320467))))
(if (<= x 7.2e+129)
(+
t_0
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))
(+
t_0
(+
(*
z
(- (* 0.0007936500793651 (/ z x)) (* 0.0027777777777778 (/ 1.0 x))))
(* 0.083333333333333 (/ 1.0 x)))))))
double code(double x, double y, double z) {
double t_0 = (log(x) * (x + -0.5)) - (x + -0.91893853320467);
double tmp;
if (x <= 7.2e+129) {
tmp = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = t_0 + ((z * ((0.0007936500793651 * (z / x)) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (log(x) * (x + (-0.5d0))) - (x + (-0.91893853320467d0))
if (x <= 7.2d+129) then
tmp = t_0 + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
else
tmp = t_0 + ((z * ((0.0007936500793651d0 * (z / x)) - (0.0027777777777778d0 * (1.0d0 / x)))) + (0.083333333333333d0 * (1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (Math.log(x) * (x + -0.5)) - (x + -0.91893853320467);
double tmp;
if (x <= 7.2e+129) {
tmp = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = t_0 + ((z * ((0.0007936500793651 * (z / x)) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
def code(x, y, z): t_0 = (math.log(x) * (x + -0.5)) - (x + -0.91893853320467) tmp = 0 if x <= 7.2e+129: tmp = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) else: tmp = t_0 + ((z * ((0.0007936500793651 * (z / x)) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x))) return tmp
function code(x, y, z) t_0 = Float64(Float64(log(x) * Float64(x + -0.5)) - Float64(x + -0.91893853320467)) tmp = 0.0 if (x <= 7.2e+129) tmp = Float64(t_0 + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)); else tmp = Float64(t_0 + Float64(Float64(z * Float64(Float64(0.0007936500793651 * Float64(z / x)) - Float64(0.0027777777777778 * Float64(1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (log(x) * (x + -0.5)) - (x + -0.91893853320467); tmp = 0.0; if (x <= 7.2e+129) tmp = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); else tmp = t_0 + ((z * ((0.0007936500793651 * (z / x)) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 7.2e+129], N[(t$95$0 + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(z * N[(N[(0.0007936500793651 * N[(z / x), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\\
\mathbf{if}\;x \leq 7.2 \cdot 10^{+129}:\\
\;\;\;\;t\_0 + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \left(z \cdot \left(0.0007936500793651 \cdot \frac{z}{x} - 0.0027777777777778 \cdot \frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < 7.2000000000000002e129Initial program 98.7%
associate-+l-98.7%
sub-neg98.7%
metadata-eval98.7%
*-commutative98.7%
sub-neg98.7%
metadata-eval98.7%
Applied egg-rr98.7%
if 7.2000000000000002e129 < x Initial program 83.5%
associate-+l-83.5%
sub-neg83.5%
metadata-eval83.5%
*-commutative83.5%
sub-neg83.5%
metadata-eval83.5%
Applied egg-rr83.5%
Taylor expanded in z around 0 99.5%
Taylor expanded in y around 0 92.6%
(FPCore (x y z)
:precision binary64
(+
(- (* (log x) (+ x -0.5)) (+ x -0.91893853320467))
(+
(*
z
(- (/ (* z (+ 0.0007936500793651 y)) x) (* 0.0027777777777778 (/ 1.0 x))))
(* 0.083333333333333 (/ 1.0 x)))))
double code(double x, double y, double z) {
return ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((z * (((z * (0.0007936500793651 + y)) / x) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((log(x) * (x + (-0.5d0))) - (x + (-0.91893853320467d0))) + ((z * (((z * (0.0007936500793651d0 + y)) / x) - (0.0027777777777778d0 * (1.0d0 / x)))) + (0.083333333333333d0 * (1.0d0 / x)))
end function
public static double code(double x, double y, double z) {
return ((Math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((z * (((z * (0.0007936500793651 + y)) / x) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
def code(x, y, z): return ((math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((z * (((z * (0.0007936500793651 + y)) / x) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x)))
function code(x, y, z) return Float64(Float64(Float64(log(x) * Float64(x + -0.5)) - Float64(x + -0.91893853320467)) + Float64(Float64(z * Float64(Float64(Float64(z * Float64(0.0007936500793651 + y)) / x) - Float64(0.0027777777777778 * Float64(1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x)))) end
function tmp = code(x, y, z) tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((z * (((z * (0.0007936500793651 + y)) / x) - (0.0027777777777778 * (1.0 / x)))) + (0.083333333333333 * (1.0 / x))); end
code[x_, y_, z_] := N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - N[(0.0027777777777778 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right) + \left(z \cdot \left(\frac{z \cdot \left(0.0007936500793651 + y\right)}{x} - 0.0027777777777778 \cdot \frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)
\end{array}
Initial program 94.5%
associate-+l-94.5%
sub-neg94.5%
metadata-eval94.5%
*-commutative94.5%
sub-neg94.5%
metadata-eval94.5%
Applied egg-rr94.5%
Taylor expanded in z around 0 94.0%
Taylor expanded in x around 0 96.7%
(FPCore (x y z)
:precision binary64
(if (<= x 6.2e+129)
(+
(+ (* -0.5 (log x)) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 6.2e+129) {
tmp = ((-0.5 * log(x)) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / 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 (x <= 6.2d+129) then
tmp = (((-0.5d0) * log(x)) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / 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 (x <= 6.2e+129) {
tmp = ((-0.5 * Math.log(x)) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / 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 x <= 6.2e+129: tmp = ((-0.5 * math.log(x)) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / 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 (x <= 6.2e+129) tmp = Float64(Float64(Float64(-0.5 * log(x)) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / 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 (x <= 6.2e+129) tmp = ((-0.5 * log(x)) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 6.2e+129], N[(N[(N[(-0.5 * N[Log[x], $MachinePrecision]), $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], 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}\;x \leq 6.2 \cdot 10^{+129}:\\
\;\;\;\;\left(-0.5 \cdot \log x + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\
\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 x < 6.1999999999999999e129Initial program 98.7%
Taylor expanded in x around 0 89.1%
if 6.1999999999999999e129 < x Initial program 83.5%
Taylor expanded in z around 0 85.9%
(FPCore (x y z)
:precision binary64
(+
(* x (- (* -1.0 (log (/ 1.0 x))) 1.0))
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return (x * ((-1.0 * log((1.0 / x))) - 1.0)) + ((((((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 * (((-1.0d0) * log((1.0d0 / x))) - 1.0d0)) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return (x * ((-1.0 * Math.log((1.0 / x))) - 1.0)) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return (x * ((-1.0 * math.log((1.0 / x))) - 1.0)) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(x * Float64(Float64(-1.0 * log(Float64(1.0 / x))) - 1.0)) + 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 * ((-1.0 * log((1.0 / x))) - 1.0)) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(x * N[(N[(-1.0 * N[Log[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $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}
\\
x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Initial program 94.5%
Taylor expanded in x around inf 93.5%
(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}
Initial program 94.5%
(FPCore (x y z)
:precision binary64
(+
(- (* (log x) (+ x -0.5)) (+ x -0.91893853320467))
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((log(x) * (x + -0.5)) - (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 = ((log(x) * (x + (-0.5d0))) - (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 ((Math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(log(x) * Float64(x + -0.5)) - Float64(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 = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $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(\log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Initial program 94.5%
associate-+l-94.5%
sub-neg94.5%
metadata-eval94.5%
*-commutative94.5%
sub-neg94.5%
metadata-eval94.5%
Applied egg-rr94.5%
(FPCore (x y z) :precision binary64 (+ (- (* (log x) (+ x -0.5)) (+ x -0.91893853320467)) (/ (+ (* -0.0027777777777778 z) 0.083333333333333) x)))
double code(double x, double y, double z) {
return ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (((-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 = ((log(x) * (x + (-0.5d0))) - (x + (-0.91893853320467d0))) + ((((-0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((Math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (((-0.0027777777777778 * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (((-0.0027777777777778 * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(log(x) * Float64(x + -0.5)) - Float64(x + -0.91893853320467)) + Float64(Float64(Float64(-0.0027777777777778 * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (((-0.0027777777777778 * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-0.0027777777777778 * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right) + \frac{-0.0027777777777778 \cdot z + 0.083333333333333}{x}
\end{array}
Initial program 94.5%
associate-+l-94.5%
sub-neg94.5%
metadata-eval94.5%
*-commutative94.5%
sub-neg94.5%
metadata-eval94.5%
Applied egg-rr94.5%
Taylor expanded in z around 0 58.8%
(FPCore (x y z) :precision binary64 (if (<= x 215.0) (/ (+ 0.083333333333333 (* x (+ 0.91893853320467 (* -0.5 (log x))))) x) (* x (- (* -1.0 (log (/ 1.0 x))) 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 215.0) {
tmp = (0.083333333333333 + (x * (0.91893853320467 + (-0.5 * log(x))))) / x;
} else {
tmp = x * ((-1.0 * log((1.0 / x))) - 1.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 215.0d0) then
tmp = (0.083333333333333d0 + (x * (0.91893853320467d0 + ((-0.5d0) * log(x))))) / x
else
tmp = x * (((-1.0d0) * log((1.0d0 / x))) - 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 215.0) {
tmp = (0.083333333333333 + (x * (0.91893853320467 + (-0.5 * Math.log(x))))) / x;
} else {
tmp = x * ((-1.0 * Math.log((1.0 / x))) - 1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 215.0: tmp = (0.083333333333333 + (x * (0.91893853320467 + (-0.5 * math.log(x))))) / x else: tmp = x * ((-1.0 * math.log((1.0 / x))) - 1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 215.0) tmp = Float64(Float64(0.083333333333333 + Float64(x * Float64(0.91893853320467 + Float64(-0.5 * log(x))))) / x); else tmp = Float64(x * Float64(Float64(-1.0 * log(Float64(1.0 / x))) - 1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 215.0) tmp = (0.083333333333333 + (x * (0.91893853320467 + (-0.5 * log(x))))) / x; else tmp = x * ((-1.0 * log((1.0 / x))) - 1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 215.0], N[(N[(0.083333333333333 + N[(x * N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(x * N[(N[(-1.0 * N[Log[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 215:\\
\;\;\;\;\frac{0.083333333333333 + x \cdot \left(0.91893853320467 + -0.5 \cdot \log x\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)\\
\end{array}
\end{array}
if x < 215Initial program 99.7%
associate-+l+99.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 46.6%
Taylor expanded in x around 0 46.6%
if 215 < x Initial program 89.2%
associate-+l+89.2%
fma-neg89.2%
sub-neg89.2%
metadata-eval89.2%
fma-define89.2%
fma-neg89.2%
metadata-eval89.2%
Simplified89.2%
Taylor expanded in z around 0 63.0%
Taylor expanded in x around inf 61.8%
(FPCore (x y z) :precision binary64 (if (<= x 215.0) (/ 0.083333333333333 x) (* x (- (* -1.0 (log (/ 1.0 x))) 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 215.0) {
tmp = 0.083333333333333 / x;
} else {
tmp = x * ((-1.0 * log((1.0 / x))) - 1.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 215.0d0) then
tmp = 0.083333333333333d0 / x
else
tmp = x * (((-1.0d0) * log((1.0d0 / x))) - 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 215.0) {
tmp = 0.083333333333333 / x;
} else {
tmp = x * ((-1.0 * Math.log((1.0 / x))) - 1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 215.0: tmp = 0.083333333333333 / x else: tmp = x * ((-1.0 * math.log((1.0 / x))) - 1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 215.0) tmp = Float64(0.083333333333333 / x); else tmp = Float64(x * Float64(Float64(-1.0 * log(Float64(1.0 / x))) - 1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 215.0) tmp = 0.083333333333333 / x; else tmp = x * ((-1.0 * log((1.0 / x))) - 1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 215.0], N[(0.083333333333333 / x), $MachinePrecision], N[(x * N[(N[(-1.0 * N[Log[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 215:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)\\
\end{array}
\end{array}
if x < 215Initial program 99.7%
associate-+l+99.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 46.6%
Taylor expanded in x around 0 45.8%
if 215 < x Initial program 89.2%
associate-+l+89.2%
fma-neg89.2%
sub-neg89.2%
metadata-eval89.2%
fma-define89.2%
fma-neg89.2%
metadata-eval89.2%
Simplified89.2%
Taylor expanded in z around 0 63.0%
Taylor expanded in x around inf 61.8%
(FPCore (x y z) :precision binary64 (if (<= x 215.0) (+ (* -0.5 (log x)) (+ 0.91893853320467 (/ 0.083333333333333 x))) (* x (- (* -1.0 (log (/ 1.0 x))) 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 215.0) {
tmp = (-0.5 * log(x)) + (0.91893853320467 + (0.083333333333333 / x));
} else {
tmp = x * ((-1.0 * log((1.0 / x))) - 1.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 215.0d0) then
tmp = ((-0.5d0) * log(x)) + (0.91893853320467d0 + (0.083333333333333d0 / x))
else
tmp = x * (((-1.0d0) * log((1.0d0 / x))) - 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 215.0) {
tmp = (-0.5 * Math.log(x)) + (0.91893853320467 + (0.083333333333333 / x));
} else {
tmp = x * ((-1.0 * Math.log((1.0 / x))) - 1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 215.0: tmp = (-0.5 * math.log(x)) + (0.91893853320467 + (0.083333333333333 / x)) else: tmp = x * ((-1.0 * math.log((1.0 / x))) - 1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 215.0) tmp = Float64(Float64(-0.5 * log(x)) + Float64(0.91893853320467 + Float64(0.083333333333333 / x))); else tmp = Float64(x * Float64(Float64(-1.0 * log(Float64(1.0 / x))) - 1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 215.0) tmp = (-0.5 * log(x)) + (0.91893853320467 + (0.083333333333333 / x)); else tmp = x * ((-1.0 * log((1.0 / x))) - 1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 215.0], N[(N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(-1.0 * N[Log[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 215:\\
\;\;\;\;-0.5 \cdot \log x + \left(0.91893853320467 + \frac{0.083333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)\\
\end{array}
\end{array}
if x < 215Initial program 99.7%
associate-+l+99.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 46.6%
Taylor expanded in x around 0 46.6%
if 215 < x Initial program 89.2%
associate-+l+89.2%
fma-neg89.2%
sub-neg89.2%
metadata-eval89.2%
fma-define89.2%
fma-neg89.2%
metadata-eval89.2%
Simplified89.2%
Taylor expanded in z around 0 63.0%
Taylor expanded in x around inf 61.8%
(FPCore (x y z) :precision binary64 (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}
\end{array}
Initial program 94.5%
Taylor expanded in z around 0 54.6%
(FPCore (x y z) :precision binary64 (+ (- (* (log x) (+ x -0.5)) (+ x -0.91893853320467)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (0.083333333333333 / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((log(x) * (x + (-0.5d0))) - (x + (-0.91893853320467d0))) + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return ((Math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (0.083333333333333 / x);
}
def code(x, y, z): return ((math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (0.083333333333333 / x)
function code(x, y, z) return Float64(Float64(Float64(log(x) * Float64(x + -0.5)) - Float64(x + -0.91893853320467)) + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right) + \frac{0.083333333333333}{x}
\end{array}
Initial program 94.5%
associate-+l-94.5%
sub-neg94.5%
metadata-eval94.5%
*-commutative94.5%
sub-neg94.5%
metadata-eval94.5%
Applied egg-rr94.5%
Taylor expanded in z around 0 54.6%
(FPCore (x y z) :precision binary64 (/ 0.083333333333333 x))
double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.083333333333333d0 / x
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
def code(x, y, z): return 0.083333333333333 / x
function code(x, y, z) return Float64(0.083333333333333 / x) end
function tmp = code(x, y, z) tmp = 0.083333333333333 / x; end
code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x}
\end{array}
Initial program 94.5%
associate-+l+94.5%
fma-neg94.5%
sub-neg94.5%
metadata-eval94.5%
fma-define94.5%
fma-neg94.5%
metadata-eval94.5%
Simplified94.5%
Taylor expanded in z around 0 54.6%
Taylor expanded in x around 0 24.8%
(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 2024076 -o generate:simplify
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:alt
(+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))