
(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 13 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 5.3e+215)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(pow
(/
x
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))))
-1.0))
(+ (* x (+ (log x) -1.0)) (/ y (/ (* x (/ 1.0 z)) z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5.3e+215) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + pow((x / (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)))), -1.0);
} else {
tmp = (x * (log(x) + -1.0)) + (y / ((x * (1.0 / 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 <= 5.3d+215) then
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((x / (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0)))) ** (-1.0d0))
else
tmp = (x * (log(x) + (-1.0d0))) + (y / ((x * (1.0d0 / z)) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5.3e+215) {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + Math.pow((x / (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)))), -1.0);
} else {
tmp = (x * (Math.log(x) + -1.0)) + (y / ((x * (1.0 / z)) / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5.3e+215: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + math.pow((x / (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)))), -1.0) else: tmp = (x * (math.log(x) + -1.0)) + (y / ((x * (1.0 / z)) / z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5.3e+215) tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - 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(x * Float64(log(x) + -1.0)) + Float64(y / Float64(Float64(x * Float64(1.0 / z)) / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5.3e+215) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((x / (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)))) ^ -1.0); else tmp = (x * (log(x) + -1.0)) + (y / ((x * (1.0 / z)) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5.3e+215], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $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[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(x * N[(1.0 / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.3 \cdot 10^{+215}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 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}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{y}{\frac{x \cdot \frac{1}{z}}{z}}\\
\end{array}
\end{array}
if x < 5.3e215Initial program 97.4%
clear-num97.5%
inv-pow97.5%
*-commutative97.5%
fma-udef97.5%
fma-neg97.5%
metadata-eval97.5%
Applied egg-rr97.5%
Taylor expanded in x around 0 97.5%
if 5.3e215 < x Initial program 68.9%
Taylor expanded in y around inf 68.5%
associate-/l*74.0%
Simplified74.0%
*-un-lft-identity74.0%
unpow274.0%
times-frac95.8%
Applied egg-rr95.8%
associate-*r/95.9%
Applied egg-rr95.9%
Taylor expanded in x around inf 96.2%
sub-neg96.2%
mul-1-neg96.2%
log-rec96.2%
remove-double-neg96.2%
metadata-eval96.2%
Simplified96.2%
Final simplification97.2%
(FPCore (x y z)
:precision binary64
(if (<= x 2e+214)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(+ (* x (+ (log x) -1.0)) (/ y (/ (* x (/ 1.0 z)) z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2e+214) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = (x * (log(x) + -1.0)) + (y / ((x * (1.0 / 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 <= 2d+214) then
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = (x * (log(x) + (-1.0d0))) + (y / ((x * (1.0d0 / z)) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 2e+214) {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = (x * (Math.log(x) + -1.0)) + (y / ((x * (1.0 / z)) / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2e+214: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = (x * (math.log(x) + -1.0)) + (y / ((x * (1.0 / z)) / z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2e+214) tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(y / Float64(Float64(x * Float64(1.0 / z)) / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 2e+214) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = (x * (log(x) + -1.0)) + (y / ((x * (1.0 / z)) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2e+214], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(x * N[(1.0 / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{+214}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{y}{\frac{x \cdot \frac{1}{z}}{z}}\\
\end{array}
\end{array}
if x < 1.9999999999999999e214Initial program 97.4%
if 1.9999999999999999e214 < x Initial program 68.9%
Taylor expanded in y around inf 68.5%
associate-/l*74.0%
Simplified74.0%
*-un-lft-identity74.0%
unpow274.0%
times-frac95.8%
Applied egg-rr95.8%
associate-*r/95.9%
Applied egg-rr95.9%
Taylor expanded in x around inf 96.2%
sub-neg96.2%
mul-1-neg96.2%
log-rec96.2%
remove-double-neg96.2%
metadata-eval96.2%
Simplified96.2%
Final simplification97.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= y -1.15e+94) (not (<= y 1.08e+94)))
(+ t_0 (/ y (* (/ 1.0 z) (/ x z))))
(+
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 <= -1.15e+94) || !(y <= 1.08e+94)) {
tmp = t_0 + (y / ((1.0 / z) * (x / z)));
} 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 <= (-1.15d+94)) .or. (.not. (y <= 1.08d+94))) then
tmp = t_0 + (y / ((1.0d0 / z) * (x / z)))
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 <= -1.15e+94) || !(y <= 1.08e+94)) {
tmp = t_0 + (y / ((1.0 / z) * (x / z)));
} 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 <= -1.15e+94) or not (y <= 1.08e+94): tmp = t_0 + (y / ((1.0 / z) * (x / z))) 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 <= -1.15e+94) || !(y <= 1.08e+94)) tmp = Float64(t_0 + Float64(y / Float64(Float64(1.0 / z) * Float64(x / z)))); 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 <= -1.15e+94) || ~((y <= 1.08e+94))) tmp = t_0 + (y / ((1.0 / z) * (x / z))); 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, -1.15e+94], N[Not[LessEqual[y, 1.08e+94]], $MachinePrecision]], N[(t$95$0 + N[(y / N[(N[(1.0 / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $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 -1.15 \cdot 10^{+94} \lor \neg \left(y \leq 1.08 \cdot 10^{+94}\right):\\
\;\;\;\;t\_0 + \frac{y}{\frac{1}{z} \cdot \frac{x}{z}}\\
\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.15e94 or 1.08e94 < y Initial program 90.9%
Taylor expanded in y around inf 78.3%
associate-/l*82.1%
Simplified82.1%
*-un-lft-identity82.1%
unpow282.1%
times-frac87.1%
Applied egg-rr87.1%
Taylor expanded in x around inf 86.9%
sub-neg86.8%
mul-1-neg86.8%
log-rec86.8%
remove-double-neg86.8%
metadata-eval86.8%
Simplified86.9%
if -1.15e94 < y < 1.08e94Initial program 91.9%
Taylor expanded in x around inf 90.8%
sub-neg48.8%
mul-1-neg48.8%
log-rec48.8%
remove-double-neg48.8%
metadata-eval48.8%
Simplified91.4%
Taylor expanded in y around 0 90.0%
Final simplification89.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= y -0.00092) (not (<= y 3.5e-73)))
(+ t_0 (/ (+ 0.083333333333333 (* z (- (* z y) 0.0027777777777778))) 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 <= -0.00092) || !(y <= 3.5e-73)) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / 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 <= (-0.00092d0)) .or. (.not. (y <= 3.5d-73))) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * y) - 0.0027777777777778d0))) / 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 <= -0.00092) || !(y <= 3.5e-73)) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / 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 <= -0.00092) or not (y <= 3.5e-73): tmp = t_0 + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / 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 <= -0.00092) || !(y <= 3.5e-73)) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * y) - 0.0027777777777778))) / 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 <= -0.00092) || ~((y <= 3.5e-73))) tmp = t_0 + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / 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, -0.00092], N[Not[LessEqual[y, 3.5e-73]], $MachinePrecision]], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * y), $MachinePrecision] - 0.0027777777777778), $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 -0.00092 \lor \neg \left(y \leq 3.5 \cdot 10^{-73}\right):\\
\;\;\;\;t\_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot y - 0.0027777777777778\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 < -9.2000000000000003e-4 or 3.4999999999999998e-73 < y Initial program 89.9%
Taylor expanded in x around inf 89.5%
sub-neg78.3%
mul-1-neg78.3%
log-rec78.3%
remove-double-neg78.3%
metadata-eval78.3%
Simplified89.5%
Taylor expanded in y around inf 89.5%
*-commutative89.5%
Simplified89.5%
if -9.2000000000000003e-4 < y < 3.4999999999999998e-73Initial program 93.3%
Taylor expanded in x around inf 92.1%
sub-neg42.1%
mul-1-neg42.1%
log-rec42.1%
remove-double-neg42.1%
metadata-eval42.1%
Simplified92.8%
Taylor expanded in y around 0 92.8%
Final simplification91.2%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.3e-43) (not (<= z 1.15e-10)))
(+ (* x (+ (log x) -1.0)) (/ y (* (/ 1.0 z) (/ x z))))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.3e-43) || !(z <= 1.15e-10)) {
tmp = (x * (log(x) + -1.0)) + (y / ((1.0 / z) * (x / z)));
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.3d-43)) .or. (.not. (z <= 1.15d-10))) then
tmp = (x * (log(x) + (-1.0d0))) + (y / ((1.0d0 / z) * (x / z)))
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.3e-43) || !(z <= 1.15e-10)) {
tmp = (x * (Math.log(x) + -1.0)) + (y / ((1.0 / z) * (x / z)));
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.3e-43) or not (z <= 1.15e-10): tmp = (x * (math.log(x) + -1.0)) + (y / ((1.0 / z) * (x / z))) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.3e-43) || !(z <= 1.15e-10)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(y / Float64(Float64(1.0 / z) * Float64(x / z)))); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.3e-43) || ~((z <= 1.15e-10))) tmp = (x * (log(x) + -1.0)) + (y / ((1.0 / z) * (x / z))); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.3e-43], N[Not[LessEqual[z, 1.15e-10]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(1.0 / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{-43} \lor \neg \left(z \leq 1.15 \cdot 10^{-10}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{y}{\frac{1}{z} \cdot \frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.3e-43 or 1.15000000000000004e-10 < z Initial program 85.7%
Taylor expanded in y around inf 54.8%
associate-/l*58.7%
Simplified58.7%
*-un-lft-identity58.7%
unpow258.7%
times-frac66.8%
Applied egg-rr66.8%
Taylor expanded in x around inf 66.8%
sub-neg66.9%
mul-1-neg66.9%
log-rec66.9%
remove-double-neg66.9%
metadata-eval66.9%
Simplified66.8%
if -1.3e-43 < z < 1.15000000000000004e-10Initial program 99.4%
Taylor expanded in z around 0 95.4%
Final simplification79.2%
(FPCore (x y z)
:precision binary64
(if (or (<= z -5.3e-45) (not (<= z 1.4e-14)))
(+ (* x (+ (log x) -1.0)) (/ y (/ (* x (/ 1.0 z)) z)))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.3e-45) || !(z <= 1.4e-14)) {
tmp = (x * (log(x) + -1.0)) + (y / ((x * (1.0 / z)) / z));
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-5.3d-45)) .or. (.not. (z <= 1.4d-14))) then
tmp = (x * (log(x) + (-1.0d0))) + (y / ((x * (1.0d0 / z)) / z))
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5.3e-45) || !(z <= 1.4e-14)) {
tmp = (x * (Math.log(x) + -1.0)) + (y / ((x * (1.0 / z)) / z));
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.3e-45) or not (z <= 1.4e-14): tmp = (x * (math.log(x) + -1.0)) + (y / ((x * (1.0 / z)) / z)) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.3e-45) || !(z <= 1.4e-14)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(y / Float64(Float64(x * Float64(1.0 / z)) / z))); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5.3e-45) || ~((z <= 1.4e-14))) tmp = (x * (log(x) + -1.0)) + (y / ((x * (1.0 / z)) / z)); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.3e-45], N[Not[LessEqual[z, 1.4e-14]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(x * N[(1.0 / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{-45} \lor \neg \left(z \leq 1.4 \cdot 10^{-14}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{y}{\frac{x \cdot \frac{1}{z}}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -5.2999999999999997e-45 or 1.4e-14 < z Initial program 85.7%
Taylor expanded in y around inf 54.8%
associate-/l*58.7%
Simplified58.7%
*-un-lft-identity58.7%
unpow258.7%
times-frac66.8%
Applied egg-rr66.8%
associate-*r/66.8%
Applied egg-rr66.8%
Taylor expanded in x around inf 66.9%
sub-neg66.9%
mul-1-neg66.9%
log-rec66.9%
remove-double-neg66.9%
metadata-eval66.9%
Simplified66.9%
if -5.2999999999999997e-45 < z < 1.4e-14Initial program 99.4%
Taylor expanded in z around 0 95.4%
Final simplification79.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= x 1.5e+214)
(+
t_0
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(+ t_0 (/ y (/ (* x (/ 1.0 z)) z))))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (x <= 1.5e+214) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + (y / ((x * (1.0 / 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 = x * (log(x) + (-1.0d0))
if (x <= 1.5d+214) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = t_0 + (y / ((x * (1.0d0 / z)) / z))
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 <= 1.5e+214) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + (y / ((x * (1.0 / z)) / z));
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if x <= 1.5e+214: tmp = t_0 + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = t_0 + (y / ((x * (1.0 / z)) / z)) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (x <= 1.5e+214) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)); else tmp = Float64(t_0 + Float64(y / Float64(Float64(x * Float64(1.0 / z)) / z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (x <= 1.5e+214) tmp = t_0 + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = t_0 + (y / ((x * (1.0 / z)) / z)); 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, 1.5e+214], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(y / N[(N[(x * N[(1.0 / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;x \leq 1.5 \cdot 10^{+214}:\\
\;\;\;\;t\_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{y}{\frac{x \cdot \frac{1}{z}}{z}}\\
\end{array}
\end{array}
if x < 1.5000000000000001e214Initial program 97.4%
Taylor expanded in x around inf 96.3%
sub-neg50.5%
mul-1-neg50.5%
log-rec50.5%
remove-double-neg50.5%
metadata-eval50.5%
Simplified96.8%
if 1.5000000000000001e214 < x Initial program 68.9%
Taylor expanded in y around inf 68.5%
associate-/l*74.0%
Simplified74.0%
*-un-lft-identity74.0%
unpow274.0%
times-frac95.8%
Applied egg-rr95.8%
associate-*r/95.9%
Applied egg-rr95.9%
Taylor expanded in x around inf 96.2%
sub-neg96.2%
mul-1-neg96.2%
log-rec96.2%
remove-double-neg96.2%
metadata-eval96.2%
Simplified96.2%
Final simplification96.7%
(FPCore (x y z) :precision binary64 (if (<= x 0.62) (- (pow (/ x 0.083333333333333) -1.0) x) (+ (* x (+ (log x) -1.0)) (* x 0.083333333333333))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.62) {
tmp = pow((x / 0.083333333333333), -1.0) - x;
} else {
tmp = (x * (log(x) + -1.0)) + (x * 0.083333333333333);
}
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.62d0) then
tmp = ((x / 0.083333333333333d0) ** (-1.0d0)) - x
else
tmp = (x * (log(x) + (-1.0d0))) + (x * 0.083333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 0.62) {
tmp = Math.pow((x / 0.083333333333333), -1.0) - x;
} else {
tmp = (x * (Math.log(x) + -1.0)) + (x * 0.083333333333333);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 0.62: tmp = math.pow((x / 0.083333333333333), -1.0) - x else: tmp = (x * (math.log(x) + -1.0)) + (x * 0.083333333333333) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 0.62) tmp = Float64((Float64(x / 0.083333333333333) ^ -1.0) - x); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(x * 0.083333333333333)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 0.62) tmp = ((x / 0.083333333333333) ^ -1.0) - x; else tmp = (x * (log(x) + -1.0)) + (x * 0.083333333333333); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 0.62], N[(N[Power[N[(x / 0.083333333333333), $MachinePrecision], -1.0], $MachinePrecision] - x), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(x * 0.083333333333333), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.62:\\
\;\;\;\;{\left(\frac{x}{0.083333333333333}\right)}^{-1} - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + x \cdot 0.083333333333333\\
\end{array}
\end{array}
if x < 0.619999999999999996Initial program 99.7%
Taylor expanded in z around 0 47.4%
add-sqr-sqrt47.4%
pow247.4%
sub-neg47.4%
metadata-eval47.4%
Applied egg-rr47.4%
Taylor expanded in x around inf 47.1%
neg-mul-147.1%
Simplified47.1%
clear-num47.2%
inv-pow47.2%
Applied egg-rr47.2%
if 0.619999999999999996 < x Initial program 84.2%
Taylor expanded in z around 0 66.9%
Taylor expanded in x around inf 66.4%
sub-neg87.6%
mul-1-neg87.6%
log-rec87.6%
remove-double-neg87.6%
metadata-eval87.6%
Simplified66.4%
div-inv0.9%
expm1-log1p-u0.9%
expm1-udef0.9%
*-commutative0.9%
add-exp-log0.9%
neg-log0.9%
add-sqr-sqrt0.0%
sqrt-unprod0.9%
sqr-neg0.9%
sqrt-unprod0.9%
add-sqr-sqrt0.9%
add-exp-log0.9%
Applied egg-rr26.3%
expm1-def0.9%
expm1-log1p0.9%
Simplified26.3%
Final simplification36.3%
(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 91.6%
Taylor expanded in x around inf 90.8%
sub-neg59.8%
mul-1-neg59.8%
log-rec59.8%
remove-double-neg59.8%
metadata-eval59.8%
Simplified91.2%
Taylor expanded in z around 0 60.6%
*-commutative60.6%
Simplified60.6%
Final simplification60.6%
(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 91.6%
Taylor expanded in z around 0 57.5%
Taylor expanded in x around inf 56.7%
sub-neg59.8%
mul-1-neg59.8%
log-rec59.8%
remove-double-neg59.8%
metadata-eval59.8%
Simplified57.1%
Final simplification57.1%
(FPCore (x y z) :precision binary64 (- (pow (/ x 0.083333333333333) -1.0) x))
double code(double x, double y, double z) {
return pow((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 = ((x / 0.083333333333333d0) ** (-1.0d0)) - x
end function
public static double code(double x, double y, double z) {
return Math.pow((x / 0.083333333333333), -1.0) - x;
}
def code(x, y, z): return math.pow((x / 0.083333333333333), -1.0) - x
function code(x, y, z) return Float64((Float64(x / 0.083333333333333) ^ -1.0) - x) end
function tmp = code(x, y, z) tmp = ((x / 0.083333333333333) ^ -1.0) - x; end
code[x_, y_, z_] := N[(N[Power[N[(x / 0.083333333333333), $MachinePrecision], -1.0], $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}
\\
{\left(\frac{x}{0.083333333333333}\right)}^{-1} - x
\end{array}
Initial program 91.6%
Taylor expanded in z around 0 57.5%
add-sqr-sqrt57.4%
pow257.4%
sub-neg57.4%
metadata-eval57.4%
Applied egg-rr57.4%
Taylor expanded in x around inf 23.1%
neg-mul-123.1%
Simplified23.1%
clear-num23.2%
inv-pow23.2%
Applied egg-rr23.2%
Final simplification23.2%
(FPCore (x y z) :precision binary64 (- (* x 0.083333333333333) x))
double code(double x, double y, double z) {
return (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 = (x * 0.083333333333333d0) - x
end function
public static double code(double x, double y, double z) {
return (x * 0.083333333333333) - x;
}
def code(x, y, z): return (x * 0.083333333333333) - x
function code(x, y, z) return Float64(Float64(x * 0.083333333333333) - x) end
function tmp = code(x, y, z) tmp = (x * 0.083333333333333) - x; end
code[x_, y_, z_] := N[(N[(x * 0.083333333333333), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}
\\
x \cdot 0.083333333333333 - x
\end{array}
Initial program 91.6%
Taylor expanded in z around 0 57.5%
add-sqr-sqrt57.4%
pow257.4%
sub-neg57.4%
metadata-eval57.4%
Applied egg-rr57.4%
Taylor expanded in x around inf 23.1%
neg-mul-123.1%
Simplified23.1%
div-inv22.8%
expm1-log1p-u21.1%
expm1-udef21.1%
*-commutative21.1%
add-exp-log21.0%
neg-log21.0%
add-sqr-sqrt20.2%
sqrt-unprod21.0%
sqr-neg21.0%
sqrt-unprod0.5%
add-sqr-sqrt1.2%
add-exp-log1.2%
Applied egg-rr1.2%
expm1-def1.2%
expm1-log1p1.2%
Simplified1.2%
Final simplification1.2%
(FPCore (x y z) :precision binary64 (- (/ 0.083333333333333 x) x))
double code(double x, double y, double z) {
return (0.083333333333333 / x) - 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) - x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 / x) - x;
}
def code(x, y, z): return (0.083333333333333 / x) - x
function code(x, y, z) return Float64(Float64(0.083333333333333 / x) - x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 / x) - x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 / x), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x} - x
\end{array}
Initial program 91.6%
Taylor expanded in z around 0 57.5%
add-sqr-sqrt57.4%
pow257.4%
sub-neg57.4%
metadata-eval57.4%
Applied egg-rr57.4%
Taylor expanded in x around inf 23.1%
neg-mul-123.1%
Simplified23.1%
Final simplification23.1%
(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 2024027
(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)))