
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= x 1.7e+47)
(+
(- 0.91893853320467 (fma (log x) (- 0.5 x) x))
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ (+ y 0.0007936500793651) (/ (/ x z) z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.7e+47) {
tmp = (0.91893853320467 - fma(log(x), (0.5 - x), x)) + (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) / ((x / z) / z));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.7e+47) tmp = Float64(Float64(0.91893853320467 - fma(log(x), Float64(0.5 - x), x)) + Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(y + 0.0007936500793651) / Float64(Float64(x / z) / z))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.7e+47], N[(N[(0.91893853320467 - N[(N[Log[x], $MachinePrecision] * N[(0.5 - x), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] / N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.7 \cdot 10^{+47}:\\
\;\;\;\;\left(0.91893853320467 - \mathsf{fma}\left(\log x, 0.5 - x, x\right)\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{y + 0.0007936500793651}{\frac{\frac{x}{z}}{z}}\\
\end{array}
\end{array}
if x < 1.6999999999999999e47Initial program 99.7%
remove-double-neg99.7%
+-commutative99.7%
associate-+r-99.7%
remove-double-neg99.7%
sub-neg99.7%
associate--r+99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-def99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
remove-double-neg99.8%
Simplified99.8%
if 1.6999999999999999e47 < x Initial program 87.5%
Taylor expanded in z around inf 87.6%
*-commutative87.6%
associate-/l*88.4%
unpow288.4%
associate-/r*99.6%
Simplified99.6%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
(if (<= x 5e+33)
(+
t_0
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(+ t_0 (/ (+ y 0.0007936500793651) (/ (/ x z) z))))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 5e+33) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((y + 0.0007936500793651) / ((x / z) / z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
if (x <= 5d+33) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
else
tmp = t_0 + ((y + 0.0007936500793651d0) / ((x / z) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 5e+33) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((y + 0.0007936500793651) / ((x / z) / z));
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x) tmp = 0 if x <= 5e+33: tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) else: tmp = t_0 + ((y + 0.0007936500793651) / ((x / z) / z)) return tmp
function code(x, y, z) t_0 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) tmp = 0.0 if (x <= 5e+33) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)); else tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) / Float64(Float64(x / z) / z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x); tmp = 0.0; if (x <= 5e+33) tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = t_0 + ((y + 0.0007936500793651) / ((x / z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 5e+33], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] / N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;x \leq 5 \cdot 10^{+33}:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{y + 0.0007936500793651}{\frac{\frac{x}{z}}{z}}\\
\end{array}
\end{array}
if x < 4.99999999999999973e33Initial program 99.7%
if 4.99999999999999973e33 < x Initial program 87.9%
Taylor expanded in z around inf 87.9%
*-commutative87.9%
associate-/l*88.8%
unpow288.8%
associate-/r*99.6%
Simplified99.6%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= x 4.1e+33)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
t_0)
(+ (/ (+ y 0.0007936500793651) (/ (/ x z) z)) t_0))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (x <= 4.1e+33) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + t_0;
} else {
tmp = ((y + 0.0007936500793651) / ((x / z) / z)) + t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (log(x) + (-1.0d0))
if (x <= 4.1d+33) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + t_0
else
tmp = ((y + 0.0007936500793651d0) / ((x / z) / z)) + t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if (x <= 4.1e+33) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + t_0;
} else {
tmp = ((y + 0.0007936500793651) / ((x / z) / z)) + t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if x <= 4.1e+33: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + t_0 else: tmp = ((y + 0.0007936500793651) / ((x / z) / z)) + t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (x <= 4.1e+33) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + t_0); else tmp = Float64(Float64(Float64(y + 0.0007936500793651) / Float64(Float64(x / z) / z)) + t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (x <= 4.1e+33) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + t_0; else tmp = ((y + 0.0007936500793651) / ((x / z) / z)) + t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 4.1e+33], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;x \leq 4.1 \cdot 10^{+33}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{y + 0.0007936500793651}{\frac{\frac{x}{z}}{z}} + t_0\\
\end{array}
\end{array}
if x < 4.09999999999999995e33Initial program 99.7%
Taylor expanded in x around inf 98.0%
*-commutative36.4%
sub-neg36.4%
metadata-eval36.4%
mul-1-neg36.4%
log-rec36.4%
remove-double-neg36.4%
Simplified98.0%
if 4.09999999999999995e33 < x Initial program 87.9%
Taylor expanded in z around inf 87.9%
*-commutative87.9%
associate-/l*88.8%
unpow288.8%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in x around inf 99.6%
*-commutative73.8%
sub-neg73.8%
metadata-eval73.8%
mul-1-neg73.8%
log-rec73.8%
remove-double-neg73.8%
Simplified99.6%
Final simplification98.7%
(FPCore (x y z)
:precision binary64
(if (<= x 4.1e-6)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (* (log x) -0.5)))
(+ (/ (+ y 0.0007936500793651) (/ (/ x z) z)) (* x (+ (log x) -1.0)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.1e-6) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5));
} else {
tmp = ((y + 0.0007936500793651) / ((x / z) / z)) + (x * (log(x) + -1.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 4.1d-6) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + (log(x) * (-0.5d0)))
else
tmp = ((y + 0.0007936500793651d0) / ((x / z) / z)) + (x * (log(x) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 4.1e-6) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (Math.log(x) * -0.5));
} else {
tmp = ((y + 0.0007936500793651) / ((x / z) / z)) + (x * (Math.log(x) + -1.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 4.1e-6: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (math.log(x) * -0.5)) else: tmp = ((y + 0.0007936500793651) / ((x / z) / z)) + (x * (math.log(x) + -1.0)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 4.1e-6) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(log(x) * -0.5))); else tmp = Float64(Float64(Float64(y + 0.0007936500793651) / Float64(Float64(x / z) / z)) + Float64(x * Float64(log(x) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 4.1e-6) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5)); else tmp = ((y + 0.0007936500793651) / ((x / z) / z)) + (x * (log(x) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 4.1e-6], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.1 \cdot 10^{-6}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y + 0.0007936500793651}{\frac{\frac{x}{z}}{z}} + x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 4.0999999999999997e-6Initial program 99.7%
add-cbrt-cube99.7%
pow399.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 99.7%
if 4.0999999999999997e-6 < x Initial program 89.5%
Taylor expanded in z around inf 89.0%
*-commutative89.0%
associate-/l*89.7%
unpow289.7%
associate-/r*99.0%
Simplified99.0%
Taylor expanded in x around inf 98.0%
*-commutative67.9%
sub-neg67.9%
metadata-eval67.9%
mul-1-neg67.9%
log-rec67.9%
remove-double-neg67.9%
Simplified98.0%
Final simplification98.8%
(FPCore (x y z)
:precision binary64
(if (<= x 4.1e-6)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (* (log x) -0.5)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* z (/ (+ y 0.0007936500793651) (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.1e-6) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * ((y + 0.0007936500793651) / (x / z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 4.1d-6) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + (log(x) * (-0.5d0)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (z * ((y + 0.0007936500793651d0) / (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 4.1e-6) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (Math.log(x) * -0.5));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (z * ((y + 0.0007936500793651) / (x / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 4.1e-6: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (math.log(x) * -0.5)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (z * ((y + 0.0007936500793651) / (x / z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 4.1e-6) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(log(x) * -0.5))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(Float64(y + 0.0007936500793651) / Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 4.1e-6) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * ((y + 0.0007936500793651) / (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 4.1e-6], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.1 \cdot 10^{-6}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{y + 0.0007936500793651}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 4.0999999999999997e-6Initial program 99.7%
add-cbrt-cube99.7%
pow399.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 99.7%
if 4.0999999999999997e-6 < x Initial program 89.5%
Taylor expanded in z around inf 89.0%
*-commutative89.0%
associate-/l*89.7%
unpow289.7%
associate-/r*99.0%
Simplified99.0%
associate-/r/99.0%
+-commutative99.0%
Applied egg-rr99.0%
Final simplification99.4%
(FPCore (x y z)
:precision binary64
(if (<= x 4.1e-6)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (* (log x) -0.5)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ (+ y 0.0007936500793651) (/ (/ x z) z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.1e-6) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) / ((x / z) / z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 4.1d-6) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + (log(x) * (-0.5d0)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((y + 0.0007936500793651d0) / ((x / z) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 4.1e-6) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (Math.log(x) * -0.5));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) / ((x / z) / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 4.1e-6: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (math.log(x) * -0.5)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) / ((x / z) / z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 4.1e-6) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(log(x) * -0.5))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(y + 0.0007936500793651) / Float64(Float64(x / z) / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 4.1e-6) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) / ((x / z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 4.1e-6], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] / N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.1 \cdot 10^{-6}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{y + 0.0007936500793651}{\frac{\frac{x}{z}}{z}}\\
\end{array}
\end{array}
if x < 4.0999999999999997e-6Initial program 99.7%
add-cbrt-cube99.7%
pow399.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 99.7%
if 4.0999999999999997e-6 < x Initial program 89.5%
Taylor expanded in z around inf 89.0%
*-commutative89.0%
associate-/l*89.7%
unpow289.7%
associate-/r*99.0%
Simplified99.0%
Final simplification99.4%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.55e-95) (not (<= z 6e-28)))
(+ (/ (+ y 0.0007936500793651) (/ (/ x z) z)) (* x (+ (log x) -1.0)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.55e-95) || !(z <= 6e-28)) {
tmp = ((y + 0.0007936500793651) / ((x / z) / z)) + (x * (log(x) + -1.0));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.55d-95)) .or. (.not. (z <= 6d-28))) then
tmp = ((y + 0.0007936500793651d0) / ((x / z) / z)) + (x * (log(x) + (-1.0d0)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.55e-95) || !(z <= 6e-28)) {
tmp = ((y + 0.0007936500793651) / ((x / z) / z)) + (x * (Math.log(x) + -1.0));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.55e-95) or not (z <= 6e-28): tmp = ((y + 0.0007936500793651) / ((x / z) / z)) + (x * (math.log(x) + -1.0)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.55e-95) || !(z <= 6e-28)) tmp = Float64(Float64(Float64(y + 0.0007936500793651) / Float64(Float64(x / z) / z)) + Float64(x * Float64(log(x) + -1.0))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.55e-95) || ~((z <= 6e-28))) tmp = ((y + 0.0007936500793651) / ((x / z) / z)) + (x * (log(x) + -1.0)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.55e-95], N[Not[LessEqual[z, 6e-28]], $MachinePrecision]], N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-95} \lor \neg \left(z \leq 6 \cdot 10^{-28}\right):\\
\;\;\;\;\frac{y + 0.0007936500793651}{\frac{\frac{x}{z}}{z}} + x \cdot \left(\log x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.54999999999999996e-95 or 6.00000000000000005e-28 < z Initial program 91.3%
Taylor expanded in z around inf 89.8%
*-commutative89.8%
associate-/l*90.4%
unpow290.4%
associate-/r*98.2%
Simplified98.2%
Taylor expanded in x around inf 97.8%
*-commutative29.5%
sub-neg29.5%
metadata-eval29.5%
mul-1-neg29.5%
log-rec29.5%
remove-double-neg29.5%
Simplified97.8%
if -1.54999999999999996e-95 < z < 6.00000000000000005e-28Initial program 99.5%
Taylor expanded in z around 0 97.4%
Final simplification97.7%
(FPCore (x y z)
:precision binary64
(if (or (<= z -4e+78) (not (<= z 5.8e+19)))
(+
(+ 0.91893853320467 (* (log x) -0.5))
(/ (* z (* z 0.0007936500793651)) x))
(+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4e+78) || !(z <= 5.8e+19)) {
tmp = (0.91893853320467 + (log(x) * -0.5)) + ((z * (z * 0.0007936500793651)) / x);
} else {
tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-4d+78)) .or. (.not. (z <= 5.8d+19))) then
tmp = (0.91893853320467d0 + (log(x) * (-0.5d0))) + ((z * (z * 0.0007936500793651d0)) / x)
else
tmp = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -4e+78) || !(z <= 5.8e+19)) {
tmp = (0.91893853320467 + (Math.log(x) * -0.5)) + ((z * (z * 0.0007936500793651)) / x);
} else {
tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4e+78) or not (z <= 5.8e+19): tmp = (0.91893853320467 + (math.log(x) * -0.5)) + ((z * (z * 0.0007936500793651)) / x) else: tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4e+78) || !(z <= 5.8e+19)) tmp = Float64(Float64(0.91893853320467 + Float64(log(x) * -0.5)) + Float64(Float64(z * Float64(z * 0.0007936500793651)) / x)); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -4e+78) || ~((z <= 5.8e+19))) tmp = (0.91893853320467 + (log(x) * -0.5)) + ((z * (z * 0.0007936500793651)) / x); else tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4e+78], N[Not[LessEqual[z, 5.8e+19]], $MachinePrecision]], N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(z * 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+78} \lor \neg \left(z \leq 5.8 \cdot 10^{+19}\right):\\
\;\;\;\;\left(0.91893853320467 + \log x \cdot -0.5\right) + \frac{z \cdot \left(z \cdot 0.0007936500793651\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -4.00000000000000003e78 or 5.8e19 < z Initial program 88.6%
Taylor expanded in z around inf 88.6%
*-commutative88.6%
associate-/l*89.4%
unpow289.4%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in y around 0 61.7%
*-commutative61.7%
associate-*l/61.7%
unpow261.7%
associate-*l*61.7%
Simplified61.7%
Taylor expanded in x around 0 51.8%
if -4.00000000000000003e78 < z < 5.8e19Initial program 99.5%
Taylor expanded in z around 0 84.8%
Taylor expanded in x around inf 83.0%
*-commutative83.0%
sub-neg83.0%
metadata-eval83.0%
mul-1-neg83.0%
log-rec83.0%
remove-double-neg83.0%
Simplified83.0%
Final simplification68.1%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.08e+77) (not (<= z 3.55e+19)))
(+
(+ 0.91893853320467 (* (log x) -0.5))
(/ (* z (* z 0.0007936500793651)) x))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.08e+77) || !(z <= 3.55e+19)) {
tmp = (0.91893853320467 + (log(x) * -0.5)) + ((z * (z * 0.0007936500793651)) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.08d+77)) .or. (.not. (z <= 3.55d+19))) then
tmp = (0.91893853320467d0 + (log(x) * (-0.5d0))) + ((z * (z * 0.0007936500793651d0)) / x)
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.08e+77) || !(z <= 3.55e+19)) {
tmp = (0.91893853320467 + (Math.log(x) * -0.5)) + ((z * (z * 0.0007936500793651)) / x);
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.08e+77) or not (z <= 3.55e+19): tmp = (0.91893853320467 + (math.log(x) * -0.5)) + ((z * (z * 0.0007936500793651)) / x) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.08e+77) || !(z <= 3.55e+19)) tmp = Float64(Float64(0.91893853320467 + Float64(log(x) * -0.5)) + Float64(Float64(z * Float64(z * 0.0007936500793651)) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.08e+77) || ~((z <= 3.55e+19))) tmp = (0.91893853320467 + (log(x) * -0.5)) + ((z * (z * 0.0007936500793651)) / x); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.08e+77], N[Not[LessEqual[z, 3.55e+19]], $MachinePrecision]], N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(z * 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{+77} \lor \neg \left(z \leq 3.55 \cdot 10^{+19}\right):\\
\;\;\;\;\left(0.91893853320467 + \log x \cdot -0.5\right) + \frac{z \cdot \left(z \cdot 0.0007936500793651\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.07999999999999996e77 or 3.55e19 < z Initial program 88.6%
Taylor expanded in z around inf 88.6%
*-commutative88.6%
associate-/l*89.4%
unpow289.4%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in y around 0 61.7%
*-commutative61.7%
associate-*l/61.7%
unpow261.7%
associate-*l*61.7%
Simplified61.7%
Taylor expanded in x around 0 51.8%
if -1.07999999999999996e77 < z < 3.55e19Initial program 99.5%
Taylor expanded in z around 0 84.8%
Final simplification69.1%
(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 94.3%
Taylor expanded in z around 0 54.6%
Taylor expanded in x around inf 53.6%
*-commutative53.6%
sub-neg53.6%
metadata-eval53.6%
mul-1-neg53.6%
log-rec53.6%
remove-double-neg53.6%
Simplified53.6%
div-inv53.6%
frac-2neg53.6%
metadata-eval53.6%
add-sqr-sqrt0.0%
sqrt-unprod40.0%
sqr-neg40.0%
sqrt-unprod36.7%
add-sqr-sqrt36.7%
Applied egg-rr36.7%
associate-*r/36.7%
metadata-eval36.7%
Simplified36.7%
Final simplification36.7%
(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 94.3%
Taylor expanded in z around 0 54.6%
Taylor expanded in x around inf 53.6%
*-commutative53.6%
sub-neg53.6%
metadata-eval53.6%
mul-1-neg53.6%
log-rec53.6%
remove-double-neg53.6%
Simplified53.6%
Final simplification53.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.3%
Taylor expanded in z around 0 54.6%
Taylor expanded in x around inf 53.6%
*-commutative53.6%
sub-neg53.6%
metadata-eval53.6%
mul-1-neg53.6%
log-rec53.6%
remove-double-neg53.6%
Simplified53.6%
div-inv53.6%
frac-2neg53.6%
metadata-eval53.6%
add-sqr-sqrt0.0%
sqrt-unprod40.0%
sqr-neg40.0%
sqrt-unprod36.7%
add-sqr-sqrt36.7%
Applied egg-rr36.7%
associate-*r/36.7%
metadata-eval36.7%
Simplified36.7%
Taylor expanded in x around 0 1.5%
Final simplification1.5%
(FPCore (x y z) :precision binary64 (+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) + (0.91893853320467d0 - x)) + (0.083333333333333d0 / x)) + ((z / x) * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) + Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)) + Float64(Float64(z / x) * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)
\end{array}
herbie shell --seed 2023230
(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)))