
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)))
(if (<= x 1.2e+34)
(+
t_0
(pow
(/
x
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333))
-1.0))
(+ t_0 (* (* z (/ z x)) (+ y 0.0007936500793651))))))
double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 1.2e+34) {
tmp = t_0 + pow((x / fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333)), -1.0);
} else {
tmp = t_0 + ((z * (z / x)) * (y + 0.0007936500793651));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if (x <= 1.2e+34) tmp = Float64(t_0 + (Float64(x / fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333)) ^ -1.0)); else tmp = Float64(t_0 + Float64(Float64(z * Float64(z / x)) * Float64(y + 0.0007936500793651))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[LessEqual[x, 1.2e+34], N[(t$95$0 + N[Power[N[(x / N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;x \leq 1.2 \cdot 10^{+34}:\\
\;\;\;\;t_0 + {\left(\frac{x}{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(z \cdot \frac{z}{x}\right) \cdot \left(y + 0.0007936500793651\right)\\
\end{array}
\end{array}
if x < 1.19999999999999993e34Initial program 99.6%
clear-num99.7%
inv-pow99.7%
*-commutative99.7%
fma-udef99.7%
fma-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
if 1.19999999999999993e34 < x Initial program 84.2%
Taylor expanded in z around inf 83.5%
associate-/l*87.6%
+-commutative87.6%
associate-/r/87.5%
+-commutative87.5%
Simplified87.5%
unpow287.5%
*-un-lft-identity87.5%
times-frac99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (<= x 2.05e+62)
(+
(fma (+ x -0.5) (log x) (- 0.91893853320467 x))
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(* (* z (/ z x)) (+ y 0.0007936500793651)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.05e+62) {
tmp = fma((x + -0.5), log(x), (0.91893853320467 - x)) + (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x);
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * (z / x)) * (y + 0.0007936500793651));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2.05e+62) 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(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(z * Float64(z / x)) * Float64(y + 0.0007936500793651))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2.05e+62], 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[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.05 \cdot 10^{+62}:\\
\;\;\;\;\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(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \frac{z}{x}\right) \cdot \left(y + 0.0007936500793651\right)\\
\end{array}
\end{array}
if x < 2.04999999999999992e62Initial program 99.6%
sub-neg99.6%
associate-+l+99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
unsub-neg99.6%
*-commutative99.6%
fma-def99.6%
fma-neg99.6%
metadata-eval99.6%
Simplified99.6%
if 2.04999999999999992e62 < x Initial program 82.9%
Taylor expanded in z around inf 82.1%
associate-/l*86.6%
+-commutative86.6%
associate-/r/86.5%
+-commutative86.5%
Simplified86.5%
unpow286.5%
*-un-lft-identity86.5%
times-frac99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (<= x 5e+38)
(+
(+ 0.91893853320467 (- (pow (sqrt (* (log x) (+ x -0.5))) 2.0) x))
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(* (* z (/ z x)) (+ y 0.0007936500793651)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5e+38) {
tmp = (0.91893853320467 + (pow(sqrt((log(x) * (x + -0.5))), 2.0) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * (z / x)) * (y + 0.0007936500793651));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 5d+38) then
tmp = (0.91893853320467d0 + ((sqrt((log(x) * (x + (-0.5d0)))) ** 2.0d0) - x)) + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((z * (z / x)) * (y + 0.0007936500793651d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5e+38) {
tmp = (0.91893853320467 + (Math.pow(Math.sqrt((Math.log(x) * (x + -0.5))), 2.0) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((z * (z / x)) * (y + 0.0007936500793651));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5e+38: tmp = (0.91893853320467 + (math.pow(math.sqrt((math.log(x) * (x + -0.5))), 2.0) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((z * (z / x)) * (y + 0.0007936500793651)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5e+38) tmp = Float64(Float64(0.91893853320467 + Float64((sqrt(Float64(log(x) * Float64(x + -0.5))) ^ 2.0) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(z * Float64(z / x)) * Float64(y + 0.0007936500793651))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5e+38) tmp = (0.91893853320467 + ((sqrt((log(x) * (x + -0.5))) ^ 2.0) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * (z / x)) * (y + 0.0007936500793651)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5e+38], N[(N[(0.91893853320467 + N[(N[Power[N[Sqrt[N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{+38}:\\
\;\;\;\;\left(0.91893853320467 + \left({\left(\sqrt{\log x \cdot \left(x + -0.5\right)}\right)}^{2} - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \frac{z}{x}\right) \cdot \left(y + 0.0007936500793651\right)\\
\end{array}
\end{array}
if x < 4.9999999999999997e38Initial program 99.6%
add-sqr-sqrt99.6%
pow299.6%
sub-neg99.6%
metadata-eval99.6%
Applied egg-rr99.6%
if 4.9999999999999997e38 < x Initial program 83.8%
Taylor expanded in z around inf 83.1%
associate-/l*87.3%
+-commutative87.3%
associate-/r/87.2%
+-commutative87.2%
Simplified87.2%
unpow287.2%
*-un-lft-identity87.2%
times-frac99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
(if (<= t_0 (- INFINITY))
(-
(+ 0.91893853320467 (* (log x) -0.5))
(* (+ y 0.0007936500793651) (/ (* z z) (- x))))
(+ (/ (+ 0.083333333333333 t_0) x) (* x (+ (log x) -1.0))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (0.91893853320467 + (log(x) * -0.5)) - ((y + 0.0007936500793651) * ((z * z) / -x));
} else {
tmp = ((0.083333333333333 + t_0) / x) + (x * (log(x) + -1.0));
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = (0.91893853320467 + (Math.log(x) * -0.5)) - ((y + 0.0007936500793651) * ((z * z) / -x));
} else {
tmp = ((0.083333333333333 + t_0) / x) + (x * (Math.log(x) + -1.0));
}
return tmp;
}
def code(x, y, z): t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778) tmp = 0 if t_0 <= -math.inf: tmp = (0.91893853320467 + (math.log(x) * -0.5)) - ((y + 0.0007936500793651) * ((z * z) / -x)) else: tmp = ((0.083333333333333 + t_0) / x) + (x * (math.log(x) + -1.0)) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(0.91893853320467 + Float64(log(x) * -0.5)) - Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) / Float64(-x)))); else tmp = Float64(Float64(Float64(0.083333333333333 + t_0) / x) + Float64(x * Float64(log(x) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778); tmp = 0.0; if (t_0 <= -Inf) tmp = (0.91893853320467 + (log(x) * -0.5)) - ((y + 0.0007936500793651) * ((z * z) / -x)); else tmp = ((0.083333333333333 + t_0) / x) + (x * (log(x) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.083333333333333 + t$95$0), $MachinePrecision] / x), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t_0 \leq -\infty:\\
\;\;\;\;\left(0.91893853320467 + \log x \cdot -0.5\right) - \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{-x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + t_0}{x} + x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < -inf.0Initial program 73.9%
Taylor expanded in z around inf 73.9%
associate-/l*88.4%
+-commutative88.4%
associate-/r/88.3%
+-commutative88.3%
Simplified88.3%
unpow288.3%
add-sqr-sqrt88.2%
times-frac99.7%
Applied egg-rr99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in x around 0 94.4%
unpow294.4%
frac-2neg94.4%
frac-times87.6%
distribute-lft-neg-in87.6%
add-sqr-sqrt87.7%
Applied egg-rr87.7%
if -inf.0 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 95.5%
Taylor expanded in x around inf 94.4%
sub-neg62.3%
mul-1-neg62.3%
log-rec62.3%
remove-double-neg62.3%
metadata-eval62.3%
Simplified94.4%
Final simplification93.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)))
(if (<= x 1.95e+34)
(+
t_0
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(+ t_0 (* (* z (/ z x)) (+ y 0.0007936500793651))))))
double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 1.95e+34) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((z * (z / x)) * (y + 0.0007936500793651));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0
if (x <= 1.95d+34) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
else
tmp = t_0 + ((z * (z / x)) * (y + 0.0007936500793651d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * Math.log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 1.95e+34) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((z * (z / x)) * (y + 0.0007936500793651));
}
return tmp;
}
def code(x, y, z): t_0 = (((x - 0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if x <= 1.95e+34: tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) else: tmp = t_0 + ((z * (z / x)) * (y + 0.0007936500793651)) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if (x <= 1.95e+34) 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(z * Float64(z / x)) * Float64(y + 0.0007936500793651))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467; tmp = 0.0; if (x <= 1.95e+34) tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = t_0 + ((z * (z / x)) * (y + 0.0007936500793651)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[LessEqual[x, 1.95e+34], 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[(z * N[(z / x), $MachinePrecision]), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;x \leq 1.95 \cdot 10^{+34}:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(z \cdot \frac{z}{x}\right) \cdot \left(y + 0.0007936500793651\right)\\
\end{array}
\end{array}
if x < 1.9500000000000001e34Initial program 99.6%
if 1.9500000000000001e34 < x Initial program 84.2%
Taylor expanded in z around inf 83.5%
associate-/l*87.6%
+-commutative87.6%
associate-/r/87.5%
+-commutative87.5%
Simplified87.5%
unpow287.5%
*-un-lft-identity87.5%
times-frac99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= y -13500000000000.0) (not (<= y 1.7e-94)))
(+ t_0 (/ (+ 0.083333333333333 (* z (* z y))) x))
(+
t_0
(/
(+
0.083333333333333
(* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x)))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if ((y <= -13500000000000.0) || !(y <= 1.7e-94)) {
tmp = t_0 + ((0.083333333333333 + (z * (z * y))) / x);
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (log(x) + (-1.0d0))
if ((y <= (-13500000000000.0d0)) .or. (.not. (y <= 1.7d-94))) then
tmp = t_0 + ((0.083333333333333d0 + (z * (z * y))) / x)
else
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * 0.0007936500793651d0) - 0.0027777777777778d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if ((y <= -13500000000000.0) || !(y <= 1.7e-94)) {
tmp = t_0 + ((0.083333333333333 + (z * (z * y))) / x);
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x);
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if (y <= -13500000000000.0) or not (y <= 1.7e-94): tmp = t_0 + ((0.083333333333333 + (z * (z * y))) / x) else: tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if ((y <= -13500000000000.0) || !(y <= 1.7e-94)) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(z * y))) / x)); else tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * 0.0007936500793651) - 0.0027777777777778))) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if ((y <= -13500000000000.0) || ~((y <= 1.7e-94))) tmp = t_0 + ((0.083333333333333 + (z * (z * y))) / x); else tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y, -13500000000000.0], N[Not[LessEqual[y, 1.7e-94]], $MachinePrecision]], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;y \leq -13500000000000 \lor \neg \left(y \leq 1.7 \cdot 10^{-94}\right):\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot y\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if y < -1.35e13 or 1.6999999999999999e-94 < y Initial program 91.2%
Taylor expanded in x around inf 89.4%
sub-neg46.6%
mul-1-neg46.6%
log-rec46.6%
remove-double-neg46.6%
metadata-eval46.6%
Simplified89.4%
Taylor expanded in y around inf 88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in z around inf 89.4%
*-commutative89.4%
Simplified89.4%
if -1.35e13 < y < 1.6999999999999999e-94Initial program 94.7%
Taylor expanded in x around inf 94.8%
sub-neg65.2%
mul-1-neg65.2%
log-rec65.2%
remove-double-neg65.2%
metadata-eval65.2%
Simplified94.8%
Taylor expanded in y around 0 94.2%
*-commutative94.2%
Simplified94.2%
Final simplification91.6%
(FPCore (x y z)
:precision binary64
(if (<= x 0.00017)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(* x (+ (log x) -1.0)))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(* (* z (/ z x)) (+ y 0.0007936500793651)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.00017) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0));
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * (z / x)) * (y + 0.0007936500793651));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 0.00017d0) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (x * (log(x) + (-1.0d0)))
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((z * (z / x)) * (y + 0.0007936500793651d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 0.00017) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (Math.log(x) + -1.0));
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((z * (z / x)) * (y + 0.0007936500793651));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 0.00017: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (math.log(x) + -1.0)) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((z * (z / x)) * (y + 0.0007936500793651)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 0.00017) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(x * Float64(log(x) + -1.0))); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(z * Float64(z / x)) * Float64(y + 0.0007936500793651))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 0.00017) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0)); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * (z / x)) * (y + 0.0007936500793651)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 0.00017], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.00017:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + x \cdot \left(\log x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \frac{z}{x}\right) \cdot \left(y + 0.0007936500793651\right)\\
\end{array}
\end{array}
if x < 1.7e-4Initial program 99.6%
Taylor expanded in x around inf 98.3%
sub-neg49.1%
mul-1-neg49.1%
log-rec49.1%
remove-double-neg49.1%
metadata-eval49.1%
Simplified98.3%
if 1.7e-4 < x Initial program 86.1%
Taylor expanded in z around inf 84.9%
associate-/l*88.5%
+-commutative88.5%
associate-/r/88.4%
+-commutative88.4%
Simplified88.4%
unpow288.4%
*-un-lft-identity88.4%
times-frac99.0%
Applied egg-rr99.0%
Final simplification98.7%
(FPCore (x y z) :precision binary64 (+ (* x (+ (log x) -1.0)) (/ (+ 0.083333333333333 (* z (* z y))) x)))
double code(double x, double y, double z) {
return (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * (z * y))) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * (z * y))) / x)
end function
public static double code(double x, double y, double z) {
return (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * (z * y))) / x);
}
def code(x, y, z): return (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * (z * y))) / x)
function code(x, y, z) return Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(z * y))) / x)) end
function tmp = code(x, y, z) tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * (z * y))) / x); end
code[x_, y_, z_] := N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot y\right)}{x}
\end{array}
Initial program 92.8%
Taylor expanded in x around inf 91.8%
sub-neg54.9%
mul-1-neg54.9%
log-rec54.9%
remove-double-neg54.9%
metadata-eval54.9%
Simplified91.8%
Taylor expanded in y around inf 81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in z around inf 80.4%
*-commutative80.4%
Simplified80.4%
Final simplification80.4%
(FPCore (x y z) :precision binary64 (+ (* x (+ (log x) -1.0)) (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x)))
double code(double x, double y, double z) {
return (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x)
end function
public static double code(double x, double y, double z) {
return (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
}
def code(x, y, z): return (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x)
function code(x, y, z) return Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)) end
function tmp = code(x, y, z) tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x); end
code[x_, y_, z_] := N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}
\end{array}
Initial program 92.8%
Taylor expanded in x around inf 91.8%
sub-neg54.9%
mul-1-neg54.9%
log-rec54.9%
remove-double-neg54.9%
metadata-eval54.9%
Simplified91.8%
Taylor expanded in z around 0 59.4%
*-commutative59.4%
Simplified59.4%
Final simplification59.4%
(FPCore (x y z) :precision binary64 (+ (* x (+ (log x) -1.0)) (/ 1.0 (* x 12.000000000000048))))
double code(double x, double y, double z) {
return (x * (log(x) + -1.0)) + (1.0 / (x * 12.000000000000048));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (log(x) + (-1.0d0))) + (1.0d0 / (x * 12.000000000000048d0))
end function
public static double code(double x, double y, double z) {
return (x * (Math.log(x) + -1.0)) + (1.0 / (x * 12.000000000000048));
}
def code(x, y, z): return (x * (math.log(x) + -1.0)) + (1.0 / (x * 12.000000000000048))
function code(x, y, z) return Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(1.0 / Float64(x * 12.000000000000048))) end
function tmp = code(x, y, z) tmp = (x * (log(x) + -1.0)) + (1.0 / (x * 12.000000000000048)); end
code[x_, y_, z_] := N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\log x + -1\right) + \frac{1}{x \cdot 12.000000000000048}
\end{array}
Initial program 92.8%
Taylor expanded in z around 0 55.9%
Taylor expanded in x around inf 54.9%
sub-neg54.9%
mul-1-neg54.9%
log-rec54.9%
remove-double-neg54.9%
metadata-eval54.9%
Simplified54.9%
clear-num54.9%
inv-pow54.9%
div-inv54.9%
metadata-eval54.9%
Applied egg-rr54.9%
unpow-154.9%
Simplified54.9%
Final simplification54.9%
(FPCore (x y z) :precision binary64 (+ (+ 0.91893853320467 (- (* x (log x)) x)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return (0.91893853320467 + ((x * log(x)) - 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 + ((x * log(x)) - x)) + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 + ((x * Math.log(x)) - x)) + (0.083333333333333 / x);
}
def code(x, y, z): return (0.91893853320467 + ((x * math.log(x)) - x)) + (0.083333333333333 / x)
function code(x, y, z) return Float64(Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x)) + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = (0.91893853320467 + ((x * log(x)) - x)) + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 + \left(x \cdot \log x - x\right)\right) + \frac{0.083333333333333}{x}
\end{array}
Initial program 92.8%
Taylor expanded in z around 0 55.9%
Taylor expanded in x around inf 55.0%
mul-1-neg55.0%
distribute-rgt-neg-in55.0%
log-rec55.0%
remove-double-neg55.0%
Simplified55.0%
Final simplification55.0%
(FPCore (x y z) :precision binary64 (+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return (x * (log(x) + -1.0)) + (0.083333333333333 / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
}
def code(x, y, z): return (x * (math.log(x) + -1.0)) + (0.083333333333333 / x)
function code(x, y, z) return Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}
\end{array}
Initial program 92.8%
Taylor expanded in z around 0 55.9%
Taylor expanded in x around inf 54.9%
sub-neg54.9%
mul-1-neg54.9%
log-rec54.9%
remove-double-neg54.9%
metadata-eval54.9%
Simplified54.9%
Final simplification54.9%
(FPCore (x y z) :precision binary64 (+ 0.91893853320467 (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return 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 = 0.91893853320467d0 + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return 0.91893853320467 + (0.083333333333333 / x);
}
def code(x, y, z): return 0.91893853320467 + (0.083333333333333 / x)
function code(x, y, z) return Float64(0.91893853320467 + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = 0.91893853320467 + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.91893853320467 + \frac{0.083333333333333}{x}
\end{array}
Initial program 92.8%
Taylor expanded in z around 0 55.9%
Taylor expanded in x around inf 55.0%
mul-1-neg55.0%
distribute-rgt-neg-in55.0%
log-rec55.0%
remove-double-neg55.0%
Simplified55.0%
Taylor expanded in x around 0 26.1%
Final simplification26.1%
(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 92.8%
Taylor expanded in z around 0 55.9%
Taylor expanded in x around inf 54.9%
sub-neg54.9%
mul-1-neg54.9%
log-rec54.9%
remove-double-neg54.9%
metadata-eval54.9%
Simplified54.9%
Taylor expanded in x around 0 25.6%
Final simplification25.6%
(FPCore (x y z) :precision binary64 (+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) + (0.91893853320467d0 - x)) + (0.083333333333333d0 / x)) + ((z / x) * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) + Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)) + Float64(Float64(z / x) * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)
\end{array}
herbie shell --seed 2024011
(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)))